tor: Import CGI script.
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 30 Jul 2013 19:53:16 +0000 (21:53 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 30 Jul 2013 19:53:16 +0000 (21:53 +0200)
13 files changed:
config/rootfiles/packages/tor
doc/language_issues.de
doc/language_issues.en
doc/language_issues.es
doc/language_issues.fr
doc/language_issues.nl
doc/language_issues.pl
doc/language_issues.ru
doc/language_issues.tr
doc/language_missings
html/cgi-bin/tor.cgi [new file with mode: 0644]
langs/de/cgi-bin/de.pl
langs/en/cgi-bin/en.pl

index 864db663c1cc005418b2667c0005ca1f6ccdcc5a..53ca8b0c49bea09a06987995770e114a3cb6708d 100644 (file)
@@ -21,6 +21,7 @@ usr/share/tor
 usr/share/tor/defaults-torrc
 usr/share/tor/geoip
 var/ipfire/backup/addons/includes/tor
+srv/web/ipfire/cgi-bin/tor.cgi
 var/ipfire/tor
 var/ipfire/tor/settings
 var/ipfire/tor/torrc
index 3b6e117ecf1f5ebcf52aa331ebff98bd55c648b7..bbe5e1de78abdaf21ae7c3d4d7e6880fbeebd9d1 100644 (file)
@@ -406,6 +406,10 @@ WARNING: translation string unused: to email adr
 WARNING: translation string unused: to install an update
 WARNING: translation string unused: to warn email bad
 WARNING: translation string unused: too long 80 char max
+WARNING: translation string unused: tor accounting period daily
+WARNING: translation string unused: tor accounting period monthly
+WARNING: translation string unused: tor accounting period weekly
+WARNING: translation string unused: tor exit country
 WARNING: translation string unused: traffic back
 WARNING: translation string unused: traffic calc time
 WARNING: translation string unused: traffic calc time bad
index 8f530a3f3eeb526cf5a444b836e80418e4133a28..12489577b404c2c94ade77687e7cc8690046bbf3 100644 (file)
@@ -437,6 +437,12 @@ WARNING: translation string unused: to email adr
 WARNING: translation string unused: to install an update
 WARNING: translation string unused: to warn email bad
 WARNING: translation string unused: too long 80 char max
+WARNING: translation string unused: tor accounting period daily
+WARNING: translation string unused: tor accounting period monthly
+WARNING: translation string unused: tor accounting period weekly
+WARNING: translation string unused: tor bridge enabled
+WARNING: translation string unused: tor errmsg invalid node id
+WARNING: translation string unused: tor exit country
 WARNING: translation string unused: traffic back
 WARNING: translation string unused: traffic calc time
 WARNING: translation string unused: traffic calc time bad
index 2258d1b55f5a52bee153eeb1b62768078c6249ea..7756f26447fc587b307cfc29bb0724e860342db5 100644 (file)
@@ -549,6 +549,13 @@ WARNING: untranslated string: ccd routes
 WARNING: untranslated string: ccd subnet
 WARNING: untranslated string: ccd used
 WARNING: untranslated string: deprecated fs warn
+WARNING: untranslated string: dnsforward
+WARNING: untranslated string: dnsforward add a new entry
+WARNING: untranslated string: dnsforward configuration
+WARNING: untranslated string: dnsforward edit an entry
+WARNING: untranslated string: dnsforward entries
+WARNING: untranslated string: dnsforward forward_server
+WARNING: untranslated string: dnsforward zone
 WARNING: untranslated string: emerging rules
 WARNING: untranslated string: fireinfo ipfire version
 WARNING: untranslated string: fireinfo is disabled
@@ -618,6 +625,45 @@ WARNING: untranslated string: routing table
 WARNING: untranslated string: server restart
 WARNING: untranslated string: static routes
 WARNING: untranslated string: system information
+WARNING: untranslated string: tor accounting
+WARNING: untranslated string: tor accounting bytes
+WARNING: untranslated string: tor accounting bytes left
+WARNING: untranslated string: tor accounting interval
+WARNING: untranslated string: tor accounting limit
+WARNING: untranslated string: tor accounting period
+WARNING: untranslated string: tor acls
+WARNING: untranslated string: tor allowed subnets
+WARNING: untranslated string: tor bandwidth burst
+WARNING: untranslated string: tor bandwidth rate
+WARNING: untranslated string: tor bandwidth settings
+WARNING: untranslated string: tor bandwidth unlimited
+WARNING: untranslated string: tor common settings
+WARNING: untranslated string: tor configuration
+WARNING: untranslated string: tor connected relays
+WARNING: untranslated string: tor contact info
+WARNING: untranslated string: tor do not advertise relay
+WARNING: untranslated string: tor enabled
+WARNING: untranslated string: tor errmsg invalid ip or mask
+WARNING: untranslated string: tor exit country any
+WARNING: untranslated string: tor exit nodes
+WARNING: untranslated string: tor relay address
+WARNING: untranslated string: tor relay configuration
+WARNING: untranslated string: tor relay enabled
+WARNING: untranslated string: tor relay external address
+WARNING: untranslated string: tor relay fingerprint
+WARNING: untranslated string: tor relay mode
+WARNING: untranslated string: tor relay mode bridge
+WARNING: untranslated string: tor relay mode exit
+WARNING: untranslated string: tor relay mode private bridge
+WARNING: untranslated string: tor relay mode relay
+WARNING: untranslated string: tor relay nickname
+WARNING: untranslated string: tor relay port
+WARNING: untranslated string: tor socks port
+WARNING: untranslated string: tor stats
+WARNING: untranslated string: tor traffic limit hard
+WARNING: untranslated string: tor traffic limit soft
+WARNING: untranslated string: tor traffic read written
+WARNING: untranslated string: tor use exit nodes
 WARNING: untranslated string: uptime load average
 WARNING: untranslated string: visit us at
 WARNING: untranslated string: vpn keyexchange
index 58f44541a5dfa84455bae7ebc3f5079db9a20135..21fa1ad170fc9376235f1dd36585d67ef9dd260f 100644 (file)
@@ -549,6 +549,13 @@ WARNING: untranslated string: ccd subnet
 WARNING: untranslated string: ccd used
 WARNING: untranslated string: deprecated fs warn
 WARNING: untranslated string: dns address deleted txt
+WARNING: untranslated string: dnsforward
+WARNING: untranslated string: dnsforward add a new entry
+WARNING: untranslated string: dnsforward configuration
+WARNING: untranslated string: dnsforward edit an entry
+WARNING: untranslated string: dnsforward entries
+WARNING: untranslated string: dnsforward forward_server
+WARNING: untranslated string: dnsforward zone
 WARNING: untranslated string: emerging rules
 WARNING: untranslated string: fireinfo ipfire version
 WARNING: untranslated string: fireinfo is disabled
@@ -603,6 +610,45 @@ WARNING: untranslated string: server restart
 WARNING: untranslated string: snort working
 WARNING: untranslated string: static routes
 WARNING: untranslated string: system information
+WARNING: untranslated string: tor accounting
+WARNING: untranslated string: tor accounting bytes
+WARNING: untranslated string: tor accounting bytes left
+WARNING: untranslated string: tor accounting interval
+WARNING: untranslated string: tor accounting limit
+WARNING: untranslated string: tor accounting period
+WARNING: untranslated string: tor acls
+WARNING: untranslated string: tor allowed subnets
+WARNING: untranslated string: tor bandwidth burst
+WARNING: untranslated string: tor bandwidth rate
+WARNING: untranslated string: tor bandwidth settings
+WARNING: untranslated string: tor bandwidth unlimited
+WARNING: untranslated string: tor common settings
+WARNING: untranslated string: tor configuration
+WARNING: untranslated string: tor connected relays
+WARNING: untranslated string: tor contact info
+WARNING: untranslated string: tor do not advertise relay
+WARNING: untranslated string: tor enabled
+WARNING: untranslated string: tor errmsg invalid ip or mask
+WARNING: untranslated string: tor exit country any
+WARNING: untranslated string: tor exit nodes
+WARNING: untranslated string: tor relay address
+WARNING: untranslated string: tor relay configuration
+WARNING: untranslated string: tor relay enabled
+WARNING: untranslated string: tor relay external address
+WARNING: untranslated string: tor relay fingerprint
+WARNING: untranslated string: tor relay mode
+WARNING: untranslated string: tor relay mode bridge
+WARNING: untranslated string: tor relay mode exit
+WARNING: untranslated string: tor relay mode private bridge
+WARNING: untranslated string: tor relay mode relay
+WARNING: untranslated string: tor relay nickname
+WARNING: untranslated string: tor relay port
+WARNING: untranslated string: tor socks port
+WARNING: untranslated string: tor stats
+WARNING: untranslated string: tor traffic limit hard
+WARNING: untranslated string: tor traffic limit soft
+WARNING: untranslated string: tor traffic read written
+WARNING: untranslated string: tor use exit nodes
 WARNING: untranslated string: upload new ruleset
 WARNING: untranslated string: uptime load average
 WARNING: untranslated string: urlfilter file ext block
index d7a7ff760a6cfe9eadf7f2a8acee0097b8344c8e..3a8f682b5f12f0aaf525613f5f7fe869f1a66dbe 100644 (file)
@@ -513,6 +513,13 @@ WARNING: untranslated string: age sminute
 WARNING: untranslated string: age ssecond
 WARNING: untranslated string: bytes
 WARNING: untranslated string: ccd iroute2
+WARNING: untranslated string: dnsforward
+WARNING: untranslated string: dnsforward add a new entry
+WARNING: untranslated string: dnsforward configuration
+WARNING: untranslated string: dnsforward edit an entry
+WARNING: untranslated string: dnsforward entries
+WARNING: untranslated string: dnsforward forward_server
+WARNING: untranslated string: dnsforward zone
 WARNING: untranslated string: new
 WARNING: untranslated string: outgoing firewall reserved groupname
 WARNING: untranslated string: qos enter bandwidths
@@ -520,6 +527,45 @@ WARNING: untranslated string: route config changed
 WARNING: untranslated string: routing config added
 WARNING: untranslated string: routing config changed
 WARNING: untranslated string: routing table
+WARNING: untranslated string: tor accounting
+WARNING: untranslated string: tor accounting bytes
+WARNING: untranslated string: tor accounting bytes left
+WARNING: untranslated string: tor accounting interval
+WARNING: untranslated string: tor accounting limit
+WARNING: untranslated string: tor accounting period
+WARNING: untranslated string: tor acls
+WARNING: untranslated string: tor allowed subnets
+WARNING: untranslated string: tor bandwidth burst
+WARNING: untranslated string: tor bandwidth rate
+WARNING: untranslated string: tor bandwidth settings
+WARNING: untranslated string: tor bandwidth unlimited
+WARNING: untranslated string: tor common settings
+WARNING: untranslated string: tor configuration
+WARNING: untranslated string: tor connected relays
+WARNING: untranslated string: tor contact info
+WARNING: untranslated string: tor do not advertise relay
+WARNING: untranslated string: tor enabled
+WARNING: untranslated string: tor errmsg invalid ip or mask
+WARNING: untranslated string: tor exit country any
+WARNING: untranslated string: tor exit nodes
+WARNING: untranslated string: tor relay address
+WARNING: untranslated string: tor relay configuration
+WARNING: untranslated string: tor relay enabled
+WARNING: untranslated string: tor relay external address
+WARNING: untranslated string: tor relay fingerprint
+WARNING: untranslated string: tor relay mode
+WARNING: untranslated string: tor relay mode bridge
+WARNING: untranslated string: tor relay mode exit
+WARNING: untranslated string: tor relay mode private bridge
+WARNING: untranslated string: tor relay mode relay
+WARNING: untranslated string: tor relay nickname
+WARNING: untranslated string: tor relay port
+WARNING: untranslated string: tor socks port
+WARNING: untranslated string: tor stats
+WARNING: untranslated string: tor traffic limit hard
+WARNING: untranslated string: tor traffic limit soft
+WARNING: untranslated string: tor traffic read written
+WARNING: untranslated string: tor use exit nodes
 WARNING: untranslated string: uptime load average
 WARNING: untranslated string: wlan client
 WARNING: untranslated string: wlan client advanced settings
index 2258d1b55f5a52bee153eeb1b62768078c6249ea..7756f26447fc587b307cfc29bb0724e860342db5 100644 (file)
@@ -549,6 +549,13 @@ WARNING: untranslated string: ccd routes
 WARNING: untranslated string: ccd subnet
 WARNING: untranslated string: ccd used
 WARNING: untranslated string: deprecated fs warn
+WARNING: untranslated string: dnsforward
+WARNING: untranslated string: dnsforward add a new entry
+WARNING: untranslated string: dnsforward configuration
+WARNING: untranslated string: dnsforward edit an entry
+WARNING: untranslated string: dnsforward entries
+WARNING: untranslated string: dnsforward forward_server
+WARNING: untranslated string: dnsforward zone
 WARNING: untranslated string: emerging rules
 WARNING: untranslated string: fireinfo ipfire version
 WARNING: untranslated string: fireinfo is disabled
@@ -618,6 +625,45 @@ WARNING: untranslated string: routing table
 WARNING: untranslated string: server restart
 WARNING: untranslated string: static routes
 WARNING: untranslated string: system information
+WARNING: untranslated string: tor accounting
+WARNING: untranslated string: tor accounting bytes
+WARNING: untranslated string: tor accounting bytes left
+WARNING: untranslated string: tor accounting interval
+WARNING: untranslated string: tor accounting limit
+WARNING: untranslated string: tor accounting period
+WARNING: untranslated string: tor acls
+WARNING: untranslated string: tor allowed subnets
+WARNING: untranslated string: tor bandwidth burst
+WARNING: untranslated string: tor bandwidth rate
+WARNING: untranslated string: tor bandwidth settings
+WARNING: untranslated string: tor bandwidth unlimited
+WARNING: untranslated string: tor common settings
+WARNING: untranslated string: tor configuration
+WARNING: untranslated string: tor connected relays
+WARNING: untranslated string: tor contact info
+WARNING: untranslated string: tor do not advertise relay
+WARNING: untranslated string: tor enabled
+WARNING: untranslated string: tor errmsg invalid ip or mask
+WARNING: untranslated string: tor exit country any
+WARNING: untranslated string: tor exit nodes
+WARNING: untranslated string: tor relay address
+WARNING: untranslated string: tor relay configuration
+WARNING: untranslated string: tor relay enabled
+WARNING: untranslated string: tor relay external address
+WARNING: untranslated string: tor relay fingerprint
+WARNING: untranslated string: tor relay mode
+WARNING: untranslated string: tor relay mode bridge
+WARNING: untranslated string: tor relay mode exit
+WARNING: untranslated string: tor relay mode private bridge
+WARNING: untranslated string: tor relay mode relay
+WARNING: untranslated string: tor relay nickname
+WARNING: untranslated string: tor relay port
+WARNING: untranslated string: tor socks port
+WARNING: untranslated string: tor stats
+WARNING: untranslated string: tor traffic limit hard
+WARNING: untranslated string: tor traffic limit soft
+WARNING: untranslated string: tor traffic read written
+WARNING: untranslated string: tor use exit nodes
 WARNING: untranslated string: uptime load average
 WARNING: untranslated string: visit us at
 WARNING: untranslated string: vpn keyexchange
index 7b83295236fa4a3b3d297a6f16f7fdbc5b04b50b..324c4772090b1723f62a38368618c16bc456a290 100644 (file)
@@ -542,6 +542,13 @@ WARNING: untranslated string: ccd used
 WARNING: untranslated string: community rules
 WARNING: untranslated string: deprecated fs warn
 WARNING: untranslated string: disk access per
+WARNING: untranslated string: dnsforward
+WARNING: untranslated string: dnsforward add a new entry
+WARNING: untranslated string: dnsforward configuration
+WARNING: untranslated string: dnsforward edit an entry
+WARNING: untranslated string: dnsforward entries
+WARNING: untranslated string: dnsforward forward_server
+WARNING: untranslated string: dnsforward zone
 WARNING: untranslated string: emerging rules
 WARNING: untranslated string: extrahd because there is already a device mounted
 WARNING: untranslated string: extrahd cant umount
@@ -583,6 +590,45 @@ WARNING: untranslated string: routing config changed
 WARNING: untranslated string: routing table
 WARNING: untranslated string: server restart
 WARNING: untranslated string: static routes
+WARNING: untranslated string: tor accounting
+WARNING: untranslated string: tor accounting bytes
+WARNING: untranslated string: tor accounting bytes left
+WARNING: untranslated string: tor accounting interval
+WARNING: untranslated string: tor accounting limit
+WARNING: untranslated string: tor accounting period
+WARNING: untranslated string: tor acls
+WARNING: untranslated string: tor allowed subnets
+WARNING: untranslated string: tor bandwidth burst
+WARNING: untranslated string: tor bandwidth rate
+WARNING: untranslated string: tor bandwidth settings
+WARNING: untranslated string: tor bandwidth unlimited
+WARNING: untranslated string: tor common settings
+WARNING: untranslated string: tor configuration
+WARNING: untranslated string: tor connected relays
+WARNING: untranslated string: tor contact info
+WARNING: untranslated string: tor do not advertise relay
+WARNING: untranslated string: tor enabled
+WARNING: untranslated string: tor errmsg invalid ip or mask
+WARNING: untranslated string: tor exit country any
+WARNING: untranslated string: tor exit nodes
+WARNING: untranslated string: tor relay address
+WARNING: untranslated string: tor relay configuration
+WARNING: untranslated string: tor relay enabled
+WARNING: untranslated string: tor relay external address
+WARNING: untranslated string: tor relay fingerprint
+WARNING: untranslated string: tor relay mode
+WARNING: untranslated string: tor relay mode bridge
+WARNING: untranslated string: tor relay mode exit
+WARNING: untranslated string: tor relay mode private bridge
+WARNING: untranslated string: tor relay mode relay
+WARNING: untranslated string: tor relay nickname
+WARNING: untranslated string: tor relay port
+WARNING: untranslated string: tor socks port
+WARNING: untranslated string: tor stats
+WARNING: untranslated string: tor traffic limit hard
+WARNING: untranslated string: tor traffic limit soft
+WARNING: untranslated string: tor traffic read written
+WARNING: untranslated string: tor use exit nodes
 WARNING: untranslated string: uptime load average
 WARNING: untranslated string: visit us at
 WARNING: untranslated string: vpn keyexchange
index 17568408d55271e459bcbd91a90ccbfcefea8765..31a18c92a44252c97bf875ed9c9a81cebd0279b4 100644 (file)
@@ -510,12 +510,58 @@ WARNING: translation string unused: year-graph
 WARNING: translation string unused: yearly firewallhits
 WARNING: untranslated string: Scan for Songs
 WARNING: untranslated string: bytes
+WARNING: untranslated string: dnsforward
+WARNING: untranslated string: dnsforward add a new entry
+WARNING: untranslated string: dnsforward configuration
+WARNING: untranslated string: dnsforward edit an entry
+WARNING: untranslated string: dnsforward entries
+WARNING: untranslated string: dnsforward forward_server
+WARNING: untranslated string: dnsforward zone
 WARNING: untranslated string: new
 WARNING: untranslated string: outgoing firewall reserved groupname
 WARNING: untranslated string: route config changed
 WARNING: untranslated string: routing config added
 WARNING: untranslated string: routing config changed
 WARNING: untranslated string: routing table
+WARNING: untranslated string: tor accounting
+WARNING: untranslated string: tor accounting bytes
+WARNING: untranslated string: tor accounting bytes left
+WARNING: untranslated string: tor accounting interval
+WARNING: untranslated string: tor accounting limit
+WARNING: untranslated string: tor accounting period
+WARNING: untranslated string: tor acls
+WARNING: untranslated string: tor allowed subnets
+WARNING: untranslated string: tor bandwidth burst
+WARNING: untranslated string: tor bandwidth rate
+WARNING: untranslated string: tor bandwidth settings
+WARNING: untranslated string: tor bandwidth unlimited
+WARNING: untranslated string: tor common settings
+WARNING: untranslated string: tor configuration
+WARNING: untranslated string: tor connected relays
+WARNING: untranslated string: tor contact info
+WARNING: untranslated string: tor do not advertise relay
+WARNING: untranslated string: tor enabled
+WARNING: untranslated string: tor errmsg invalid ip or mask
+WARNING: untranslated string: tor exit country any
+WARNING: untranslated string: tor exit nodes
+WARNING: untranslated string: tor relay address
+WARNING: untranslated string: tor relay configuration
+WARNING: untranslated string: tor relay enabled
+WARNING: untranslated string: tor relay external address
+WARNING: untranslated string: tor relay fingerprint
+WARNING: untranslated string: tor relay mode
+WARNING: untranslated string: tor relay mode bridge
+WARNING: untranslated string: tor relay mode exit
+WARNING: untranslated string: tor relay mode private bridge
+WARNING: untranslated string: tor relay mode relay
+WARNING: untranslated string: tor relay nickname
+WARNING: untranslated string: tor relay port
+WARNING: untranslated string: tor socks port
+WARNING: untranslated string: tor stats
+WARNING: untranslated string: tor traffic limit hard
+WARNING: untranslated string: tor traffic limit soft
+WARNING: untranslated string: tor traffic read written
+WARNING: untranslated string: tor use exit nodes
 WARNING: untranslated string: wlan client
 WARNING: untranslated string: wlan client advanced settings
 WARNING: untranslated string: wlan client and
index b78b367b0e433d621514b346dfa0da13723f883b..e47da816f78eeae29a4eadca2f0968753c374750 100644 (file)
 < ccd used
 < deprecated fs warn
 < dns address deleted txt
+< dnsforward
+< dnsforward add a new entry
+< dnsforward configuration
+< dnsforward edit an entry
+< dnsforward entries
+< dnsforward forward_server
+< dnsforward zone
 < fireinfo ipfire version
 < fireinfo is disabled
 < fireinfo is enabled
 < snort working
 < static routes
 < system information
+< tor accounting
+< tor accounting bytes
+< tor accounting bytes left
+< tor accounting interval
+< tor accounting limit
+< tor accounting period
+< tor accounting period daily
+< tor accounting period monthly
+< tor accounting period weekly
+< tor acls
+< tor allowed subnets
+< tor bandwidth burst
+< tor bandwidth rate
+< tor bandwidth settings
+< tor bandwidth unlimited
+< tor common settings
+< tor configuration
+< tor connected relays
+< tor contact info
+< tor do not advertise relay
+< tor enabled
+< tor errmsg invalid ip or mask
+< tor exit country
+< tor exit country any
+< tor exit nodes
+< tor relay address
+< tor relay configuration
+< tor relay enabled
+< tor relay external address
+< tor relay fingerprint
+< tor relay mode
+< tor relay mode bridge
+< tor relay mode exit
+< tor relay mode private bridge
+< tor relay mode relay
+< tor relay nickname
+< tor relay port
+< tor socks port
+< tor stats
+< tor traffic limit hard
+< tor traffic limit soft
+< tor traffic read written
+< tor use exit nodes
 < updxlrtr sources
 < updxlrtr standard view
 < upload new ruleset
 < ccd subnet
 < ccd used
 < deprecated fs warn
+< dnsforward
+< dnsforward add a new entry
+< dnsforward configuration
+< dnsforward edit an entry
+< dnsforward entries
+< dnsforward forward_server
+< dnsforward zone
 < fireinfo ipfire version
 < fireinfo is disabled
 < fireinfo is enabled
 < Set time on boot
 < static routes
 < system information
+< tor accounting
+< tor accounting bytes
+< tor accounting bytes left
+< tor accounting interval
+< tor accounting limit
+< tor accounting period
+< tor accounting period daily
+< tor accounting period monthly
+< tor accounting period weekly
+< tor acls
+< tor allowed subnets
+< tor bandwidth burst
+< tor bandwidth rate
+< tor bandwidth settings
+< tor bandwidth unlimited
+< tor common settings
+< tor configuration
+< tor connected relays
+< tor contact info
+< tor do not advertise relay
+< tor enabled
+< tor errmsg invalid ip or mask
+< tor exit country
+< tor exit country any
+< tor exit nodes
+< tor relay address
+< tor relay configuration
+< tor relay enabled
+< tor relay external address
+< tor relay fingerprint
+< tor relay mode
+< tor relay mode bridge
+< tor relay mode exit
+< tor relay mode private bridge
+< tor relay mode relay
+< tor relay nickname
+< tor relay port
+< tor socks port
+< tor stats
+< tor traffic limit hard
+< tor traffic limit soft
+< tor traffic read written
+< tor use exit nodes
 < updxlrtr sources
 < updxlrtr standard view
 < uptime
 < ccd subnet
 < ccd used
 < deprecated fs warn
+< dnsforward
+< dnsforward add a new entry
+< dnsforward configuration
+< dnsforward edit an entry
+< dnsforward entries
+< dnsforward forward_server
+< dnsforward zone
 < extrahd because there is already a device mounted
 < extrahd cant umount
 < extrahd install or load driver
 < qos enter bandwidths
 < server restart
 < static routes
+< tor accounting
+< tor accounting bytes
+< tor accounting bytes left
+< tor accounting interval
+< tor accounting limit
+< tor accounting period
+< tor accounting period daily
+< tor accounting period monthly
+< tor accounting period weekly
+< tor acls
+< tor allowed subnets
+< tor bandwidth burst
+< tor bandwidth rate
+< tor bandwidth settings
+< tor bandwidth unlimited
+< tor common settings
+< tor configuration
+< tor connected relays
+< tor contact info
+< tor do not advertise relay
+< tor enabled
+< tor errmsg invalid ip or mask
+< tor exit country
+< tor exit country any
+< tor exit nodes
+< tor relay address
+< tor relay configuration
+< tor relay enabled
+< tor relay external address
+< tor relay fingerprint
+< tor relay mode
+< tor relay mode bridge
+< tor relay mode exit
+< tor relay mode private bridge
+< tor relay mode relay
+< tor relay nickname
+< tor relay port
+< tor socks port
+< tor stats
+< tor traffic limit hard
+< tor traffic limit soft
+< tor traffic read written
+< tor use exit nodes
 < updxlrtr sources
 < updxlrtr standard view
 < uptime
 < day-graph
 < deprecated fs warn
 < disk access per
+< dnsforward
+< dnsforward add a new entry
+< dnsforward configuration
+< dnsforward edit an entry
+< dnsforward entries
+< dnsforward forward_server
+< dnsforward zone
 < Edit an existing route
 < extrahd because there is already a device mounted
 < extrahd cant umount
 < qos enter bandwidths
 < server restart
 < static routes
+< tor accounting
+< tor accounting bytes
+< tor accounting bytes left
+< tor accounting interval
+< tor accounting limit
+< tor accounting period
+< tor accounting period daily
+< tor accounting period monthly
+< tor accounting period weekly
+< tor acls
+< tor allowed subnets
+< tor bandwidth burst
+< tor bandwidth rate
+< tor bandwidth settings
+< tor bandwidth unlimited
+< tor common settings
+< tor configuration
+< tor connected relays
+< tor contact info
+< tor do not advertise relay
+< tor enabled
+< tor errmsg invalid ip or mask
+< tor exit country
+< tor exit country any
+< tor exit nodes
+< tor relay address
+< tor relay configuration
+< tor relay enabled
+< tor relay external address
+< tor relay fingerprint
+< tor relay mode
+< tor relay mode bridge
+< tor relay mode exit
+< tor relay mode private bridge
+< tor relay mode relay
+< tor relay nickname
+< tor relay port
+< tor socks port
+< tor stats
+< tor traffic limit hard
+< tor traffic limit soft
+< tor traffic read written
+< tor use exit nodes
 < updxlrtr sources
 < updxlrtr standard view
 < uptime
diff --git a/html/cgi-bin/tor.cgi b/html/cgi-bin/tor.cgi
new file mode 100644 (file)
index 0000000..6b4d9cc
--- /dev/null
@@ -0,0 +1,895 @@
+#!/usr/bin/perl
+###############################################################################
+#                                                                             #
+# IPFire.org - A linux based firewall                                         #
+# Copyright (C) 2013  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        #
+# the Free Software Foundation, either version 3 of the License, or           #
+# (at your option) any later version.                                         #
+#                                                                             #
+# This program is distributed in the hope that it will be useful,             #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
+# GNU General Public License for more details.                                #
+#                                                                             #
+# You should have received a copy of the GNU General Public License           #
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
+#                                                                             #
+###############################################################################
+
+use strict;
+use Locale::Country;
+
+# enable only the following on debugging purpose
+use warnings;
+use CGI::Carp 'fatalsToBrowser';
+
+require '/var/ipfire/general-functions.pl';
+require "${General::swroot}/lang.pl";
+require "${General::swroot}/header.pl";
+
+#workaround to suppress a warning when a variable is used only once
+my @dummy = ( ${Header::colouryellow} );
+undef (@dummy);
+
+my @bandwidth_limits = (
+       1000 * 1024, # 1G
+        500 * 1024,
+        200 * 1024,
+        100 * 1024, # 100M
+         64 * 1024,
+         50 * 1024,
+         25 * 1024,
+         20 * 1024,
+         16 * 1024,
+         10 * 1024,
+          8 * 1024,
+          4 * 1024,
+          2 * 1024,
+              1024, # 1M
+               512,
+               256,
+               128,
+                64
+);
+my @accounting_periods = ('daily', 'weekly', 'monthly');
+
+my $TOR_CONTROL_PORT = 9051;
+
+our %netsettings = ();
+&General::readhash("${General::swroot}/ethernet/settings", \%netsettings);
+
+our %settings = ();
+
+$settings{'TOR_ENABLED'} = 'off';
+$settings{'TOR_SOCKS_PORT'} = 9050;
+$settings{'TOR_EXIT_COUNTRY'} = '';
+$settings{'TOR_USE_EXIT_NODES'} = '';
+$settings{'TOR_ALLOWED_SUBNETS'} = "$netsettings{'GREEN_NETADDRESS'}\/$netsettings{'GREEN_NETMASK'}";
+if (&Header::blue_used()) {
+       $settings{'TOR_ALLOWED_SUBNETS'} .= ",$netsettings{'BLUE_NETADDRESS'}\/$netsettings{'BLUE_NETMASK'}";
+}
+
+$settings{'TOR_RELAY_ENABLED'} = 'off';
+$settings{'TOR_RELAY_MODE'} = 'exit';
+$settings{'TOR_RELAY_PORT'} = 9001;
+$settings{'TOR_RELAY_NOADVERTISE'} = 'off';
+$settings{'TOR_RELAY_BANDWIDTH_RATE'} = 0;
+$settings{'TOR_RELAY_BANDWIDTH_BURST'} = 0;
+$settings{'TOR_RELAY_ACCOUNTING_LIMIT'} = 0;
+$settings{'TOR_RELAY_ACCOUNTING_PERIOD'} = 'daily';
+
+$settings{'ACTION'} = '';
+
+my $errormessage = '';
+my $warnmessage = '';
+
+&Header::showhttpheaders();
+
+# Load settings from file.
+&General::readhash("${General::swroot}/tor/settings", \%settings);
+
+# Get GUI values.
+&Header::getcgihash(\%settings);
+
+# Create tor command connection.
+our $torctrl = &TorConnect();
+
+# Toggle enable/disable field.
+if ($settings{'ACTION'} eq $Lang::tr{'save'}) {
+       my @temp = split(/[\n,]/,$settings{'TOR_ALLOWED_SUBNETS'});
+       $settings{'TOR_ALLOWED_SUBNETS'} = "";
+       foreach (@temp) {
+               s/^\s+//g; s/\s+$//g;
+               if ($_) {
+                       unless (&General::validipandmask($_)) {
+                               $errormessage = "$Lang::tr{'tor errmsg invalid ip or mask'}: $_";
+                       }
+                       $settings{'TOR_ALLOWED_SUBNETS'} .= $_.",";
+               }
+       }
+
+       @temp = split(/[\n,]/,$settings{'TOR_USE_EXIT_NODES'});
+       $settings{'TOR_USE_EXIT_NODES'} = "";
+       foreach (@temp) {
+               s/^\s+//g; s/\s+$//g;
+               if ($_) {
+                       $settings{'TOR_USE_EXIT_NODES'} .= $_.",";
+               }
+       }
+
+       if ($errormessage eq '') {
+               # Write configuration settings to file.
+               &General::writehash("${General::swroot}/tor/settings", \%settings);
+
+               # Update configuration files.
+               &BuildConfiguration();
+       }
+
+       # Reset ACTION.
+       $settings{'ACTION'} = '';
+}
+
+&showMainBox();
+
+# Close Tor control connection.
+&TorClose($torctrl);
+
+# Functions
+
+sub showMainBox() {
+       my %checked = ();
+       my %selected = ();
+
+       $checked{'TOR_ENABLED'}{'on'} = '';
+       $checked{'TOR_ENABLED'}{'off'} = '';
+       $checked{'TOR_ENABLED'}{$settings{'TOR_ENABLED'}} = 'checked';
+
+       $checked{'TOR_RELAY_ENABLED'}{'on'} = '';
+       $checked{'TOR_RELAY_ENABLED'}{'off'} = '';
+       $checked{'TOR_RELAY_ENABLED'}{$settings{'TOR_RELAY_ENABLED'}} = 'checked';
+
+       &Header::openpage($Lang::tr{'tor configuration'}, 1, '');
+       &Header::openbigbox('100%', 'left', '', $errormessage);
+
+       if ($errormessage) {
+               &Header::openbox('100%', 'left', $Lang::tr{'error messages'});
+               print "<font class='base'>$errormessage&nbsp;</font>\n";
+               &Header::closebox();
+       }
+
+       print "<form method='post' action='$ENV{'SCRIPT_NAME'}'>\n";
+
+       &Header::openbox('100%', 'left', $Lang::tr{'tor configuration'});
+
+       print <<END;
+               <table width='100%'>
+                       <tr>
+                               <td colspan='4' class='base'><b>$Lang::tr{'tor common settings'}</b></td>
+                       </tr>
+                       <tr>
+                               <td width='25%' class='base'>$Lang::tr{'tor enabled'}:</td>
+                               <td width='20%'><input type='checkbox' name='TOR_ENABLED' $checked{'TOR_ENABLED'}{'on'} /></td>
+                               <td width='25%' class='base'></td>
+                               <td width='30%'></td>
+                       </tr>
+                       <tr>
+                               <td width='25%' class='base'>$Lang::tr{'tor relay enabled'}:</td>
+                               <td width='20%'><input type='checkbox' name='TOR_RELAY_ENABLED' $checked{'TOR_RELAY_ENABLED'}{'on'} /></td>
+                               <td width='25%' class='base'></td>
+                               <td width='30%'></td>
+                       </tr>
+               </table>
+END
+
+       &Header::closebox();
+
+       if ($settings{'TOR_ENABLED'} eq 'on') {
+               my @temp = split(",", $settings{'TOR_ALLOWED_SUBNETS'});
+               $settings{'TOR_ALLOWED_SUBNETS'} = join("\n", @temp);
+
+               @temp = split(",", $settings{'TOR_USE_EXIT_NODES'});
+               $settings{'TOR_USE_EXIT_NODES'} = join("\n", @temp);
+
+               &Header::openbox('100%', 'left', $Lang::tr{'tor configuration'});
+
+               print <<END;
+                       <table width='100%'>
+                               <tr>
+                                       <td width='25%' class='base'>$Lang::tr{'tor socks port'}:</td>
+                                       <td width='30%'><input type='text' name='TOR_SOCKS_PORT' value='$settings{'TOR_SOCKS_PORT'}' size='5' /></td>
+                                       <td width='50%' class='base' colspan='2'></td>
+                               </tr>
+                       </table>
+
+                       <hr size='1'>
+
+                       <table width='100%'>
+                               <tr>
+                                       <td colspan='4' class='base'><b>$Lang::tr{'tor acls'}</b></td>
+                               </tr>
+                               <tr>
+                                       <td colspan='2' class='base' width='55%'>
+                                               $Lang::tr{'tor allowed subnets'}:
+                                       </td>
+                                       <td colspan='2' width='45%'></td>
+                               </tr>
+                               <tr>
+                                       <td colspan='2' class='base' width='55%'>
+                                               <textarea name='TOR_ALLOWED_SUBNETS' cols='32' rows='3' wrap='off'>$settings{'TOR_ALLOWED_SUBNETS'}</textarea>
+                                       </td>
+                                       <td colspan='2' width='45%'></td>
+                               </tr>
+                       </table>
+
+                       <hr size='1'>
+
+                       <table width='100%'>
+                               <tr>
+                                       <td colspan='4' class='base'><b>$Lang::tr{'tor exit nodes'}</b></td>
+                               </tr>
+                               <tr>
+                                       <td colspan='2' class='base' width='55%'></td>
+                                       <td colspan='2' class='base' width='45%'>$Lang::tr{'tor use exit nodes'}:</td>
+                               </tr>
+                               <tr>
+                                       <td width='50%' colspan='2'>
+                                               <select name='TOR_EXIT_COUNTRY'>
+                                                       <option value=''>- $Lang::tr{'tor exit country any'} -</option>
+END
+
+                       my @country_names = Locale::Country::all_country_names();
+                       foreach my $country_name (sort @country_names) {
+                               my $country_code = Locale::Country::country2code($country_name);
+                               $country_code = uc($country_code);
+                               print "<option value='$country_code'>$country_name ($country_code)</option>\n";
+                       }
+
+               print <<END;
+                                               </select>
+                                       </td>
+                                       <td colspan='2'>
+                                               <textarea name='TOR_USE_EXIT_NODES' cols='32' rows='3' wrap='off'>$settings{'TOR_USE_EXIT_NODES'}</textarea>
+                                       </td>
+                               </tr>
+                       </table>
+END
+
+               &Header::closebox();
+       }
+
+       if ($settings{'TOR_RELAY_ENABLED'} eq 'on') {
+               $checked{'TOR_RELAY_NOADVERTISE'}{'on'} = '';
+               $checked{'TOR_RELAY_NOADVERTISE'}{'off'} = '';
+               $checked{'TOR_RELAY_NOADVERTISE'}{$settings{'TOR_RELAY_NOADVERTISE'}} = 'checked';
+
+               $selected{'TOR_RELAY_MODE'}{'bridge'} = '';
+               $selected{'TOR_RELAY_MODE'}{'exit'} = '';
+               $selected{'TOR_RELAY_MODE'}{'private-bridge'} = '';
+               $selected{'TOR_RELAY_MODE'}{'relay'} = '';
+               $selected{'TOR_RELAY_MODE'}{$settings{'TOR_RELAY_MODE'}} = 'selected';
+
+               $selected{'TOR_RELAY_BANDWIDTH_RATE'}{'0'} = '';
+               foreach (@bandwidth_limits) {
+                       $selected{'TOR_RELAY_BANDWIDTH_RATE'}{$_} = '';
+               }
+               $selected{'TOR_RELAY_BANDWIDTH_RATE'}{$settings{'TOR_RELAY_BANDWIDTH_RATE'}} = 'selected';
+
+               $selected{'TOR_RELAY_BANDWIDTH_BURST'}{'0'} = '';
+               foreach (@bandwidth_limits) {
+                       $selected{'TOR_RELAY_BANDWIDTH_BURST'}{$_} = '';
+               }
+               $selected{'TOR_RELAY_BANDWIDTH_BURST'}{$settings{'TOR_RELAY_BANDWIDTH_BURST'}} = 'selected';
+
+               foreach (@accounting_periods) {
+                       $selected{'TOR_RELAY_ACCOUNTING_PERIOD'}{$_} = '';
+               }
+               $selected{'TOR_RELAY_ACCOUNTING_PERIOD'}{$settings{'TOR_RELAY_ACCOUNTING_PERIOD'}} = 'selected';
+
+               &Header::openbox('100%', 'left', $Lang::tr{'tor relay configuration'});
+
+               print <<END;
+                       <table width='100%'>
+                               <tr>
+                                       <td width='25%' class='base'>$Lang::tr{'tor relay mode'}:</td>
+                                       <td width='30%'>
+                                               <select name='TOR_RELAY_MODE'>
+                                                       <option value='exit' $selected{'TOR_RELAY_MODE'}{'exit'}>$Lang::tr{'tor relay mode exit'}</option>
+                                                       <option value='relay' $selected{'TOR_RELAY_MODE'}{'relay'}>$Lang::tr{'tor relay mode relay'}</option>
+                                                       <option value='bridge' $selected{'TOR_RELAY_MODE'}{'bridge'}>$Lang::tr{'tor relay mode bridge'}</option>
+                                                       <option value='private-bridge' $selected{'TOR_RELAY_MODE'}{'private-bridge'}>$Lang::tr{'tor relay mode private bridge'}</option>
+                                               </select>
+                                       </td>
+                                       <td width='25%' class='base'>$Lang::tr{'tor relay port'}:</td>
+                                       <td width='20%'>
+                                               <input type='text' name='TOR_RELAY_PORT' value='$settings{'TOR_RELAY_PORT'}' size='5' />
+                                       </td>
+                               </tr>
+                               <tr>
+                                       <td width='25%' class='base'>$Lang::tr{'tor relay address'}:&nbsp;<img src='/blob.gif' alt='*' /></td>
+                                       <td width='30%'>
+                                               <input type='text' name='TOR_RELAY_ADDRESS' value='$settings{'TOR_RELAY_ADDRESS'}' />
+                                       </td>
+                                       <td width='25%' class='base'>$Lang::tr{'tor do not advertise relay'}:</td>
+                                       <td width='20%'>
+                                               <input type='checkbox' name='TOR_RELAY_NOADVERTISE' $checked{'TOR_RELAY_NOADVERTISE'}{'on'} />
+                                       </td>
+                               </tr>
+                               <tr>
+                                       <td width='25%' class='base'>$Lang::tr{'tor relay nickname'}:&nbsp;<img src='/blob.gif' alt='*' /></td>
+                                       <td width='30%'>
+                                               <input type='text' name='TOR_RELAY_NICKNAME' value='$settings{'TOR_RELAY_NICKNAME'}' />
+                                       </td>
+                                       <td colspan='2'></td>
+                               </tr>
+                               <tr>
+                                       <td width='25%' class='base'>$Lang::tr{'tor contact info'}:&nbsp;<img src='/blob.gif' alt='*' /></td>
+                                       <td width='75%' colspan='3'>
+                                               <input type='text' name='TOR_RELAY_CONTACT_INFO' value='$settings{'TOR_RELAY_CONTACT_INFO'}' size='60' />
+                                       </td>
+                               </tr>
+                       </table>
+
+                       <hr size='1'>
+
+                       <table width='100%'>
+                               <tr>
+                                       <td colspan='4' class='base'><b>$Lang::tr{'tor bandwidth settings'}</b></td>
+                               </tr>
+                               <tr>
+                                       <td width='25%' class='base'>$Lang::tr{'tor bandwidth rate'}:</td>
+                                       <td width='30%' class='base'>
+                                               <select name='TOR_RELAY_BANDWIDTH_RATE'>
+END
+
+               foreach (@bandwidth_limits) {
+                       if ($_ >= 1024) {
+                               print "<option value='$_' $selected{'TOR_RELAY_BANDWIDTH_RATE'}{$_}>". $_ / 1024 ." MBit/s</option>\n";
+                       } else {
+                               print "<option value='$_' $selected{'TOR_RELAY_BANDWIDTH_RATE'}{$_}>$_ kBit/s</option>\n";
+                       }
+               }
+
+               print <<END;
+                                                       <option value='0' $selected{'TOR_RELAY_BANDWIDTH_RATE'}{'0'}>$Lang::tr{'tor bandwidth unlimited'}</option>
+                                               </select>
+                                       </td>
+                                       <td width='25%' class='base'>$Lang::tr{'tor accounting limit'}:</td>
+                                       <td width='20%'>
+                                               <input type='text' name='TOR_RELAY_ACCOUNTING_LIMIT' value='$settings{'TOR_RELAY_ACCOUNTING_LIMIT'}' size='12' />
+                                       </td>
+                               </tr>
+                               <tr>
+                                       <td width='25%' class='base'>$Lang::tr{'tor bandwidth burst'}:</td>
+                                       <td width='20%' class='base'>
+                                               <select name='TOR_RELAY_BANDWIDTH_BURST'>
+END
+
+               foreach (@bandwidth_limits) {
+                       if ($_ >= 1024) {
+                               print "<option value='$_' $selected{'TOR_RELAY_BANDWIDTH_BURST'}{$_}>". $_ / 1024 ." MBit/s</option>\n";
+                       } else {
+                               print "<option value='$_' $selected{'TOR_RELAY_BANDWIDTH_BURST'}{$_}>$_ kBit/s</option>\n";
+                       }
+               }
+               print <<END;
+                                                       <option value='0' $selected{'TOR_RELAY_BANDWIDTH_BURST'}{'0'}>$Lang::tr{'tor bandwidth unlimited'}</option>
+                                               </select>
+                                       </td>
+                                       <td width='25%' class='base'>$Lang::tr{'tor accounting period'}:</td>
+                                       <td width='20%'>
+                                               <select name='TOR_RELAY_ACCOUNTING_PERIOD'>
+END
+
+               foreach (@accounting_periods) {
+                       print "<option value='$_' $selected{'TOR_RELAY_ACCOUNTING_PERIOD'}{$_}>$Lang::tr{'tor accounting period '.$_}</option>";
+               }
+
+               print <<END;
+                                               </select>
+                                       </td>
+                               </tr>
+                       </table>
+END
+
+               &Header::closebox();
+       }
+
+       print <<END;
+               <table width='100%'>
+                       <tr>
+                               <td>
+                                       <img src='/blob.gif' align='top' alt='*' />&nbsp;<font class='base'>$Lang::tr{'this field may be blank'}</font>
+                               </td>
+                               <td align='right'>&nbsp;</td>
+                       </tr>
+               </table>
+
+               <hr>
+
+               <table width='100%'>
+                       <tr>
+                               <td>&nbsp;</td>
+                               <td align='center'><input type='submit' name='ACTION' value='$Lang::tr{'save'}' /></td>
+                               <td>&nbsp;</td>
+                       </tr>
+               </table>
+END
+
+       # If we have a control connection, show the stats.
+       if ($torctrl) {
+               &Header::openbox('100%', 'left', $Lang::tr{'tor stats'});
+
+               my @traffic = &TorTrafficStats($torctrl);
+
+               if (@traffic) {
+                       print <<END;
+                               <table width='100%'>
+END
+
+               if ($settings{'TOR_RELAY_ENABLED'} eq 'on') {
+                       my $fingerprint = &TorRelayFingerprint($torctrl);
+                       if ($fingerprint) {
+                               print <<END;
+                                       <tr>
+                                               <td width='40%' class='base'>$Lang::tr{'tor relay fingerprint'}:</td>
+                                               <td width='60%'>
+                                                       <a href='https://atlas.torproject.org/#details/$fingerprint' target='_blank'>$fingerprint</a>
+                                               </td>
+                                       </tr>
+END
+                       }
+               }
+
+               my $address = TorGetInfo($torctrl, "address");
+               if ($address) {
+                       print <<END;
+                               <tr>
+                                       <td width='40%' class='base'>$Lang::tr{'tor relay external address'}:</td>
+                                       <td width='60%'>$address</td>
+                               </tr>
+END
+               }
+
+               print <<END;
+                                       <tr>
+                                               <td width='40%'>$Lang::tr{'tor traffic read written'}:</td>
+END
+                       print "<td width='60%'>" . &FormatBytes($traffic[0]) ."/". &FormatBytes($traffic[1]) . "</td>";
+                       print <<END;
+                                       </tr>
+                               </table>
+END
+               }
+
+               my $accounting = &TorAccountingStats($torctrl);
+               if ($accounting) {
+                       print <<END;
+                               <table width='100%'>
+                                       <tr>
+                                               <td colspan='2' class='base'><b>$Lang::tr{'tor accounting'}</b></td>
+                                       </tr>
+END
+
+                       if ($accounting->{'hibernating'} eq "hard") {
+                               print <<END;
+                                       <tr>
+                                               <td class='base' colspan='2' bgcolor="$Header::colourred" align='center'>
+                                                       <font color='white'>$Lang::tr{'tor traffic limit hard'}</font>
+                                               </td>
+                                       </tr>
+END
+                       } elsif ($accounting->{'hibernating'} eq "soft") {
+                               print <<END;
+                                       <tr>
+                                               <td class='base' colspan='2' bgcolor="$Header::colourorange" align='center'>
+                                                       <font color='white'>$Lang::tr{'tor traffic limit soft'}</font>
+                                               </td>
+                                       </tr>
+END
+                       }
+
+                       print <<END;
+                                       <tr>
+                                               <td width='40%' class='base'>$Lang::tr{'tor accounting interval'}</td>
+                                               <td width='60%'>
+                                                       $accounting->{'interval-start'} - $accounting->{'interval-end'}
+                                               </td>
+                                       </tr>
+                                       <tr>
+                                               <td width='40%' class='base'>$Lang::tr{'tor accounting bytes'}</td>
+                                               <td width='60%'>
+END
+
+                       print &FormatBytes($accounting->{'bytes_read'}) . "/" . &FormatBytes($accounting->{'bytes_written'});
+                       print " (" . &FormatBytes($accounting->{'bytes-left_read'}) . "/" . &FormatBytes($accounting->{'bytes-left_written'});
+                       print " $Lang::tr{'tor accounting bytes left'})";
+
+                       print <<END;
+                                               </td>
+                                       </tr>
+                               </table>
+END
+               }
+
+               my @nodes = &TorORConnStatus($torctrl);
+               if (@nodes) {
+                       print <<END;
+                               <table width='100%'>
+                                       <tr>
+                                               <td colspan='3' class='base'><b>$Lang::tr{'tor connected relays'}</b></td>
+                                       </tr>
+END
+
+                       foreach my $node (@nodes) {
+                               print <<END;
+                                       <tr>
+                                               <td width='40%'>
+                                                       <a href='https://atlas.torproject.org/#details/$node->{'fingerprint'}' target='_blank'>
+                                                               $node->{'name'}
+                                                       </a>
+                                               </td>
+                                               <td width='30%'>
+END
+
+                               if (exists($node->{'country_code'})) {
+                                               print "<a href='country.cgi#$node->{'country_code'}'><img src='/images/flags/$node->{'country_code'}.png' border='0' align='absmiddle' alt='$node->{'country_code'}'></a>";
+                               }
+
+                               print <<END;
+                                                       <a href='ipinfo.cgi?ip=$node->{'address'}'>$node->{'address'}</a>:$node->{'port'}
+                                               </td>
+                                               <td width='30%' align='right'>
+                                                       ~$node->{'bandwidth_string'}
+                                               </td>
+                                       </tr>
+END
+                       }
+                       print "</table>";
+               }
+
+               &Header::closebox();
+       }
+
+       print "</form>\n";
+
+       &Header::closebigbox();
+       &Header::closepage();
+}
+
+sub BuildConfiguration() {
+       my %settings = ();
+       &General::readhash("${General::swroot}/tor/settings", \%settings);
+
+       my $torrc = "${General::swroot}/tor/torrc";
+
+       open(FILE, ">$torrc");
+
+       # Global settings.
+       print FILE "ControlPort $TOR_CONTROL_PORT\n";
+
+       if ($settings{'TOR_ENABLED'} eq 'on') {
+               my $strict_nodes = 0;
+
+               print FILE "SocksPort 0.0.0.0:$settings{'TOR_SOCKS_PORT'}\n";
+
+               my @subnets = split(",", $settings{'TOR_ALLOWED_SUBNETS'});
+               foreach (@subnets) {
+                       print FILE "SocksPolicy accept $_\n" if (&General::validipandmask($_));
+               }
+               print FILE "SocksPolicy reject *\n" if (@subnets);
+
+               if ($settings{'TOR_EXIT_COUNTRY'} ne '') {
+                       $strict_nodes = 1;
+
+                       print FILE "ExitNodes {$settings{'TOR_EXIT_COUNTRY'}}\n";
+               }
+
+               if ($settings{'TOR_USE_EXIT_NODES'} ne '') {
+                       $strict_nodes = 1;
+
+                       my @nodes = split(",", $settings{'TOR_USE_EXIT_NODES'});
+                       foreach (@nodes) {
+                               print FILE "ExitNode $_\n";
+                       }
+               }
+
+               if ($strict_nodes > 0) {
+                       print FILE "StrictNodes 1\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'}";
+               if ($settings{'TOR_RELAY_NOADVERTISE'} eq 'on') {
+                       print FILE " NoAdvertise";
+               }
+               print FILE "\n";
+
+               if ($settings{'TOR_RELAY_ADDRESS'} ne '') {
+                       print FILE "Address $settings{'TOR_RELAY_ADDRESS'}\n";
+               }
+
+               if ($settings{'TOR_RELAY_NICKNAME'} ne '') {
+                       print FILE "Nickname $settings{'TOR_RELAY_NICKNAME'}\n";
+               }
+
+               if ($settings{'TOR_RELAY_CONTACT_INFO'} ne '') {
+                       print FILE "ContactInfo $settings{'TOR_RELAY_CONTACT_INFO'}\n";
+               }
+
+               # Limit to bridge mode.
+               my $is_bridge = 0;
+
+               if ($settings{'TOR_RELAY_MODE'} eq 'bridge') {
+                       $is_bridge++;
+
+               # Private bridge.
+               } elsif ($settings{'TOR_RELAY_MODE'} eq 'private-bridge') {
+                       $is_bridge++;
+
+                       print FILE "PublishServerDescriptor 0\n";
+
+               # Exit node.
+               } elsif ($settings{'TOR_RELAY_MODE'} eq 'exit') {
+                       print FILE "ExitPolicy accept *:*\n";
+
+               # Relay only.
+               } elsif ($settings{'TOR_RELAY_MODE'} eq 'relay') {
+                       print FILE "ExitPolicy reject *:*\n";
+               }
+
+               if ($is_bridge > 0) {
+                       print FILE "BridgeRelay 1\n";
+                       print FILE "Exitpolicy reject *:*\n";
+               }
+
+               if ($settings{'TOR_RELAY_BANDWIDTH_RATE'} > 0) {
+                       print FILE "RelayBandwidthRate ";
+                       print FILE $settings{'TOR_RELAY_BANDWIDTH_RATE'} / 8;
+                       print FILE " KB\n";
+
+                       if ($settings{'TOR_RELAY_BANDWIDTH_BURST'} > 0) {
+                               print FILE "RelayBandwidthBurst ";
+                               print FILE $settings{'TOR_RELAY_BANDWIDTH_BURST'} / 8;
+                               print FILE " KB\n";
+                       }
+               }
+
+               if ($settings{'TOR_RELAY_ACCOUNTING_LIMIT'} > 0) {
+                       print FILE "AccountingMax ".$settings{'TOR_RELAY_ACCOUNTING_LIMIT'}." MB\n";
+
+                       if ($settings{'TOR_RELAY_ACCOUNTING_PERIOD'} eq 'daily') {
+                               print FILE "AccountingStart day 00:00\n";
+                       } elsif ($settings{'TOR_RELAY_ACCOUNTING_PERIOD'} eq 'weekly') {
+                               print FILE "AccountingStart week 1 00:00\n";
+                       } elsif ($settings{'TOR_RELAY_ACCOUNTING_PERIOD'} eq 'monthly') {
+                               print FILE "AccountingStart month 1 00:00\n";
+                       }
+               }
+       }
+
+       close(FILE);
+
+       # Restart the service.
+       if (($settings{'TOR_ENABLED'} eq 'on') || ($settings{'TOR_RELAY_ENABLED'} eq 'on')) {
+               system("/usr/local/bin/torctrl restart");
+       } else {
+               system("/usr/local/bin/torctrl stop");
+       }
+}
+
+sub TorConnect() {
+       my $socket = new IO::Socket::INET(
+               Proto => 'tcp', PeerAddr => '127.0.0.1', PeerPort => $TOR_CONTROL_PORT,
+       ) or return;
+
+       $socket->autoflush(1);
+
+       # Authenticate.
+       &TorSendCommand($socket, "AUTHENTICATE");
+
+       return $socket;
+}
+
+sub TorSendCommand() {
+       my ($socket, $cmd) = @_;
+
+       # Replace line ending with \r\n.
+       chomp $cmd;
+       $cmd .= "\r\n";
+
+       $socket->send($cmd);
+
+       my @output = ();
+       while (my $line = <$socket>) {
+               # Skip empty lines.
+               if ($line =~ /^.\r\n$/) {
+                       next;
+               }
+
+               # Command has been successfully executed.
+               if ($line =~ /250 OK/) {
+                       last;
+
+               # Error.
+               } elsif ($line =~ /^5\d+/) {
+                       last;
+
+               } else {
+                       # Remove line endings.
+                       $line =~ s/\r\n$//;
+
+                       push(@output, $line);
+               }
+       }
+
+       return @output;
+}
+
+sub TorSendCommandOneLine() {
+       my ($tor, $cmd) = @_;
+
+       my @output = &TorSendCommand($tor, $cmd);
+       return $output[0];
+}
+
+sub TorGetInfo() {
+       my ($tor, $cmd) = @_;
+
+       my $output = &TorSendCommandOneLine($tor, "GETINFO ".$cmd);
+
+       my ($key, $value) = split("=", $output);
+       return $value;
+}
+
+sub TorClose() {
+       my $socket = shift;
+
+       if ($socket) {
+               $socket->shutdown(2);
+       }
+}
+
+sub TorTrafficStats() {
+       my $tor = shift;
+
+       my $output_read    = &TorGetInfo($tor, "traffic/read");
+       my $output_written = &TorGetInfo($tor, "traffic/written");
+
+       return ($output_read, $output_written);
+}
+
+sub TorRelayFingerprint() {
+       my $tor = shift;
+
+       return &TorGetInfo($tor, "fingerprint");
+}
+
+sub TorORConnStatus() {
+       my $tor = shift;
+       my @nodes = ();
+
+       my @output = &TorSendCommand($tor, "GETINFO orconn-status");
+       foreach (@output) {
+               $_ =~ s/^250[\+-]orconn-status=//;
+               next if ($_ eq "");
+               last if ($_ eq ".");
+               next unless ($_ =~ /^\$/);
+
+               my @line = split(" ", $_);
+               my @node = split(/[=~]/, $line[0]);
+
+               my $node = &TorNodeDescription($tor, $node[0]);
+               if ($node) {
+                       push(@nodes, $node);
+               }
+       }
+
+       # Sort by names.
+       @nodes = sort { $a->{'name'} cmp $b->{'name'} } @nodes;
+
+       return @nodes;
+}
+
+sub TorNodeDescription() {
+       my ($tor, $fingerprint) = @_;
+       $fingerprint =~ s/\$//;
+
+       my $node = {
+               fingerprint  => $fingerprint,
+               exit_node    => 0,
+       };
+
+       my @output = &TorSendCommand($tor, "GETINFO ns/id/$node->{'fingerprint'}");
+
+       foreach (@output) {
+               # Router
+               if ($_ =~ /^r (\w+) (.*) (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}) (\d+)/) {
+                       $node->{'name'}    = $1;
+                       $node->{'address'} = $3;
+                       $node->{'port'}    = $4;
+
+                       my $country_code = &TorGetInfo($tor, "ip-to-country/$node->{'address'}");
+                       $node->{'country_code'} = $country_code;
+
+               # Flags
+               } elsif ($_ =~ /^s (.*)$/) {
+                       $node->{'flags'} = split(" ", $1);
+
+                       foreach my $flag ($node->{'flags'}) {
+                               if ($flag eq "Exit") {
+                                       $node->{'exit_node'}++;
+                               }
+                       }
+
+               # Bandwidth
+               } elsif ($_ =~ /^w Bandwidth=(\d+)/) {
+                       $node->{'bandwidth'} = $1 * 8;
+                       $node->{'bandwidth_string'} = &FormatBitsPerSecond($node->{'bandwidth'});
+               }
+       }
+
+       if (exists($node->{'name'})) {
+               return $node;
+       }
+}
+
+sub TorAccountingStats() {
+       my $tor = shift;
+       my $ret = {};
+
+       my $enabled = &TorGetInfo($tor, "accounting/enabled");
+       if ($enabled ne '1') {
+               return;
+       }
+
+       my @cmds = ("hibernating", "interval-start", "interval-end");
+       foreach (@cmds) {
+               $ret->{$_} = &TorGetInfo($tor, "accounting/$_");
+       }
+
+       my @cmds = ("bytes", "bytes-left");
+       foreach (@cmds) {
+               my $output = &TorGetInfo($tor, "accounting/$_");
+               my @bytes = split(" ", $output);
+
+               $ret->{$_."_read"}    = $bytes[0];
+               $ret->{$_."_written"} = $bytes[1];
+       }
+
+       return $ret;
+}
+
+sub FormatBytes() {
+       my $bytes = shift;
+
+       my @units = ("B", "KB", "MB", "GB", "TB");
+       my $units_index = 0;
+
+       while (($units_index <= $#units) && ($bytes >= 1024)) {
+               $units_index++;
+               $bytes /= 1024;
+       }
+
+       return sprintf("%.2f %s", $bytes, $units[$units_index]);
+}
+
+sub FormatBitsPerSecond() {
+       my $bits = shift;
+
+       my @units = ("Bit/s", "KBit/s", "MBit/s", "GBit/s", "TBit/s");
+       my $units_index = 0;
+
+       while (($units_index <= $#units) && ($bits >= 1024)) {
+               $units_index++;
+               $bits /= 1024;
+       }
+
+       return sprintf("%.2f %s", $bits, $units[$units_index]);
+}
index d1ad7b0fc010d5e3f8f4b0f6caf24b8e750dbdb0..848aaefa24f34c994fee0cd814791e71f8cb8047 100644 (file)
 'tone' => 'Ton',
 'tone dial' => 'Tonwahl:',
 'too long 80 char max' => ' ist zu lang, es sind maximal 80 Zeichen erlaubt',
+'tor accounting' => 'Accounting',
+'tor accounting bytes' => 'Traffic (empfangen/gesendet)',
+'tor accounting bytes left' => 'übrig',
+'tor accounting interval' => 'Intervall (UTC)',
+'tor accounting limit' => 'Übertragungslimit (MB)',
+'tor accounting period' => 'Accounting-Periode',
+'tor accounting period daily' => 'täglich',
+'tor accounting period monthly' => 'monatlich',
+'tor accounting period weekly' => 'wöchentlich',
+'tor acls' => 'Zugriffskontrolle',
+'tor allowed subnets' => 'Erlaubte Subnetze (eins pro Zeile)',
+'tor bandwidth burst' => 'Max. Spitzenwert (Burst)',
+'tor bandwidth rate' => 'Max. Bandbreite',
+'tor bandwidth settings' => 'Bandbreiteneinstellungen',
+'tor bandwidth unlimited' => 'unlimitiert',
+'tor common settings' => 'Einstellungen',
+'tor configuration' => 'Tor-Konfiguration',
+'tor connected relays' => 'Verbundene Relays',
+'tor contact info' => 'Kontaktinformationen',
+'tor do not advertise relay' => 'Relay nicht announcieren',
+'tor enabled' => 'Tor einschalten',
+'tor errmsg invalid ip or mask' => 'Ungültiges IP-Subnetz',
+'tor exit country' => 'Exit-Land',
+'tor exit country any' => 'Beliebig',
+'tor exit nodes' => 'Exit-Nodes',
+'tor relay address' => 'Relay-Adresse',
+'tor relay configuration' => 'Tor-Relay-Konfiguration',
+'tor relay enabled' => 'Tor-Relay einschalten',
+'tor relay external address' => 'Externe Relay-Adresse',
+'tor relay fingerprint' => 'Relay-Fingerabdruck',
+'tor relay mode' => 'Relay-Modues',
+'tor relay mode bridge' => 'Bridge',
+'tor relay mode exit' => 'Exit-Node',
+'tor relay mode private bridge' => 'private Bridge',
+'tor relay mode relay' => 'Nur Relay',
+'tor relay nickname' => 'Relay-Nickname',
+'tor relay port' => 'Relay-Port',
+'tor socks port' => 'SOCKS-Port',
+'tor stats' => 'Statistiken',
+'tor traffic limit hard' => 'Das Übertragungslimit wurde erreicht.',
+'tor traffic limit soft' => 'Das Übertragungslimit wurde fast erreicht. Es werden keine neuen Verbindungen akzeptiert.',
+'tor traffic read written' => 'Gesamter Traffic (empfangen/gesendet)',
+'tor use exit nodes' => 'Nur diese Exit-Nodes benutzen (eins pro Zeile)',
 'total connection time' => 'Verbindungszeit',
 'total hits for log section' => 'Gesamte Treffer für Log Sektion',
 'traffic back' => 'Zurück',
index 30d07345dbaefbb21a8dd91a67658171e963fcad..150411a4adadd0f05dfcd7476c37648ee5f5dd40 100644 (file)
 'tone' => 'Tone',
 'tone dial' => 'Tone dial:',
 'too long 80 char max' => ' is too long, maximum allowed is 80 characters',
+'tor accounting' => 'Accounting',
+'tor accounting bytes' => 'Traffic (read/written)',
+'tor accounting bytes left' => 'left',
+'tor accounting interval' => 'Interval (UTC)',
+'tor accounting limit' => 'Accounting limit (MB)',
+'tor accounting period' => 'Accounting period',
+'tor accounting period daily' => 'daily',
+'tor accounting period monthly' => 'monthly',
+'tor accounting period weekly' => 'weekly',
+'tor acls' => 'Access Control',
+'tor allowed subnets' => 'Allowed subnets (one per line)',
+'tor bandwidth burst' => 'Max. burst',
+'tor bandwidth rate' => 'Max. rate',
+'tor bandwidth settings' => 'Bandwidth Settings',
+'tor bandwidth unlimited' => 'unlimited',
+'tor bridge enabled' => 'Enable Tor bridge',
+'tor common settings' => 'Common Settings',
+'tor configuration' => 'Tor Configuration',
+'tor connected relays' => 'Connected relays',
+'tor contact info' => 'Contact Info',
+'tor do not advertise relay' => 'Do not advertise the relay',
+'tor enabled' => 'Enable Tor',
+'tor errmsg invalid ip or mask' => 'Invalid IP subnet',
+'tor errmsg invalid node id' => 'Invalid node ID',
+'tor exit country' => 'Exit country',
+'tor exit country any' => 'Any country',
+'tor exit nodes' => 'Exit Nodes',
+'tor relay address' => 'Relay address',
+'tor relay configuration' => 'Tor Relay Configuration',
+'tor relay enabled' => 'Enable Tor Relay',
+'tor relay external address' => 'Relay external address',
+'tor relay fingerprint' => 'Relay fingerprint',
+'tor relay mode' => 'Relay mode',
+'tor relay mode bridge' => 'Bridge',
+'tor relay mode exit' => 'Exit-Node',
+'tor relay mode private bridge' => 'Private bridge',
+'tor relay mode relay' => 'Relay only',
+'tor relay nickname' => 'Relay nickname',
+'tor relay port' => 'Relay port',
+'tor socks port' => 'SOCKS port',
+'tor stats' => 'Statistics',
+'tor traffic limit hard' => 'Traffic limit has been reached.',
+'tor traffic limit soft' => 'Traffic limit almost reached. Not accepting any new connections.',
+'tor traffic read written' => 'Total traffic (read/written)',
+'tor use exit nodes' => 'Use only these exit nodes (one per line)',
 'total connection time' => 'Total connection time',
 'total hits for log section' => 'Total hits for log section',
 'traffic back' => 'Back',