Browse Source

Remove niver.log

main
Miraty 2 months ago
parent
commit
ab09c84514
  1. 1
      .gitignore
  2. 12
      fn/ht.php
  3. 0
      niver.log
  4. 3
      public/ht/le.php

1
.gitignore

@ -1,2 +1 @@
/niver.log
/db/niver.db

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;

0
niver.log

3
public/ht/le.php

@ -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…
Cancel
Save