Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please share your setup #19

Open
vx3r opened this issue Feb 25, 2020 · 6 comments
Open

Please share your setup #19

vx3r opened this issue Feb 25, 2020 · 6 comments

Comments

@vx3r
Copy link
Owner

vx3r commented Feb 25, 2020

Would be nice if you can share your setup with a revers proxy in form of a docker-compose.yml ready to go for popular revers proxy web apps like.

  • nginx (i will add mine)
  • traefik
  • caddy
  • apache maybe

Thank you

@wsw70
Copy link

wsw70 commented Mar 24, 2020

Traefik 2

version: '3.6'
services:
  wg-gen-web:
    image: vx3r/wg-gen-web:latest
    container_name: wg-gen-web
    restart: unless-stopped
    environment:
      - WG_CONF_DIR=/data
      - WG_INTERFACE_NAME=wg0.conf
      - SMTP_HOST=your.smtp.host
      - SMTP_PORT=465
      - SMTP_USERNAME=your_smtp_username
      - SMTP_PASSWORD=your_smtp_password
      - SMTP_FROM=Wg Gen Web <address@to.send.from>
    volumes:
      - /etc/docker/container-data/wg-gen-web:/data
    labels:
      - traefik.http.routers.wg-gen-web.entryPoints=http
      - traefik.enable=true

@sphen13
Copy link
Contributor

sphen13 commented Apr 15, 2020

simple setup with Caddy (i am using my own built container that uses digitalocean token for dns validation - based upon abiosoft/caddy)

version: '3.6'
services:
  caddy:
    image: "sphen/caddy-digitalocean"
    container_name: caddy
    environment:
      - DO_AUTH_TOKEN=abc123
      - ACME_AGREE=TRUE
    volumes:
      - /home/user/caddy/Caddyfile:/etc/Caddyfile
      - /home/user/caddy:/root/.caddy
    ports:
      - 443:443
    depends_on:
      - wg-gen-web
    restart: always

  wg-gen-web:
    image: vx3r/wg-gen-web
    container_name: wg-gen-web
    restart: always
    environment:
      - WG_CONF_DIR=/data
      - WG_INTERFACE_NAME=wg0.conf
    volumes:
      - /etc/wireguard:/data

Caddyfile:

vpn.xxx.com {
  basicauth / user password
  proxy / http://wg-gen-web:8080 {
    transparent
  }
  tls {
    dns digitalocean
  }
}

@wsw70
Copy link

wsw70 commented Apr 15, 2020

simple setup with Caddy

@sphen13 you may be interested in https://github.com/lucaslorentz/caddy-docker-proxy - a Caddy proxy to docker containers with automatic reload of the configuration and detection of container exposed ports.

I used it happily for a few months but eventually moved to Traefik

@squat
Copy link

squat commented May 4, 2020

Hi (x-posted from the Discord channel), here is a setup for easily running Wg Gen Web on Kubernetes with Kilo:

https://github.com/squat/kilo-wg-gen-web

The manifests can be found at https://raw.githubusercontent.com/squat/kilo-wg-gen-web/master/manifests/kilo-wg-gen-web.yaml

@wsw70
Copy link

wsw70 commented Jun 10, 2020

I used it happily for a few months but eventually moved to Traefik

... and then moved back to caddy v2 (using the new API in v2)

@rahmadsandy
Copy link

Wg Dashboard with caddy

version: '3.6'

networks:
  monitor-net:
    driver: bridge

services:
  wgweb:
    container_name: wgweb
    build: 
      context: .
    volumes:
      - /etc/wireguard:/data

    expose:
      - 8888/tcp
    networks:
      - monitor-net


    
  caddy:
    image: stefanprodan/caddy
    container_name: caddy
    ports:
      - "8282:8888"
    volumes:
      - ./caddy:/etc/caddy
    environment:
      - ADMIN_USER=${ADMIN_USER}
      - ADMIN_PASSWORD=${ADMIN_PASSWORD}
    networks:
      - monitor-net
    labels:
      org.label-schema.group: "monitoring"

Dockerfile

FROM ubuntu
RUN apt update && \
    apt install curl vim net-tools iputils-ping -y
RUN mkdir /data
WORKDIR /app
COPY . /app
WORKDIR /app
EXPOSE 8888
CMD [ "./wg-gen-web" ]

Wireguard API

version: '3.6'
services:
  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.27.0.1:8080

Caddyfile

:8888 {
    basicauth / {$ADMIN_USER} {$ADMIN_PASSWORD}
    proxy / wgweb:8888 {
            transparent
        }

    errors stderr
    tls off
}

Env

# IP address to listen to
SERVER=0.0.0.0
# port to bind
PORT=8888
# Gin framework release mode
GIN_MODE=release
# where to write all generated config files
WG_CONF_DIR=/data
# WireGuard main config file name, generally <interface name>.conf
WG_INTERFACE_NAME=wg0.conf

# SMTP settings to send email to clients
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USERNAME=**************************
SMTP_PASSWORD=**************************
SMTP_FROM=**************************

#fake 
OAUTH2_PROVIDER_NAME=fake

ADMIN_USER=**************************
ADMIN_PASSWORD=**************************
WG_STATS_API=http://172.27.0.1:8080

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants