mirror of
https://github.com/sstent/containers.git
synced 2026-01-26 09:02:22 +00:00
first
This commit is contained in:
36
openpyn_alpine/Dockerfile
Normal file
36
openpyn_alpine/Dockerfile
Normal file
@@ -0,0 +1,36 @@
|
||||
|
||||
FROM alpine:latest
|
||||
|
||||
ENV OpenVPN-Client 1.0
|
||||
|
||||
RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing/" >> /etc/apk/repositories
|
||||
|
||||
RUN apk add openvpn unzip wget dante-server sudo expect iputils
|
||||
|
||||
RUN apk add --no-cache python3 && \
|
||||
python3 -m ensurepip && \
|
||||
rm -r /usr/lib/python*/ensurepip && \
|
||||
pip3 install --upgrade pip setuptools && \
|
||||
if [ ! -e /usr/bin/pip ]; then ln -s pip3 /usr/bin/pip ; fi && \
|
||||
if [[ ! -e /usr/bin/python ]]; then ln -sf /usr/bin/python3 /usr/bin/python; fi
|
||||
|
||||
ADD sockd.conf /etc/sockd.conf
|
||||
ADD sockd.sh /usr/local/bin/
|
||||
RUN chmod a+x /usr/local/bin/sockd.sh
|
||||
|
||||
|
||||
RUN pip3 install verboselogs
|
||||
RUN pip3 install --upgrade openpyn
|
||||
|
||||
WORKDIR /root
|
||||
ADD openpyn_init.exp .
|
||||
RUN expect openpyn_init.exp
|
||||
|
||||
|
||||
ADD run.sh /usr/local/bin/startup.sh
|
||||
RUN chmod a+x /usr/local/bin/startup.sh
|
||||
|
||||
EXPOSE 1080
|
||||
|
||||
ENTRYPOINT ["/bin/sh","/usr/local/bin/startup.sh"]
|
||||
|
||||
1
openpyn_alpine/README.md
Normal file
1
openpyn_alpine/README.md
Normal file
@@ -0,0 +1 @@
|
||||
[](http://droneci.service.dc1.consul/sstent/openpyn_alpine)
|
||||
2
openpyn_alpine/credentials
Normal file
2
openpyn_alpine/credentials
Normal file
@@ -0,0 +1,2 @@
|
||||
shapechecker@protonmail.com
|
||||
0okjU0CN1U4juKqs2OmQ
|
||||
11
openpyn_alpine/openpyn_init.exp
Normal file
11
openpyn_alpine/openpyn_init.exp
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
spawn /usr/bin/openpyn --init
|
||||
|
||||
expect "Enter your username for NordVPN"
|
||||
send "stuart.stent@gmail.com\r"
|
||||
|
||||
expect "Enter the password for NordVPN"
|
||||
send "drRp4mQBVU6awAFOk9lO\r"
|
||||
|
||||
expect "\[INFO\] To see usage options type"
|
||||
7
openpyn_alpine/run.sh
Normal file
7
openpyn_alpine/run.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -n "$VPNFLAGS" ]; then
|
||||
/usr/bin/openpyn ${VPNFLAGS} -o "--fast-io --cipher AES-128-GCM --mssfix 1431 --script-security 2 --up /usr/local/bin/sockd.sh"
|
||||
else
|
||||
/usr/bin/openpyn nl --max-load 70 --top-servers 10 --tcp --pings 5 -o "--cipher AES-128-GCM --mssfix 1431 --script-security 2 --up /usr/local/bin/sockd.sh"
|
||||
fi
|
||||
28
openpyn_alpine/sockd.conf
Normal file
28
openpyn_alpine/sockd.conf
Normal file
@@ -0,0 +1,28 @@
|
||||
debug: 0
|
||||
logoutput: stderr
|
||||
internal: 0.0.0.0 port = 1080
|
||||
external: tun0
|
||||
socksmethod: none
|
||||
clientmethod: none
|
||||
user.privileged: root
|
||||
user.unprivileged: nobody
|
||||
|
||||
client pass {
|
||||
from: 192.168.1.0/24 port 1-65535 to: 0.0.0.0/0
|
||||
#clientmethod: rfc931 # match all idented users that also are in passwordfile
|
||||
}
|
||||
|
||||
client pass {
|
||||
from: 172.0.0.0/8 port 1-65535 to: 0.0.0.0/0
|
||||
#clientmethod: rfc931 # match all idented users that also are in passwordfile
|
||||
}
|
||||
|
||||
|
||||
client pass {
|
||||
from: 127.0.0.0/8 port 1-65535 to: 0.0.0.0/0
|
||||
}
|
||||
|
||||
socks pass {
|
||||
from: 0.0.0.0/0 to: 0.0.0.0/0
|
||||
protocol: tcp udp
|
||||
}
|
||||
9
openpyn_alpine/sockd.sh
Normal file
9
openpyn_alpine/sockd.sh
Normal file
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
CFGFILE=/etc/sockd.conf
|
||||
PIDFILE=/tmp/sockd.pid
|
||||
WORKERS=10
|
||||
|
||||
/etc/openvpn/up.sh
|
||||
ip route add 192.168.1.0/24 via 172.17.0.1 dev eth0
|
||||
echo -e "nameserver 192.168.1.1\n$(cat /etc/resolv.conf)" > /etc/resolv.conf
|
||||
sockd -f $CFGFILE -p $PIDFILE -N $WORKERS &
|
||||
58
openpyn_alpine/update-resolv-conf.sh
Normal file
58
openpyn_alpine/update-resolv-conf.sh
Normal file
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Parses DHCP options from openvpn to update resolv.conf
|
||||
# To use set as 'up' and 'down' script in your openvpn *.conf:
|
||||
# up /etc/openvpn/update-resolv-conf
|
||||
# down /etc/openvpn/update-resolv-conf
|
||||
#
|
||||
# Used snippets of resolvconf script by Thomas Hood and Chris Hanson.
|
||||
# Licensed under the GNU GPL. See /usr/share/common-licenses/GPL.
|
||||
#
|
||||
# NordVPN DNS IPs:
|
||||
#
|
||||
foreign_option_1='dhcp-option DNS 103.86.99.100'
|
||||
foreign_option_2='dhcp-option DNS 103.86.96.100'
|
||||
foreign_option_3='dhcp-option DNS 208.67.222.220' #opendns
|
||||
#
|
||||
|
||||
[ -x /sbin/resolvconf ] || exit 0
|
||||
[ "$script_type" ] || exit 0
|
||||
[ "$dev" ] || exit 0
|
||||
|
||||
split_into_parts()
|
||||
{
|
||||
part1="$1"
|
||||
part2="$2"
|
||||
part3="$3"
|
||||
}
|
||||
|
||||
case "$script_type" in
|
||||
up)
|
||||
NMSRVRS=""
|
||||
SRCHS=""
|
||||
for optionvarname in ${!foreign_option_*} ; do
|
||||
option="${!optionvarname}"
|
||||
echo "$option"
|
||||
split_into_parts $option
|
||||
if [ "$part1" = "dhcp-option" ] ; then
|
||||
if [ "$part2" = "DNS" ] ; then
|
||||
NMSRVRS="${NMSRVRS:+$NMSRVRS }$part3"
|
||||
elif [ "$part2" = "DOMAIN" ] ; then
|
||||
SRCHS="${SRCHS:+$SRCHS }$part3"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
R=""
|
||||
[ "$SRCHS" ] && R="search $SRCHS
|
||||
"
|
||||
for NS in $NMSRVRS ; do
|
||||
R="${R}nameserver $NS
|
||||
"
|
||||
done
|
||||
echo -n "$R" | /sbin/resolvconf -a "${dev}.openvpn"
|
||||
/usr/local/bin/sockd.sh
|
||||
;;
|
||||
down)
|
||||
/sbin/resolvconf -d "${dev}.openvpn"
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user