Cleanup pubkey.(pem/txt)
This commit is contained in:
parent
5d3febd4bb
commit
0617c7cef2
|
@ -1,12 +1,13 @@
|
||||||
<?php
|
<?php
|
||||||
echo '<center>';
|
echo '<center>';
|
||||||
echo '<font size="1em">';
|
$pubkeyfile = getcwd().'/../tmp/pubkey.txt';
|
||||||
$pubkeyfile = getcwd().'/../tmp/pubkey.pem';
|
if(is_file($pubkeyfile) && (isset($CONFIG['site_shortname']) && $CONFIG['site_shortname'] != '')) {
|
||||||
if(is_file($pubkeyfile)) {
|
echo '<font size="1.5em">';
|
||||||
echo 'sitename: '.$CONFIG[site_shortname].' ';
|
echo '<a href="/tmp/pubkey.txt" target=_blank>'.$CONFIG[site_shortname].'</a>';
|
||||||
echo '<a href="/tmp/pubkey.pem" target=_blank>public key</a>';
|
|
||||||
echo '<br />';
|
echo '<br />';
|
||||||
|
echo '</font>';
|
||||||
}
|
}
|
||||||
|
echo '<font size="1em">';
|
||||||
echo '<i>rocksolid light</i> '.$rslight_version;
|
echo '<i>rocksolid light</i> '.$rslight_version;
|
||||||
echo '<br />';
|
echo '<br />';
|
||||||
echo '<a href="https://github.com/novabbs/rocksolid-light" target=_blank>clearnet</a>';
|
echo '<a href="https://github.com/novabbs/rocksolid-light" target=_blank>clearnet</a>';
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
// This file runs maintenance scripts and should be executed by cron regularly
|
// This file runs maintenance scripts and should be executed by cron regularly
|
||||||
include "config.inc.php";
|
include "config.inc.php";
|
||||||
|
include $config_dir."/scripts/rslight-lib.php";
|
||||||
|
|
||||||
$menulist = file($config_dir."menu.conf", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
$menulist = file($config_dir."menu.conf", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
||||||
|
|
||||||
|
@ -36,7 +37,8 @@
|
||||||
|
|
||||||
$uinfo=posix_getpwnam($CONFIG['webserver_user']);
|
$uinfo=posix_getpwnam($CONFIG['webserver_user']);
|
||||||
$cwd = getcwd();
|
$cwd = getcwd();
|
||||||
$webtmp = preg_replace('/spoolnews/','tmp',$cwd);
|
$webtmp = preg_replace('/spoolnews/','tmp/',$cwd);
|
||||||
|
|
||||||
@mkdir($webtmp,0755,'recursive');
|
@mkdir($webtmp,0755,'recursive');
|
||||||
@chown($webtmp, $uinfo["uid"]);
|
@chown($webtmp, $uinfo["uid"]);
|
||||||
@chgrp($webtmp, $uinfo["gid"]);
|
@chgrp($webtmp, $uinfo["gid"]);
|
||||||
|
@ -57,8 +59,14 @@
|
||||||
@mkdir($logdir,0755,'recursive');
|
@mkdir($logdir,0755,'recursive');
|
||||||
@mkdir($lockdir,0755,'recursive');
|
@mkdir($lockdir,0755,'recursive');
|
||||||
|
|
||||||
if(!is_file($webtmp.'/pubkey.pem') && is_file($config_dir.'/ssl/pubkey.pem')) {
|
$pemfile = $ssldir.'/server.pem';
|
||||||
copy($config_dir.'/ssl/pubkey.pem', $webtmp.'/pubkey.pem');
|
$pubkeyfile = $ssldir.'/pubkey.pem';
|
||||||
|
if((!is_file($pemfile)) || (!is_file($pubkeyfile))) {
|
||||||
|
create_certificate($pemfile, $pubkeyfile);
|
||||||
|
}
|
||||||
|
if(!is_file($webtmp.'/pubkey.txt') && is_file($config_dir.'/ssl/pubkey.pem')) {
|
||||||
|
echo 'Writing pubkey.txt to: '.$webtmp."/pubkey.txt\n";
|
||||||
|
copy($config_dir.'/ssl/pubkey.pem', $webtmp.'/pubkey.txt');
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($CONFIG['enable_nocem']) && $CONFIG['enable_nocem'] == true) {
|
if(isset($CONFIG['enable_nocem']) && $CONFIG['enable_nocem'] == true) {
|
||||||
|
|
Loading…
Reference in New Issue