From bc096c388bb0beeee09fa866a55ea1fbb41b9cb6 Mon Sep 17 00:00:00 2001 From: FChannel <> Date: Thu, 16 Jun 2022 13:59:15 -0700 Subject: config to set static modkey instead of randomly generate --- config/config.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/config.go b/config/config.go index 11f4792..02d43eb 100644 --- a/config/config.go +++ b/config/config.go @@ -33,10 +33,12 @@ var PostCountPerPage = 10 var SupportedFiles = []string{"image/gif", "image/jpeg", "image/png", "image/webp", "image/apng", "video/mp4", "video/ogg", "video/webm", "audio/mpeg", "audio/ogg", "audio/wav", "audio/wave", "audio/x-wav"} var Log = log.New(os.Stdout, "", log.Ltime) var MediaHashs = make(map[string]string) -var Key string +var Key = GetConfigValue("modkey", "") var Themes []string var DB *sql.DB +// TODO Change this to some other config format like YAML +// to save into a struct and only read once func GetConfigValue(value string, ifnone string) string { file, err := os.Open("config/config-init") -- cgit v1.2.3