add jwtkey config to avoid logging in again after reboot

This commit is contained in:
2025-10-04 23:15:20 +02:00
parent c5d71bbfeb
commit f18e6a3ba8
3 changed files with 15 additions and 4 deletions

View File

@@ -12,10 +12,16 @@ type Config struct {
Port string `toml:"port" comment:"The port to listen on for the server."`
DatabaseFilePath string `toml:"database_file_path" comment:"Path to sqlite database file."`
DemoDataPath string `toml:"demo_data_path" comment:"The path to the sql file to load for demo data."`
JWTKey string `toml:"jwt_key" comment:"The key used to encrypt the generated JWT. Encoded in base64. If empty a random one will be generated on every restart."`
}
func defaultConfig() Config {
return Config{Port: "8080", DatabaseFilePath: "plm.db", DemoDataPath: ""}
return Config{
Port: "8080",
DatabaseFilePath: "plm.db",
DemoDataPath: "",
JWTKey: "",
}
}
func LoadConfig(configPath string) Config {