mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-06 08:22:24 +01:00
chore (constant): env constants
This commit is contained in:
parent
c5ee4e0632
commit
67275e32e9
1 changed files with 9 additions and 1 deletions
|
|
@ -58,7 +58,7 @@ func init() {
|
|||
var (
|
||||
BUILD_REF string
|
||||
BUILD_DATE string
|
||||
LICENSE string = "agpl"
|
||||
LICENSE string = env("LICENSE", "agpl")
|
||||
SECRET_KEY string
|
||||
SECRET_KEY_DERIVATE_FOR_PROOF string
|
||||
SECRET_KEY_DERIVATE_FOR_ADMIN string
|
||||
|
|
@ -95,3 +95,11 @@ func TrimBase(href string) string {
|
|||
}
|
||||
return strings.TrimPrefix(href, base)
|
||||
}
|
||||
|
||||
func env(key string, val string) string {
|
||||
l := os.Getenv(key)
|
||||
if l != "" {
|
||||
return l
|
||||
}
|
||||
return val
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue