mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-06 16:32:31 +01:00
feature (license): mechanism to override default license
This commit is contained in:
parent
3b48a5fa80
commit
1c3736e6f2
1 changed files with 3 additions and 3 deletions
|
|
@ -15,8 +15,9 @@ type license struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
lenv := os.Getenv("LICENSE")
|
||||||
Hooks.Register.Onload(func() {
|
Hooks.Register.Onload(func() {
|
||||||
if LICENSE != "agpl" {
|
if LICENSE != "agpl" && lenv == "" {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
data, err := DecryptString(fmt.Sprintf("%-16s", "filestash"), Config.Get("general.license").Schema(func(f *FormElement) *FormElement {
|
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.Type = "text"
|
||||||
f.Placeholder = "License Key"
|
f.Placeholder = "License Key"
|
||||||
f.Description = "Reach out to support@filestash.app to get your license"
|
f.Description = "Reach out to support@filestash.app to get your license"
|
||||||
lenv := os.Getenv("LICENSE")
|
|
||||||
if lenv != "" {
|
if lenv != "" {
|
||||||
f.Value = os.Getenv("LICENSE")
|
f.Value = lenv
|
||||||
f.ReadOnly = true
|
f.ReadOnly = true
|
||||||
}
|
}
|
||||||
return f
|
return f
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue