From 8e190304aa2fa0a5bbf7e02de2f619bb7082b448 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Thu, 12 Apr 2012 13:02:15 +0200 Subject: [PATCH] Remove squid stuff --- createlinks | 3 -- .../db/configuration/defaults/qos/WebGlobalLimit | 1 - .../defaults/qos/WebThrottleExtensions | 1 - .../db/configuration/defaults/qos/WebThrottleLimit | 1 - root/etc/e-smith/events/actions/reload-squid | 3 -- .../locale/en-us/etc/e-smith/web/functions/qos | 48 ------------------ .../locale/fr/etc/e-smith/web/functions/qos | 48 ------------------ .../templates/etc/squid/squid.conf/90DelayPools | 57 ---------------------- root/etc/e-smith/web/functions/qos | 54 -------------------- .../perl5/site_perl/esmith/FormMagick/Panel/qos.pm | 16 +----- smeserver-qos.spec | 21 ++------ 11 files changed, 6 insertions(+), 247 deletions(-) delete mode 100644 root/etc/e-smith/db/configuration/defaults/qos/WebGlobalLimit delete mode 100644 root/etc/e-smith/db/configuration/defaults/qos/WebThrottleExtensions delete mode 100644 root/etc/e-smith/db/configuration/defaults/qos/WebThrottleLimit delete mode 100644 root/etc/e-smith/events/actions/reload-squid delete mode 100644 root/etc/e-smith/templates/etc/squid/squid.conf/90DelayPools diff --git a/createlinks b/createlinks index 39f00f1..896b078 100644 --- a/createlinks +++ b/createlinks @@ -10,9 +10,6 @@ service_link_enhanced("qos", "K25", "0"); templates2events("/etc/rc.d/init.d/qos", "bootstrap-console-save"); templates2events("/etc/rc.d/init.d/qos", "qos-update"); -templates2events("/etc/squid/squid.conf", "qos-update"); - -event_link("reload-squid", "qos-update", "90"); safe_symlink("adjust", "root/etc/e-smith/events/qos-update/services2adjust/qos"); safe_symlink("adjust", "root/etc/e-smith/events/ip-up/services2adjust/qos"); diff --git a/root/etc/e-smith/db/configuration/defaults/qos/WebGlobalLimit b/root/etc/e-smith/db/configuration/defaults/qos/WebGlobalLimit deleted file mode 100644 index 29d6383..0000000 --- a/root/etc/e-smith/db/configuration/defaults/qos/WebGlobalLimit +++ /dev/null @@ -1 +0,0 @@ -100 diff --git a/root/etc/e-smith/db/configuration/defaults/qos/WebThrottleExtensions b/root/etc/e-smith/db/configuration/defaults/qos/WebThrottleExtensions deleted file mode 100644 index e085d6f..0000000 --- a/root/etc/e-smith/db/configuration/defaults/qos/WebThrottleExtensions +++ /dev/null @@ -1 +0,0 @@ -.rar,.zip,.tar,.tar.gz,.tar.bz2,.tgz,.tbz2,.avi,.mpg,.mpeg,.mkv,.mov,.flv,.iso diff --git a/root/etc/e-smith/db/configuration/defaults/qos/WebThrottleLimit b/root/etc/e-smith/db/configuration/defaults/qos/WebThrottleLimit deleted file mode 100644 index 29d6383..0000000 --- a/root/etc/e-smith/db/configuration/defaults/qos/WebThrottleLimit +++ /dev/null @@ -1 +0,0 @@ -100 diff --git a/root/etc/e-smith/events/actions/reload-squid b/root/etc/e-smith/events/actions/reload-squid deleted file mode 100644 index 4e00709..0000000 --- a/root/etc/e-smith/events/actions/reload-squid +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -/usr/sbin/squid -k reconfigure diff --git a/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/qos b/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/qos index 56ba010..98a3d41 100644 --- a/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/qos +++ b/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/qos @@ -76,54 +76,6 @@ disabled - DESC_WEB_THROTTLE - The following settings only apply to web downloads which pass through the proxy on this server. Web proxy need to be enabled for this to take effect. - - - DESC_WEB_GLOBAL_LIMIT - This settings will define a global speed limit for web trafic as a percent of your total available downlink speed. For example, if you set 90, downloads from the web will be limited to 90% of your total bandwidth. You use this to reduce the impact of big downloads on critial streams, like VoIP. - - - LABEL_WEB_GLOBAL_LIMIT - Web global limit - - - DESC_WEB_THROTTLE_LIMIT - This settings controls per host limit. For example, if you choose 70, each host will be limited to 70% of the total bandwidth (after the burst at full speed). This setting helps preventing one user to slow down everything with big downloads - - - LABEL_WEB_THROTTLE_LIMIT - Per host limit - - - DESC_WEB_THROTTLE_EXTENSIONS - Enter here the list of extensions which will be affected by the per host limit, one per line. If you want everything to be limited, just enter a dot (.) - - - LABEL_WEB_THROTTLE_EXTENSIONS - Extensions to throttle - - - DESC_WEB_SOURCE_EXCEPTION - You can enter here IP address of internal host which won't be limited by the per host throttle, one IP address per line. Usefull for example to let your boss surf at full speed. Global limit will still apply to this list. - - - LABEL_WEB_SOURCE_EXCEPTION - Exceptions (sources) - - - DESC_WEB_DEST_EXCEPTION - You can also enter a list of domain names which won't be affected by the per host throttle, one per line (global limit still applies). - - - LABEL_WEB_DEST_EXCEPTION - Exceptions (destinations) - - - VALUE_NEED_TO_BE_PERCENT - This value must be between 0 and 100 - - VALUE_ZERO_OR_POSITIVE This value must be positive or null diff --git a/root/etc/e-smith/locale/fr/etc/e-smith/web/functions/qos b/root/etc/e-smith/locale/fr/etc/e-smith/web/functions/qos index 3ea7126..2b026f7 100644 --- a/root/etc/e-smith/locale/fr/etc/e-smith/web/functions/qos +++ b/root/etc/e-smith/locale/fr/etc/e-smith/web/functions/qos @@ -76,54 +76,6 @@ désactivé - DESC_WEB_THROTTLE - Les réglages suivants ne s'appliquent qu'aux téléchargements sur le web passant à travers le proxy de ce serveur. Le proxy HTTP doit être activé pour que ces réglages soient effectifs - - - DESC_WEB_GLOBAL_LIMIT - Ce paramètre permet de définir une limite de vitesse pour le trafic web exprimée comme un pourcentage de la bande passante descendante totale. Par exemple, si vous le réglez à 90, les téléchargements seront limités à 90% de votre bande passante totale. Vous pouvez utiliser ce réglage pour limiter l'impacte de gros téléchargements sur des flux critiques, comme la VoIP. - - - LABEL_WEB_GLOBAL_LIMIT - Limite web globale - - - DESC_WEB_THROTTLE_LIMIT - Ce paramètre contrôle la limite de vitesse par hôte. Par exemple, si vous choisissez 70, chaque machine de votre réseau sera limitée à 70% de la bande passante totale. Ce paramètre permet d'éviter qu'un utilisateur ralentisse tout le réseau avec de gros téléchargements. - - - LABEL_WEB_THROTTLE_LIMIT - Limite par machine - - - DESC_WEB_THROTTLE_EXTENSIONS - Entrez ici une liste d'extensions sur lesquelles appliquer la limite par machine, une par ligne. Si vous voulez limiter tout type de fichier, entrez simplement un point (.) - - - LABEL_WEB_THROTTLE_EXTENSIONS - Extensions à limiter - - - DESC_WEB_SOURCE_EXCEPTION - Vous pouvez entrer ici une liste d'adresses IP des machines internes qui ne seront pas affectées par la limite par machine, une adresse par ligne. Ce réglage est utile par exemple pour laisser votre patron surfer à pleine vitesse. La limite globale s'applique tout de même. - - - LABEL_WEB_SOURCE_EXCEPTION - Exceptions (sources) - - - DESC_WEB_DEST_EXCEPTION - Vous pouvez aussi entrer une liste de noms de domaine qui ne seront pas affectés par la limite par machine, un domaine par ligne. (le limite globale s'applique toujours) - - - LABEL_WEB_DEST_EXCEPTION - Exceptions (destinations) - - - VALUE_NEED_TO_BE_PERCENT - Cette valeure doit être comprise entre 0 et 100 - - VALUE_ZERO_OR_POSITIVE Cette valeure doit être positive ou nulle diff --git a/root/etc/e-smith/templates/etc/squid/squid.conf/90DelayPools b/root/etc/e-smith/templates/etc/squid/squid.conf/90DelayPools deleted file mode 100644 index 64763d8..0000000 --- a/root/etc/e-smith/templates/etc/squid/squid.conf/90DelayPools +++ /dev/null @@ -1,57 +0,0 @@ -{ - -my $status = $qos{'status'} || 'disabled'; - -return "" unless ($status eq 'enabled'); - -my $down = $qos{'DownLink'} || '4000'; -my $weblimit = $qos{'WebGlobalLimit'} || '100'; -my $limit = $qos{'WebThrottleLimit'} || '99'; - -# Convert weblimit and per user limit in absolute values (in bytes) -$weblimit = $down * $weblimit * 1024 / (100 * 8); -$limit = $down * $limit * 1024 / (100 * 8); - -my $extensions = $qos{'WebThrottleExtensions'} || '.rar .zip .tar .tar.gz .tar.bz2 .tgz .tbz2 .avi .mpg .mpeg .mkv .mov .flv .iso'; -$extensions =~ s/[,;]/\ /g; -$extensions =~ s/\./\\\./g; - -my @sexcludes = split(/[;,]/, ($qos{'WebThrottleSourceException'} || '')); -my @dexcludes = split(/[;,]/, ($qos{'WebThrottleDestException'} || '')); - -$OUT .=<<"EOF"; - -acl throttle url_regex -i $extensions - -delay_pools 2 -delay_class 1 1 -delay_parameters 1 $weblimit/$weblimit - -delay_class 2 2 -delay_parameters 2 $weblimit/$weblimit $limit/$limit - -delay_access 1 allow localdst - -acl exclude_throttle_src src 127.0.0.1 -acl exclude_throttle_dst dstdomain $DomainName - -EOF - -foreach (@sexcludes){ - $OUT .= "acl exclude_throttle_src src $_\n"; -} -foreach (@dexcludes){ - $_ =~ s/^/\./ unless $_ =~ m/^\./; - $OUT .= "acl exclude_throttle_dst dstdomain $_\n"; -} - -$OUT .=<<"EOF" - -delay_access 1 allow localdst -delay_access 1 allow exclude_throttle_src -delay_access 1 allow exclude_throttle_dst -delay_access 2 allow throttle -delay_access 1 allow !throttle - -EOF -} diff --git a/root/etc/e-smith/web/functions/qos b/root/etc/e-smith/web/functions/qos index cfde09d..39fd05e 100644 --- a/root/etc/e-smith/web/functions/qos +++ b/root/etc/e-smith/web/functions/qos @@ -77,60 +77,6 @@ __DATA__ - - - - DESC_WEB_THROTTLE - - - - DESC_WEB_GLOBAL_LIMIT - - - - DESC_WEB_THROTTLE_LIMIT - - - - DESC_WEB_THROTTLE_EXTENSIONS - - - - DESC_WEB_SOURCE_EXCEPTION - - - - DESC_WEB_DEST_EXCEPTION - - diff --git a/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/qos.pm b/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/qos.pm index 7c188c1..38a4324 100644 --- a/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/qos.pm +++ b/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/qos.pm @@ -62,14 +62,6 @@ sub zero_or_positive{ return $self->localise('VALUE_ZERO_OR_POSITIVE'); } -sub is_percent{ - my ($self,$val) = @_; - if ($val =~ m/^\d+$/ && $val <= 100 && $val >= 0){ - return 'OK'; - } - return $self->localise('VALUE_NEED_TO_BE_PERCENT'); -} - sub port_range{ my $self = shift; my $val = shift || 0; @@ -100,16 +92,10 @@ sub change_settings { my $fm = shift; my $q = $fm->{'cgi'}; - foreach (qw/status UDPPrio TCPPrio HostsPrio UpLink DownLink WebGlobalLimit WebThrottleLimit/){ + foreach (qw/status UDPPrio TCPPrio HostsPrio UpLink DownLink/){ $db->set_prop('qos', "$_", $q->param("$_") ||''); } - foreach (qw/WebThrottleExtensions WebThrottleSourceException WebThrottleDestException/){ - my $list = $q->param("$_") || ''; - $list =~ s/\r?\n/,/g; - $db->set_prop('qos', "$_", $list); - } - unless (system ("/sbin/e-smith/signal-event qos-update") == 0 ){ $fm->error('ERROR'); } diff --git a/smeserver-qos.spec b/smeserver-qos.spec index 050d1e5..0c99d9a 100644 --- a/smeserver-qos.spec +++ b/smeserver-qos.spec @@ -3,8 +3,8 @@ # Name: Daniel Berteaud %define name smeserver-qos -%define version 1.2 -%define release 0.beta5 +%define version 1.2.0 +%define release 0.beta6 Summary: Install management web console for QoS Name: %{name} @@ -14,12 +14,6 @@ License: GNU GPL version 2 URL: http://contribs.org Group: SMEserver/addon Source: %{name}-%{version}.tar.gz -Patch0: smeserver-qos-1.2-fix_throttle_access.patch -Patch1: smeserver-qos-1.2-stop_prio_ack.patch -Patch2: smeserver-qos-1.2-only_mark_out_on_extdev.patch -Patch3: smeserver-qos-1.2-remove_bogus_burst_param.patch -Patch4: smeserver-qos-1.2-bigger_burst_on_ingress.patch -Patch5: smeserver-qos-1.2-locale_fr_fix.patch BuildRoot: %{_tmppath}/%{name}-buildroot BuildArchitectures: noarch @@ -31,6 +25,9 @@ Conflicts: smeserver-htbwshaper SME Server admin interface for QoS %changelog +* Thu Apr 12 2012 Daniel B. - 1.2.0-1.sme +- Remove all squid stuff + * Fri Oct 07 2011 Daniel B. - 1.2-1.sme - Add squid delay pools - Translate in french @@ -108,14 +105,6 @@ SME Server admin interface for QoS %prep %setup -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 - -%{__rm} -f root/etc/e-smith/templates/etc/rc.d/init.d/qos/30Functions25DefineClasses.orig %build perl createlinks