diff --git a/cmd/misc/main.go b/cmd/misc/main.go index b99d0b7b16..bd2e69b3a0 100644 --- a/cmd/misc/main.go +++ b/cmd/misc/main.go @@ -415,6 +415,15 @@ func disableUserPerEmail() error { if opts.Email == "" { return errors.New("no email specified") } + + if utils.Config.Frontend.SessionSecret == "" { + return fmt.Errorf("session secret is empty, please provide a secure random string") + } + + logrus.Infof("initializing session store: %v", utils.Config.RedisSessionStoreEndpoint) + + utils.InitSessionStore(utils.Config.Frontend.SessionSecret) + user := struct { ID uint64 `db:"id"` Email string `db:"email"` diff --git a/ratelimit/ratelimit.go b/ratelimit/ratelimit.go index ba872b71ca..b42bb45fde 100644 --- a/ratelimit/ratelimit.go +++ b/ratelimit/ratelimit.go @@ -183,7 +183,7 @@ func (r *responseWriterDelegator) Status() int { } var DefaultRequestFilter = func(req *http.Request) bool { - if req.URL == nil || !strings.HasPrefix(req.URL.Path, "/api") { + if req.URL == nil || !strings.HasPrefix(req.URL.Path, "/api") || strings.HasPrefix(req.URL.Path, "/api/i/") || strings.HasPrefix(req.URL.Path, "/api/v1/docs/") || strings.HasPrefix(req.URL.Path, "/api/v2/docs/") { return false } return true