Skip to content

Commit a93a827

Browse files
Bot Updating Templated Files
1 parent cf3959a commit a93a827

File tree

1 file changed

+106
-37
lines changed

1 file changed

+106
-37
lines changed

README.md

Lines changed: 106 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
<!-- DO NOT EDIT THIS FILE MANUALLY -->
2-
<!-- Please read the https://github.com/linuxserver/docker-wireguard/blob/legacy/.github/CONTRIBUTING.md -->
3-
1+
<!-- DO NOT EDIT THIS FILE MANUALLY -->
2+
<!-- Please read https://github.com/linuxserver/docker-wireguard/blob/legacy/.github/CONTRIBUTING.md -->
43
[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)](https://linuxserver.io)
54

65
[![Blog](https://img.shields.io/static/v1.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=linuxserver.io&message=Blog)](https://blog.linuxserver.io "all the things you can do with our containers including How-To guides, opinions and much more!")
@@ -65,6 +64,7 @@ This image provides various versions that are available via tags. Please read th
6564
| :----: | :----: |--- |
6665
| latest || Stable releases based on Alpine *without* support for compiling Wireguard modules. |
6766
| legacy || Stable releases with support for compiling Wireguard modules for older kernels. |
67+
6868
## Application Setup
6969

7070
During container start, it will first check if the wireguard module is already installed and loaded. Kernels newer than 5.6 generally have the wireguard module built-in (along with some older custom kernels). However, the module may not be enabled. Make sure it is enabled prior to starting the container.
@@ -87,11 +87,13 @@ To add more peers/clients later on, you increment the `PEERS` environment variab
8787

8888
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).
8989

90-
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.
90+
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/wg_confs/wg0.conf` and restarting the container.
91+
92+
The container managed server conf is hardcoded to `wg0.conf`. However, the users can add additional tunnel config files with `.conf` extensions into `/config/wg_confs/` and the container will attempt to start them all in alphabetical order. If any one of the tunnels fail, they will all be stopped and the default route will be deleted, requiring user intervention to fix the invalid conf and a container restart.
9193

9294
## Client Mode
9395

94-
Do not set the `PEERS` environment variable. Drop your client conf into the config folder as `/config/wg0.conf` and start the container.
96+
Do not set the `PEERS` environment variable. Drop your client conf(s) into the config folder as `/config/wg_confs/<tunnel name>.conf` and start the container. If there are multiple tunnel configs, the container will attempt to start them all in alphabetical order. If any one of the tunnels fail, they will all be stopped and the default route will be deleted, requiring user intervention to fix the invalid conf and a container restart.
9597

9698
If you get IPv6 related errors in the log and connection cannot be established, edit the `AllowedIPs` line in your peer/client wg0.conf to include only `0.0.0.0/0` and not `::/0`; and restart the container.
9799

@@ -134,7 +136,7 @@ Don't forget to set the necessary POSTUP and POSTDOWN rules in your client's pee
134136

135137
## Usage
136138

137-
Here are some example snippets to help you get started creating a container.
139+
To help you get started creating a container from this image you can either use docker-compose or the docker cli.
138140

139141
### docker-compose (recommended, [click here for more info](https://docs.linuxserver.io/general/docker-compose))
140142

@@ -194,12 +196,11 @@ docker run -d \
194196
--sysctl="net.ipv4.conf.all.src_valid_mark=1" \
195197
--restart unless-stopped \
196198
lscr.io/linuxserver/wireguard:legacy
197-
198199
```
199200

200201
## Parameters
201202

202-
Container images are configured using parameters passed at runtime (such as those above). These parameters are separated by a colon and indicate `<external>:<internal>` respectively. For example, `-p 8080:80` would expose port `80` from inside the container to be accessible from the host's IP on port `8080` outside the container.
203+
Containers are configured using parameters passed at runtime (such as those above). These parameters are separated by a colon and indicate `<external>:<internal>` respectively. For example, `-p 8080:80` would expose port `80` from inside the container to be accessible from the host's IP on port `8080` outside the container.
203204

204205
| Parameter | Function |
205206
| :----: | --- |
@@ -230,10 +231,10 @@ You can set any environment variable from a file by using a special prepend `FIL
230231
As an example:
231232

232233
```bash
233-
-e FILE__PASSWORD=/run/secrets/mysecretpassword
234+
-e FILE__MYVAR=/run/secrets/mysecretvariable
234235
```
235236

236-
Will set the environment variable `PASSWORD` based on the contents of the `/run/secrets/mysecretpassword` file.
237+
Will set the environment variable `MYVAR` based on the contents of the `/run/secrets/mysecretvariable` file.
237238

238239
## Umask for running applications
239240

@@ -242,15 +243,20 @@ Keep in mind umask is not chmod it subtracts from permissions based on it's valu
242243

243244
## User / Group Identifiers
244245

245-
When using volumes (`-v` flags) permissions issues can arise between the host OS and the container, we avoid this issue by allowing you to specify the user `PUID` and group `PGID`.
246+
When using volumes (`-v` flags), permissions issues can arise between the host OS and the container, we avoid this issue by allowing you to specify the user `PUID` and group `PGID`.
246247

247248
Ensure any volume directories on the host are owned by the same user you specify and any permissions issues will vanish like magic.
248249

249-
In this instance `PUID=1000` and `PGID=1000`, to find yours use `id user` as below:
250+
In this instance `PUID=1000` and `PGID=1000`, to find yours use `id your_user` as below:
250251

251252
```bash
252-
$ id username
253-
uid=1000(dockeruser) gid=1000(dockergroup) groups=1000(dockergroup)
253+
id your_user
254+
```
255+
256+
Example output:
257+
258+
```text
259+
uid=1000(your_user) gid=1000(your_user) groups=1000(your_user)
254260
```
255261

256262
## Docker Mods
@@ -261,12 +267,29 @@ We publish various [Docker Mods](https://github.com/linuxserver/docker-mods) to
261267

262268
## Support Info
263269

264-
* Shell access whilst the container is running: `docker exec -it wireguard /bin/bash`
265-
* To monitor the logs of the container in realtime: `docker logs -f wireguard`
266-
* container version number
267-
* `docker inspect -f '{{ index .Config.Labels "build_version" }}' wireguard`
268-
* image version number
269-
* `docker inspect -f '{{ index .Config.Labels "build_version" }}' lscr.io/linuxserver/wireguard:legacy`
270+
* Shell access whilst the container is running:
271+
272+
```bash
273+
docker exec -it wireguard /bin/bash
274+
```
275+
276+
* To monitor the logs of the container in realtime:
277+
278+
```bash
279+
docker logs -f wireguard
280+
```
281+
282+
* Container version number:
283+
284+
```bash
285+
docker inspect -f '{{ index .Config.Labels "build_version" }}' wireguard
286+
```
287+
288+
* Image version number:
289+
290+
```bash
291+
docker inspect -f '{{ index .Config.Labels "build_version" }}' lscr.io/linuxserver/wireguard:legacy
292+
```
270293

271294
## Updating Info
272295

@@ -276,38 +299,83 @@ Below are the instructions for updating containers:
276299

277300
### Via Docker Compose
278301

279-
* Update all images: `docker-compose pull`
280-
* or update a single image: `docker-compose pull wireguard`
281-
* Let compose update all containers as necessary: `docker-compose up -d`
282-
* or update a single container: `docker-compose up -d wireguard`
283-
* You can also remove the old dangling images: `docker image prune`
302+
* Update images:
303+
* All images:
304+
305+
```bash
306+
docker-compose pull
307+
```
308+
309+
* Single image:
310+
311+
```bash
312+
docker-compose pull wireguard
313+
```
314+
315+
* Update containers:
316+
* All containers:
317+
318+
```bash
319+
docker-compose up -d
320+
```
321+
322+
* Single container:
323+
324+
```bash
325+
docker-compose up -d wireguard
326+
```
327+
328+
* You can also remove the old dangling images:
329+
330+
```bash
331+
docker image prune
332+
```
284333

285334
### Via Docker Run
286335

287-
* Update the image: `docker pull lscr.io/linuxserver/wireguard:legacy`
288-
* Stop the running container: `docker stop wireguard`
289-
* Delete the container: `docker rm wireguard`
336+
* Update the image:
337+
338+
```bash
339+
docker pull lscr.io/linuxserver/wireguard:legacy
340+
```
341+
342+
* Stop the running container:
343+
344+
```bash
345+
docker stop wireguard
346+
```
347+
348+
* Delete the container:
349+
350+
```bash
351+
docker rm wireguard
352+
```
353+
290354
* Recreate a new container with the same docker run parameters as instructed above (if mapped correctly to a host folder, your `/config` folder and settings will be preserved)
291-
* You can also remove the old dangling images: `docker image prune`
355+
* You can also remove the old dangling images:
356+
357+
```bash
358+
docker image prune
359+
```
292360

293361
### Via Watchtower auto-updater (only use if you don't remember the original parameters)
294362

295363
* Pull the latest image at its tag and replace it with the same env variables in one run:
296364

297-
```bash
298-
docker run --rm \
299-
-v /var/run/docker.sock:/var/run/docker.sock \
300-
containrrr/watchtower \
301-
--run-once wireguard
302-
```
365+
```bash
366+
docker run --rm \
367+
-v /var/run/docker.sock:/var/run/docker.sock \
368+
containrrr/watchtower \
369+
--run-once wireguard
370+
```
303371

304372
* You can also remove the old dangling images: `docker image prune`
305373

306-
**Note:** We do not endorse the use of Watchtower as a solution to automated updates of existing Docker containers. In fact we generally discourage automated updates. However, this is a useful tool for one-time manual updates of containers where you have forgotten the original parameters. In the long term, we highly recommend using [Docker Compose](https://docs.linuxserver.io/general/docker-compose).
374+
**warning**: We do not endorse the use of Watchtower as a solution to automated updates of existing Docker containers. In fact we generally discourage automated updates. However, this is a useful tool for one-time manual updates of containers where you have forgotten the original parameters. In the long term, we highly recommend using [Docker Compose](https://docs.linuxserver.io/general/docker-compose).
307375

308376
### Image Update Notifications - Diun (Docker Image Update Notifier)
309377

310-
* We recommend [Diun](https://crazymax.dev/diun/) for update notifications. Other tools that automatically update containers unattended are not recommended or supported.
378+
**tip**: We recommend [Diun](https://crazymax.dev/diun/) for update notifications. Other tools that automatically update containers unattended are not recommended or supported.
311379

312380
## Building locally
313381

@@ -332,6 +400,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
332400

333401
## Versions
334402

403+
* **03.10.23:** - **Potentially Breaking Change:** Support for multiple interfaces added. Wireguard confs moved to `/config/wg_confs/`. Any file with a `.conf` extension in that folder will be treated as a live tunnel config and will be attempted to start. If any of the tunnels fail, all tunnels will be stopped. Tunnels are started in alphabetical order. Managed server conf will continue to be hardcoded to `wg0.conf`.
335404
* **24.06.23:** - Deprecate armhf as per [https://www.linuxserver.io/armhf](https://www.linuxserver.io/armhf).
336405
* **26.04.23:** - Rework branches, swap alpine & ubuntu builds.
337406
* **28.01.23:** - Patch wg-quick to suppress false positive sysctl warning.

0 commit comments

Comments
 (0)