From c0827d070ac95300b19854a4a623ed8f15b2d3b3 Mon Sep 17 00:00:00 2001 From: Aleksey Spiridonov Date: Fri, 3 Dec 2021 12:34:57 +0400 Subject: [PATCH 1/5] Added ability for changing VPN subnet --- bin/run | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bin/run b/bin/run index c7939fe..9ba1f08 100755 --- a/bin/run +++ b/bin/run @@ -1,4 +1,7 @@ #!/bin/sh + +VPN_SUBNET="${SUBNET:-192.168.255}" # You can override subnet of VPN + set -e [ -d /dev/net ] || @@ -20,7 +23,7 @@ chmod 600 key.pem openssl x509 -req -in csr.pem -out cert.pem -signkey key.pem -days 24855 [ -f tcp443.conf ] || cat >tcp443.conf <udp1194.conf <> tcp443.log & From b8f2cdb22c26b18b34d81d1f3627ea989f27890f Mon Sep 17 00:00:00 2001 From: Aleksey Spiridonov Date: Fri, 3 Dec 2021 12:58:15 +0400 Subject: [PATCH 2/5] Updated README --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ed208cd..a23002c 100644 --- a/README.md +++ b/README.md @@ -63,8 +63,9 @@ is rooted. The topology used is `net30`, because it works on the widest range of OS. `p2p`, for instance, does not work on Windows. -The TCP server uses `192.168.255.0/25` and the UDP server uses -`192.168.255.128/25`. +The TCP by default server uses `192.168.255.0/25` and the UDP server uses +`192.168.255.128/25`. You can override subnet (three octets, for now you can't override mask) by `SUBNET` variable. +For example `docker run -d --privileged -p 1194:1194/udp -p 443:443/tcp -e SUBNET=192.168.13 jpetazzo/dockvpn` The client profile specifies `redirect-gateway def1`, meaning that after establishing the VPN connection, all traffic will go through the VPN. From 4234f8843d8dd7d4538a1f96716a67c6f1bb9ed9 Mon Sep 17 00:00:00 2001 From: Aleksey Spiridonov Date: Wed, 13 Sep 2023 15:40:43 +0400 Subject: [PATCH 3/5] Update Ubuntu to 22.04 LTS --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a4c2c43..a9a32df 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:focal +FROM ubuntu:jammy RUN apt-get update -q RUN apt-get install -qy openvpn iptables socat curl ADD ./bin /usr/local/sbin From 1d71c8a846affe43b30d0909ef6fac41778d764f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Petazzoni?= Date: Tue, 26 Sep 2023 16:05:38 +0200 Subject: [PATCH 4/5] Add automated build + warning in README --- .github/workflows/automated-build.yaml | 21 +++++++++++++++++++++ README.md | 11 +++++++++++ 2 files changed, 32 insertions(+) create mode 100644 .github/workflows/automated-build.yaml diff --git a/.github/workflows/automated-build.yaml b/.github/workflows/automated-build.yaml new file mode 100644 index 0000000..b05d760 --- /dev/null +++ b/.github/workflows/automated-build.yaml @@ -0,0 +1,21 @@ +name: Automated Build + +on: + # workflow_dispatch is optional. + # It lets you trigger the workflow manually from GitHub's web UI. + workflow_dispatch: + push: + branches: + - master + # Or, to build on tag pushes : + #tags: + # - '*' + +jobs: + automated-build: + uses: jpetazzo/workflows/.github/workflows/automated-build.yaml@main + secrets: + DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }} + with: + #DOCKER_HUB_USERNAME: myuser + PLATFORMS: linux/amd64,linux/arm64 diff --git a/README.md b/README.md index a23002c..495a293 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,14 @@ +# ⚠️ WARNING + +This repository is quite old, and it's likely that there are better +alternatives these days. The original author (@jpetazzo) is not +maintaining it anymore, and cannot provide help or support with it. +That being said, if you feel brave, feel free to try it; but keep +in mind that it hasn't received significant updates since 2016. + +Thank you! + + # OpenVPN for Docker Quick instructions: From 06bef41f1b24b283b0a0789463d11ee33b7db9fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Petazzoni?= Date: Mon, 6 Nov 2023 19:47:33 +0100 Subject: [PATCH 5/5] Tweak README and comments adding the SUBNET env var --- README.md | 16 +++++++++++++--- bin/run | 3 ++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 495a293..2e82042 100644 --- a/README.md +++ b/README.md @@ -74,9 +74,19 @@ is rooted. The topology used is `net30`, because it works on the widest range of OS. `p2p`, for instance, does not work on Windows. -The TCP by default server uses `192.168.255.0/25` and the UDP server uses -`192.168.255.128/25`. You can override subnet (three octets, for now you can't override mask) by `SUBNET` variable. -For example `docker run -d --privileged -p 1194:1194/udp -p 443:443/tcp -e SUBNET=192.168.13 jpetazzo/dockvpn` +The TCP server uses `192.168.255.0/25` and the UDP server uses +`192.168.255.128/25`. However, you can change these subnets by +setting the `SUBNET` environment variable. Note that at the moment, +you can only specify the first three octets of the subnet, and +the TCP and UDP servers will use the lower /25 and upper /25 +subnets respectively. + +For instance, you can do: + +```bash +docker run -d --privileged -p 1194:1194/udp -p 443:443/tcp \ + -e SUBNET=192.168.13 jpetazzo/dockvpn +``` The client profile specifies `redirect-gateway def1`, meaning that after establishing the VPN connection, all traffic will go through the VPN. diff --git a/bin/run b/bin/run index 9ba1f08..13f5fad 100755 --- a/bin/run +++ b/bin/run @@ -1,6 +1,7 @@ #!/bin/sh -VPN_SUBNET="${SUBNET:-192.168.255}" # You can override subnet of VPN +# The subnet can be overridden with an environment variable +VPN_SUBNET="${SUBNET:-192.168.255}" set -e