From 837010906cc424d20e0827a1186c3393503af3d7 Mon Sep 17 00:00:00 2001 From: Julien Escario Date: Thu, 1 Apr 2021 13:20:06 +0200 Subject: [PATCH] Add Wg Gen Web and traefik conf files --- docker/traefik/traefik.yaml | 36 +++++++++++++++ docker/wg-gen-web/wg-gen-web-traefik.yaml | 54 +++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 docker/traefik/traefik.yaml create mode 100644 docker/wg-gen-web/wg-gen-web-traefik.yaml diff --git a/docker/traefik/traefik.yaml b/docker/traefik/traefik.yaml new file mode 100644 index 0000000..2ccdb2c --- /dev/null +++ b/docker/traefik/traefik.yaml @@ -0,0 +1,36 @@ +version: "3.3" + +services: + traefik: + container_name: traefik + image: "traefik:latest" + command: + - --entrypoints.web.address=:80 + - --entrypoints.websecure.address=:443 + - --providers.docker + - --log.level=ERROR + - --certificatesresolvers.leresolver.acme.httpchallenge=true + - --certificatesresolvers.leresolver.acme.email=noc@altinea.fr + - --certificatesresolvers.leresolver.acme.storage=/etc/traefik/acme/acme.json + - --certificatesresolvers.leresolver.acme.httpchallenge.entrypoint=web + - --api.insecure=true + - --providers.docker.exposedByDefault=false + ports: + - "80:80" + - "443:443" + - "8090:8080" + volumes: + - "/var/run/docker.sock:/var/run/docker.sock:ro" + - "acme-json:/etc/traefik/acme" + labels: + - "traefik.http.routers.http-catchall.rule=hostregexp(`{host:.+}`)" + - "traefik.http.routers.http-catchall.entrypoints=web" + networks: + traefik: +volumes: + acme-json: + driver: local +networks: + traefik: + name: traefik + diff --git a/docker/wg-gen-web/wg-gen-web-traefik.yaml b/docker/wg-gen-web/wg-gen-web-traefik.yaml new file mode 100644 index 0000000..ff37279 --- /dev/null +++ b/docker/wg-gen-web/wg-gen-web-traefik.yaml @@ -0,0 +1,54 @@ +version: '3.6' +services: + wg-gen-web: + image: vx3r/wg-gen-web:latest + container_name: wg-gen-web + restart: unless-stopped + expose: + - "8080" + environment: + - WG_CONF_DIR=/data + - WG_INTERFACE_NAME=wg0.conf + - WG_STATS_API=http://172.20.1.1:8182 + - WG_STATS_API_USER= + - WG_STATS_API_PASS= + - SMTP_HOST= + - SMTP_PORT= + - SMTP_USERNAME= + - SMTP_PASSWORD= + - SMTP_FROM= + volumes: + - /etc/wireguard:/data + labels: + - "traefik.enable=true" + - "traefik.http.routers.wg-gen-web.rule=Host(`vpn.admr-jura.org`)" + - "traefik.http.routers.wg-gen-web.entrypoints=web" + - "traefik.http.routers.wg-gen-web.service=wg-gen-web" + - "traefik.http.services.wg-gen-web.loadbalancer.server.port=8080" + - "traefik.docker.network=traefik" + # Add authentication here in the form : :,: + # https://www.bcrypt.fr/ to generate hashes. Don't forget to double '$' caracters ! + # - "traefik.http.routers.wg-gen-web.middlewares=wg-gen-web" + # - "traefik.http.middlewares.wg-gen-web.basicauth.users=test:$$apr1$$H6uskkkW$$IgXLP6ewTrSuBkTrqE8wj/,test2:$$apr1$$d9hr9HBB$$4HxwgUir3HP4EsggP/QNo0" + networks: + traefik: + wg-gen-web: + wg-json-api: + image: james/wg-api:latest + container_name: wg-json-api + restart: unless-stopped + cap_add: + - NET_ADMIN + network_mode: "host" + command: wg-api --device wg0 --listen 172.20.1.1:8182 +networks: + traefik: + external: + name: traefik + wg-gen-web: + driver: bridge + name: wg-gen-web + ipam: + driver: default + config: + - subnet: 172.20.1.0/24