aghrapidpro/wireguard-ui

By aghrapidpro

Updated over 1 year ago

Our fork of the original https://github.com/ngoduykhanh/wireguard-ui project

Image
Networking
0

688

aghrapidpro/wireguard-ui repository overview

Here is a configuration that works neatly as remote access to site. Make sure to tweak email, ips and other setting to your needs.

---
services:
  wireguard:
    container_name: wireguard
    image: linuxserver/wireguard:latest
    restart: always
    cap_add:
      - NET_ADMIN
      - SYS_MODULE #optional
    volumes:
      - ./wireguard:/config
      - /lib/modules:/lib/modules #optional
    sysctls:
      - net.ipv4.conf.all.src_valid_mark=1
    ports:
      # port for wireguard-ui
      - "5000:5000"
      # port of the wireguard server
      - "51820:51820/udp"

  wireguard-ui:
    image: aghrapidpro/wireguard-ui:latest
    container_name: wireguard-ui
    restart: always
    depends_on:
      - wireguard
    cap_add:
      - NET_ADMIN
      - SYS_MODULE #optional
    # use the network of the 'wireguard' service. this enables to show active clients in the status page
    network_mode: service:wireguard
    logging:
      driver: json-file
      options:
        max-size: 50m
    volumes:
      - ./wireguard-ui:/app/db
      - ./wireguard/config:/etc/wireguard
      - /lib/modules:/lib/modules #optional
    sysctls:
      - net.ipv4.conf.all.src_valid_mark=1
    environment:
      - WGUI_ENDPOINT_ADDRESS=${RAPID_SUBDOMAIN}.${RAPID_DOMAIN}
      - WGUI_DNS=192.168.68.1,1.1.1.1,8.8.8.8
      - WGUI_MTU=1420
      - WGUI_PERSISTENT_KEEPALIVE=10
      - EMAIL_FROM_ADDRESS=${EMAIL_USERNAME}
      - EMAIL_FROM_NAME=AGH Rapid - VPN
      - WGUI_USERNAME=admin
      - WGUI_PASSWORD=${WIREGUARD_GUI_PASSWORD}
      - WGUI_MANAGE_START=true
      - WGUI_MANAGE_RESTART=true
      - SMTP_HOSTNAME=poczta.agh.edu.pl
      - SMTP_USERNAME=${EMAIL_USERNAME}
      - SMTP_PASSWORD=${EMAIL_APP_KEY}
      - SMTP_PORT=465
      - SMTP_AUTH_TYPE=LOGIN
      - SMTP_ENCRYPTION=SSL
      - WGUI_SERVER_INTERFACE_ADDRESSES=10.0.68.1/24
      - WGUI_SERVER_LISTEN_PORT=51820
      # Make sure that docker IP and ports line up with the docker enviropment you deploy that in
      - WGUI_SERVER_POST_UP_SCRIPT=ip route add default via 172.18.0.1 dev eth0; iptables -I INPUT -p udp --dport 51820 -j ACCEPT; iptables -I FORWARD -i eth0 -o wg0 -j ACCEPT; iptables -I FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
      - WGUI_SERVER_POST_DOWN_SCRIPT=ip route del default; iptables -D INPUT -p udp --dport 51820 -j ACCEPT; iptables -D FORWARD -i eth0 -o wg0 -j ACCEPT; iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
      - WGUI_DEFAULT_CLIENT_ALLOWED_IPS=192.168.68.0/22
      - WGUI_DEFAULT_CLIENT_ENABLE_AFTER_CREATION=true
      - WGUI_DEFAULT_CLIENT_USE_SERVER_DNS=true

Tag summary

Content type

Image

Digest

sha256:a3f514cbe

Size

17.4 MB

Last updated

over 1 year ago

docker pull aghrapidpro/wireguard-ui