add proxy support

This commit is contained in:
uazo
2021-07-31 10:06:38 +00:00
parent 5f239bfb4c
commit 532a0475bf
9 changed files with 84 additions and 7 deletions

13
images/privoxy/Dockerfile Normal file
View 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

View 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

View 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

View 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