Commit Graph

43 Commits

Author SHA1 Message Date
Erik Kapfer
a913e1ebdd tor.cgi: Fixes deprecated tor option 'ExitNode' to 'ExitNodes'
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-please-use-exitnodes-instead/10582/10

Signed-off-by: Erik Kapfer <erik.kapfer@ipfire.org>
2023-12-04 22:32:43 +00:00
Peter Müller
13b04e6998 Tor: Do not attempt to establish connections via IPv6
To quote from the changelog of Tor 0.4.8.4:

  o Minor feature (client, IPv6):
    - Make client able to pick IPv6 relays by default now meaning
      ClientUseIPv6 option now defaults to 1. Closes ticket 40785.

In order to avoid any malfunctions on IPFire installations,
set this option to "0" explicitly.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2023-09-15 06:56:21 +00:00
Peter Müller
8a0be2033f Tor: Disable SOCKS port if unused
Fixes: #11780
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2022-11-18 14:37:55 +00:00
Peter Müller
76f36a621d Tor: Bump package version
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2021-10-22 10:21:19 +00:00
Peter Müller
91aa257ed7 Tor: Do not try to support IPv6 for Directory and OR ports
We currently don't have IPv6 in vanilla IPFire 2.x installations, hence
there is no sense in letting Tor finding out IPv6 connectivity.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2021-10-22 10:21:04 +00:00
Peter Müller
fb4e1d53a0 Tor: Use crypto hardware acceleration if available
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2021-10-22 10:20:52 +00:00
Peter Müller
0b6a2e761b Tor: Enable syscall sandbox
This makes post-exploitation activities harder, in case the local Tor
instance has been compromised. It is worth noticing that Tor won't
respond to a "GETINFO address" command on the control port if sandboxed,
but our CGI does not make use of it, and neither is any legitimate
service on IPFire doing so.

Tested on a small middle relay running on an IPFire machine.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2021-10-22 10:20:37 +00:00
Michael Tremer
c4a54c419d tor.cgi: Use new perl system functions
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-06-10 15:01:36 +01:00
Jonatan Schlag
8186b37230 Hardcode theme to ipfire
This disables the theme support and makes it impossible to use any other
themes than the ipfire default theme.

The only intention of this patch is to hardcode the theme to ipfire.
To change any cgi we have is an ugly way, but the only way to do this
fast. The colour handling needs certainly to be improved as well, but
this will and should be done in other patches.

Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-04-08 10:11:34 +00:00
Peter Müller
848911b247 tor.cgi: fix location function call again
This line was accidentially messed up while merging two patchsets
together, causing tor.cgi to crash with an HTTP error 500 in testing.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-12-02 14:56:34 +00:00
Peter Müller
7c507f3d5b Tor: allow enforcing distinct Guard relays or countries
In order to make deanonymisation harder, especially high-risk Tor users
might want to use certain Guard relays only (for example operated by
people they trust), enforce Tor to use Guard relays in certain countries
only (for example countries with very strict data protection laws or
poor diplomatic relations), or avoid Guard relays in certain countries
entirely.

Since Tor sticks to sampled Guards for a long time (usually within the
range of months), restricting those is believed to cause less harm to a
users' anonymity than restricting Exit relays, since their diversity of
a generic Tor user is significantly higher.

This patch extends the Tor CGI for restricting Guard nodes to certain
countries or relays matching certain fingerprints.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-11-25 17:20:51 +00:00
Peter Müller
5efe8957a5 Tor: allow multiple countries to be selected for Exit relays
This extends the functionality of the Tor CGI in order to be able to
select multiple countries for possible Exit relays, which is - in terms
of anonymity - less worse than limiting all Tor circuits to a single
country.

For example, a user might want to avoid Exit relays in more than one
country, and permit Tor to use Exit relays elesewhere, and vice versa.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-11-25 17:20:14 +00:00
Stefan Schantl
07e42be978 Adjust CGI files to work with latest location-function.pl changes.
Fixes #12515.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-11-09 14:07:21 +00:00
Peter Müller
c63ea6cf49 tor.cgi: look up Tor relay country codes using libloc
Tor provides a function to resolve a relay's IP address into a country
code by taking advantage of a (heavily outdated) GeoIP database shipped
with it.

We should consequently use libloc for doing this, since it can be
confusing if those results differ from active connections in the
connection tracking CGI (where we _use_ libloc) and such tasks are why
we invented libloc in the first place. :-)

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-11-05 23:31:14 +00:00
Peter Müller
5fe798b52f tor.cgi: fix calling Perl location module functions
The second version of this patch avoids re-defining $db_handle.

Fixes: #12492

Cc: Stefan Schantl <stefan.schantl@ipfire.org
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Acked-By: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-10-12 10:15:36 +00:00
Stefan Schantl
8b45257326 tor.cgi: Use own location functions.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-09-24 17:36:38 +00:00
Stefan Schantl
0893eef4cc tor.cgi: Use location-functions.pl
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-06-12 18:48:24 +02:00
Erik Kapfer
ac2fdbb15e tor.cgi: Disable debugging output
Signed-off-by: Erik Kapfer <ummeegge@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-05-27 15:46:45 +01:00
Peter Müller
04f9321955 Tor WebUI: drop relay bandwith options < 1 MBit/s
Tor requires at least 1 MBit/s in order to participate.

