###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2007-2020 IPFire Team <info@ipfire.org> #
+# Copyright (C) 2007-2023 IPFire Team <info@ipfire.org> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
open(FILE, ">$torrc");
# Global settings.
+ print FILE "Sandbox 1\n";
+ print FILE "HardwareAccel 1\n";
+ print FILE "ClientUseIPv6 0\n";
print FILE "ControlPort $TOR_CONTROL_PORT\n";
if ($settings{'TOR_ENABLED'} eq 'on') {
my @nodes = split(",", $settings{'TOR_USE_EXIT_NODES'});
foreach (@nodes) {
- print FILE "ExitNode $_\n";
+ print FILE "ExitNodes $_\n";
}
}
if ($strict_nodes > 0) {
print FILE "StrictNodes 1\n";
}
- }
+ } else {
+ print FILE "SocksPort 0\n";
+ }
if ($settings{'TOR_RELAY_ENABLED'} eq 'on') {
# Reject access to private networks.
print FILE "ExitPolicyRejectPrivate 1\n";
- print FILE "ORPort $settings{'TOR_RELAY_PORT'}\n";
+ print FILE "ORPort $settings{'TOR_RELAY_PORT'} IPv4Only\n";
if ($settings{'TOR_RELAY_DIRPORT'} ne '0') {
- print FILE "DirPort $settings{'TOR_RELAY_DIRPORT'}\n";
+ print FILE "DirPort $settings{'TOR_RELAY_DIRPORT'} IPv4Only\n";
}
if ($settings{'TOR_RELAY_ADDRESS'} ne '') {
# Restart the service.
if (($settings{'TOR_ENABLED'} eq 'on') || ($settings{'TOR_RELAY_ENABLED'} eq 'on')) {
- system("/usr/local/bin/torctrl restart &>/dev/null");
+ &General::system("/usr/local/bin/torctrl", "restart");
} else {
- system("/usr/local/bin/torctrl stop &>/dev/null");
+ &General::system("/usr/local/bin/torctrl", "stop");
}
# Update pid and memory
daemonstats();