|
@@ -7,7 +7,7 @@ rateLimit();
|
|
|
|
|
|
// Add Tor config
|
|
// Add Tor config
|
|
$torConf = 'HiddenServiceDir ' . CONF['ht']['tor_keys_path'] . '/' . $_SESSION['id'] . '/' . $_POST['dir'] . '/
|
|
$torConf = 'HiddenServiceDir ' . CONF['ht']['tor_keys_path'] . '/' . $_SESSION['id'] . '/' . $_POST['dir'] . '/
|
|
-HiddenServicePort 80 [::1]:' . CONF['ht']['internal_onion_http_port'] . '
|
|
|
|
|
|
+HiddenServicePort 80 unix:' . CONF['ht']['http_onion_socket'] . '
|
|
';
|
|
';
|
|
if (file_put_contents(CONF['ht']['tor_config_path'] . '/' . $_SESSION['id'] . '/' . $_POST['dir'], $torConf) === false)
|
|
if (file_put_contents(CONF['ht']['tor_config_path'] . '/' . $_SESSION['id'] . '/' . $_POST['dir'], $torConf) === false)
|
|
output(500, 'Failed to write new Tor configuration.');
|
|
output(500, 'Failed to write new Tor configuration.');
|
|
@@ -28,7 +28,7 @@ addSite($_SESSION['id'], $_POST['dir'], $onion, 'onion');
|
|
|
|
|
|
// Add Nginx config
|
|
// Add Nginx config
|
|
$nginxConf = 'server {
|
|
$nginxConf = 'server {
|
|
- listen [::1]:' . CONF['ht']['internal_onion_http_port'] . ';
|
|
|
|
|
|
+ listen unix:' . CONF['ht']['http_onion_socket'] . ';
|
|
server_name ' . $onion . ';
|
|
server_name ' . $onion . ';
|
|
root ' . CONF['ht']['ht_path'] . '/' . $_SESSION['id'] . '/' . $_POST['dir'] . ';
|
|
root ' . CONF['ht']['ht_path'] . '/' . $_SESSION['id'] . '/' . $_POST['dir'] . ';
|
|
|
|
|