hotfix(httpproxy): Retro-compat with old env vars
This commit is contained in:
26
internal/configuration/sources/env/httproxy.go
vendored
26
internal/configuration/sources/env/httproxy.go
vendored
@@ -79,33 +79,17 @@ func (r *Reader) readHTTProxyPassword() (user *string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (r *Reader) readHTTProxyListeningAddress() (listeningAddress string) {
|
func (r *Reader) readHTTProxyListeningAddress() (listeningAddress string) {
|
||||||
s := os.Getenv("HTTPPROXY_LISTENING_ADDRESS")
|
|
||||||
if s != "" {
|
|
||||||
return s
|
|
||||||
}
|
|
||||||
|
|
||||||
// Retro-compatibility
|
// Retro-compatibility
|
||||||
s = os.Getenv("HTTPROXY_PORT")
|
retroKeys := []string{"PROXY_PORT", "TINYPROXY_PORT", "HTTPPROXY_PORT"}
|
||||||
|
for _, retroKey := range retroKeys {
|
||||||
|
s := os.Getenv(retroKey)
|
||||||
if s != "" {
|
if s != "" {
|
||||||
r.onRetroActive("HTTPROXY_PORT", "HTTPPROXY_LISTENING_ADDRESS")
|
r.onRetroActive(retroKey, "HTTPPROXY_LISTENING_ADDRESS")
|
||||||
return ":" + s
|
return ":" + s
|
||||||
}
|
}
|
||||||
|
|
||||||
// Retro-compatibility
|
|
||||||
s = os.Getenv("TINYPROXY_PORT")
|
|
||||||
if s != "" {
|
|
||||||
r.onRetroActive("TINYPROXY_PORT", "HTTPPROXY_LISTENING_ADDRESS")
|
|
||||||
return ":" + s
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Retro-compatibility
|
return os.Getenv("HTTPPROXY_LISTENING_ADDRESS")
|
||||||
s = os.Getenv("PROXY_PORT")
|
|
||||||
if s != "" {
|
|
||||||
r.onRetroActive("PROXY_PORT", "HTTPPROXY_LISTENING_ADDRESS")
|
|
||||||
return ":" + s
|
|
||||||
}
|
|
||||||
|
|
||||||
return ""
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *Reader) readHTTProxyEnabled() (enabled *bool, err error) {
|
func (r *Reader) readHTTProxyEnabled() (enabled *bool, err error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user