Kaynağa Gözat

Delete Tor keys in del-http-onion.php

Miraty 3 yıl önce
ebeveyn
işleme
b579c57200
2 değiştirilmiş dosya ile 6 ekleme ve 0 silme
  1. 1 0
      config.ini
  2. 5 0
      public/ht/del-http-onion.php

+ 1 - 0
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
 

+ 5 - 0
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'],