You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+9-33
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,13 @@
1
1
# OpenVPN Client for Docker
2
2
## What is this and what does it do?
3
-
[`ghcr.io/wfg/openvpn-client`](https://github.com/users/wfg/packages/container/package/openvpn-client) is a containerized OpenVPN client.
3
+
This is a containerized OpenVPN client.
4
4
It has a kill switch built with `nftables` that kills Internet connectivity to the container if the VPN tunnel goes down for any reason.
5
-
It also includes an HTTP proxy server ([Tinyproxy](https://tinyproxy.github.io/)) and a SOCKS proxy server ([Dante](https://www.inet.no/dante/index.html)).
6
5
This allows hosts and non-containerized applications to use the VPN without having to run VPN clients on those hosts.
7
6
8
7
This image requires you to supply the necessary OpenVPN configuration file(s).
9
8
Because of this, any VPN provider should work.
10
9
11
-
If you find something that doesn't work or have an idea for a new feature, issues and **pull requests are welcome**.
10
+
*Contributions will not automatically be accepted for this fork. This fork is based on v3.1.0 of upstream.*
12
11
13
12
## Why?
14
13
Having a containerized VPN client lets you use container networking to easily choose which applications you want using the VPN instead of having to set up split tunnelling.
@@ -20,18 +19,18 @@ You can either pull it from GitHub Container Registry or build it yourself.
The image requires the container be created with the `NET_ADMIN` capability and `/dev/net/tun` accessible.
33
32
Below are bare-bones examples for `docker run` and Compose; however, you'll probably want to do more than just run the VPN client.
34
-
See the sections below to learn how to use the [proxies](#http_proxy-and-socks_proxy) and have [other containers use `openvpn-client`'s network stack](#using-with-other-containers).
33
+
See the sections below to learn how to have [other containers use `openvpn-client`'s network stack](#using-with-other-containers).
| `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. |
70
69
| `KILL_SWITCH` | `iptables` | Which packet filterer to use for the kill switch. This value likely depends on your underlying host. Recommended to leave default unless you have problems. Acceptable values are `iptables` and `nftables`. To disable the kill switch, set to any other value. |
71
-
| `HTTP_PROXY` | | Whether or not to enable the built-in HTTP proxy server. To enable, set to any "truthy" value (see below the table). Any other value (including unset) will cause the proxy server to not run. It listens on port 8080. |
72
-
| `HTTP_PROXY_USERNAME` | | Credentials for accessing the HTTP proxy. If `HTTP_PROXY_USERNAME` is specified, you should also specify `HTTP_PROXY_PASSWORD`. |
73
-
| `HTTP_PROXY_PASSWORD` | | Credentials for accessing the HTTP proxy. If `HTTP_PROXY_PASSWORD` is specified, you should also specify `HTTP_PROXY_USERNAME`. |
74
-
| `HTTP_PROXY_USERNAME_SECRET` | | Docker secrets that contain the credentials for accessing the HTTP proxy. If `HTTP_PROXY_USERNAME_SECRET` is specified, you should also specify `HTTP_PROXY_PASSWORD_SECRET`. |
75
-
| `HTTP_PROXY_PASSWORD_SECRET` | | Docker secrets that contain the credentials for accessing the HTTP proxy. If `HTTP_PROXY_PASSWORD_SECRET` is specified, you should also specify `HTTP_PROXY_USERNAME_SECRET`. |
76
-
| `SOCKS_PROXY` | | Whether or not to enable the built-in SOCKS proxy server. To enable, set to any "truthy" value (see below the table). Any other value (including unset) will cause the proxy server to not run. It listens on port 1080. |
77
-
| `SOCKS_LISTEN_ON` | | Address the proxies will be listening on. Set to `0.0.0.0` to listen on all IP addresses. |
78
-
| `SOCKS_PROXY_USERNAME` | | Credentials for accessing the proxies. If `SOCKS_PROXY_USERNAME` is specified, you should also specify `SOCKS_PROXY_PASSWORD`. |
79
-
| `SOCKS_PROXY_PASSWORD` | | Credentials for accessing the proxies. If `SOCKS_PROXY_PASSWORD` is specified, you should also specify `SOCKS_PROXY_USERNAME`. |
80
-
| `SOCKS_PROXY_USERNAME_SECRET` | | Docker secrets that contain the credentials for accessing the proxies. If `SOCKS_PROXY_USERNAME_SECRET` is specified, you should also specify `SOCKS_PROXY_PASSWORD_SECRET`. |
81
-
| `SOCKS_PROXY_PASSWORD_SECRET` | | Docker secrets that contain the credentials for accessing the proxies. If `SOCKS_PROXY_PASSWORD_SECRET` is specified, you should also specify `SOCKS_PROXY_USERNAME_SECRET`. |
82
-
"Truthy"values are the following: `true`, `t`, `yes`, `y`, `1`, `on`, `enable`, or `enabled`.
83
-
84
-
##### Environment variable considerations
85
-
###### `HTTP_PROXY` and `SOCKS_PROXY`
86
-
If enabling the the proxy server(s), you'll want to publish the appropriate port(s) in order to access the server(s).
87
-
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.
88
-
If you're using `docker-compose`, add the relevant port specification(s) from the snippet below to the `openvpn-client` service definition in your Compose file.
89
-
```yaml
90
-
ports:
91
-
- <host_port>:8080
92
-
- <host_port>:1080
93
-
```
94
70
95
-
##### `*_PROXY_USERNAME_SECRET`, `*_PROXY_PASSWORD_SECRET`, and `VPN_AUTH_SECRET`
71
+
##### `VPN_AUTH_SECRET`
96
72
Compose has support for [Docker secrets](https://docs.docker.com/engine/swarm/secrets/#use-secrets-in-compose).
97
73
See the [Compose file](docker-compose.yml) in this repository for example usage of passing proxy credentials as Docker secrets.
98
74
@@ -118,7 +94,7 @@ ports:
118
94
In both cases, replace `<host_port>` and `<container_port>` with the port used by your connected container.
119
95
120
96
### Verifying functionality
121
-
Once you have container running `ghcr.io/wfg/openvpn-client`, run the following command to spin up a temporary container using `openvpn-client` for networking.
97
+
Once you have container running `ghcr.io/RosemanLabs/openvpn-client`, run the following command to spin up a temporary container using `openvpn-client` for networking.
122
98
The `wget -qO - ifconfig.me` bit will return the public IP of the container (and anything else using `openvpn-client` for networking).
123
99
You should see an IP address owned by your VPN provider.
0 commit comments