diff --git a/internal/config/config.go b/internal/config/config.go index 564a0c41..7ae231b7 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -87,6 +87,7 @@ func DefaultConfig() *Config { config.ListenAddressRestActions = "localhost:1338" config.ListenAddressGrpcActions = "localhost:1339" config.ListenAddressWebUI = "localhost:1340" + config.ExternalRestAddress = "" config.LogLevel = "INFO" config.CheckForUpdates = true config.DefaultPermissions.Exec = true diff --git a/internal/httpservers/httpServer.go b/internal/httpservers/httpServer.go index f94b6651..be581f7e 100644 --- a/internal/httpservers/httpServer.go +++ b/internal/httpservers/httpServer.go @@ -8,9 +8,10 @@ import ( // for both of them. func StartServers(cfg *config.Config) { go startWebUIServer(cfg) - go startRestAPIServer(cfg) if cfg.UseSingleHTTPFrontend { - StartSingleHTTPFrontend(cfg) + go StartSingleHTTPFrontend(cfg) } + + startRestAPIServer(cfg) } diff --git a/internal/httpservers/webuiServer.go b/internal/httpservers/webuiServer.go index 12f616f2..38c230d3 100644 --- a/internal/httpservers/webuiServer.go +++ b/internal/httpservers/webuiServer.go @@ -44,16 +44,10 @@ func findWebuiDir() string { } func generateWebUISettings(w http.ResponseWriter, r *http.Request) { - restAddress := "" - - if !cfg.UseSingleHTTPFrontend { - restAddress = cfg.ExternalRestAddress - } - jsonRet, _ := json.Marshal(webUISettings{ - Rest: restAddress + "/api/", + Rest: cfg.ExternalRestAddress + "/api/", ThemeName: cfg.ThemeName, - ShowFooter: cfg.ShowFooter, + ShowFooter: cfg.ShowFooter, ShowNavigation: cfg.ShowNavigation, ShowNewVersions: cfg.ShowNewVersions, AvailableVersion: updatecheck.AvailableVersion,