Remove niver.log
This commit is contained in:
parent
e637877ab3
commit
ab09c84514
4 changed files with 0 additions and 16 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,2 +1 @@
|
|||
/niver.log
|
||||
/db/niver.db
|
||||
|
|
12
fn/ht.php
12
fn/ht.php
|
@ -6,18 +6,6 @@ function checkDomainFormat($domain) {
|
|||
userError("Wrong domain.");
|
||||
}
|
||||
|
||||
function addNiverLog($message, $outputLines, $returnCode = false) {
|
||||
$logs = "\n" . date("Y-m-d H:i:s") . " " . $message . "\n";
|
||||
if ($returnCode !== false)
|
||||
$logs = $logs . "Return code: " . $returnCode . "\n";
|
||||
else
|
||||
$logs = $logs . "No return code logged\n";
|
||||
foreach ($outputLines as $outputLine) {
|
||||
$logs = $logs . " " . $outputLine . "\n";
|
||||
}
|
||||
file_put_contents(CONF['common']['root_path'] . "/niver.log", $logs, FILE_APPEND);
|
||||
}
|
||||
|
||||
function listFsDirs($username) {
|
||||
$absoluteDirs = glob(CONF['ht']['ht_path'] . "/" . $username . "/*/", GLOB_ONLYDIR);
|
||||
$relativeDirs = false;
|
||||
|
|
|
@ -27,9 +27,6 @@ switchToFormProcess();
|
|||
|
||||
exec(CONF['ht']['sudo_path'] . " " . CONF['ht']['certbot_path'] . " certonly --dry-run --test-cert --webroot --webroot-path /srv/acme --register-unsafely-without-email --agree-tos --domain " . $_POST['domain'], $output, $returnCode);
|
||||
|
||||
// Log Certbot response
|
||||
addNiverLog($_SESSION['username'] . " installed a Let's Encrypt certificate on their site", $output, $returnCode);
|
||||
|
||||
// Abort if Certbot failed
|
||||
if ($returnCode !== 0)
|
||||
serverError("Certbot failed to get a Let's Encrypt certificate.");
|
||||
|
|
Loading…
Reference in a new issue