Browse Source

added docker container with wg-utils

toastie89 1 year ago
parent
commit
ff3a33f4e8

+ 1 - 1
linux/wireguard/create-config/.gitignore

@@ -1,3 +1,3 @@
 peers.cfg
 server.cfg
-config/
+.bash_history

+ 3 - 1
linux/wireguard/create-config/README.md

@@ -2,4 +2,6 @@ Scripts and templates to setup keys, PSKs and config files for a central wiregua
 
 1. [wg-new.sh](wg-new.sh) prepares a new `./config/` directory **(!! any existing directory will be deleted)**
 2. Next the files `server.cfg` and `peers.cfg` in `./config/` need to be modified as per your requirements
-3. Finally run  [wg-createconfig.sh](wg-createconfig.sh) generate keys, PSKs and configs
+3. Finally run  [wg-createconfig.sh](wg-createconfig.sh) generate keys, PSKs and configs
+
+To run in docker: `docker-compose run wg-config`

+ 2 - 0
linux/wireguard/create-config/build/Dockerfile

@@ -0,0 +1,2 @@
+FROM alpine:latest
+RUN apk add wireguard-tools libqrencode

+ 15 - 0
linux/wireguard/create-config/docker-compose.yml

@@ -0,0 +1,15 @@
+version: '3.7' 
+services:
+  wg-config:
+    image: toastie89/wg-config
+    build: ./build
+    container_name: wg-config 
+    hostname: restic
+    restart: on-failure:3
+    volumes:
+      - .:/opt/wg-config
+    entrypoint: /bin/sh -c 'cd /opt/wg-config; exec bash'
+    environment:
+      - HOME=/opt/wg-config
+    # For debugging, docker-compose run restic
+    #entrypoint: /bin/sh