Refactor environment variables with shorter names and add comprehensive override support

- Rename OVERRIDE_INTERFACE_* to WG_* (shorter, non-conflicting)
- Add interface overrides: WG_PORT, WG_DEVICE, WG_MTU, WG_IPV4_CIDR, WG_IPV6_CIDR, WG_ENABLED
- Add client config overrides: WG_HOST, WG_CLIENT_PORT, WG_DEFAULT_DNS, WG_DEFAULT_ALLOWED_IPS, WG_DEFAULT_MTU, WG_DEFAULT_PERSISTENT_KEEPALIVE
- Add general config overrides: WG_SESSION_TIMEOUT, WG_METRICS_PROMETHEUS, WG_METRICS_JSON
- Update all API endpoints to apply and filter overrides
- Update documentation with all new environment variables
- Exclude AmneziaWG parameters (j*, s*, i*, h*) as requested

Co-authored-by: kaaax0815 <32197462+kaaax0815@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-11-14 13:25:22 +00:00
parent 5fd3ee9843
commit 67185192fd
9 changed files with 189 additions and 23 deletions
+2 -1
View File
@@ -154,6 +154,7 @@ class WireGuard {
const wgInterface = await Database.interfaces.get();
const wgInterfaceWithOverrides = applyInterfaceOverrides(wgInterface);
const userConfig = await Database.userConfigs.get();
const userConfigWithOverrides = applyUserConfigOverrides(userConfig);
const client = await Database.clients.get(clientId);
@@ -163,7 +164,7 @@ class WireGuard {
return wg.generateClientConfig(
wgInterfaceWithOverrides,
userConfig,
userConfigWithOverrides,
client,
{
enableIpv6: !WG_ENV.DISABLE_IPV6,