Skip to content

Commit 09a0854

Browse files
Bot Updating Templated Files
1 parent c5a43f2 commit 09a0854

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ services:
8383
- PEERS=1 #optional
8484
- PEERDNS=auto #optional
8585
- INTERNAL_SUBNET=10.13.13.0 #optional
86+
- ALLOWEDIPS=192.168.1.0/24,192.168.2.0/24 #optional
8687
volumes:
8788
- /path/to/appdata/config:/config
8889
- /lib/modules:/lib/modules
@@ -108,6 +109,7 @@ docker run -d \
108109
-e PEERS=1 `#optional` \
109110
-e PEERDNS=auto `#optional` \
110111
-e INTERNAL_SUBNET=10.13.13.0 `#optional` \
112+
-e ALLOWEDIPS=192.168.1.0/24,192.168.2.0/24 `#optional` \
111113
-p 51820:51820/udp \
112114
-v /path/to/appdata/config:/config \
113115
-v /lib/modules:/lib/modules \
@@ -129,9 +131,10 @@ Container images are configured using parameters passed at runtime (such as thos
129131
| `-e TZ=Europe/London` | Specify a timezone to use EG Europe/London |
130132
| `-e SERVERURL=wireguard.domain.com` | External IP or domain name for docker host. Used in server mode. If set to `auto`, the container will try to determine and set the external IP automatically |
131133
| `-e SERVERPORT=51820` | External port for docker host. Used in server mode. |
132-
| `-e PEERS=1` | Number of peers to create confs for. Required for server mode. |
134+
| `-e PEERS=1` | Number of peers to create confs for. Required for server mode. Can be a list of names too: myPC,myPhone,myTablet... |
133135
| `-e PEERDNS=auto` | DNS server set in peer/client configs (can be set as `8.8.8.8`). Used in server mode. Defaults to `auto`, which uses wireguard docker host's DNS via included CoreDNS forward. |
134136
| `-e INTERNAL_SUBNET=10.13.13.0` | Internal subnet for the wireguard and server and peers (only change if it clashes). Used in server mode. |
137+
| `-e ALLOWEDIPS=192.168.1.0/24,192.168.2.0/24` | The IPs/Ranges that the peers will be able to reach using the VPN connection. If not specified the default value is: '0.0.0.0/0, ::0/0' |
135138
| `-v /config` | Contains all relevant configuration files. |
136139
| `-v /lib/modules` | Maps host's modules folder. |
137140
| `--sysctl=` | Required for client mode. |
@@ -179,13 +182,13 @@ With regards to arm32/64 devices, Raspberry Pi 2-4 running the [official ubuntu
179182
This can be run as a server or a client, based on the parameters used.
180183

181184
## Server Mode
182-
If the environment variable `PEERS` is set to a number, the container will run in server mode and the necessary server and peer/client confs will be generated. The peer/client config qr codes will be output in the docker log. They will also be saved in text and png format under `/config/peerX`.
185+
If the environment variable `PEERS` is set to a number or a list of strings separated by comma, the container will run in server mode and the necessary server and peer/client confs will be generated. The peer/client config qr codes will be output in the docker log. They will also be saved in text and png format under `/config/peerX` in case `PEERS` is a variable and an integer or `/config/peer_X` in case a list of names was provided instead of an integer.
183186

184187
Variables `SERVERURL`, `SERVERPORT`, `INTERNAL_SUBNET` and `PEERDNS` are optional variables used for server mode. Any changes to these environment variables will trigger regeneration of server and peer confs. Peer/client confs will be recreated with existing private/public keys. Delete the peer folders for the keys to be recreated along with the confs.
185188

186-
To add more peers/clients later on, you increment the `PEERS` environment variable and recreate the container.
189+
To add more peers/clients later on, you increment the `PEERS` environment variable or add more elements to the list and recreate the container.
187190

188-
To display the QR codes of active peers again, you can use the following command and list the peer numbers as arguments: `docker exec -it wireguard /app/show-peer 1 4 5` (Keep in mind that the QR codes are also stored as PNGs in the config folder).
191+
To display the QR codes of active peers again, you can use the following command and list the peer numbers as arguments: `docker exec -it wireguard /app/show-peer 1 4 5` or `docker exec -it wireguard /app/show-peer myPC myPhone myTablet` (Keep in mind that the QR codes are also stored as PNGs in the config folder).
189192

190193
The templates used for server and peer confs are saved under `/config/templates`. Advanced users can modify these templates and force conf generation by deleting `/config/wg0.conf` and restarting the container.
191194

@@ -288,6 +291,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
288291

289292
## Versions
290293

294+
* **04.10.20:** - Allow to specify a list of names as PEERS and add ALLOWEDIPS environment variable. Also, add peer name/id to each one of the peer sections in wg0.conf. Important: Existing users need to delete `/config/templates/peer.conf` and restart
291295
* **27.09.20:** - Cleaning service binding example to have accurate PreDown script.
292296
* **06.08.20:** - Replace resolvconf with openresolv due to dns issues when a client based on this image is connected to a server also based on this image. Add IPv6 info to readme. Display kernel version in logs.
293297
* **29.07.20:** - Update Coredns config to detect dns loops (existing users need to delete `/config/coredns/Corefile` and restart).

0 commit comments

Comments
 (0)