Merge remote-tracking branch 'earl/tor' into next
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 14 Sep 2013 12:37:18 +0000 (14:37 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 14 Sep 2013 12:37:18 +0000 (14:37 +0200)
Conflicts:
lfs/tor

config/rootfiles/packages/tor
html/cgi-bin/tor.cgi
langs/de/cgi-bin/de.pl
langs/en/cgi-bin/en.pl
lfs/tor
src/initscripts/init.d/tor

index 58de7da86a2c5d4f3151cddff6f56219f383ddb0..f9c657c881a663d1cf1c7e54ecfe01d2a042c59d 100644 (file)
@@ -5,7 +5,7 @@ etc/rc.d/rc0.d/K40tor
 etc/rc.d/rc3.d/S60tor
 etc/rc.d/rc6.d/K40tor
 #etc/tor
-etc/tor/tor-tsocks.conf
+#etc/tor/tor-tsocks.conf
 etc/tor/torrc
 srv/web/ipfire/cgi-bin/tor.cgi
 usr/bin/tor
@@ -25,6 +25,7 @@ usr/local/bin/torctrl
 usr/share/tor
 usr/share/tor/defaults-torrc
 usr/share/tor/geoip
+usr/share/tor/geoip6
 var/ipfire/backup/addons/includes/tor
 var/ipfire/menu.d/EX-tor.menu
 var/ipfire/tor
index b920724de7aeab1e592b851fc51f088a1a9b1879..befd5083442993a57168fa6315ccdeba3b20b568 100755 (executable)
@@ -108,6 +108,7 @@ $settings{'TOR_RELAY_ENABLED'} = 'off';
 $settings{'TOR_RELAY_MODE'} = 'exit';
 $settings{'TOR_RELAY_ADDRESS'} = '';
 $settings{'TOR_RELAY_PORT'} = 9001;
+$settings{'TOR_RELAY_DIRPORT'} = 0;
 $settings{'TOR_RELAY_NICKNAME'} = '';
 $settings{'TOR_RELAY_CONTACT_INFO'} = '';
 $settings{'TOR_RELAY_BANDWIDTH_RATE'} = 0;
@@ -143,6 +144,11 @@ if ($settings{'ACTION'} eq $Lang::tr{'save'}) {
        if (!&General::validport($settings{'TOR_RELAY_PORT'})) {
                $errormessage = "$Lang::tr{'tor errmsg invalid relay port'}: $settings{'TOR_RELAY_PORT'}";
        }
+       if ($settings{'TOR_RELAY_DIRPORT'} ne '0') {
+               if (!&General::validport($settings{'TOR_RELAY_DIRPORT'})) {
+                       $errormessage = "$Lang::tr{'tor errmsg invalid directory port'}: $settings{'TOR_RELAY_DIRPORT'}";
+               }
+       }
 
        if ($settings{'TOR_RELAY_ADDRESS'} ne '') {
                if ((!&General::validfqdn($settings{'TOR_RELAY_ADDRESS'})) && (!&General::validip($settings{'TOR_RELAY_ADDRESS'}))) {
@@ -382,7 +388,7 @@ END
                                </td>
                                <td width='25%' class='base'>$Lang::tr{'tor relay nickname'}:&nbsp;<img src='/blob.gif' alt='*' /></td>
                                <td width='20%'>
-                                       <input type='text' name='TOR_RELAY_NICKNAME' value='$settings{'TOR_RELAY_NICKNAME'}' />
+                                       <input type='text' name='TOR_RELAY_NICKNAME' value='$settings{'TOR_RELAY_NICKNAME'}' maxlength='19' />
                                </td>
                        </tr>
                        <tr>
@@ -395,6 +401,14 @@ END
                                        <input type='text' name='TOR_RELAY_PORT' value='$settings{'TOR_RELAY_PORT'}' size='5' />
                                </td>
                        </tr>
+                       <tr>
+                               <td width='25%'>&nbsp;</td>
+                               <td width='30%'>&nbsp;</td>
+                               <td width='25%' class='base'>$Lang::tr{'tor directory port'}:</td>
+                               <td width='20%'>
+                                       <input type='text' name='TOR_RELAY_DIRPORT' value='$settings{'TOR_RELAY_DIRPORT'}' size='5' />&nbsp;$Lang::tr{'tor 0 = disabled'}
+                               </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'>
@@ -607,7 +621,7 @@ END
 END
 
                                if (exists($node->{'country_code'})) {
-                                       if ($node->{'country_code'} eq '??') {
+                                       if (!$node->{'country_code'} or $node->{'country_code'} eq '??') {
                                                print "<img src='/images/flags/blank.png' border='0' align='absmiddle'/>";
                                        } else {
                                                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>";
@@ -683,6 +697,10 @@ sub BuildConfiguration() {
 
                print FILE "ORPort $settings{'TOR_RELAY_PORT'}\n";
 
+               if ($settings{'TOR_RELAY_DIRPORT'} ne '0') {
+                       print FILE "DirPort $settings{'TOR_RELAY_DIRPORT'}\n";
+               }
+
                if ($settings{'TOR_RELAY_ADDRESS'} ne '') {
                        print FILE "Address $settings{'TOR_RELAY_ADDRESS'}\n";
                }
index 4e005e1a88de39d1dca56d00a8180b191d44a2d0..f9814d57999a60c682a74da09192a372c05244a0 100644 (file)
 'tone dial' => 'Tonwahl:',
 'too long 80 char max' => ' ist zu lang, es sind maximal 80 Zeichen erlaubt',
 'tor' => 'Tor',
+'tor 0 = disabled' => '0 = deaktiviert',
 'tor accounting' => 'Accounting',
 'tor accounting bytes' => 'Traffic (empfangen/gesendet)',
 'tor accounting bytes left' => 'übrig',
 'tor connected relays' => 'Verbundene Relays',
 'tor contact info' => 'Kontaktinformationen',
 'tor daemon' => 'Daemon',
+'tor directory port' => 'Directory-Port',
 'tor enabled' => 'Tor einschalten',
 'tor errmsg invalid accounting limit' => 'Ungültiges Accounting-Limit',
+'tor errmsg invalid directory port' => 'Ungültiger Directory-Port',
 'tor errmsg invalid ip or mask' => 'Ungültiges IP-Subnetz',
 'tor errmsg invalid relay address' => 'Ungültige Relay-Adresse',
-'tor errmsg invalid relay name' => 'Ungültiger Relay-Nickname.',
+'tor errmsg invalid relay name' => 'Ungültiger Relay-Nickname',
 'tor errmsg invalid relay port' => 'Ungültiger Relay-Port',
 'tor errmsg invalid socks port' => 'Ungültiger SOCKS-Port',
 'tor exit country' => 'Exit-Land',
index ba80985a8ef58c91aea30a1282d5db32e5e54f1a..1c502967245766d094e6d14eb196556d6e66d90d 100644 (file)
 'tone dial' => 'Tone dial:',
 'too long 80 char max' => ' is too long, maximum allowed is 80 characters',
 'tor' => 'Tor',
+'tor 0 = disabled' => '0 = disabled',
 'tor accounting' => 'Accounting',
 'tor accounting bytes' => 'Traffic (read/written)',
 'tor accounting bytes left' => 'left',
 'tor connected relays' => 'Connected relays',
 'tor contact info' => 'Contact Info',
 'tor daemon' => 'Daemon',
+'tor directory port' => 'Directory port',
 'tor enabled' => 'Enable Tor',
 'tor errmsg invalid accounting limit' => 'Invalid accounting limit',
+'tor errmsg invalid directory port' => 'Invalid directory port',
 'tor errmsg invalid ip or mask' => 'Invalid IP subnet',
 'tor errmsg invalid node id' => 'Invalid node ID',
 'tor errmsg invalid relay address' => 'Invalid relay address',
diff --git a/lfs/tor b/lfs/tor
index 6161a56484098f76ff78f92964a56f9febadbe0d..795f7c3ebcd8a16773f48e90658bd3ec9b197177 100644 (file)
--- a/lfs/tor
+++ b/lfs/tor
@@ -24,7 +24,7 @@
 
 include Config
 
-VER        = 0.2.3.25
+VER        = 0.2.4.17-rc
 
 THISAPP    = tor-$(VER)
 DL_FILE    = $(THISAPP).tar.gz
@@ -32,7 +32,7 @@ DL_FROM    = $(URL_IPFIRE)
 DIR_APP    = $(DIR_SRC)/$(THISAPP)
 TARGET     = $(DIR_INFO)/$(THISAPP)
 PROG       = tor
-PAK_VER    = 3
+PAK_VER    = 4
 
 DEPS       = "libevent2"
 
@@ -44,7 +44,7 @@ objects = $(DL_FILE)
 
 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
 
-$(DL_FILE)_MD5 = a1c364189a9a66ed9daa8e6436489daf
+$(DL_FILE)_MD5 = 2cdfb8dcc3306a43cf465a858bf97b2d
 
 install : $(TARGET)
 
index d631e867f915e123e918383b3c9caa86af1e5a71..9c1dfc769285f282a926eca8ef230456e6652fff 100644 (file)
@@ -22,6 +22,10 @@ function setup_firewall() {
        if [ "${TOR_RELAY_ENABLED}" = "on" -a -n "${TOR_RELAY_PORT}" ]; then
                iptables -A TOR_INPUT -p tcp --dport "${TOR_RELAY_PORT}" -j ACCEPT
        fi
+
+       if [ "${TOR_RELAY_ENABLED}" = "on" -a -n "${TOR_RELAY_DIRPORT}" ] && [ "${TOR_RELAY_DIRPORT}" -ne 0 ]; then
+               iptables -A TOR_INPUT -p tcp --dport "${TOR_RELAY_DIRPORT}" -j ACCEPT
+       fi
 }
 
 function flush_firewall() {