mirror of
https://github.com/swissmakers/fail2ban-ui.git
synced 2026-04-17 14:03:15 +02:00
Add guard it the callback-env var is set over env, that there is no modifications because of the port variable
This commit is contained in:
@@ -1321,6 +1321,15 @@ func GetPortFromEnv() (int, bool) {
|
||||
return 0, false
|
||||
}
|
||||
|
||||
// GetCallbackURLFromEnv returns the CALLBACK_URL environment variable value and whether it's set.
|
||||
func GetCallbackURLFromEnv() (string, bool) {
|
||||
v := strings.TrimSpace(os.Getenv("CALLBACK_URL"))
|
||||
if v == "" {
|
||||
return "", false
|
||||
}
|
||||
return strings.TrimRight(v, "/"), true
|
||||
}
|
||||
|
||||
// GetBindAddressFromEnv returns the BIND_ADDRESS environment variable value if set, and whether it's set
|
||||
// If not set, returns "0.0.0.0" as the default bind address
|
||||
// Validates that the address is a valid IP address format
|
||||
|
||||
Reference in New Issue
Block a user