From b579c57200517e1003c9056c1f4dd328a96cdf96 Mon Sep 17 00:00:00 2001 From: Miraty Date: Fri, 17 Jun 2022 00:28:22 +0200 Subject: [PATCH] Delete Tor keys in del-http-onion.php --- config.ini | 1 + public/ht/del-http-onion.php | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/config.ini b/config.ini index d44e248..a12cd08 100644 --- a/config.ini +++ b/config.ini @@ -35,6 +35,7 @@ systemctl_path = "/usr/bin/systemctl" certbot_path = "/usr/bin/certbot" chgrp_path = "/usr/bin/chgrp" cat_path = "/usr/bin/cat" +rm_path = "/usr/bin/rm" sftpgo_group = sftpgo diff --git a/public/ht/del-http-onion.php b/public/ht/del-http-onion.php index 7a80df5..31d75a8 100644 --- a/public/ht/del-http-onion.php +++ b/public/ht/del-http-onion.php @@ -49,6 +49,11 @@ exec(CONF['ht']['sudo_path'] . " " . CONF['ht']['systemctl_path'] . " reload " . if ($code !== 0) serverError("Failed to reload Tor."); +// Delete Tor keys +exec(CONF['ht']['sudo_path'] . " -u " . CONF['ht']['tor_user'] . " " . CONF['ht']['rm_path'] . " --recursive " . CONF['ht']['tor_keys_path'] . "/" . $_POST['dir'], $output, $code); +if ($code !== 0) + serverError("Failed to delete Tor keys."); + // Delete Nginx config $onion = query('select', 'sites', [ 'username' => $_SESSION['username'],