Update main.go

synced with dev
This commit is contained in:
Wouter van Elten
2025-06-30 13:09:11 +02:00
committed by GitHub
parent 9db3b78373
commit 071a51afbc

32
main.go
View File

@@ -353,19 +353,21 @@ func resolveDomain(domain string) (string, error) {
} }
var ( var (
endpoint string endpoint string
id string id string
secret string secret string
mtu string mtu string
mtuInt int mtuInt int
dns string dns string
privateKey wgtypes.Key privateKey wgtypes.Key
err error err error
logLevel string logLevel string
updownScript string updownScript string
tlsPrivateKey string tlsPrivateKey string
dockerSocket string dockerSocket string
healthFile string // NEW dockerEnforceNetworkValidation string
dockerEnforceNetworkValidationBool bool
healthFile string // NEW
) )
func main() { func main() {
@@ -379,6 +381,7 @@ func main() {
updownScript = os.Getenv("UPDOWN_SCRIPT") updownScript = os.Getenv("UPDOWN_SCRIPT")
tlsPrivateKey = os.Getenv("TLS_CLIENT_CERT") tlsPrivateKey = os.Getenv("TLS_CLIENT_CERT")
dockerSocket = os.Getenv("DOCKER_SOCKET") dockerSocket = os.Getenv("DOCKER_SOCKET")
dockerEnforceNetworkValidation = os.Getenv("DOCKER_ENFORCE_NETWORK_VALIDATION")
healthFile = os.Getenv("HEALTH_FILE") // NEW healthFile = os.Getenv("HEALTH_FILE") // NEW
if endpoint == "" { if endpoint == "" {
@@ -408,6 +411,9 @@ func main() {
if dockerSocket == "" { if dockerSocket == "" {
flag.StringVar(&dockerSocket, "docker-socket", "", "Path to Docker socket (typically /var/run/docker.sock)") flag.StringVar(&dockerSocket, "docker-socket", "", "Path to Docker socket (typically /var/run/docker.sock)")
} }
if dockerEnforceNetworkValidation == "" {
flag.StringVar(&dockerEnforceNetworkValidation, "docker-enforce-network-validation", "false", "Enforce validation of container on newt network (true or false)")
}
// CLI flag for healthFile if not set by env // CLI flag for healthFile if not set by env
if healthFile == "" { if healthFile == "" {
flag.StringVar(&healthFile, "health-file", "", "Path to health file (if unset, health file wont be written)") flag.StringVar(&healthFile, "health-file", "", "Path to health file (if unset, health file wont be written)")