diff --git a/public/ht/del-http-dns.php b/public/ht/del-http-dns.php new file mode 100644 index 0000000..cff8a3d --- /dev/null +++ b/public/ht/del-http-dns.php @@ -0,0 +1,60 @@ + + +
+ Retirer un accès DNS et TLS d'un dossier +
+ + + +dir."); + +// Delete Nginx config +$onion = query('select', 'sites', [ + 'username' => $_SESSION['username'], + 'domain_type' => 'dns', + 'protocol' => 'http', + 'site_dir' => $_POST['dir'], +], 'domain')[0]; +if (unlink(CONF['ht']['nginx_config_path'] . "/" . $onion . ".conf") !== true) + serverError("Failed to delete Nginx configuration."); + +// Reload Nginx +exec(CONF['ht']['sudo_path'] . " " . CONF['ht']['systemctl_path'] . " reload nginx", result_code: $code); +if ($code !== 0) + serverError("Failed to reload Nginx."); + +// Delete from database +query('delete', 'sites', [ + 'username' => $_SESSION['username'], + 'domain_type' => 'dns', + 'protocol' => 'http', + 'site_dir' => $_POST['dir'], +]); + +success("Accès retiré avec succès."); diff --git a/public/ht/del-http-onion.php b/public/ht/del-http-onion.php index 40ecc61..7a80df5 100644 --- a/public/ht/del-http-onion.php +++ b/public/ht/del-http-onion.php @@ -1,6 +1,7 @@ +-Ajouter un accès en .onion sur un dossier + Retirer un accès Onion d'un dossier