diff --git a/assets/stores/config.ts b/assets/stores/config.ts index cf1bbca0..225df15c 100644 --- a/assets/stores/config.ts +++ b/assets/stores/config.ts @@ -3,11 +3,11 @@ const text = document.querySelector("script#config__json")?.textContent || "{}"; interface Config { version: string; base: string; - authorizationNeeded: boolean | "false" | "true"; - secured: boolean | "false" | "true"; + authorizationNeeded: boolean; + secured: boolean; maxLogs: number; hostname: string; - hosts: string[] | string; + hosts: string[]; } const pageConfig = JSON.parse(text); @@ -17,22 +17,6 @@ const config: Config = { ...pageConfig, }; -if (config.version == "{{ .Version }}") { - config.version = "master"; - config.base = ""; - config.authorizationNeeded = false; - config.secured = false; - config.hostname = "localhost"; - config.hosts = ["localhost", "64.225.88.189"]; -} else { - config.version = config.version.replace(/^v/, ""); - config.authorizationNeeded = config.authorizationNeeded === "true"; - config.secured = config.secured === "true"; - config.hosts = (config.hosts as string).split(","); -} +config.version = config.version.replace(/^v/, ""); -export default config as Omit & { - hosts: string[]; - authorizationNeeded: boolean; - secured: boolean; -}; +export default config; diff --git a/web/routes.go b/web/routes.go index 6bf206cf..c22e94a3 100644 --- a/web/routes.go +++ b/web/routes.go @@ -161,19 +161,19 @@ func (h *handler) executeTemplate(w http.ResponseWriter, req *http.Request) { } config := struct { - Base string `json:"base"` - Version string `json:"version"` - AuthorizationNeeded bool `json:"authorizationNeeded"` - Secured bool `json:"secured"` - Hostname string `json:"hostname"` - Hosts string `json:"hosts"` + Base string `json:"base"` + Version string `json:"version"` + AuthorizationNeeded bool `json:"authorizationNeeded"` + Secured bool `json:"secured"` + Hostname string `json:"hostname"` + Hosts []string `json:"hosts"` }{ path, h.config.Version, h.isAuthorizationNeeded(req), secured, h.config.Hostname, - strings.Join(hosts, ","), + hosts, } data := map[string]interface{}{