From c7fba717210ca555081aa07806416e5089b184f9 Mon Sep 17 00:00:00 2001 From: Miraty Date: Sat, 11 Jun 2022 23:50:14 +0200 Subject: [PATCH] Add del-http-dns.php --- public/ht/del-http-dns.php | 60 ++++++++++++++++++++++++++++++++++++ public/ht/del-http-onion.php | 3 +- 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 public/ht/del-http-dns.php 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