From b683fad5d8e8686f118d56bd37a0eac69ec98265 Mon Sep 17 00:00:00 2001 From: lofyer Date: Mon, 6 Jul 2026 23:57:31 +0800 Subject: [PATCH] Make admin web UI port configurable via WEB_PORT Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> --- .env.example | 3 +++ docker-compose.yml | 4 +++- entrypoint.sh | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index aa483a2..fb187c1 100644 --- a/.env.example +++ b/.env.example @@ -25,6 +25,9 @@ WG_RELAY_SUBNETS= # Set true to block peer-to-peer traffic between VPN clients (isolation). WG_PEER_ISOLATION=false +# Port the admin web UI listens on (host port, since network_mode: host). +WEB_PORT=8000 + # Admin panel login ADMIN_USERNAME=admin ADMIN_PASSWORD=password diff --git a/docker-compose.yml b/docker-compose.yml index 377d974..faa6c8a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,7 +6,8 @@ services: cap_add: - NET_ADMIN # Host networking: new interfaces and their UDP ports work without - # editing port mappings. The admin UI listens on host port 8000. + # editing port mappings. The admin UI listens on host port WEB_PORT + # (default 8000). # Requires net.ipv4.ip_forward=1 on the host (sysctls cannot be set # per-container in host network mode); entrypoint.sh enables it. network_mode: host @@ -21,6 +22,7 @@ services: WG_ALLOWED_IPS: ${WG_ALLOWED_IPS:-0.0.0.0/0, ::/0} WG_RELAY_SUBNETS: ${WG_RELAY_SUBNETS:-} WG_PEER_ISOLATION: ${WG_PEER_ISOLATION:-false} + WEB_PORT: ${WEB_PORT:-8000} ADMIN_USERNAME: ${ADMIN_USERNAME:-admin} ADMIN_PASSWORD: ${ADMIN_PASSWORD:?set ADMIN_PASSWORD in .env} SECRET_KEY: ${SECRET_KEY:?set SECRET_KEY in .env} diff --git a/entrypoint.sh b/entrypoint.sh index d6478c6..0550c26 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -23,4 +23,4 @@ for subnet in ${WG_RELAY_SUBNETS:-}; do done IFS="$OLD_IFS" -exec uvicorn app.main:app --host 0.0.0.0 --port 8000 +exec uvicorn app.main:app --host 0.0.0.0 --port "${WEB_PORT:-8000}"