Move deploy config to .env with wg1/51821 defaults for server+client coexistence

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
This commit is contained in:
lofyer
2026-07-04 07:19:33 +08:00
co-authored by factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
parent c8922b62ed
commit d97ae64c85
3 changed files with 29 additions and 13 deletions
+18
View File
@@ -0,0 +1,18 @@
# Copy to .env and fill in. .env is gitignored.
# Public IP or domain that clients use to reach this server (required)
WG_HOST=
# WireGuard interface and port managed by the panel.
# Use wg1/51821 so it can coexist with a local wg0 client tunnel.
WG_INTERFACE=wg1
WG_PORT=51821
WG_SUBNET=10.8.0.0/24
WG_DNS=8.8.8.8
# Admin panel login
ADMIN_USERNAME=admin
ADMIN_PASSWORD=password
# Session signing / key encryption secret. Generate with: openssl rand -hex 32
SECRET_KEY=secret
+2
View File
@@ -2,4 +2,6 @@
__pycache__/
*.pyc
data/
wg-admin-data/
wg-config/
.env
+9 -13
View File
@@ -11,21 +11,17 @@ services:
devices:
- /dev/net/tun:/dev/net/tun
ports:
- "51820:51820/udp"
- "${WG_PORT:-51821}:${WG_PORT:-51821}/udp"
- "127.0.0.1:8000:8000/tcp"
environment:
WG_INTERFACE: wg0
WG_INTERFACE: ${WG_INTERFACE:-wg1}
WG_HOST: ${WG_HOST:?set WG_HOST to your public IP or domain}
WG_PORT: "51820"
WG_SUBNET: 10.8.0.0/24
WG_DNS: 1.1.1.1
WG_PORT: ${WG_PORT:-51821}
WG_SUBNET: ${WG_SUBNET:-10.8.0.0/24}
WG_DNS: ${WG_DNS:-8.8.8.8}
ADMIN_USERNAME: ${ADMIN_USERNAME:-admin}
ADMIN_PASSWORD: ${ADMIN_PASSWORD:?set ADMIN_PASSWORD}
SECRET_KEY: ${SECRET_KEY:?set SECRET_KEY to a long random string}
ADMIN_PASSWORD: ${ADMIN_PASSWORD:?set ADMIN_PASSWORD in .env}
SECRET_KEY: ${SECRET_KEY:?set SECRET_KEY in .env}
volumes:
- wg-admin-data:/opt/wireguard-admin/data
- wg-config:/etc/wireguard
volumes:
wg-admin-data:
wg-config:
- ./wg-admin-data:/opt/wireguard-admin/data
- ./wg-config:/etc/wireguard