From 8d0a1143fd2a8ad81965ad32984cd48a8988f2ea Mon Sep 17 00:00:00 2001 From: kev Date: Mon, 29 Jun 2015 10:43:41 +0800 Subject: [PATCH] update --- privoxy/Dockerfile | 7 +++---- privoxy/README.md | 6 ++++++ privoxy/privoxy/user.action | 6 ++++++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/privoxy/Dockerfile b/privoxy/Dockerfile index 512a230..3b01c1b 100644 --- a/privoxy/Dockerfile +++ b/privoxy/Dockerfile @@ -18,10 +18,9 @@ RUN sed -i -e '/^listen-address/s/127.0.0.1/0.0.0.0/' \ VOLUME /etc/privoxy EXPOSE 8118 -CMD iptables -A INPUT -s 127.0.0.1 -d 127.0.0.1 -j REJECT \ - && iptables -A INPUT -s $(ip a s eth0 | grep -w inet | awk '{print $2}' | cut -d/ -f1) \ - -d $(ip a s eth0 | grep -w inet | awk '{print $2}' | cut -d/ -f1) \ - -j REJECT \ +CMD echo "{+block}" >> /etc/privoxy/user.action \ + && ip a s eth0 | grep -w inet | awk '{print $2}' | cut -d/ -f1 >> /etc/privoxy/user.action \ + && ip r s | grep default | awk '{print $3}' >> /etc/privoxy/user.action \ && iptables -t filter -P OUTPUT DROP \ && iptables -t filter -A OUTPUT -p udp --dport 53 -j ACCEPT \ && iptables -t filter -A OUTPUT -p tcp \ diff --git a/privoxy/README.md b/privoxy/README.md index 2f3d27e..f34205d 100644 --- a/privoxy/README.md +++ b/privoxy/README.md @@ -40,6 +40,12 @@ file: user.action ``` {+filter{rot}} / + +{+block} +127.0.0.1 +104.156.239.190 +.datageek.info + ``` file: user.filter diff --git a/privoxy/privoxy/user.action b/privoxy/privoxy/user.action index 3f63b22..36cc58e 100644 --- a/privoxy/privoxy/user.action +++ b/privoxy/privoxy/user.action @@ -1,2 +1,8 @@ {+filter{rot}} / + +{+block} +127.0.0.1 +104.156.239.190 +.datageek.info +