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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user