diff --git a/config/rootfiles/core/71/update.sh b/config/rootfiles/core/71/update.sh index 8990b97ed..e45ccd837 100644 --- a/config/rootfiles/core/71/update.sh +++ b/config/rootfiles/core/71/update.sh @@ -39,7 +39,7 @@ cp -f /etc/snort/snort.conf /etc/snort/snort.conf.backup # #Stop services /etc/init.d/snort stop - +/etc/init.d/squid stop # #Remove old usb-modeswitch file rm /usr/share/usb_modeswitch/0e8d:0002 @@ -59,6 +59,7 @@ grep "^include $RULE_PATH" /etc/snort/snort.conf.backup >> /etc/snort/snort.conf # #Start services +/etc/init.d/squid start /etc/init.d/snort start # diff --git a/html/cgi-bin/tor.cgi b/html/cgi-bin/tor.cgi old mode 100644 new mode 100755 index 2a31dd4bf..a1d0ae72f --- 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 = ; + 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 = ; + @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 "
\n"; - &Header::openbox('100%', 'left', $Lang::tr{'tor configuration'}); + &Header::openbox('100%', 'center', $Lang::tr{'tor'}); + + +if ( ($memory != 0) && (@pid[0] ne "///") ){ + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print "
$Lang::tr{'tor service'}
$Lang::tr{'tor daemon'}$Lang::tr{'running'}
PID$Lang::tr{'memory'}
@pid[0]$memory KB
"; + } else { + print ""; + print ""; + print ""; + print ""; + print "
$Lang::tr{'tor service'}
$Lang::tr{'tor daemon'}$Lang::tr{'stopped'}
"; + } + + &Header::closebox(); + + &Header::openbox('100%', 'center', $Lang::tr{'tor configuration'}); print < + - + @@ -222,12 +280,11 @@ END print < -

-
$Lang::tr{'tor common settings'}$Lang::tr{'tor common settings'}
$Lang::tr{'tor enabled'}:
+
- +
$Lang::tr{'tor acls'}$Lang::tr{'tor acls'}
@@ -244,12 +301,11 @@ END

-

- +
- + @@ -276,7 +332,6 @@ END
$Lang::tr{'tor exit nodes'}$Lang::tr{'tor exit nodes'}
-

END &Header::closebox(); @@ -305,10 +360,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 < +
$Lang::tr{'tor relay mode'}: @@ -342,11 +397,11 @@ END
-
+
- +
- + @@ -407,7 +462,7 @@ END &Header::closebox(); print < +
$Lang::tr{'tor bandwidth settings'}$Lang::tr{'tor bandwidth settings'}
$Lang::tr{'tor bandwidth rate'}:
* $Lang::tr{'this field may be blank'} @@ -418,7 +473,7 @@ END
- +
@@ -429,13 +484,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 if ($settings{'TOR_RELAY_ENABLED'} eq 'on') { @@ -476,7 +531,7 @@ END my $accounting = &TorAccountingStats($torctrl); if ($accounting) { print < +
@@ -527,7 +582,7 @@ END if (@nodes) { my $nodes_length = scalar @nodes; print < +
$Lang::tr{'tor accounting'}
@@ -546,7 +601,11 @@ END END if (exists($node->{'country_code'})) { + if ($node->{'country_code'} eq '??') { + print ""; + } else { print "$node->{"; + } } print </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 a0c426f3f..584bee59e 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 b84c6bbbf..43bd03d6d 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 8bce4be8f..ae63d961a 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)
$Lang::tr{'tor connected relays'} ($nodes_length)