From: ms Date: Mon, 12 Jun 2006 15:00:19 +0000 (+0000) Subject: Hinzugefügt: X-Git-Tag: v2.3-beta1~1083 X-Git-Url: http://git.ipfire.org/?p=ipfire-2.x.git;a=commitdiff_plain;h=a68fedca8fde0f46f6cdab6dc6bdedd6c4b80eaa Hinzugefügt: * IPTables ins Webinterface - Muss der Benne nochmal drüberkucken! Geändert: * Blinde Datei oh323 gelöscht. * Kein sudo-Paket mehr, da bereits in ISO. * makegraphs gefixt wegen hddtemp * Menü im Webinterface wieder einmal bearbeitet. git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@171 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8 --- diff --git a/config/cfgroot/header.pl b/config/cfgroot/header.pl index cefdc316f5..659d41a687 100644 --- a/config/cfgroot/header.pl +++ b/config/cfgroot/header.pl @@ -195,9 +195,9 @@ sub genmenu { 'enabled' => 1, }; $substatus->{'70.hddtemp'} = { - 'caption' => '$tr{'HDD temperature graphs'}', + 'caption' => "$tr{'harddisk temperature graphs'}", 'uri' => '/cgi-bin/hddgraph.cgi', - 'title' => "$tr{'HDD temperature graphs'}", + 'title' => "$tr{'harddisk temperature graphs'}", 'enabled' => 1, }; $substatus->{'80.connections'} = { @@ -212,10 +212,10 @@ sub genmenu { 'title' => "$tr{'sstraffic'}", 'enabled' => 1, }; - $substatus->{'99.iptfilters'} = { - 'caption' => $tr{'iptfilters iptable rules'}, - 'uri' => '/cgi-bin/iptfilters.cgi', - 'title' => "$tr{'iptfilters iptable rules'}", + $substatus->{'99.iptable'} = { + 'caption' => $tr{'iptable rules'}, + 'uri' => '/cgi-bin/iptables.cgi', + 'title' => "$tr{'iptable rules'}", 'enabled' => 1, }; @@ -259,7 +259,7 @@ sub genmenu { 'caption' => $tr{'aliases'}, 'uri' => '/cgi-bin/aliases.cgi', 'title' => "$tr{'aliases'}", - 'enabled' => 1, + 'enabled' => 0, }; my %subserviceshash = (); @@ -451,13 +451,13 @@ sub genmenu { }; if (! blue_used() && ! orange_used()) { - $menu->{'05.firewall'}{'subMenu'}->{'04.dmz'}{'enabled'} = 0; + $menu->{'05.firewall'}{'subMenu'}->{'40.dmz'}{'enabled'} = 0; } if (! blue_used()) { - $menu->{'05.firewall'}{'subMenu'}->{'03.wireless'}{'enabled'} = 0; + $menu->{'05.firewall'}{'subMenu'}->{'30.wireless'}{'enabled'} = 0; } if (! $ethsettings{'CONFIG_TYPE'} =~ /^(2|3|6|7)$/ && $ethsettings{'RED_TYPE'} eq 'STATIC' ) { - $menu->{'03.network'}{'subMenu'}->{'04.aliases'}{'enabled'} = 0; + $menu->{'03.network'}{'subMenu'}->{'70.aliases'}{'enabled'} = 1; } } diff --git a/doc/packages-to-remove-from-ftp b/doc/packages-to-remove-from-ftp index e69de29bb2..420c8e1495 100644 --- a/doc/packages-to-remove-from-ftp +++ b/doc/packages-to-remove-from-ftp @@ -0,0 +1 @@ +snort-2.3.3.tar.gz diff --git a/html/cgi-bin/iptables.cgi b/html/cgi-bin/iptables.cgi new file mode 100644 index 0000000000..d62c84e376 --- /dev/null +++ b/html/cgi-bin/iptables.cgi @@ -0,0 +1,104 @@ +#!/usr/bin/perl +# +# IPFire CGIs +# +# This code is distributed under the terms of the GPL +# + +require '/var/ipfire/general-functions.pl'; +require "${General::swroot}/lang.pl"; +require "${General::swroot}/header.pl"; + +my @iplines; +my $lines = 0; +my @ipmanlines; +my $manlines = 0; +my @ipnatlines; +my $natlines = 0; + +system('/usr/local/bin/getipstat'); + +&Header::showhttpheaders(); +&Header::openpage($Lang::tr{'ipts'}, 1, ''); +&Header::openbigbox('100%', 'LEFT'); +&Header::openbox('100%', 'LEFT', $Lang::tr{'ipts'}.':'); +print < +
+END
+;
+	open (FILE, '/home/httpd/html/iptables.txt');
+	while ()
+       {
+         	$iplines[$lines] = $_;
+		$lines++;
+       }
+	close (FILE);
+	foreach $_ (@iplines) {
+		print "$_"; }
+
+print <
+    
+    
+ +END +; +&Header::closebox(); + +## MANGLE +&Header::openbox('100%', 'LEFT', $Lang::tr{'iptmangles'}.':'); +print < +
+END
+;
+	open (FILEMAN, '/home/httpd/html/iptablesmangle.txt');
+	while ()
+       {
+         	$ipmanlines[$manlines] = $_;
+		$manlines++;
+       }
+	close (FILEMAN);
+	foreach $_ (@ipmanlines) {
+		print "$_"; }
+
+print <
+    
+    
+ +END +; +&Header::closebox(); + +## NAT +&Header::openbox('100%', 'LEFT', $Lang::tr{'iptnats'}.':'); +print < +
+END
+;
+	open (FILENAT, '/home/httpd/html/iptablesnat.txt');
+	while ()
+       {
+         	$ipnatlines[$natlines] = $_;
+		$natlines++;
+       }
+	close (FILENAT);
+	foreach $_ (@ipnatlines) {
+		print "$_"; }
+
+print <
+    
+    
+ +END +; +&Header::closebox(); +&Header::closebigbox(); +&Header::closepage(); diff --git a/langs/de/cgi-bin/de.pl b/langs/de/cgi-bin/de.pl index d0fc043d04..2ed318a3b7 100644 --- a/langs/de/cgi-bin/de.pl +++ b/langs/de/cgi-bin/de.pl @@ -1278,6 +1278,10 @@ 'harddisk temperature' => 'Festplattentemperatur', 'harddisk temperature graphs' => 'Festplattentemperatur-Diagramme', 'hdd temperature in' => 'Festplattentemperatur in', +'ipts' => 'IPTables', +'iptable rules' => 'IPTable-Regeln', +'iptmangles' => 'IPTable Mangles', +'iptnats' => 'IPTable Network Address Translation', ); diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index 4e6124d6a7..d9e66c47e6 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -1311,5 +1311,9 @@ 'harddisk temperature' => 'Harddisk temperature', 'harddisk temperature graphs' => 'harddisk temperature graphs', 'hdd temperature in' => 'Harddisk temperature in', +'ipts' => 'IPTables', +'iptable rules' => 'IPTable rules', +'iptmangles' => 'IPTable Mangles', +'iptnats' => 'IPTable Network Address Translation', ); diff --git a/lfs/oh323 b/lfs/oh323 deleted file mode 100644 index b92f78ba74..0000000000 --- a/lfs/oh323 +++ /dev/null @@ -1,92 +0,0 @@ -############################################################################### -# This file is part of the IPCop Firewall. # -# # -# IPCop 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 2 of the License, or # -# (at your option) any later version. # -# # -# IPCop 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 IPCop; if not, write to the Free Software # -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# # -# Makefiles are based on LFSMake, which is # -# Copyright (C) 2002 Rod Roard # -# # -# Modifications by: # -# ??-12-2003 Mark Wormgoor < mark@wormgoor.com> # -# - Modified Makefile for IPCop build # -# # -# $Id: ntp,v 1.6.2.3 2005/02/05 15:38:15 gespinasse Exp $ -# # -############################################################################### - -############################################################################### -# Definitions -############################################################################### - -include Config - -VER = 2.2.9 - -THISAPP = postfix-$(VER) -DL_FILE = $(THISAPP).tar.gz -DL_FROM = ftp://netmirror.org/postfix.org/official -DIR_APP = $(DIR_SRC)/$(THISAPP) -TARGET = $(DIR_INFO)/$(THISAPP) - -############################################################################### -# Top-level Rules -############################################################################### - -objects = $(DL_FILE) - -$(DL_FILE) = $(DL_FROM)/$(DL_FILE) - -$(DL_FILE)_MD5 = be78631bd9b6bf7735e43abfa54d69f6 - -install : $(TARGET) - -check : $(patsubst %,$(DIR_CHK)/%,$(objects)) - -download :$(patsubst %,$(DIR_DL)/%,$(objects)) - -md5 : $(subst %,%_MD5,$(objects)) - -dist: - make-packages.sh postfix $(THISAPP)-ipfire-beta-1 - -############################################################################### -# Downloading, checking, md5sum -############################################################################### - -$(patsubst %,$(DIR_CHK)/%,$(objects)) : - @$(CHECK) - -$(patsubst %,$(DIR_DL)/%,$(objects)) : - @$(LOAD) - -$(subst %,%_MD5,$(objects)) : - @$(MD5) - -############################################################################### -# Installation Details -############################################################################### - -$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) - @$(PREBUILD) - @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE) - cd $(DIR_APP) && make -f Makefile.init makefiles \ - 'CCARGS=-DDEF_DAEMON_DIR=\"/usr/lib/postfix\" -DDEF_MANPAGE_DIR=\"/usr/share/man\" -DUSE_TLS -DUSE_SALS_AUTH -DHAS_PGSQL -I/usr/include/openssl -DHAS_MYSQL -I/opt/lampp/include/mysql -I/usr/include/sasl -I/opt/lampp/include' \ - 'AUXLIBS=-L/usr/lib -L/opt/lampp/lib/mysql -L/opt/lampp/lib -lmysqlclient -lz -lm -lssl -lsasl2 -lcrypto -lpq' - cd $(DIR_APP) && make - cd $(DIR_APP) && sh postfix-install -non-interactive - cp -v /usr/src/config/etc/aliases /etc/aliases - cd /etc/ && postmap aliases - @rm -rf $(DIR_APP) - @$(POSTBUILD) \ No newline at end of file diff --git a/lfs/procps b/lfs/procps index a77d711dae..34751b3cb3 100644 --- a/lfs/procps +++ b/lfs/procps @@ -18,12 +18,6 @@ # Makefiles are based on LFSMake, which is # # Copyright (C) 2002 Rod Roard # # # -# Modifications by: # -# ??-12-2003 Mark Wormgoor < mark@wormgoor.com> # -# - Modified Makefile for IPCop build # -# # -# $Id: procps,v 1.4.2.4 2005/07/10 16:01:33 franck78 Exp $ -# # ############################################################################### ############################################################################### @@ -36,7 +30,7 @@ VER = 3.2.5 THISAPP = procps-$(VER) DL_FILE = $(THISAPP).tar.gz -DL_FROM = http://procps.sf.net +DL_FROM = $(URL_IPFIRE) DIR_APP = $(DIR_SRC)/$(THISAPP) TARGET = $(DIR_INFO)/$(THISAPP) diff --git a/lfs/sudo b/lfs/sudo index 31fd36c360..67abe6c3ed 100644 --- a/lfs/sudo +++ b/lfs/sudo @@ -36,7 +36,7 @@ VER = 1.6.8p12 THISAPP = sudo-$(VER) DL_FILE = $(THISAPP).tar.gz -DL_FROM = http://www.courtesan.com/sudo/dist +DL_FROM = $(URL_IPFIRE) DIR_APP = $(DIR_SRC)/$(THISAPP) TARGET = $(DIR_INFO)/$(THISAPP) @@ -58,9 +58,6 @@ download :$(patsubst %,$(DIR_DL)/%,$(objects)) md5 : $(subst %,%_MD5,$(objects)) -dist: - make-packages.sh sudo $(THISAPP)-ipfire-beta-1 - ############################################################################### # Downloading, checking, md5sum ############################################################################### diff --git a/make.sh b/make.sh index 8a09d7e921..51bb5f92b1 100644 --- a/make.sh +++ b/make.sh @@ -335,7 +335,7 @@ ipcopmake() { ipfiredist() { if [ -f $BASEDIR/build/usr/src/lfs/$1 ]; then - if [ ! `ls -w1 $BASEDIR/packages/*.tar.gz | grep $1` ]; then +# if [ ! `ls -w1 $BASEDIR/packages/*.tar.gz | grep $1` ]; then echo "`date -u '+%b %e %T'`: Packaging $1" | tee -a $LOGFILE cp -f $BASEDIR/src/scripts/make-packages.sh $BASEDIR/build/usr/local/bin chroot $LFS /tools/bin/env -i HOME=/root \ @@ -353,9 +353,9 @@ ipfiredist() { if [ $? -ne 0 ]; then exiterror "Packaging $1" fi - else - echo "`date -u '+%b %e %T'`: Packaging: The package $1 already exists" - fi +# else +# echo "`date -u '+%b %e %T'`: Packaging: The package $1 already exists" +# fi else exiterror "No such file or directory: $BASEDIR/build/usr/src/lfs/$1" fi @@ -845,14 +845,10 @@ ipfirepackages() { ipfiredist lame ipfiredist libtiff ipfiredist libxml2 - ipfiredist mc ipfiredist ntop ipfiredist postfix ipfiredist pwlib ipfiredist samba - ipfiredist sane - ipfiredist spandsp - ipfiredist sudo ipfiredist xampp ipfiredist xinetd test -d $BASEDIR/packages || mkdir $BASEDIR/packages @@ -1119,7 +1115,11 @@ diff) ;; sync) echo -e "Syncing Cache to FTP:" - echo -ne "Password for mirror.ipfire.org: "; read PASS + if [ -f .pass ]; then + PASS="`cat .pass`" + else + echo -ne "Password for mirror.ipfire.org: "; read PASS + fi rm -f doc/packages-to-remove-from-ftp ncftpls -u web3 -p $PASS ftp://mirror.ipfire.org/html/source-packages/source/ > ftplist for i in `ls -w1 cache/`; do @@ -1143,7 +1143,11 @@ sync) ;; pub-iso) echo -e "Upload the ISO to the beta-mirror!" - echo -ne "Password for mirror.ipfire.org: "; read PASS + if [ -f .pass ]; then + PASS="`cat .pass`" + else + echo -ne "Password for mirror.ipfire.org: "; read PASS + fi ncftpls -u web3 -p $PASS ftp://mirror.ipfire.org/html/source-packages/beta/ | grep `svn info | grep Revision | cut -c 11-` if [ "$?" -eq "1" ]; then cp $BASEDIR/ipfire-install-1.4.i386.iso $BASEDIR/ipfire-install-1.4.i386-r`svn info | grep Revision | cut -c 11-`.iso @@ -1162,7 +1166,11 @@ pub-iso) ;; pub-paks) echo -e "Upload the packages to the beta-mirror!" - echo -ne "Password for mirror.ipfire.org: "; read PASS + if [ -f .pass ]; then + PASS="`cat .pass`" + else + echo -ne "Password for mirror.ipfire.org: "; read PASS + fi ncftpput -z -u web3 -p $PASS mirror.ipfire.org /html/source-packages/packages/ packages/* if [ "$?" -eq "0" ]; then echo -e "The packages were successfully uploaded to the ftp server." diff --git a/src/ROOTFILES.i386 b/src/ROOTFILES.i386 index f3a8035742..77d4a5b342 100644 --- a/src/ROOTFILES.i386 +++ b/src/ROOTFILES.i386 @@ -21010,6 +21010,7 @@ home/httpd/cgi-bin/hddgraph.cgi home/httpd/cgi-bin/ids.cgi home/httpd/cgi-bin/index.cgi home/httpd/cgi-bin/ipinfo.cgi +home/httpd/cgi-bin/iptables.cgi home/httpd/cgi-bin/fwhits.cgi home/httpd/cgi-bin/ovpnfunc.pl home/httpd/cgi-bin/ovpnmain.cgi @@ -22519,6 +22520,7 @@ sbin/mingetty ## ## misc-progs ## +usr/local/bin/getipstat usr/local/bin/installfcdsl usr/local/bin/installpackage usr/local/bin/iowrap diff --git a/src/misc-progs/Makefile b/src/misc-progs/Makefile index ce04fb1599..828dafabeb 100644 --- a/src/misc-progs/Makefile +++ b/src/misc-progs/Makefile @@ -9,7 +9,8 @@ SUID_PROGS = setdmzholes setportfw setfilters setxtaccess restartdhcp restartsno ipfirebkcfg ipfirerscfg installpackage installfcdsl ipsecctrl \ setaliases ipfirebackup restartntpd \ restartapplejuice setdate rebuildhosts \ - restartsyslogd logwatch openvpnctrl timecheckctrl restartwireless + restartsyslogd logwatch openvpnctrl timecheckctrl \ + restartwireless getipstat install : all install -m 755 $(PROGS) /usr/local/bin @@ -80,5 +81,8 @@ ipsecctrl: ipsecctrl.c setuid.o ../install+setup/libsmooth/varval.o timecheckctrl: timecheckctrl.c setuid.o ../install+setup/libsmooth/varval.o $(COMPILE) -I../install+setup/libsmooth/ timecheckctrl.c setuid.o ../install+setup/libsmooth/varval.o -o $@ +getipstat: getipstat.c setuid.o ../install+setup/libsmooth/varval.o + $(COMPILE) -I../install+setup/libsmooth/ getipstat.c setuid.o ../install+setup/libsmooth/varval.o -o $@ + ipfirebackup: ipfirebackup.c setuid.o $(COMPILE) -lcrypt ipfirebackup.c setuid.o -o $@ diff --git a/src/misc-progs/getipstat.c b/src/misc-progs/getipstat.c new file mode 100644 index 0000000000..808eec803c --- /dev/null +++ b/src/misc-progs/getipstat.c @@ -0,0 +1,27 @@ +/* IPFire helper program - IPStat + * + * Get the list from IPTABLES -L + * + */ + +#include +#include +#include +#include +#include +#include +#include "setuid.h" + + +int main(void) +{ + if (!(initsetuid())) + exit(1); + + safe_system("/sbin/iptables -L -v -n > /home/httpd/html/iptables.txt"); + safe_system("/sbin/iptables -L -v -n -t nat > /home/httpd/html/iptablesnat.txt"); + safe_system("/sbin/iptables -t mangle -L -v -n > /home/httpd/html/iptablesmangle.txt"); + + return 0; +} + diff --git a/src/scripts/make-packages.sh b/src/scripts/make-packages.sh index 0cdc292ec0..e4b6847ded 100755 --- a/src/scripts/make-packages.sh +++ b/src/scripts/make-packages.sh @@ -26,7 +26,7 @@ cd /paks/$1/ROOT && tar cvfz /paks/$1/files.tgz * cd /paks/$1/CONF && tar cvfz /paks/$1/conf.tgz * cd /paks/$1 && tar cvfz ../$2.tar.gz files.tgz conf.tgz install.sh uninstall.sh -cd .. && md5sum $2.tar.gz >> $2.tar.gz.md5 +cd .. && md5sum $2.tar.gz > $2.tar.gz.md5 rm -fr /paks/$1 diff --git a/src/scripts/makegraphs b/src/scripts/makegraphs index 8cd4de0cf5..67bacd4881 100644 --- a/src/scripts/makegraphs +++ b/src/scripts/makegraphs @@ -56,6 +56,7 @@ my $rrdlog = "/var/log/rrd"; my $graphs = "/home/httpd/html/graphs"; $ENV{PATH}="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"; my $hdd_device = "/dev/harddisk"; +my $temp = ''; sub gettraffic { my $interface = $_[0];