add proxy support
This commit is contained in:
13
images/privoxy/Dockerfile
Normal file
13
images/privoxy/Dockerfile
Normal file
@@ -0,0 +1,13 @@
|
||||
FROM alpine:3.14
|
||||
|
||||
ARG REMOTEEXEC_ADDR
|
||||
|
||||
COPY user.action .
|
||||
COPY privoxy.conf .
|
||||
COPY start-proxy.sh .
|
||||
|
||||
RUN apk update && apk add privoxy bash sudo socat
|
||||
|
||||
CMD sudo chmod +x ./start-proxy.sh &&\
|
||||
REMOTEEXEC_ADDR=$REMOTEEXEC_ADDR &&\
|
||||
./start-proxy.sh
|
18
images/privoxy/privoxy.conf
Normal file
18
images/privoxy/privoxy.conf
Normal file
@@ -0,0 +1,18 @@
|
||||
#confdir /etc/privoxy
|
||||
logdir /var/log/privoxy
|
||||
|
||||
#listen-address 127.0.0.1:8118
|
||||
listen-address 0.0.0.0:8118
|
||||
|
||||
debug 1024
|
||||
#debug 32768 # log all data read from the network
|
||||
#debug 65536 # Log the applying actions
|
||||
|
||||
toggle 1
|
||||
enable-remote-toggle 0
|
||||
enable-edit-actions 1
|
||||
enable-remote-http-toggle 0
|
||||
enforce-blocks 1
|
||||
|
||||
actionsfile user.action
|
||||
|
12
images/privoxy/start-proxy.sh
Normal file
12
images/privoxy/start-proxy.sh
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
test -e /tmp/forward-proxy/proxy.sock && sudo rm /tmp/forward-proxy/proxy.sock
|
||||
test -e /tmp/proxy/bots.sock && sudo rm /tmp/proxy/bots.sock
|
||||
|
||||
socat UNIX-LISTEN:/tmp/forward-proxy/proxy.sock,reuseaddr,fork TCP:127.0.0.1:8118 &
|
||||
socat UNIX-LISTEN:/tmp/proxy/bots.sock,reuseaddr,fork TCP4:$REMOTEEXEC_ADDR &
|
||||
|
||||
sudo chmod 777 /tmp/forward-proxy/proxy.sock
|
||||
sudo chmod 777 /tmp/proxy/bots.sock
|
||||
|
||||
privoxy --no-daemon privoxy.conf
|
20
images/privoxy/user.action
Normal file
20
images/privoxy/user.action
Normal file
@@ -0,0 +1,20 @@
|
||||
{ +block{blocked} }
|
||||
/ # Block all URLs
|
||||
|
||||
{ -block }
|
||||
.github.com
|
||||
.docker.io
|
||||
.docker.com
|
||||
.githubusercontent.com
|
||||
.ubuntu.com
|
||||
|
||||
# for buildeps
|
||||
chromium.googlesource.com
|
||||
|
||||
# for chr-source
|
||||
chrome-infra-packages.appspot.com
|
||||
.googleapis.com
|
||||
.googlesource.com
|
||||
|
||||
# for goma client
|
||||
chrome-infra-packages.appspot.com
|
Reference in New Issue
Block a user