Skip to content

Commit 67275e3

Browse files
chore (constant): env constants
1 parent c5ee4e0 commit 67275e3

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

server/common/constants.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func init() {
5858
var (
5959
BUILD_REF string
6060
BUILD_DATE string
61-
LICENSE string = "agpl"
61+
LICENSE string = env("LICENSE", "agpl")
6262
SECRET_KEY string
6363
SECRET_KEY_DERIVATE_FOR_PROOF string
6464
SECRET_KEY_DERIVATE_FOR_ADMIN string
@@ -95,3 +95,11 @@ func TrimBase(href string) string {
9595
}
9696
return strings.TrimPrefix(href, base)
9797
}
98+
99+
func env(key string, val string) string {
100+
l := os.Getenv(key)
101+
if l != "" {
102+
return l
103+
}
104+
return val
105+
}

0 commit comments

Comments
 (0)