From cfa915142c2bbff8d1572488b6343e56dfef9b64 Mon Sep 17 00:00:00 2001 From: Raul Benencia Date: Tue, 12 Jan 2021 16:57:26 -0800 Subject: Segregate BindAddr and BaseURL --- internal/environment/environment.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'internal/environment/environment.go') diff --git a/internal/environment/environment.go b/internal/environment/environment.go index eac0430..8dad2c9 100644 --- a/internal/environment/environment.go +++ b/internal/environment/environment.go @@ -35,7 +35,6 @@ import ( // Environment struct holds the shoelaces instance global data. type Environment struct { ConfigFile string - BaseURL string HostnameMaps []mappings.HostnameMap NetworkMaps []mappings.NetworkMap ServerStates *server.States @@ -46,8 +45,8 @@ type Environment struct { Environments []string // Valid config environments Logger log.Logger - Port int - Domain string + BindAddr string + BaseURL string DataDir string StaticDir string EnvDir string @@ -66,7 +65,10 @@ func New() *Environment { env.Logger = log.AllowDebug(env.Logger) } - env.BaseURL = fmt.Sprintf("%s:%d", env.Domain, env.Port) + if env.BaseURL == "" { + env.BaseURL = env.BindAddr + } + env.Environments = env.initEnvOverrides() env.EventLog = &event.Log{} -- cgit v1.2.3