From 1c3736e6f2b5e224e621d30a12b8349bb386bf43 Mon Sep 17 00:00:00 2001 From: MickaelK Date: Thu, 28 Aug 2025 10:47:31 +1000 Subject: [PATCH] feature (license): mechanism to override default license --- server/plugin/plg_license/index.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/plugin/plg_license/index.go b/server/plugin/plg_license/index.go index 0c9f1fef..85f2f02d 100644 --- a/server/plugin/plg_license/index.go +++ b/server/plugin/plg_license/index.go @@ -15,8 +15,9 @@ type license struct { } func init() { + lenv := os.Getenv("LICENSE") Hooks.Register.Onload(func() { - if LICENSE != "agpl" { + if LICENSE != "agpl" && lenv == "" { return } data, err := DecryptString(fmt.Sprintf("%-16s", "filestash"), Config.Get("general.license").Schema(func(f *FormElement) *FormElement { @@ -27,9 +28,8 @@ func init() { f.Type = "text" f.Placeholder = "License Key" f.Description = "Reach out to support@filestash.app to get your license" - lenv := os.Getenv("LICENSE") if lenv != "" { - f.Value = os.Getenv("LICENSE") + f.Value = lenv f.ReadOnly = true } return f