This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "IPFire 2.x development tree".
The branch, core72 has been updated
via 26cce22da0ffd9b861e6734e943238bc9a2b512c (commit)
via 9e4945393d205da3f1a599651c6e94cbce386ecd (commit)
via 0006d11060177a506c675f18c4678e0b7f82c3a9 (commit)
via 8505f1ff4c743b98f4e72c0275f60ddaa06627f9 (commit)
via 3387469bdb06af775d8708db7a743c95d3d2ca27 (commit)
via 529ac19c466e3c1c079d6c8d73d21c3016edae59 (commit)
via 67df3c3f1c3dc12d4238c617d91bb6622024efa2 (commit)
via c83e7d5f81c1a86f156355ad4e04f73b94308452 (commit)
from 9e78ce6142549d6d786fe97c56bf58df6b81e80f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 26cce22da0ffd9b861e6734e943238bc9a2b512c
Author: Michael Tremer <michael.tremer(a)ipfire.org>
Date: Tue Aug 20 10:39:40 2013 +0200
tor.cgi: Remember selected exit node country.
commit 9e4945393d205da3f1a599651c6e94cbce386ecd
Author: Jan Paul Tuecking <earl(a)ipfire.org>
Date: Sun Aug 18 12:42:24 2013 +0200
tor: added startup files
commit 0006d11060177a506c675f18c4678e0b7f82c3a9
Author: Michael Tremer <michael.tremer(a)ipfire.org>
Date: Mon Aug 19 13:20:42 2013 +0200
translation: Fix typo.
commit 8505f1ff4c743b98f4e72c0275f60ddaa06627f9
Author: Jan Paul Tuecking <earl(a)ipfire.org>
Date: Sun Aug 18 12:18:50 2013 +0200
tor: new stings added to language files
commit 3387469bdb06af775d8708db7a743c95d3d2ca27
Author: Jan Paul Tuecking <earl(a)ipfire.org>
Date: Sun Aug 18 12:11:58 2013 +0200
tor: added daemon stats and little changes on styling
commit 529ac19c466e3c1c079d6c8d73d21c3016edae59
Author: Michael Tremer <michael.tremer(a)ipfire.org>
Date: Mon Aug 19 13:23:51 2013 +0200
tor: Only start tor when it has been enabled.
commit 67df3c3f1c3dc12d4238c617d91bb6622024efa2
Author: Michael Tremer <michael.tremer(a)ipfire.org>
Date: Mon Aug 19 17:40:57 2013 +0200
ovpnmain.cgi: Don't fail if files are not existant.
N2N connections could not be deleted if they have never been
started.
commit c83e7d5f81c1a86f156355ad4e04f73b94308452
Author: Michael Tremer <michael.tremer(a)ipfire.org>
Date: Mon Aug 19 17:33:23 2013 +0200
ovpnmain.cgi: Fix remote IP address validation.
-----------------------------------------------------------------------
Summary of changes:
doc/language_issues.es | 2 +
doc/language_issues.fr | 2 +
doc/language_issues.nl | 2 +
doc/language_issues.pl | 2 +
doc/language_issues.ru | 2 +
doc/language_issues.tr | 2 +
doc/language_missings | 8 ++++
html/cgi-bin/ovpnmain.cgi | 59 ++++++++++++------------
html/cgi-bin/tor.cgi | 111 ++++++++++++++++++++++++++++++++++++---------
langs/de/cgi-bin/de.pl | 2 +
langs/en/cgi-bin/en.pl | 2 +
lfs/tor | 6 ++-
src/initscripts/init.d/tor | 6 +++
13 files changed, 153 insertions(+), 53 deletions(-)
mode change 100644 => 100755 html/cgi-bin/tor.cgi
Difference in files:
diff --git a/doc/language_issues.es b/doc/language_issues.es
index 790ce1a..fe46355 100644
--- a/doc/language_issues.es
+++ b/doc/language_issues.es
@@ -642,6 +642,7 @@ 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 daemon
WARNING: untranslated string: tor enabled
WARNING: untranslated string: tor errmsg invalid accounting limit
WARNING: untranslated string: tor errmsg invalid ip or mask
@@ -663,6 +664,7 @@ 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 service
WARNING: untranslated string: tor socks port
WARNING: untranslated string: tor stats
WARNING: untranslated string: tor traffic limit hard
diff --git a/doc/language_issues.fr b/doc/language_issues.fr
index 41d8d9d..d5a1057 100644
--- a/doc/language_issues.fr
+++ b/doc/language_issues.fr
@@ -627,6 +627,7 @@ 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 daemon
WARNING: untranslated string: tor enabled
WARNING: untranslated string: tor errmsg invalid accounting limit
WARNING: untranslated string: tor errmsg invalid ip or mask
@@ -648,6 +649,7 @@ 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 service
WARNING: untranslated string: tor socks port
WARNING: untranslated string: tor stats
WARNING: untranslated string: tor traffic limit hard
diff --git a/doc/language_issues.nl b/doc/language_issues.nl
index 46838b0..c8249ff 100644
--- a/doc/language_issues.nl
+++ b/doc/language_issues.nl
@@ -544,6 +544,7 @@ 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 daemon
WARNING: untranslated string: tor enabled
WARNING: untranslated string: tor errmsg invalid accounting limit
WARNING: untranslated string: tor errmsg invalid ip or mask
@@ -565,6 +566,7 @@ 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 service
WARNING: untranslated string: tor socks port
WARNING: untranslated string: tor stats
WARNING: untranslated string: tor traffic limit hard
diff --git a/doc/language_issues.pl b/doc/language_issues.pl
index 790ce1a..fe46355 100644
--- a/doc/language_issues.pl
+++ b/doc/language_issues.pl
@@ -642,6 +642,7 @@ 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 daemon
WARNING: untranslated string: tor enabled
WARNING: untranslated string: tor errmsg invalid accounting limit
WARNING: untranslated string: tor errmsg invalid ip or mask
@@ -663,6 +664,7 @@ 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 service
WARNING: untranslated string: tor socks port
WARNING: untranslated string: tor stats
WARNING: untranslated string: tor traffic limit hard
diff --git a/doc/language_issues.ru b/doc/language_issues.ru
index 6700696..ef7b31c 100644
--- a/doc/language_issues.ru
+++ b/doc/language_issues.ru
@@ -607,6 +607,7 @@ 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 daemon
WARNING: untranslated string: tor enabled
WARNING: untranslated string: tor errmsg invalid accounting limit
WARNING: untranslated string: tor errmsg invalid ip or mask
@@ -628,6 +629,7 @@ 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 service
WARNING: untranslated string: tor socks port
WARNING: untranslated string: tor stats
WARNING: untranslated string: tor traffic limit hard
diff --git a/doc/language_issues.tr b/doc/language_issues.tr
index 6c4502f..1821fb4 100644
--- a/doc/language_issues.tr
+++ b/doc/language_issues.tr
@@ -540,6 +540,7 @@ 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 daemon
WARNING: untranslated string: tor enabled
WARNING: untranslated string: tor errmsg invalid accounting limit
WARNING: untranslated string: tor errmsg invalid ip or mask
@@ -561,6 +562,7 @@ 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 service
WARNING: untranslated string: tor socks port
WARNING: untranslated string: tor stats
WARNING: untranslated string: tor traffic limit hard
diff --git a/doc/language_missings b/doc/language_missings
index 3c611e6..865a42a 100644
--- a/doc/language_missings
+++ b/doc/language_missings
@@ -136,6 +136,7 @@
< tor configuration
< tor connected relays
< tor contact info
+< tor daemon
< tor enabled
< tor errmsg invalid accounting limit
< tor errmsg invalid ip or mask
@@ -158,6 +159,7 @@
< tor relay mode relay
< tor relay nickname
< tor relay port
+< tor service
< tor socks port
< tor stats
< tor traffic limit hard
@@ -371,6 +373,7 @@
< tor configuration
< tor connected relays
< tor contact info
+< tor daemon
< tor enabled
< tor errmsg invalid accounting limit
< tor errmsg invalid ip or mask
@@ -393,6 +396,7 @@
< tor relay mode relay
< tor relay nickname
< tor relay port
+< tor service
< tor socks port
< tor stats
< tor traffic limit hard
@@ -558,6 +562,7 @@
< tor configuration
< tor connected relays
< tor contact info
+< tor daemon
< tor enabled
< tor errmsg invalid accounting limit
< tor errmsg invalid ip or mask
@@ -580,6 +585,7 @@
< tor relay mode relay
< tor relay nickname
< tor relay port
+< tor service
< tor socks port
< tor stats
< tor traffic limit hard
@@ -750,6 +756,7 @@
< tor configuration
< tor connected relays
< tor contact info
+< tor daemon
< tor enabled
< tor errmsg invalid accounting limit
< tor errmsg invalid ip or mask
@@ -772,6 +779,7 @@
< tor relay mode relay
< tor relay nickname
< tor relay port
+< tor service
< tor socks port
< tor stats
< tor traffic limit hard
diff --git a/html/cgi-bin/ovpnmain.cgi b/html/cgi-bin/ovpnmain.cgi
index 5e18d3c..73e610b 100644
--- a/html/cgi-bin/ovpnmain.cgi
+++ b/html/cgi-bin/ovpnmain.cgi
@@ -2195,14 +2195,15 @@ else
# m.a.d net2net
###
- if ($confighash{$cgiparams{'KEY'}}[3] eq 'net') {
-
+if ($confighash{$cgiparams{'KEY'}}[3] eq 'net') {
my $conffile = glob("${General::swroot}/ovpn/n2nconf/$confighash{$cgiparams{'KEY'}}[1]/$confighash{$cgiparams{'KEY'}}[1].conf");
- my $certfile = glob("${General::swroot}/ovpn/certs/$confighash{$cgiparams{'KEY'}}[1].p12");
- unlink ($certfile) or die "Removing $certfile fail: $!";
- unlink ($conffile) or die "Removing $conffile fail: $!";
- rmdir ("${General::swroot}/ovpn/n2nconf/$confighash{$cgiparams{'KEY'}}[1]") || die "Kann Verzeichnis nicht loeschen: $!";
-
+ my $certfile = glob("${General::swroot}/ovpn/certs/$confighash{$cgiparams{'KEY'}}[1].p12");
+ unlink ($certfile);
+ unlink ($conffile);
+
+ if (-e "${General::swroot}/ovpn/n2nconf/$confighash{$cgiparams{'KEY'}}[1]") {
+ rmdir ("${General::swroot}/ovpn/n2nconf/$confighash{$cgiparams{'KEY'}}[1]") || die "Kann Verzeichnis nicht loeschen: $!";
+ }
}
unlink ("${General::swroot}/ovpn/certs/$confighash{$cgiparams{'KEY'}}[1]cert.pem");
@@ -3604,35 +3605,33 @@ if ($cgiparams{'TYPE'} eq 'net') {
}
# Check if a remote host/IP has been set for the client.
- if ($cgiparams{'REMOTE'} eq '' && $cgiparams{'SIDE'} ne 'server') {
- $errormessage = $Lang::tr{'invalid input for remote host/ip'};
+ if ($cgiparams{'TYPE'} eq 'net') {
+ if ($cgiparams{'SIDE'} ne 'server' && $cgiparams{'REMOTE'} eq '') {
+ $errormessage = $Lang::tr{'invalid input for remote host/ip'};
- # Check if this is a N2N connection and drop temporary config.
- if ($cgiparams{'TYPE'} eq 'net') {
- unlink ("${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}/$cgiparams{'NAME'}.conf") or die "Removing Configfile fail: $!";
- rmdir ("${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}") || die "Removing Directory fail: $!";
- }
- goto VPNCONF_ERROR;
- }
+ # Check if this is a N2N connection and drop temporary config.
+ unlink ("${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}/$cgiparams{'NAME'}.conf") or die "Removing Configfile fail: $!";
+ rmdir ("${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}") || die "Removing Directory fail: $!";
- # Check if a remote host/IP has been configured - the field can be empty on the server side.
- if ($cgiparams{'REMOTE'} ne '') {
+ goto VPNCONF_ERROR;
+ }
- # Check if the given IP is valid - otherwise check if it is a valid domain.
- if (! &General::validip($cgiparams{'REMOTE'})) {
+ # Check if a remote host/IP has been configured - the field can be empty on the server side.
+ if ($cgiparams{'REMOTE'} ne '') {
+ # Check if the given IP is valid - otherwise check if it is a valid domain.
+ if (! &General::validip($cgiparams{'REMOTE'})) {
+ # Check for a valid domain.
+ if (! &General::validfqdn ($cgiparams{'REMOTE'})) {
+ $errormessage = $Lang::tr{'invalid input for remote host/ip'};
- # Check for a valid domain.
- if (! &General::validfqdn ($cgiparams{'REMOTE'})) {
- $errormessage = $Lang::tr{'invalid input for remote host/ip'};
+ # Check if this is a N2N connection and drop temporary config.
+ unlink ("${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}/$cgiparams{'NAME'}.conf") or die "Removing Configfile fail: $!";
+ rmdir ("${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}") || die "Removing Directory fail: $!";
- # Check if this is a N2N connection and drop temporary config.
- if ($cgiparams{'TYPE'} eq 'net') {
- unlink ("${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}/$cgiparams{'NAME'}.conf") or die "Removing Configfile fail: $!";
- rmdir ("${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}") || die "Removing Directory fail: $!";
- }
- goto VPNCONF_ERROR;
+ goto VPNCONF_ERROR;
+ }
+ }
}
- }
}
if ($cgiparams{'TYPE'} ne 'host') {
diff --git a/html/cgi-bin/tor.cgi b/html/cgi-bin/tor.cgi
old mode 100644
new mode 100755
index 2a31dd4..b920724
--- a/html/cgi-bin/tor.cgi
+++ b/html/cgi-bin/tor.cgi
@@ -57,9 +57,42 @@ my @accounting_periods = ('daily', 'weekly', 'monthly');
my $TOR_CONTROL_PORT = 9051;
+my $string=();
+my $memory=();
+my @memory=();
+my @pid=();
+my @tor=();
+sub daemonstats
+{
+ $memory = 0;
+ # for pid and memory
+ open(FILE, '/usr/local/bin/addonctrl tor status | ');
+ @tor = <FILE>;
+ close(FILE);
+ $string = join("", @tor);
+ $string =~ s/[a-z_]//gi;
+ $string =~ s/\[[0-1]\;[0-9]+//gi;
+ $string =~ s/[\(\)\.]//gi;
+ $string =~ s/ //gi;
+ $string =~ s///gi;
+ @pid = split(/\s/,$string);
+ if (open(FILE, "/proc/$pid[0]/statm")){
+ my $temp = <FILE>;
+ @memory = split(/ /,$temp);
+ close(FILE);
+ }
+ $memory+=$memory[0];
+}
+daemonstats();
+
our %netsettings = ();
&General::readhash("${General::swroot}/ethernet/settings", \%netsettings);
+our %color = ();
+our %mainsettings = ();
+&General::readhash("${General::swroot}/main/settings", \%mainsettings);
+&General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color);
+
our %settings = ();
$settings{'TOR_ENABLED'} = 'off';
@@ -192,12 +225,37 @@ sub showMainBox() {
print "<form method='post' action='$ENV{'SCRIPT_NAME'}'>\n";
- &Header::openbox('100%', 'left', $Lang::tr{'tor configuration'});
+ &Header::openbox('100%', 'center', $Lang::tr{'tor'});
+
+
+if ( ($memory != 0) && (@pid[0] ne "///") ){
+ print "<table width='95%' cellspacing='0'>";
+ print "<tr><td bgcolor='$color{'color20'}' colspan='3' align='left'><strong>$Lang::tr{'tor service'}</strong></td></tr>";
+ print "<tr><td class='base'>$Lang::tr{'tor daemon'}</td>";
+ print "<td align='center' colspan='2' width='75%' bgcolor='${Header::colourgreen}'><font color='white'><strong>$Lang::tr{'running'}</strong></font></td></tr>";
+ print "<tr><td class='base'></td>";
+ print "<td bgcolor='$color{'color20'}' align='center'><strong>PID</strong></td>";
+ print "<td bgcolor='$color{'color20'}' align='center'><strong>$Lang::tr{'memory'}</strong></td></tr>";
+ print "<tr><td class='base'></td>";
+ print "<td bgcolor='$color{'color22'}' align='center'>@pid[0]</td>";
+ print "<td bgcolor='$color{'color22'}' align='center'>$memory KB</td></tr>";
+ print "</table>";
+ } else {
+ print "<table width='95%' cellspacing='0'>";
+ print "<tr><td bgcolor='$color{'color20'}' colspan='3' align='left'><strong>$Lang::tr{'tor service'}</strong></td></tr>";
+ print "<tr><td class='base'>$Lang::tr{'tor daemon'}</td>";
+ print "<td align='center' width='75%' bgcolor='${Header::colourred}'><font color='white'><strong>$Lang::tr{'stopped'}</strong></font></td></tr>";
+ print "</table>";
+ }
+
+ &Header::closebox();
+
+ &Header::openbox('100%', 'center', $Lang::tr{'tor configuration'});
print <<END;
- <table width='100%'>
+ <table width='95%'>
<tr>
- <td colspan='4' class='base'><b>$Lang::tr{'tor common settings'}</b></td>
+ <td colspan='4' class='base' bgcolor='$color{'color20'}'><b>$Lang::tr{'tor common settings'}</b></td>
</tr>
<tr>
<td width='25%' class='base'>$Lang::tr{'tor enabled'}:</td>
@@ -222,12 +280,11 @@ END
print <<END;
<br>
- <hr size='1'>
<br>
- <table width='100%'>
+ <table width='95%'>
<tr>
- <td colspan='4' class='base'><b>$Lang::tr{'tor acls'}</b></td>
+ <td colspan='4' class='base' bgcolor='$color{'color20'}'><b>$Lang::tr{'tor acls'}</b></td>
</tr>
<tr>
<td colspan='2' class='base' width='55%'>
@@ -244,12 +301,11 @@ END
</table>
<br>
- <hr size='1'>
<br>
- <table width='100%'>
+ <table width='95%'>
<tr>
- <td colspan='4' class='base'><b>$Lang::tr{'tor exit nodes'}</b></td>
+ <td colspan='4' class='base' bgcolor='$color{'color20'}'><b>$Lang::tr{'tor exit nodes'}</b></td>
</tr>
<tr>
<td colspan='2' class='base' width='55%'></td>
@@ -265,7 +321,13 @@ END
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 "<option value='$country_code'";
+
+ if ($settings{'TOR_EXIT_COUNTRY'} eq $country_code) {
+ print " selected";
+ }
+
+ print ">$country_name ($country_code)</option>\n";
}
print <<END;
@@ -276,7 +338,6 @@ END
</td>
</tr>
</table>
- <br><br>
END
&Header::closebox();
@@ -305,10 +366,10 @@ END
}
$selected{'TOR_RELAY_ACCOUNTING_PERIOD'}{$settings{'TOR_RELAY_ACCOUNTING_PERIOD'}} = 'selected';
- &Header::openbox('100%', 'left', $Lang::tr{'tor relay configuration'});
+ &Header::openbox('100%', 'center', $Lang::tr{'tor relay configuration'});
print <<END;
- <table width='100%'>
+ <table width='95%'>
<tr>
<td width='25%' class='base'>$Lang::tr{'tor relay mode'}:</td>
<td width='30%'>
@@ -342,11 +403,11 @@ END
</tr>
</table>
- <hr size='1'>
+ <br>
- <table width='100%'>
+ <table width='95%'>
<tr>
- <td colspan='4' class='base'><b>$Lang::tr{'tor bandwidth settings'}</b></td>
+ <td colspan='4' class='base' bgcolor='$color{'color20'}'><b>$Lang::tr{'tor bandwidth settings'}</b></td>
</tr>
<tr>
<td width='25%' class='base'>$Lang::tr{'tor bandwidth rate'}:</td>
@@ -407,7 +468,7 @@ END
&Header::closebox();
print <<END;
- <table width='100%'>
+ <table width='95%'>
<tr>
<td>
<img src='/blob.gif' align='top' alt='*' /> <font class='base'>$Lang::tr{'this field may be blank'}</font>
@@ -418,7 +479,7 @@ END
<hr>
- <table width='100%'>
+ <table width='95%'>
<tr>
<td> </td>
<td align='center'><input type='submit' name='ACTION' value='$Lang::tr{'save'}' /></td>
@@ -429,13 +490,13 @@ END
# If we have a control connection, show the stats.
if ($torctrl) {
- &Header::openbox('100%', 'left', $Lang::tr{'tor stats'});
+ &Header::openbox('100%', 'center', $Lang::tr{'tor stats'});
my @traffic = &TorTrafficStats($torctrl);
if (@traffic) {
print <<END;
- <table width='100%'>
+ <table width='95%'>
END
if ($settings{'TOR_RELAY_ENABLED'} eq 'on') {
@@ -476,7 +537,7 @@ END
my $accounting = &TorAccountingStats($torctrl);
if ($accounting) {
print <<END;
- <table width='100%'>
+ <table width='95%'>
<tr>
<td colspan='2' class='base'><b>$Lang::tr{'tor accounting'}</b></td>
</tr>
@@ -527,7 +588,7 @@ END
if (@nodes) {
my $nodes_length = scalar @nodes;
print <<END;
- <table width='100%'>
+ <table width='95%'>
<tr>
<td width='40%' class='base'><b>$Lang::tr{'tor connected relays'}</b></td>
<td width='60%' colspan='2'>($nodes_length)</td>
@@ -546,7 +607,11 @@ END
END
if (exists($node->{'country_code'})) {
+ if ($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>";
+ }
}
print <<END;
@@ -689,6 +754,8 @@ sub BuildConfiguration() {
} else {
system("/usr/local/bin/torctrl stop &>/dev/null");
}
+ # Update pid and memory
+ daemonstats();
}
sub TorConnect() {
diff --git a/langs/de/cgi-bin/de.pl b/langs/de/cgi-bin/de.pl
index a0c426f..b55179f 100644
--- a/langs/de/cgi-bin/de.pl
+++ b/langs/de/cgi-bin/de.pl
@@ -1817,6 +1817,7 @@
'tor configuration' => 'Tor-Konfiguration',
'tor connected relays' => 'Verbundene Relays',
'tor contact info' => 'Kontaktinformationen',
+'tor daemon' => 'Daemon',
'tor enabled' => 'Tor einschalten',
'tor errmsg invalid accounting limit' => 'Ungültiges Accounting-Limit',
'tor errmsg invalid ip or mask' => 'Ungültiges IP-Subnetz',
@@ -1839,6 +1840,7 @@
'tor relay mode relay' => 'Nur Relay',
'tor relay nickname' => 'Relay-Nickname',
'tor relay port' => 'Relay-Port',
+'tor service' => 'Tor-Service',
'tor socks port' => 'SOCKS-Port',
'tor stats' => 'Statistiken',
'tor traffic limit hard' => 'Das Ãœbertragungslimit wurde erreicht.',
diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl
index b12ae7d..7035bed 100644
--- a/langs/en/cgi-bin/en.pl
+++ b/langs/en/cgi-bin/en.pl
@@ -1852,6 +1852,7 @@
'tor configuration' => 'Tor Configuration',
'tor connected relays' => 'Connected relays',
'tor contact info' => 'Contact Info',
+'tor daemon' => 'Daemon',
'tor enabled' => 'Enable Tor',
'tor errmsg invalid accounting limit' => 'Invalid accounting limit',
'tor errmsg invalid ip or mask' => 'Invalid IP subnet',
@@ -1875,6 +1876,7 @@
'tor relay mode relay' => 'Relay only',
'tor relay nickname' => 'Relay nickname',
'tor relay port' => 'Relay port',
+'tor service' => 'Tor Service',
'tor socks port' => 'SOCKS port',
'tor stats' => 'Statistics',
'tor traffic limit hard' => 'Traffic limit has been reached.',
diff --git a/lfs/tor b/lfs/tor
index 8bce4be..ae63d96 100644
--- a/lfs/tor
+++ b/lfs/tor
@@ -32,7 +32,7 @@ DL_FROM = $(URL_IPFIRE)
DIR_APP = $(DIR_SRC)/$(THISAPP)
TARGET = $(DIR_INFO)/$(THISAPP)
PROG = tor
-PAK_VER = 1
+PAK_VER = 2
DEPS = "libevent2"
@@ -107,6 +107,10 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
install -v -m 644 $(DIR_SRC)/config/tor/defaults-torrc \
/usr/share/tor/defaults-torrc
+ # Install start links and backup include file.
+ ln -sf ../init.d/tor /etc/rc.d/rc3.d/S60tor
+ ln -sf ../init.d/tor /etc/rc.d/rc0.d/K40tor
+ ln -sf ../init.d/tor /etc/rc.d/rc6.d/K40tor
install -v -m 644 $(DIR_SRC)/config/backup/includes/tor \
/var/ipfire/backup/addons/includes/tor
@rm -rf $(DIR_APP)
diff --git a/src/initscripts/init.d/tor b/src/initscripts/init.d/tor
index e27241f..4fef577 100644
--- a/src/initscripts/init.d/tor
+++ b/src/initscripts/init.d/tor
@@ -9,6 +9,10 @@
. /etc/sysconfig/rc
. ${rc_functions}
+function tor_is_enabled() {
+ [ "${TOR_ENABLED}" = "on" ] || [ "${TOR_RELAY_ENABLED}" = "on" ]
+}
+
function setup_firewall() {
eval $(/usr/local/bin/readhash /var/ipfire/tor/settings)
@@ -27,6 +31,8 @@ function flush_firewall() {
case "${1}" in
start)
+ tor_is_enabled || exit 0
+
# Setup firewall.
setup_firewall
hooks/post-receive
--
IPFire 2.x development tree