From b7fcb319da622a6de340b34e9255efd5fae6cf19 Mon Sep 17 00:00:00 2001 From: JustSong Date: Wed, 20 Dec 2023 22:50:50 +0800 Subject: [PATCH] chore: check if SESSION_SECRET equals to random_string --- common/init.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/init.go b/common/init.go index 1e9c85ce63..12df5f51c2 100644 --- a/common/init.go +++ b/common/init.go @@ -36,7 +36,11 @@ func init() { } if os.Getenv("SESSION_SECRET") != "" { - SessionSecret = os.Getenv("SESSION_SECRET") + if os.Getenv("SESSION_SECRET") == "random_string" { + SysError("SESSION_SECRET is set to an example value, please change it to a random string.") + } else { + SessionSecret = os.Getenv("SESSION_SECRET") + } } if os.Getenv("SQLITE_PATH") != "" { SQLitePath = os.Getenv("SQLITE_PATH")