If fingerprints in the Exit Node section are in usage, tor.cgi prints the deprecated option 'ExitNode' into torrc which leads to the following warning "The abbreviation ‘ExitNode’ is deprecated. Please use ‘ExitNodes’ instead". Fix has been found and tested in the community for reference please see --> https://community.ipfire.org/t/the-abbreviation-exitnode-is-deprecated-pleas...
Signed-off-by: Erik Kapfer erik.kapfer@ipfire.org --- html/cgi-bin/tor.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/html/cgi-bin/tor.cgi b/html/cgi-bin/tor.cgi index 75fdf0d5d..9aa2bc95a 100644 --- a/html/cgi-bin/tor.cgi +++ b/html/cgi-bin/tor.cgi @@ -790,7 +790,7 @@ sub BuildConfiguration() {
my @nodes = split(",", $settings{'TOR_USE_EXIT_NODES'}); foreach (@nodes) { - print FILE "ExitNode $_\n"; + print FILE "ExitNodes $_\n"; } }
Signed-off-by: Erik Kapfer erik.kapfer@ipfire.org --- config/rootfiles/core/182/update.sh | 11 +++++++++++ 1 file changed, 11 insertions(+)
diff --git a/config/rootfiles/core/182/update.sh b/config/rootfiles/core/182/update.sh index 4416e73f4..cb7d853ec 100644 --- a/config/rootfiles/core/182/update.sh +++ b/config/rootfiles/core/182/update.sh @@ -91,6 +91,17 @@ if grep -q "ENABLED=on" /var/ipfire/vpn/settings; then /etc/rc.d/init.d/ipsec start fi
+# Change deprecated option in tor configuration file if in usage +if grep -q 'ExitNode ' /var/ipfire/tor/torrc; then + if pgrep tor >/dev/null; then + /usr/local/bin/torctrl stop >/dev/null + sed -i 's/ExitNode /ExitNodes /g' /var/ipfire/tor/torrc + /usr/local/bin/torctrl restart >/dev/null + fi +else + sed -i 's/ExitNode /ExitNodes /g' /var/ipfire/tor/torrc +fi + # Rebuild initial ramdisks dracut --regenerate-all --force KVER="xxxKVERxxx"
Hello Erik,
Thanks for the patch, but doesn’t it look a little bit over-engineered?
On 30 Nov 2023, at 07:56, Erik Kapfer erik.kapfer@ipfire.org wrote:
Signed-off-by: Erik Kapfer erik.kapfer@ipfire.org
config/rootfiles/core/182/update.sh | 11 +++++++++++ 1 file changed, 11 insertions(+)
diff --git a/config/rootfiles/core/182/update.sh b/config/rootfiles/core/182/update.sh index 4416e73f4..cb7d853ec 100644 --- a/config/rootfiles/core/182/update.sh +++ b/config/rootfiles/core/182/update.sh @@ -91,6 +91,17 @@ if grep -q "ENABLED=on" /var/ipfire/vpn/settings; then /etc/rc.d/init.d/ipsec start fi
+# Change deprecated option in tor configuration file if in usage +if grep -q 'ExitNode ' /var/ipfire/tor/torrc; then
- if pgrep tor >/dev/null; then
- /usr/local/bin/torctrl stop >/dev/null
- sed -i 's/ExitNode /ExitNodes /g' /var/ipfire/tor/torrc
- /usr/local/bin/torctrl restart >/dev/null
- fi
+else
- sed -i 's/ExitNode /ExitNodes /g' /var/ipfire/tor/torrc
You can always run this command without checking for “ExitNode “ because, because it wouldn’t break anything.
And I think that stopping Tor feels a little bit complicated, or does it actually overwrite its own configuration file?
-Michael
+fi
# Rebuild initial ramdisks dracut --regenerate-all --force KVER="xxxKVERxxx" -- 2.42.0
Good morning Michael,
Am Donnerstag, dem 30.11.2023 um 09:36 +0000 schrieb Michael Tremer:
Hello Erik,
Thanks for the patch, but doesn’t it look a little bit over- engineered?
Probably :-) .
On 30 Nov 2023, at 07:56, Erik Kapfer erik.kapfer@ipfire.org wrote:
Signed-off-by: Erik Kapfer erik.kapfer@ipfire.org
config/rootfiles/core/182/update.sh | 11 +++++++++++ 1 file changed, 11 insertions(+)
diff --git a/config/rootfiles/core/182/update.sh b/config/rootfiles/core/182/update.sh index 4416e73f4..cb7d853ec 100644 --- a/config/rootfiles/core/182/update.sh +++ b/config/rootfiles/core/182/update.sh @@ -91,6 +91,17 @@ if grep -q "ENABLED=on" /var/ipfire/vpn/settings; then /etc/rc.d/init.d/ipsec start fi
+# Change deprecated option in tor configuration file if in usage +if grep -q 'ExitNode ' /var/ipfire/tor/torrc; then
- if pgrep tor >/dev/null; then
- /usr/local/bin/torctrl stop >/dev/null
- sed -i 's/ExitNode /ExitNodes /g' /var/ipfire/tor/torrc
- /usr/local/bin/torctrl restart >/dev/null
- fi
+else
- sed -i 's/ExitNode /ExitNodes /g' /var/ipfire/tor/torrc
You can always run this command without checking for “ExitNode “ because, because it wouldn’t break anything.
Mainly therefor to spare a tor restart if nothing have to be changed but if this fix goes into the next update, a reboot is needed anyway.
And I think that stopping Tor feels a little bit complicated, or does it actually overwrite its own configuration file?
No i don´t think so, mainly business a usual. Will send a v2.
-Michael
Best,
Erik
+fi
# Rebuild initial ramdisks dracut --regenerate-all --force KVER="xxxKVERxxx" -- 2.42.0
Signed-off-by: Erik Kapfer erik.kapfer@ipfire.org --- config/rootfiles/core/182/update.sh | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/config/rootfiles/core/182/update.sh b/config/rootfiles/core/182/update.sh index 4416e73f4..47a9be230 100644 --- a/config/rootfiles/core/182/update.sh +++ b/config/rootfiles/core/182/update.sh @@ -91,6 +91,14 @@ if grep -q "ENABLED=on" /var/ipfire/vpn/settings; then /etc/rc.d/init.d/ipsec start fi
+# Change deprecated option in tor configuration file if in usage +if pgrep tor >/dev/null; then + sed -i 's/ExitNode /ExitNodes /g' /var/ipfire/tor/torrc + /usr/local/bin/torctrl restart >/dev/null +else + sed -i 's/ExitNode /ExitNodes /g' /var/ipfire/tor/torrc +fi + # Rebuild initial ramdisks dracut --regenerate-all --force KVER="xxxKVERxxx"