Add support for PROXY and PORT envs
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package config
|
||||
|
||||
import "os"
|
||||
|
||||
type ConfigInterface interface {
|
||||
GetConfig() ZurgConfig
|
||||
GetVersion() string
|
||||
@@ -80,6 +82,9 @@ func (z *ZurgConfig) GetHost() string {
|
||||
}
|
||||
|
||||
func (z *ZurgConfig) GetPort() string {
|
||||
if os.Getenv("PORT") != "" {
|
||||
return os.Getenv("PORT")
|
||||
}
|
||||
if z.Port == "" {
|
||||
return "9999"
|
||||
}
|
||||
@@ -95,6 +100,9 @@ func (z *ZurgConfig) GetPassword() string {
|
||||
}
|
||||
|
||||
func (z *ZurgConfig) GetProxy() string {
|
||||
if os.Getenv("PROXY") != "" {
|
||||
return os.Getenv("PROXY")
|
||||
}
|
||||
return z.Proxy
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user