Documentation
¶
Index ¶
- func FiberConfig(trustProxy ...bool) fiber.Config
- func InitServer(setupLogger *zap.SugaredLogger, uiAssets embed.FS, pluginAssets embed.FS)
- func PrepareServer(setupLogger *zap.SugaredLogger)
- func RecoverMiddleware(logger *zap.SugaredLogger) fiber.Handler
- func StartUpdater(logger *zap.SugaredLogger, s *settings.Settings, currentVersion string, ...) *updater.Updater
- type RequiredTool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FiberConfig ¶ added in v0.7.0
FiberConfig is the HTTP server's configuration.
Immutable: without it, the strings fiber hands out (route parameters, cookies, form values) point into its request buffer, which is reused for the next request. etherpad-go keeps pad ids from requests beyond the request (the pad cache, pad locks, the memory datastore), so a pad id taken from one request turned into another request's pad id afterwards: an import into pad "d" made pad "s" disappear from the memory store, and a cached pad could be found under another pad's id.
trustProxy is the trustProxy setting (etherpad-lite: express "trust proxy"): behind a reverse proxy the client's address, the scheme (https) and the host come from its X-Forwarded-* headers. It used to be ignored, so every client had the proxy's address (rate limiting and logs) and cookies never got Secure.
func InitServer ¶
func PrepareServer ¶
func PrepareServer(setupLogger *zap.SugaredLogger)
func RecoverMiddleware ¶ added in v0.7.0
func RecoverMiddleware(logger *zap.SugaredLogger) fiber.Handler
RecoverMiddleware is recoverMiddleware for tests that build their own app.
func StartUpdater ¶ added in v0.6.5
func StartUpdater(logger *zap.SugaredLogger, s *settings.Settings, currentVersion string, broadcast func(secsLeft int)) *updater.Updater
StartUpdater builds, starts and returns the self-update orchestrator. The broadcast callback (may be nil) is invoked with the seconds remaining at each drain announcement so connected clients can be warned of the restart.