Fixes #12001

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-03-11 09:52:54 +00:00
Peter Müller
0675a66d83 update metrics links in Tor WebUI
https://atlas.torproject.org/ is deprecated in favour of
https://metrics.torproject.org/ by now.

Fixes #11781.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-02-25 01:02:59 +00:00
Peter Müller
eea4969dff Tor: Use relay mode as default setting
Set the default operating mode to "relay" in the Tor WebUI
configuration page.

Running a Tor exit relay may cause legal trouble in some
countries and should not be the default setting to prevent
users from accidentally running an exit router.

Signed-off-by: Peter Müller <peter.mueller@link38.eu>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2017-11-07 16:14:36 +00:00
Alf Høgemark
f00699e8bb Change case of the unit "bit" from "Bit" to "bit" in web UI
The correct case for "kilobit" is "kilobit", not "kiloBit".
And the same applies for Mbit, Gbit etc.
Reference is https://en.wikipedia.org/wiki/Kilobit

This commit changes the texts used in the web UI, so
that it correctly displays as "bit", "kbit", "Mbit" etc.

This fixes bugzilla item 10918.

Signed-off-by: Alf Høgemark <alf@i100.no>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2016-07-20 16:46:23 +01:00
Stefan Schantl
a9a28430b5 tor.cgi: Fix missing country flag icons.
The CGI now is using the GeoIP::get_flag_icon function provided by the
geoip-functions.pl, which takes care of the changed flag icons shipped
by core update 90.

Fixes #10919.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Tested-by: Jan Paul Tuecking <jan.paul.tuecking@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2015-10-15 15:42:44 +01:00
Lars Schuhmacher
e3edceeb7a Mark required input fields with a star
Mark required input fields with a star as nowadays this is
the de-facto default. Before, it was the other way around and
optional fields were marked.

Signed-off-by: Lars Schumacher <larsen007@web.de>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2015-09-21 16:40:41 +01:00
Stefan Schantl
b013822b99 Rename Locale::Country to Locale::Codes::Country in various scripts.
The new Locale-Country version needs to be loaded and used by specifing
Locale::Codes::Country since an upstream API change. Adjusting various perl
scripts to use the module in the proper way again.
2015-04-22 18:18:38 +02:00
Alexander Marx
aeefcc9caa Firewall: modified firewall-groups so that they can be empty even if used in rules
Now one can create a group, use it in a rule and then delete every entry
from the group. (The firewallrule then will be displayed yellow and
disabled).
2014-01-11 12:13:45 +01:00
Alexander Marx
f76b104cf3 fifteen-theme: made tor.cgi table themeable 2014-01-08 15:02:34 +01:00
Jan Paul Tuecking
4245fe3479 tor: added directory port to tor.cgi 2013-09-07 14:47:28 +02:00
Jan Paul Tuecking
ae666bf128 tor: fixed display of not founded country flags in tor.cgi 2013-09-06 22:05:10 +02:00
Jan Paul Tuecking
b31af08582 tor: valid client names are max. 19 characters long changed that in tor.cgi 2013-09-06 22:01:21 +02:00
Michael Tremer
26cce22da0 tor.cgi: Remember selected exit node country. 2013-08-21 17:24:36 +02:00
Jan Paul Tuecking
3387469bdb tor: added daemon stats and little changes on styling 2013-08-21 17:23:16 +02:00
Michael Tremer
919a50208b tor.cgi: Remove NoAdvertise option.
This does not make much sense with our setup.
2013-08-10 12:14:29 +02:00
Michael Tremer
a03547fe5e tor.cgi: Always show all configuration options.
Otherwise, if tor was disable, all settings like nickname, etc.
were reset to default.
2013-08-02 13:17:54 +02:00
Michael Tremer
56bf9f2174 tor.cgi: Check for valid accounting limit. 2013-08-02 11:27:14 +02:00
Michael Tremer
bd8b033078 tor.cgi: Check for valid relay address. 2013-08-02 11:22:52 +02:00
Michael Tremer
818f47d06f tor.cgi: Check for valid port numbers. 2013-08-02 11:20:53 +02:00
Michael Tremer
b0449403e6 tor.cgi: Catch invalid characters in relay name. 2013-08-02 11:06:40 +02:00
Michael Tremer
3308f8d09f tor.cgi: Burst bandwidth may never be less than rate. 2013-08-02 10:57:01 +02:00
Michael Tremer
6eb9c49d60 tor: The slowest bandwidth rate for a relay is 20 kbyte/s. 2013-08-02 10:42:41 +02:00
Michael Tremer
f16bcc3e31 tor.cgi: Show number of connected relays. 2013-07-31 19:26:37 +02:00
Michael Tremer
005db20668 tor.cgi: Minor functionality fixes and layout improvements. 2013-07-31 19:11:59 +02:00
Michael Tremer
13b5ce6e40 tor: Import CGI script. 2013-07-30 21:53:16 +02:00