|
@@ -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']));
|