mirror of
https://github.com/fosrl/olm.git
synced 2026-02-08 05:56:41 +00:00
14
main.go
14
main.go
@@ -197,7 +197,11 @@ func runOlmMainWithArgs(ctx context.Context, args []string) {
|
|||||||
httpAddr = os.Getenv("HTTP_ADDR")
|
httpAddr = os.Getenv("HTTP_ADDR")
|
||||||
pingIntervalStr := os.Getenv("PING_INTERVAL")
|
pingIntervalStr := os.Getenv("PING_INTERVAL")
|
||||||
pingTimeoutStr := os.Getenv("PING_TIMEOUT")
|
pingTimeoutStr := os.Getenv("PING_TIMEOUT")
|
||||||
doHolepunch = os.Getenv("HOLEPUNCH") == "true" // Default to true, can be overridden by flag
|
enableHTTPEnv := os.Getenv("ENABLE_HTTP")
|
||||||
|
holepunchEnv := os.Getenv("HOLEPUNCH")
|
||||||
|
|
||||||
|
enableHTTP = enableHTTPEnv == "true"
|
||||||
|
doHolepunch = holepunchEnv == "true"
|
||||||
|
|
||||||
if endpoint == "" {
|
if endpoint == "" {
|
||||||
serviceFlags.StringVar(&endpoint, "endpoint", "", "Endpoint of your Pangolin server")
|
serviceFlags.StringVar(&endpoint, "endpoint", "", "Endpoint of your Pangolin server")
|
||||||
@@ -229,8 +233,12 @@ func runOlmMainWithArgs(ctx context.Context, args []string) {
|
|||||||
if pingTimeoutStr == "" {
|
if pingTimeoutStr == "" {
|
||||||
serviceFlags.StringVar(&pingTimeoutStr, "ping-timeout", "5s", " Timeout for each ping (default 3s)")
|
serviceFlags.StringVar(&pingTimeoutStr, "ping-timeout", "5s", " Timeout for each ping (default 3s)")
|
||||||
}
|
}
|
||||||
serviceFlags.BoolVar(&enableHTTP, "enable-http", false, "Enable HTT server for receiving connection requests")
|
if enableHTTPEnv == "" {
|
||||||
serviceFlags.BoolVar(&doHolepunch, "holepunch", false, "Enable hole punching (default false)")
|
serviceFlags.BoolVar(&enableHTTP, "enable-http", false, "Enable HTT server for receiving connection requests")
|
||||||
|
}
|
||||||
|
if holepunchEnv == "" {
|
||||||
|
serviceFlags.BoolVar(&doHolepunch, "holepunch", false, "Enable hole punching (default false)")
|
||||||
|
}
|
||||||
|
|
||||||
version := serviceFlags.Bool("version", false, "Print the version")
|
version := serviceFlags.Bool("version", false, "Print the version")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user