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

Commit f9eb4af

Browse files
committed
Clean up docs and normalize variable names (closes #31)
1 parent 2461375 commit f9eb4af

File tree

2 files changed

+14
-19
lines changed

2 files changed

+14
-19
lines changed

README.md

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ docker run --detach \
4343
--name=openvpn-client \
4444
--cap-add=NET_ADMIN \
4545
--device=/dev/net/tun \
46-
--env KILL_SWITCH=off \
4746
--volume <path/to/config/dir>:/data/vpn \
4847
ghcr.io/wfg/openvpn-client
4948
```
@@ -58,32 +57,28 @@ services:
5857
- NET_ADMIN
5958
devices:
6059
- /dev/net/tun
61-
environment:
62-
- KILL_SWITCH=off
6360
volumes:
6461
- <path/to/config/dir>:/data/vpn
6562
restart: unless-stopped
6663
```
6764
68-
#### Environment variables
65+
#### Environment variables (alphabetical)
6966
| Variable | Default (blank is unset) | Description |
7067
| --- | --- | --- |
71-
| `KILL_SWITCH` | `on` | The on/off status of the network kill switch. |
72-
| `SUBNETS` | | A list of one or more comma-separated subnets (e.g. `192.168.0.0/24,192.168.1.0/24`) to allow outside of the VPN tunnel. See important note about this [below](#subnets). |
73-
| `VPN_CONFIG_FILE` | | The OpenVPN config file to use. If this is unset, the first file with the extension .conf will be used. |
74-
| `VPN_LOG_LEVEL` | `3` | OpenVPN verbosity (`1`-`11`) |
7568
| `HTTP_PROXY` | `off` | The on/off status of Tinyproxy, the built-in HTTP proxy server. To enable, set to `on`. Any other value (including unset) will cause the proxy server to not start. It listens on port 8080. |
76-
| `SOCKS_PROXY` | `off` | The on/off status of Dante, the built-in SOCKS proxy server. To enable, set to `on`. Any other value (including unset) will cause the proxy server to not start. It listens on port 1080. |
77-
| `PROXY_USERNAME` | | Credentials for accessing the proxies. If `PROXY_USERNAME` is specified, you must also specify `PROXY_PASSWORD`. |
69+
| `KILL_SWITCH` | `on` | The on/off status of the network kill switch. |
70+
| `LISTEN_ON` | | Address the proxies will be listening on. Set to `0.0.0.0` to listen on all IP addresses. |
7871
| `PROXY_PASSWORD` | | Credentials for accessing the proxies. If `PROXY_PASSWORD` is specified, you must also specify `PROXY_USERNAME`. |
79-
| `PROXY_USERNAME_SECRET` | | Docker secrets that contain the credentials for accessing the proxies. If `PROXY_USERNAME_SECRET` is specified, you must also specify `PROXY_PASSWORD_SECRET`. |
8072
| `PROXY_PASSWORD_SECRET` | | Docker secrets that contain the credentials for accessing the proxies. If `PROXY_PASSWORD_SECRET` is specified, you must also specify `PROXY_USERNAME_SECRET`. |
81-
| `LISTEN_ON` | | Address the proxies will be listening on. Set to `0.0.0.0` to allow all IP addresses. |
73+
| `PROXY_USERNAME` | | Credentials for accessing the proxies. If `PROXY_USERNAME` is specified, you must also specify `PROXY_PASSWORD`. |
74+
| `PROXY_USERNAME_SECRET` | | Docker secrets that contain the credentials for accessing the proxies. If `PROXY_USERNAME_SECRET` is specified, you must also specify `PROXY_PASSWORD_SECRET`. |
75+
| `SOCKS_PROXY` | `off` | The on/off status of Dante, the built-in SOCKS proxy server. To enable, set to `on`. Any other value (including unset) will cause the proxy server to not start. It listens on port 1080. |
76+
| `SUBNETS` | | A list of one or more comma-separated subnets (e.g. `192.168.0.0/24,192.168.1.0/24`) to allow outside of the VPN tunnel. |
77+
| `VPN_AUTH_SECRET` | | Docker secret that contain the credentials for accessing the VPN. |
78+
| `VPN_CONFIG_FILE` | | The OpenVPN config file to use. If this is unset, the first file with the extension .conf will be used. |
79+
| `VPN_LOG_LEVEL` | `3` | OpenVPN verbosity (`1`-`11`) |
8280

8381
##### Environment variable considerations
84-
###### `SUBNETS`
85-
The specified subnets will be allowed through the firewall to allow for connectivity to and from hosts on the subnets.
86-
8782
###### `HTTP_PROXY` and `SOCKS_PROXY`
8883
If enabling the the proxy server(s), you'll want to publish the appropriate port(s) in order to access the server(s).
8984
To do that using `docker run`, add `-p <host_port>:8080` and/or `-p <host_port>:1080` where `<host_port>` is whatever port you want to use on the host.
@@ -94,7 +89,7 @@ ports:
9489
- <host_port>:1080
9590
```
9691

97-
###### `PROXY_USERNAME_SECRET` and `PROXY_PASSWORD_SECRET`
92+
###### `PROXY_USERNAME_SECRET`, `PROXY_PASSWORD_SECRET`, and `VPN_AUTH_SECRET`
9893
Compose has support for [Docker secrets](https://docs.docker.com/engine/swarm/secrets/#use-secrets-in-compose).
9994
See the [Compose file](docker-compose.yml) in this repository for example usage of passing proxy credentials as Docker secrets.
10095

data/scripts/entry.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,10 @@ openvpn_args=(
209209
"--verb" "$vpn_log_level"
210210
)
211211

212-
if [[ -n "$OPENVPN_AUTH_SECRET" ]]; then
213-
if [[ -f "/run/secrets/$OPENVPN_AUTH_SECRET" ]]; then
212+
if [[ -n "$VPN_AUTH_SECRET" ]]; then
213+
if [[ -f "/run/secrets/$VPN_AUTH_SECRET" ]]; then
214214
echo "Configuring OpenVPN authentication."
215-
openvpn_args+=("--auth-user-pass" "/run/secrets/$OPENVPN_AUTH_SECRET")
215+
openvpn_args+=("--auth-user-pass" "/run/secrets/$VPN_AUTH_SECRET")
216216
else
217217
echo "WARNING: OpenVPN credentials secrets not present."
218218
fi

0 commit comments

Comments
 (0)