mirror of
https://github.com/go-shiori/shiori.git
synced 2025-09-04 12:04:58 +08:00
feat: allow disabling swagger ui and disable it by default (#1026)
* feat: allow disabling swagger ui and disable by default * chore: Add codecov configuration to disable GitHub PR annotations
This commit is contained in:
parent
4aa0f51f10
commit
87bc7a87a5
3 changed files with 14 additions and 8 deletions
2
codecov.yml
Normal file
2
codecov.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
github_checks:
|
||||
annotations: false
|
|
@ -49,13 +49,14 @@ func readDotEnv(logger *logrus.Logger) map[string]string {
|
|||
}
|
||||
|
||||
type HttpConfig struct {
|
||||
Enabled bool `env:"HTTP_ENABLED,default=True"`
|
||||
Port int `env:"HTTP_PORT,default=8080"`
|
||||
Address string `env:"HTTP_ADDRESS,default=:"`
|
||||
RootPath string `env:"HTTP_ROOT_PATH,default=/"`
|
||||
AccessLog bool `env:"HTTP_ACCESS_LOG,default=True"`
|
||||
ServeWebUI bool `env:"HTTP_SERVE_WEB_UI,default=True"`
|
||||
SecretKey []byte `env:"HTTP_SECRET_KEY"`
|
||||
Enabled bool `env:"HTTP_ENABLED,default=True"`
|
||||
Port int `env:"HTTP_PORT,default=8080"`
|
||||
Address string `env:"HTTP_ADDRESS,default=:"`
|
||||
RootPath string `env:"HTTP_ROOT_PATH,default=/"`
|
||||
AccessLog bool `env:"HTTP_ACCESS_LOG,default=True"`
|
||||
ServeWebUI bool `env:"HTTP_SERVE_WEB_UI,default=True"`
|
||||
ServeSwagger bool `env:"HTTP_SERVE_SWAGGER,default=False"`
|
||||
SecretKey []byte `env:"HTTP_SECRET_KEY"`
|
||||
// Fiber Specific
|
||||
BodyLimit int `env:"HTTP_BODY_LIMIT,default=1024"`
|
||||
ReadTimeout time.Duration `env:"HTTP_READ_TIMEOUT,default=10s"`
|
||||
|
|
|
@ -61,7 +61,10 @@ func (s *HttpServer) Setup(cfg *config.Config, deps *dependencies.Dependencies)
|
|||
s.handle("/system", routes.NewSystemRoutes(s.logger))
|
||||
s.handle("/bookmark", routes.NewBookmarkRoutes(s.logger, deps))
|
||||
s.handle("/api/v1", api_v1.NewAPIRoutes(s.logger, deps, legacyRoutes.HandleLogin))
|
||||
s.handle("/swagger", routes.NewSwaggerAPIRoutes(s.logger))
|
||||
|
||||
if cfg.Http.ServeSwagger {
|
||||
s.handle("/swagger", routes.NewSwaggerAPIRoutes(s.logger))
|
||||
}
|
||||
|
||||
s.http.Handler = s.engine
|
||||
s.http.Addr = fmt.Sprintf("%s%d", cfg.Http.Address, cfg.Http.Port)
|
||||
|
|
Loading…
Add table
Reference in a new issue