diff --git a/Deploy/templates/ui/env b/Deploy/templates/ui/env index 6a02f08ac..972d94df7 100644 --- a/Deploy/templates/ui/env +++ b/Deploy/templates/ui/env @@ -13,7 +13,7 @@ LDAP_URL=$ldap_url LDAP_BASE_DN=$ldap_basedn UI_SECRET=$ui_secret SELF_REGISTRATION=$self_registration -PRODUCTION=$use_compressed_js +USE_COMPRESSED_JS=$use_compressed_js LOG_LEVEL=debug GODEBUG=netdns=cgo EXT_ENDPOINT=$ui_url diff --git a/controllers/base.go b/controllers/base.go index ca32bd247..bd9a23bf7 100644 --- a/controllers/base.go +++ b/controllers/base.go @@ -21,7 +21,7 @@ type BaseController struct { SelfRegistration bool IsAdmin bool AuthMode string - Production bool + UseCompressedJS bool } type langType struct { @@ -99,13 +99,13 @@ func (b *BaseController) Prepare() { b.AuthMode = authMode b.Data["AuthMode"] = b.AuthMode - production := os.Getenv("PRODUCTION") - if production == "on" { - b.Production = true + useCompressedJS := os.Getenv("USE_COMPRESSED_JS") + if useCompressedJS == "on" { + b.UseCompressedJS = true } if _, err := os.Stat(filepath.Join("static", "resources", "js", "harbor.app.min.js")); os.IsNotExist(err) { - b.Production = false + b.UseCompressedJS = false } } @@ -117,7 +117,7 @@ func (b *BaseController) Forward(title, templateName string) { b.LayoutSections = make(map[string]string) b.LayoutSections["HeaderInclude"] = filepath.Join(prefixNg, viewPath, "header-include.htm") - if b.Production { + if b.UseCompressedJS { b.LayoutSections["HeaderScriptInclude"] = filepath.Join(prefixNg, viewPath, "script-min-include.htm") } else { b.LayoutSections["HeaderScriptInclude"] = filepath.Join(prefixNg, viewPath, "script-include.htm")