mirror of
https://github.com/linux-do/new-api.git
synced 2025-09-25 03:16:37 +08:00
Warning when SESSION_SECRET is 'random_string'
This commit is contained in:
parent
c5f08a757d
commit
6463e0539f
@ -36,7 +36,14 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if os.Getenv("SESSION_SECRET") != "" {
|
if os.Getenv("SESSION_SECRET") != "" {
|
||||||
SessionSecret = os.Getenv("SESSION_SECRET")
|
ss := os.Getenv("SESSION_SECRET")
|
||||||
|
if ss == "random_string" {
|
||||||
|
log.Println("WARNING: SESSION_SECRET is set to the default value 'random_string', please change it to a random string.")
|
||||||
|
log.Println("警告:SESSION_SECRET被设置为默认值'random_string',请修改为随机字符串。")
|
||||||
|
log.Fatal("Please set SESSION_SECRET to a random string.")
|
||||||
|
} else {
|
||||||
|
SessionSecret = ss
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if os.Getenv("SQLITE_PATH") != "" {
|
if os.Getenv("SQLITE_PATH") != "" {
|
||||||
SQLitePath = os.Getenv("SQLITE_PATH")
|
SQLitePath = os.Getenv("SQLITE_PATH")
|
||||||
|
Loading…
Reference in New Issue
Block a user