mirror of
https://github.com/go-shiori/shiori.git
synced 2025-10-04 02:36:47 +08:00
* chore: use http.NoBody * fix: remove cookie token on logout * fix: remove token cookie on middleware and redirect * fix: frontend sets cookie token if authenticated * refactor: remove session-id, rely on token only * docs: make swagger * fix: redirect * fix: archive route handler * fix: properly unset cookie
32 lines
798 B
Go
32 lines
798 B
Go
package webserver
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/go-shiori/shiori/internal/model"
|
|
cch "github.com/patrickmn/go-cache"
|
|
)
|
|
|
|
// Config is parameter that used for starting web server
|
|
type Config struct {
|
|
DB model.DB
|
|
DataDir string
|
|
ServerAddress string
|
|
ServerPort int
|
|
RootPath string
|
|
Log bool
|
|
}
|
|
|
|
// GetLegacyHandler returns a legacy handler to use with the new webserver
|
|
func GetLegacyHandler(cfg Config, dependencies model.Dependencies) *Handler {
|
|
return &Handler{
|
|
DB: cfg.DB,
|
|
DataDir: cfg.DataDir,
|
|
UserCache: cch.New(time.Hour, 10*time.Minute),
|
|
// SessionCache: cch.New(time.Hour, 10*time.Minute),
|
|
ArchiveCache: cch.New(time.Minute, 5*time.Minute),
|
|
RootPath: cfg.RootPath,
|
|
Log: cfg.Log,
|
|
dependencies: dependencies,
|
|
}
|
|
}
|