mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-15 19:48:06 +01:00
🔒 Randomly generate the cookie key https://github.com/siyuan-note/siyuan/issues/16690
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
cef8ca8cf7
commit
a65dcd220f
5 changed files with 13 additions and 7 deletions
|
|
@ -62,7 +62,7 @@ const (
|
|||
)
|
||||
|
||||
var (
|
||||
sessionStore = cookie.NewStore([]byte("ATN51UlxVq1Gcvdf"))
|
||||
sessionStore cookie.Store
|
||||
|
||||
HttpMethods = []string{
|
||||
http.MethodGet,
|
||||
|
|
@ -129,7 +129,7 @@ var (
|
|||
}
|
||||
)
|
||||
|
||||
func Serve(fastMode bool) {
|
||||
func Serve(fastMode bool, cookieKey string) {
|
||||
gin.SetMode(gin.ReleaseMode)
|
||||
ginServer := gin.New()
|
||||
ginServer.UseH2C = true
|
||||
|
|
@ -143,6 +143,7 @@ func Serve(fastMode bool) {
|
|||
gzip.Gzip(gzip.DefaultCompression, gzip.WithExcludedExtensions([]string{".pdf", ".mp3", ".wav", ".ogg", ".mov", ".weba", ".mkv", ".mp4", ".webm", ".flac"})),
|
||||
)
|
||||
|
||||
sessionStore = cookie.NewStore([]byte(cookieKey))
|
||||
sessionStore.Options(sessions.Options{
|
||||
Path: "/",
|
||||
Secure: util.SSL,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue