Remove squid stuff

This commit is contained in:
Daniel Berteaud 2012-04-12 13:02:15 +02:00
parent 87dcc05fcc
commit 8e190304aa
11 changed files with 6 additions and 247 deletions

View File

@ -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");

View File

@ -1 +0,0 @@
.rar,.zip,.tar,.tar.gz,.tar.bz2,.tgz,.tbz2,.avi,.mpg,.mpeg,.mkv,.mov,.flv,.iso

View File

@ -1,3 +0,0 @@
#!/bin/bash
/usr/sbin/squid -k reconfigure

View File

@ -75,54 +75,6 @@
<base>DISABLED</base>
<trans>disabled</trans>
</entry>
<entry>
<base>DESC_WEB_THROTTLE</base>
<trans>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.</trans>
</entry>
<entry>
<base>DESC_WEB_GLOBAL_LIMIT</base>
<trans>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.</trans>
</entry>
<entry>
<base>LABEL_WEB_GLOBAL_LIMIT</base>
<trans>Web global limit</trans>
</entry>
<entry>
<base>DESC_WEB_THROTTLE_LIMIT</base>
<trans>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</trans>
</entry>
<entry>
<base>LABEL_WEB_THROTTLE_LIMIT</base>
<trans>Per host limit</trans>
</entry>
<entry>
<base>DESC_WEB_THROTTLE_EXTENSIONS</base>
<trans>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 (.)</trans>
</entry>
<entry>
<base>LABEL_WEB_THROTTLE_EXTENSIONS</base>
<trans>Extensions to throttle</trans>
</entry>
<entry>
<base>DESC_WEB_SOURCE_EXCEPTION</base>
<trans>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.</trans>
</entry>
<entry>
<base>LABEL_WEB_SOURCE_EXCEPTION</base>
<trans>Exceptions (sources)</trans>
</entry>
<entry>
<base>DESC_WEB_DEST_EXCEPTION</base>
<trans>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).</trans>
</entry>
<entry>
<base>LABEL_WEB_DEST_EXCEPTION</base>
<trans>Exceptions (destinations)</trans>
</entry>
<entry>
<base>VALUE_NEED_TO_BE_PERCENT</base>
<trans>This value must be between 0 and 100</trans>
</entry>
<entry>
<base>VALUE_ZERO_OR_POSITIVE</base>
<trans>This value must be positive or null</trans>

View File

@ -75,54 +75,6 @@
<base>DISABLED</base>
<trans>désactivé</trans>
</entry>
<entry>
<base>DESC_WEB_THROTTLE</base>
<trans>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</trans>
</entry>
<entry>
<base>DESC_WEB_GLOBAL_LIMIT</base>
<trans>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.</trans>
</entry>
<entry>
<base>LABEL_WEB_GLOBAL_LIMIT</base>
<trans>Limite web globale</trans>
</entry>
<entry>
<base>DESC_WEB_THROTTLE_LIMIT</base>
<trans>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.</trans>
</entry>
<entry>
<base>LABEL_WEB_THROTTLE_LIMIT</base>
<trans>Limite par machine</trans>
</entry>
<entry>
<base>DESC_WEB_THROTTLE_EXTENSIONS</base>
<trans>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 (.)</trans>
</entry>
<entry>
<base>LABEL_WEB_THROTTLE_EXTENSIONS</base>
<trans>Extensions à limiter</trans>
</entry>
<entry>
<base>DESC_WEB_SOURCE_EXCEPTION</base>
<trans>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.</trans>
</entry>
<entry>
<base>LABEL_WEB_SOURCE_EXCEPTION</base>
<trans>Exceptions (sources)</trans>
</entry>
<entry>
<base>DESC_WEB_DEST_EXCEPTION</base>
<trans>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)</trans>
</entry>
<entry>
<base>LABEL_WEB_DEST_EXCEPTION</base>
<trans>Exceptions (destinations)</trans>
</entry>
<entry>
<base>VALUE_NEED_TO_BE_PERCENT</base>
<trans>Cette valeure doit être comprise entre 0 et 100</trans>
</entry>
<entry>
<base>VALUE_ZERO_OR_POSITIVE</base>
<trans>Cette valeure doit être positive ou nulle</trans>

View File

@ -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
}

View File

@ -77,60 +77,6 @@ __DATA__
<label>LABEL_HostsPrio</label>
</field>
<subroutine src="print_section_bar()" />
<field
type="literal"
id="web_desc"
value="">
<description>DESC_WEB_THROTTLE</description>
</field>
<field
type="text"
id="WebGlobalLimit"
size="4"
validation="is_percent"
value="get_prop('WebGlobalLimit')">
<description>DESC_WEB_GLOBAL_LIMIT</description>
<label>LABEL_WEB_GLOBAL_LIMIT</label>
</field>
<field
type="text"
id="WebThrottleLimit"
size="4"
validation="is_percent"
value="get_prop('WebThrottleLimit')">
<description>DESC_WEB_THROTTLE_LIMIT</description>
<label>LABEL_WEB_THROTTLE_LIMIT</label>
</field>
<field
type="textarea"
rows="12"
cols="35"
id="WebThrottleExtensions"
value="get_list('WebThrottleExtensions')">
<description>DESC_WEB_THROTTLE_EXTENSIONS</description>
<label>LABEL_WEB_THROTTLE_EXTENSIONS</label>
</field>
<field
type="textarea"
rows="12"
cols="35"
id="WebThrottleSourceException"
value="get_list('WebThrottleSourceException')">
<description>DESC_WEB_SOURCE_EXCEPTION</description>
<label>LABEL_WEB_SOURCE_EXCEPTION</label>
</field>
<field
type="textarea"
rows="12"
cols="35"
id="WebThrottleDestException"
value="get_list('WebThrottleDestException')">
<description>DESC_WEB_DEST_EXCEPTION</description>
<label>LABEL_WEB_DEST_EXCEPTION</label>
</field>
<subroutine src="print_button( 'SAVE' )" />
</page>

View File

@ -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');
}

View File

@ -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. <daniel@firewall-services.com> - 1.2.0-1.sme
- Remove all squid stuff
* Fri Oct 07 2011 Daniel B. <daniel@firewall-services.com> - 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