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, next has been updated via 5428eeeeaac1ecacbec2aecb9279cccd29e9c47d (commit) from ee299e2ecf6e9fbc6dbf7fdc18c5a8980e122b12 (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 5428eeeeaac1ecacbec2aecb9279cccd29e9c47d Author: Michael Tremer michael.tremer@ipfire.org Date: Tue Jun 16 14:39:26 2015 +0200
url-filter: Use upstream proxy when downloading blacklists
Fixes #10690
Signed-off-by: Michael Tremer michael.tremer@ipfire.org
-----------------------------------------------------------------------
Summary of changes: config/cfgroot/network-functions.pl | 27 +++++++++++++++++++++++++++ config/urlfilter/autoupdate.pl | 3 +++ 2 files changed, 30 insertions(+)
Difference in files: diff --git a/config/cfgroot/network-functions.pl b/config/cfgroot/network-functions.pl index 029ffc0..1cd2814 100644 --- a/config/cfgroot/network-functions.pl +++ b/config/cfgroot/network-functions.pl @@ -23,6 +23,8 @@
package Network;
+require "/var/ipfire/general-functions.pl"; + use Socket;
my %PREFIX2NETMASK = ( @@ -244,6 +246,31 @@ sub ip_address_in_network($$) { return (($address_bin ge $network_bin) && ($address_bin le $broadcast_bin)); }
+sub setup_upstream_proxy() { + my %proxysettings = (); + &General::readhash("${General::swroot}/proxy/settings", %proxysettings); + + if ($proxysettings{'UPSTREAM_PROXY'}) { + my $credentials = ""; + + if ($proxysettings{'UPSTREAM_USER'}) { + $credentials = $proxysettings{'UPSTREAM_USER'}; + + if ($proxysettings{'UPSTREAM_PASSWORD'}) { + $credentials .= ":" . $proxysettings{'UPSTREAM_PASSWORD'}; + } + + $credentials .= "@"; + } + + my $proxy = "http://" . $credentials . $proxysettings{'UPSTREAM_PROXY'}; + + $ENV{'http_proxy'} = $proxy; + $ENV{'https_proxy'} = $proxy; + $ENV{'ftp_proxy'} = $proxy; + } +} + 1;
# Remove the next line to enable the testsuite diff --git a/config/urlfilter/autoupdate.pl b/config/urlfilter/autoupdate.pl index fa6ec91..39b9b4f 100644 --- a/config/urlfilter/autoupdate.pl +++ b/config/urlfilter/autoupdate.pl @@ -8,6 +8,8 @@ # use strict;
+require "/var/ipfire/general-functions.pl"; + my $make_clean = 1;
my $swroot = "/var/ipfire"; @@ -72,6 +74,7 @@ unless ($blacklist_url eq '') if (-d $target) { system("rm -rf $target"); } system("mkdir $target");
+ &Network::setup_upstream_proxy(); system("/usr/bin/wget -o $target/wget.log -O $blacklist $blacklist_url");
if (-e $blacklist)
hooks/post-receive -- IPFire 2.x development tree