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
[](https://microbadger.com/images/slocomptech/openvpn"Get your own version badge on microbadger.com")[](https://microbadger.com/images/slocomptech/openvpn"Get your own image badge on microbadger.com")[](https://microbadger.com/images/slocomptech/openvpn"Get your own commit badge on microbadger.com")
4
5
5
6
Features:
6
7
7
-
- OpenVPN is running as non-root user, soo it has limited permission.
8
-
-OpenVPN is running in isolated environment (container) so you don't break it with updates, upgrades of your PC.
9
-
- Easy managed (has helper scripts).
8
+
- OpenVPN running as non-root user (limited permission)
9
+
-Containerized (Isolated environment)
10
+
- Easy managed (Helper scripts).
10
11
- Easy start (Simple first-start guide).
11
12
- Easly modified to your needs (see [docs](CONTRIBUTING.md)).
12
13
- Easy scripting (python3 installed).
13
14
14
15
## Usage
15
16
17
+
Here are some example snippets to help you get started creating a container.
18
+
16
19
### docker
17
20
18
21
```bash
19
-
22
+
# Normal start command (but you need to setup config first)
23
+
docker run \
24
+
--name=ovpn \
25
+
--cap-add NET_ADMIN \
26
+
-e PUID=1000 \
27
+
-e GUID=1000 \
28
+
-p 1194:1194/udp \
29
+
-v </path/o/config>:/config \
30
+
--restart=unless-stopped \
31
+
--network host \
32
+
slocomptech/openvpn:latest
20
33
```
21
34
22
35
### docker-compose
@@ -29,6 +42,9 @@ Features:
29
42
30
43
|**Parameter**|**Function**|
31
44
|:-----------:|:----------:|
45
+
|`-e PUID=1000`|for UserID - see below for explanation|
46
+
|`-e PGID=1000`|for GroupID - see below for explanation|
47
+
|`-v /config`|All the config files including OpenVPNs reside here|
32
48
33
49
## User / Group Identifiers
34
50
@@ -45,29 +61,56 @@ In this instance `PUID=1000` and `PGID=1000`, to find yours use `id user` as bel
45
61
46
62
## Application setup
47
63
48
-
```bash
49
-
# Setup config directory
50
-
sudo docker run -v <Config on Host>:/config --rm -it slocomptech/docker-openvpn bash
51
-
$ ovpn_init
52
-
# Here will ask for password for CA (needed for signing new certificates) (add nopass if you dont want to set password)
53
-
# Enable basic example as config & edit /config/openvpn/server/server_*.conf & /config/openvpn/client_*.conf
54
-
$ ovpn_enconf basic1
55
-
# Or put your own server config in /config/openvpn/server & client template (without certs) to /config/openvpn/client
56
-
# To add client (generate certificates)
57
-
$ ovpn_client add <name> [nopass]
58
-
# To build .ovpn file
59
-
$ ovpn_client ovpn <name>><file>
60
-
# Or from outside of docker (currently not working yet)
|`ovpn_enconf`|Enables OpenVPN config from examples|
21
+
|`ovpn_init`|Inits PKI|
22
+
23
+
#### ovpn_backup
24
+
25
+
This command backups your configration into *.tar.gz* archive and puts it into `/config/backup` directory.
26
+
27
+
```
28
+
Usage: ovpn_backup COMMAND
29
+
30
+
Commands:
31
+
all # Backup whole config directory"
32
+
pki # Backup PKI files"
33
+
hooks # Backup hooks"
34
+
openvpn # Backup openvpn live config"
35
+
```
36
+
37
+
**Note:** Store your backups in a **SECURE** way, because they are unecrypted.
38
+
39
+
#### ovpn_client
40
+
41
+
This commands manages clients of your OpenVPN server.
42
+
43
+
```
44
+
Usage: ovpn_client COMMAND [ARGS]
45
+
46
+
Commands:
47
+
add [NAME [nopass]] # Creates certificates for client
48
+
ovpn NAME # Builds .ovpn file
49
+
revoke|ban|delete|remove NAME # Removes client
50
+
```
51
+
52
+
**Note:** First you need to use `add` to create client certificates, before you can use `ovpn` command.
53
+
54
+
#### ovpn_disconf
55
+
56
+
This command deletes your active configuration. **Container restart** is needed for changes to take affect.
57
+
58
+
```
59
+
Usage: ovpn_disconf
60
+
```
61
+
62
+
**NOTE:** This command does not delete PKI.
63
+
64
+
#### ovpn_enconf
65
+
66
+
This command enables OpenVPN config based on config example. If config name isn't specified it prints out config list.
67
+
68
+
```
69
+
Usage: ovpn_enconf CONFIG_NAME [wizard args...]
70
+
71
+
Configs:
72
+
<example config name>
73
+
```
74
+
75
+
**Note:** Please read example documentation to understand how to use it.
76
+
**Tip:** If you modifed config in a way that others might need same configuration, consider making new example.
77
+
78
+
#### ovpn_init
79
+
80
+
This command inits your PKI in `/config/pki` folder. You need to run this command only once.
81
+
82
+
```
83
+
Usage: ovpn_init [nopass]
84
+
```
85
+
86
+
**Note:** Best practise is to use password for your PKI. Password is only needed for signing new certificates (when adding new clients). If you don't want your PKI certificate protected with password, add `nopass` parameter.
87
+
**Note:** In this process you need to enter PKI password serveral times, because a lot of things are generated.
0 commit comments