diff options
Diffstat (limited to 'modules-available/webinterface/inc/acme.inc.php')
-rw-r--r-- | modules-available/webinterface/inc/acme.inc.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/modules-available/webinterface/inc/acme.inc.php b/modules-available/webinterface/inc/acme.inc.php index c23578cc..f12ceb2e 100644 --- a/modules-available/webinterface/inc/acme.inc.php +++ b/modules-available/webinterface/inc/acme.inc.php @@ -81,21 +81,26 @@ class Acme if (!is_array($task) || !Taskmanager::isTask($task)) return; $task = Taskmanager::waitComplete($task, 250); + $args = ['user' => User::getLogin()]; if (Taskmanager::isFinished($task)) { - self::callbackErrorCheck($task); + self::callbackErrorCheck($task, $args); } else { Property::set(self::PROP_ERROR, false); - TaskmanagerCallback::addCallback($task, 'acmeErrors'); + TaskmanagerCallback::addCallback($task, 'acmeErrors', $args); } } - public static function callbackErrorCheck(array $task): void + public static function callbackErrorCheck(array $task, $args): void { if (!Taskmanager::isFinished($task)) return; if (Taskmanager::isFailed($task)) { + if (($args['user'] ?? null) === null) { + EventLog::warning('Automatic ACME renewal of HTTPS certificate failed', json_encode($task, JSON_PRETTY_PRINT)); + } Property::set(self::PROP_ERROR, $task['data']['error'] ?? 'Unknown error'); } else { + EventLog::info('ACME issue/renewal of HTTPS certificate by ' . ($args['user'] ?? 'automatic cronjob')); Property::set(self::PROP_ERROR, false); } } |