From: git@ipfire.org
To: ipfire-scm@lists.ipfire.org
Subject: [git.ipfire.org] IPFire 2.x development tree branch, next, updated. 5428eeeeaac1ecacbec2aecb9279cccd29e9c47d
Date: Tue, 16 Jun 2015 14:54:50 +0200 [thread overview]
Message-ID: <20150616125450.3861E2236E@argus.ipfire.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 3017 bytes --]
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(a)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(a)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
reply other threads:[~2015-06-16 12:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150616125450.3861E2236E@argus.ipfire.org \
--to=git@ipfire.org \
--cc=ipfire-scm@lists.ipfire.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox