feat: add GatewayBootstrapToken configuration field
Add GatewayBootstrapToken field to Config struct and load from GATEWAY_BOOTSTRAP_TOKEN environment variable with default value "nexavpn-gateway-bootstrap".
This commit is contained in:
@@ -15,6 +15,7 @@ type Config struct {
|
|||||||
JWTSecret string
|
JWTSecret string
|
||||||
AccessTokenTTL time.Duration
|
AccessTokenTTL time.Duration
|
||||||
RefreshTokenTTL time.Duration
|
RefreshTokenTTL time.Duration
|
||||||
|
GatewayBootstrapToken string
|
||||||
DefaultGatewayID string
|
DefaultGatewayID string
|
||||||
DefaultDNS []string
|
DefaultDNS []string
|
||||||
DefaultVPNCIDR string
|
DefaultVPNCIDR string
|
||||||
@@ -32,6 +33,7 @@ func Load() Config {
|
|||||||
JWTSecret: getenv("JWT_SECRET", "change-me-in-production"),
|
JWTSecret: getenv("JWT_SECRET", "change-me-in-production"),
|
||||||
AccessTokenTTL: time.Duration(getenvInt("ACCESS_TOKEN_TTL_SECONDS", 900)) * time.Second,
|
AccessTokenTTL: time.Duration(getenvInt("ACCESS_TOKEN_TTL_SECONDS", 900)) * time.Second,
|
||||||
RefreshTokenTTL: time.Duration(getenvInt("REFRESH_TOKEN_TTL_SECONDS", 2592000)) * time.Second,
|
RefreshTokenTTL: time.Duration(getenvInt("REFRESH_TOKEN_TTL_SECONDS", 2592000)) * time.Second,
|
||||||
|
GatewayBootstrapToken: getenv("GATEWAY_BOOTSTRAP_TOKEN", "nexavpn-gateway-bootstrap"),
|
||||||
DefaultGatewayID: getenv("DEFAULT_GATEWAY_ID", ""),
|
DefaultGatewayID: getenv("DEFAULT_GATEWAY_ID", ""),
|
||||||
DefaultDNS: splitCSV(getenv("DEFAULT_DNS_SERVERS", "10.20.0.53")),
|
DefaultDNS: splitCSV(getenv("DEFAULT_DNS_SERVERS", "10.20.0.53")),
|
||||||
DefaultVPNCIDR: getenv("DEFAULT_VPN_CIDR", "100.96.0.0/24"),
|
DefaultVPNCIDR: getenv("DEFAULT_VPN_CIDR", "100.96.0.0/24"),
|
||||||
|
|||||||
Reference in New Issue
Block a user