Skip to content
This repository was archived by the owner on Mar 16, 2024. It is now read-only.

Commit b34c2c5

Browse files
author
yacht7
committed
Update packages, tidy script
1 parent f2108a7 commit b34c2c5

File tree

5 files changed

+68
-7
lines changed

5 files changed

+68
-7
lines changed

.dockerignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.git
22
.gitignore
3-
README.md
3+
packages.txt
4+
README.md

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ RUN \
1414
tinyproxy
1515

1616
RUN \
17-
mkdir -p /data/vpn /var/log/openvpn && \
17+
mkdir -p /data/vpn && \
1818
addgroup -S shadowsocks && \
1919
adduser -S -G shadowsocks -g "shadowsocks user" -H -h /dev/null shadowsocks
2020

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# OpenVPN Client for Docker
22
## What is this and what does it do?
3-
[`yacht7/openvpn-client`](https://hub.docker.com/r/yacht7/openvpn-client) is a containerized OpenVPN client. It has a kill switch built with `iptables` that kills Internet connectivity to the container if the VPN tunnel goes down for any reason. It also includes two types of proxy: HTTP (Tinyproxy) and SOCKS5 (Shadowsocks). These allow hosts and non-containerized applications to use the VPN without having to run VPN clients on every host.
3+
[`yacht7/openvpn-client`](https://hub.docker.com/r/yacht7/openvpn-client) is a containerized OpenVPN client. It has a kill switch built with `iptables` that kills Internet connectivity to the container if the VPN tunnel goes down for any reason. It also includes two types of proxy: HTTP (Tinyproxy) and SOCKS5 (Shadowsocks). These allow hosts and non-containerized applications to use the VPN without having to run VPN clients on those hosts.
44

55
This image requires you to supply the necessary OpenVPN configuration file(s). Because of this, any VPN provider should work (however, if you find something that doesn't, please open an issue for it).
66

@@ -31,7 +31,7 @@ docker run -d \
3131
--name=openvpn-client \
3232
--cap-add=NET_ADMIN \
3333
--device=/dev/net/tun \
34-
-v <path/to/config>:/data/vpn
34+
-v <path/to/config>:/data/vpn \
3535
yacht7/openvpn-client
3636
```
3737

data/scripts/entry.sh

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
cleanup() {
3+
function cleanup {
44
# When you run `docker stop` or any equivalent, a SIGTERM signal is sent to PID 1.
55
# A process running as PID 1 inside a container is treated specially by Linux:
66
# it ignores any signal with the default action. As a result, the process will
@@ -64,7 +64,10 @@ echo -e "Changes made.\n"
6464

6565
trap cleanup INT TERM
6666

67-
if [ $KILL_SWITCH = "on" ]; then
67+
# NOTE: When testing with the kill switch enabled, don't forget to pass in the
68+
# local subnet. It will save a lot of headache.
69+
70+
if [ $KILL_SWITCH = "on" ]; then
6871
local_subnet=$(ip r | grep -v 'default via' | grep eth0 | tail -n 1 | cut -d " " -f 1)
6972
default_gateway=$(ip r | grep 'default via' | cut -d " " -f 3)
7073

@@ -160,7 +163,14 @@ fi
160163

161164
echo -e "Running OpenVPN client.\n"
162165

163-
openvpn --auth-nocache --config $config_file_modified --verb $vpn_log_level --cd /data/vpn --pull-filter ignore "route-ipv6" --pull-filter ignore "ifconfig-ipv6" --up-restart &
166+
openvpn --config $config_file_modified \
167+
--verb $vpn_log_level \
168+
--auth-nocache \
169+
--connect-retry-max 10 \
170+
--pull-filter ignore "route-ipv6" \
171+
--pull-filter ignore "ifconfig-ipv6" \
172+
--up-restart \
173+
--cd /data/vpn &
164174
openvpn_child=$!
165175

166176
wait $openvpn_child

packages.txt

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
tinyproxy-1.10.0-r3 x86_64 {tinyproxy} (GPL-2.0-or-later) [installed]
2+
libsodium-1.0.18-r0 x86_64 {libsodium} (ISC) [installed]
3+
json-c-0.14-r1 x86_64 {json-c} (MIT) [installed]
4+
libprotoc-3.12.2-r0 x86_64 {protobuf} (BSD-3-Clause) [installed]
5+
krb5-libs-1.18.2-r0 x86_64 {krb5} (MIT) [installed]
6+
libuv-1.37.0-r0 x86_64 {libuv} (MIT AND ISC) [installed]
7+
mbedtls-2.16.6-r0 x86_64 {mbedtls} (Apache-2.0) [installed]
8+
musl-1.1.24-r8 x86_64 {musl} (MIT) [installed]
9+
fstrm-0.6.0-r1 x86_64 {fstrm} (MIT) [installed]
10+
libbz2-1.0.8-r1 x86_64 {bzip2} (bzip2-1.0.6) [installed]
11+
libcom_err-1.45.6-r0 x86_64 {e2fsprogs} (GPL-2.0-or-later AND LGPL-2.0-or-later AND BSD-3-Clause AND MIT) [installed]
12+
bind-tools-9.16.6-r0 x86_64 {bind} (MPL-2.0) [installed]
13+
pcre-8.44-r0 x86_64 {pcre} (BSD-3-Clause) [installed]
14+
libstdc++-9.3.0-r2 x86_64 {gcc} (GPL-2.0-or-later LGPL-2.1-or-later) [installed]
15+
zlib-1.2.11-r3 x86_64 {zlib} (Zlib) [installed]
16+
keyutils-libs-1.6.1-r1 x86_64 {keyutils} (GPL-2.0-or-later LGPL-2.0-or-later) [installed]
17+
libprotobuf-3.12.2-r0 x86_64 {protobuf} (BSD-3-Clause) [installed]
18+
apk-tools-2.10.5-r1 x86_64 {apk-tools} (GPL-2.0-only) [installed]
19+
iptables-1.8.4-r2 x86_64 {iptables} (GPL-2.0-or-later) [installed]
20+
musl-utils-1.1.24-r8 x86_64 {musl} (MIT BSD GPL2+) [installed]
21+
libssl1.1-1.1.1g-r0 x86_64 {openssl} (OpenSSL) [installed]
22+
alpine-baselayout-3.2.0-r6 x86_64 {alpine-baselayout} (GPL-2.0-only) [installed]
23+
libelf-0.179-r0 x86_64 {elfutils} (GPL-3.0-or-later and (GPL-2.0-or-later or LGPL-3.0-or-later)) [installed]
24+
libev-4.33-r0 x86_64 {libev} (BSD-2-Clause OR GPL-2.0-or-later) [installed]
25+
xz-libs-5.2.5-r0 x86_64 {xz} (GPL-2.0-or-later AND Public-Domain AND LGPL-2.1-or-later) [installed]
26+
libxml2-2.9.10-r4 x86_64 {libxml2} (MIT) [installed]
27+
protobuf-c-1.3.3-r1 x86_64 {protobuf-c} (BSD-2-Clause) [installed]
28+
libverto-0.3.1-r1 x86_64 {libverto} (MIT) [installed]
29+
libgcc-9.3.0-r2 x86_64 {gcc} (GPL-2.0-or-later LGPL-2.1-or-later) [installed]
30+
c-ares-1.16.1-r0 x86_64 {c-ares} (MIT) [installed]
31+
openvpn-2.4.9-r0 x86_64 {openvpn} (custom) [installed]
32+
lzo-2.10-r2 x86_64 {lzo} (GPL) [installed]
33+
fts-1.2.7-r1 x86_64 {fts} (BSD-3-Clause) [installed]
34+
alpine-keys-2.2-r0 x86_64 {alpine-keys} (MIT) [installed]
35+
busybox-1.31.1-r16 x86_64 {busybox} (GPL-2.0-only) [installed]
36+
scanelf-1.2.6-r0 x86_64 {pax-utils} (GPL-2.0-only) [installed]
37+
bind-libs-9.16.6-r0 x86_64 {bind} (MPL-2.0) [installed]
38+
libnftnl-libs-1.1.6-r0 x86_64 {libnftnl} (GPL-2.0-or-later) [installed]
39+
libmnl-1.0.4-r0 x86_64 {libmnl} (GPL) [installed]
40+
ca-certificates-bundle-20191127-r2 x86_64 {ca-certificates} (MPL-2.0 GPL-2.0-or-later) [installed]
41+
libc-utils-0.7.2-r3 x86_64 {libc-dev} (BSD-2-Clause AND BSD-3-Clause) [installed]
42+
shadowsocks-libev-3.3.4-r0 x86_64 {shadowsocks-libev} (GPL-3.0-or-later) [installed]
43+
iproute2-5.6.0-r0 x86_64 {iproute2} (GPL-2.0-or-later) [installed]
44+
libcork-0.15.0-r1 x86_64 {libcork} (BSD-3-Clause) [installed]
45+
libtls-standalone-2.9.1-r1 x86_64 {libtls-standalone} (ISC) [installed]
46+
ssl_client-1.31.1-r16 x86_64 {busybox} (GPL-2.0-only) [installed]
47+
krb5-conf-1.0-r2 x86_64 {krb5-conf} (MIT) [installed]
48+
libbloom-1.6-r1 x86_64 {libbloom} (BSD-2-Clause) [installed]
49+
libcorkipset-1.1.1-r0 x86_64 {libcorkipset} (BSD-3-Clause) [installed]
50+
libcrypto1.1-1.1.1g-r0 x86_64 {openssl} (OpenSSL) [installed]

0 commit comments

Comments
 (0)