-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add packages, env vars, and docker scripts
- Loading branch information
Showing
9 changed files
with
1,423 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
IMAGE_NAME=vpnproxy | ||
DOCKER_PREFIX=proxy | ||
VPN_USER=user | ||
VPN_PASS=pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
FROM alpine:3.7 | ||
|
||
EXPOSE 8118 | ||
|
||
RUN apk add --no-cache \ | ||
git bash supervisor python iptables \ | ||
openvpn privoxy | ||
|
||
# OpenVPN | ||
ADD config/openvpn/supervisord-openvpn.ini /etc/supervisor.d/supervisord-openvpn.ini | ||
ADD config/openvpn/openvpn-start.sh /usr/local/bin/ | ||
RUN chmod +x /usr/local/bin/openvpn-start.sh | ||
|
||
# Privoxy | ||
ADD config/privoxy/privoxy-start.sh /usr/local/bin/ | ||
ADD config/privoxy/supervisord-privoxy.ini /etc/supervisor.d/supervisord-privoxy.ini | ||
RUN sed -i'' 's/127\.0\.0\.1:8118/0\.0\.0\.0:8118/' /etc/privoxy/config && \ | ||
sed -i'' 's/enable-edit-actions\ 0/enable-edit-actions\ 1/' /etc/privoxy/config && \ | ||
sed -i'' 's/#max-client-connections/max-client-connections/' /etc/privoxy/config && \ | ||
sed -i'' 's/accept-intercepted-requests\ 0/accept-intercepted-requests\ 1/' /etc/privoxy/config | ||
RUN chmod +r /etc/privoxy/config && chmod +x /usr/local/bin/privoxy-start.sh | ||
|
||
CMD ["supervisord", "-n"] | ||
VOLUME [ "/ovpn" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
export $(egrep -v '^#' ../.env | xargs) | ||
|
||
PREFIX=${DOCKER_PREFIX:-proxy} | ||
|
||
docker build -t $PREFIX . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
printf "$VPN_USER\n$VPN_PASS" > auth.txt | ||
openvpn --config ovpn/$OVPN_FILE --auth-user-pass auth.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[program:openvpn] | ||
command=openvpn-start.sh | ||
numprocs=1 | ||
autostart=true | ||
autorestart=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh | ||
|
||
CONFFILE=/etc/privoxy/config | ||
PIDFILE=/var/run/privoxy.pid | ||
|
||
if [ ! -f "${CONFFILE}" ]; then | ||
echo "Configuration file ${CONFFILE} not found!" | ||
exit 1 | ||
fi | ||
|
||
/usr/sbin/privoxy --no-daemon --pidfile "${PIDFILE}" "${CONFFILE}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[program:privoxy] | ||
command=privoxy-start.sh | ||
numprocs=1 | ||
autostart=true | ||
autorestart=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"name": "vpn-proxy", | ||
"version": "1.0.0", | ||
"main": "index.js", | ||
"license": "MIT", | ||
"scripts": { | ||
"start": "node src/index.js", | ||
"build": "cd docker && ./build.sh" | ||
}, | ||
"dependencies": { | ||
"dockerode": "^2.5.8", | ||
"dotenv": "^6.2.0", | ||
"fs-extra": "^7.0.1", | ||
"http-proxy": "^1.17.0", | ||
"lodash": "^4.17.11" | ||
}, | ||
"devDependencies": { | ||
"prettier": "^1.16.4", | ||
"standard": "^12.0.1" | ||
} | ||
} |
Oops, something went wrong.