From c4a3118e9f885e92bb9b7d882898e9a51fc3be69 Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Tue, 2 Aug 2016 16:37:09 -0400 Subject: PLT-3408 Add SiteURL to config.json (#3692) * PLT-3408 Changed serverside code to get the service's URL from config.json * PLT-3408 Changed most clientside code to use the SiteURL config setting instead of window.location * PLT-3408 Changed default SiteURL to be autodetected --- utils/config.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'utils') diff --git a/utils/config.go b/utils/config.go index 194aba5f4..868e96b51 100644 --- a/utils/config.go +++ b/utils/config.go @@ -185,7 +185,7 @@ func LoadConfig(fileName string) { } Cfg = &config - ClientCfg = getClientConfig(Cfg) + RegenerateClientConfig() // Actions that need to run every time the config is loaded if ldapI := einterfaces.GetLdapInterface(); ldapI != nil { @@ -198,6 +198,10 @@ func LoadConfig(fileName string) { } } +func RegenerateClientConfig() { + ClientCfg = getClientConfig(Cfg) +} + func getClientConfig(c *model.Config) map[string]string { props := make(map[string]string) @@ -208,6 +212,7 @@ func getClientConfig(c *model.Config) map[string]string { props["BuildHashEnterprise"] = model.BuildHashEnterprise props["BuildEnterpriseReady"] = model.BuildEnterpriseReady + props["SiteURL"] = *c.ServiceSettings.SiteURL props["SiteName"] = c.TeamSettings.SiteName props["EnableTeamCreation"] = strconv.FormatBool(c.TeamSettings.EnableTeamCreation) props["EnableUserCreation"] = strconv.FormatBool(c.TeamSettings.EnableUserCreation) -- cgit v1.2.3-1-g7c22