Call Certbot before adding to DB
This commit is contained in:
parent
13bfd8e9be
commit
f3752163af
1 changed files with 2 additions and 2 deletions
|
@ -30,12 +30,12 @@ checkAuthToken($matches[1], $matches[2]);
|
|||
|
||||
rateLimit();
|
||||
|
||||
addSite($_SESSION['id'], $_POST['dir'], $_POST['domain'], 'dns');
|
||||
|
||||
exec('2>&1 ' . CONF['ht']['sudo_path'] . ' ' . CONF['ht']['certbot_path'] . ' certonly' . (($_SESSION['type'] === 'approved') ? '' : ' --test-cert') . ' --domain ' . $_POST['domain'], $output, $returnCode);
|
||||
if ($returnCode !== 0)
|
||||
output(500, 'Certbot failed to get a Let\'s Encrypt certificate.', $output);
|
||||
|
||||
addSite($_SESSION['id'], $_POST['dir'], $_POST['domain'], 'dns');
|
||||
|
||||
htRelativeSymlink('../fs/' . $_SESSION['id'] . '/' . $_POST['dir'], CONF['ht']['ht_path'] . '/uri/' . $_POST['domain']);
|
||||
|
||||
output(200, sprintf(_('%s added on this directory.'), PAGE_METADATA['title']));
|
||||
|
|
Loading…
Reference in a new issue