mirror of
https://github.com/thomiceli/opengist.git
synced 2025-07-13 03:11:51 +02:00
Allow to define secret key & move the secret key file to parent directory (#358)
This commit is contained in:
@ -167,10 +167,8 @@ type Server struct {
|
||||
func NewServer(isDev bool, sessionsPath string) *Server {
|
||||
dev = isDev
|
||||
flashStore = sessions.NewCookieStore([]byte("opengist"))
|
||||
userStore = sessions.NewFilesystemStore(sessionsPath,
|
||||
utils.GenerateSecretKey(path.Join(sessionsPath, "session-auth.key")),
|
||||
utils.GenerateSecretKey(path.Join(sessionsPath, "session-encrypt.key")),
|
||||
)
|
||||
encryptKey, _ := utils.GenerateSecretKey(filepath.Join(sessionsPath, "session-encrypt.key"))
|
||||
userStore = sessions.NewFilesystemStore(sessionsPath, config.SecretKey, encryptKey)
|
||||
userStore.MaxLength(10 * 1024)
|
||||
gothic.Store = userStore
|
||||
|
||||
|
Reference in New Issue
Block a user