mirror of
https://github.com/hay-kot/homebox.git
synced 2024-11-22 08:35:43 +00:00
feat: expose timeout variables (#622)
* expose timeout variables * formatting
This commit is contained in:
parent
a70ee33759
commit
eeae790fe4
7 changed files with 21 additions and 13 deletions
|
@ -167,7 +167,6 @@ func (ctrl *V1Controller) HandleItemUpdate() errchain.HandlerFunc {
|
||||||
return adapters.ActionID("id", fn, http.StatusOK)
|
return adapters.ActionID("id", fn, http.StatusOK)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// HandleItemPatch godocs
|
// HandleItemPatch godocs
|
||||||
//
|
//
|
||||||
// @Summary Update Item
|
// @Summary Update Item
|
||||||
|
|
|
@ -146,6 +146,9 @@ func run(cfg *config.Config) error {
|
||||||
app.server = server.NewServer(
|
app.server = server.NewServer(
|
||||||
server.WithHost(app.conf.Web.Host),
|
server.WithHost(app.conf.Web.Host),
|
||||||
server.WithPort(app.conf.Web.Port),
|
server.WithPort(app.conf.Web.Port),
|
||||||
|
server.WithReadTimeout(app.conf.Web.ReadTimeout),
|
||||||
|
server.WithWriteTimeout(app.conf.Web.WriteTimeout),
|
||||||
|
server.WithIdleTimeout(app.conf.Web.IdleTimeout),
|
||||||
)
|
)
|
||||||
log.Info().Msgf("Starting HTTP Server on %s:%s", app.server.Host, app.server.Port)
|
log.Info().Msgf("Starting HTTP Server on %s:%s", app.server.Host, app.server.Port)
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,9 @@ type WebConfig struct {
|
||||||
Port string `yaml:"port" conf:"default:7745"`
|
Port string `yaml:"port" conf:"default:7745"`
|
||||||
Host string `yaml:"host"`
|
Host string `yaml:"host"`
|
||||||
MaxUploadSize int64 `yaml:"max_file_upload" conf:"default:10"`
|
MaxUploadSize int64 `yaml:"max_file_upload" conf:"default:10"`
|
||||||
|
ReadTimeout int `yaml:"read_timeout" conf:"default:10"`
|
||||||
|
WriteTimeout int `yaml:"write_timeout" conf:"default:10"`
|
||||||
|
IdleTimeout int `yaml:"idle_timeout" conf:"default:30"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// New parses the CLI/Config file and returns a Config struct. If the file argument is an empty string, the
|
// New parses the CLI/Config file and returns a Config struct. If the file argument is an empty string, the
|
||||||
|
|
|
@ -62,6 +62,9 @@ volumes:
|
||||||
| HBOX_OPTIONS_ALLOW_REGISTRATION | true | allow users to register themselves |
|
| HBOX_OPTIONS_ALLOW_REGISTRATION | true | allow users to register themselves |
|
||||||
| HBOX_OPTIONS_AUTO_INCREMENT_ASSET_ID | true | auto increments the asset_id field for new items |
|
| HBOX_OPTIONS_AUTO_INCREMENT_ASSET_ID | true | auto increments the asset_id field for new items |
|
||||||
| HBOX_WEB_MAX_UPLOAD_SIZE | 10 | maximum file upload size supported in MB |
|
| HBOX_WEB_MAX_UPLOAD_SIZE | 10 | maximum file upload size supported in MB |
|
||||||
|
| HBOX_WEB_READ_TIMEOUT | 10 | Read timeout of HTTP sever |
|
||||||
|
| HBOX_WEB_WRITE_TIMEOUT | 10 | Write timeout of HTTP server |
|
||||||
|
| HBOX_WEB_IDLE_TIMEOUT | 30 | Idle timeout of HTTP server |
|
||||||
| HBOX_STORAGE_DATA | /data/ | path to the data directory, do not change this if you're using docker |
|
| HBOX_STORAGE_DATA | /data/ | path to the data directory, do not change this if you're using docker |
|
||||||
| HBOX_STORAGE_SQLITE_URL | /data/homebox.db?_fk=1 | sqlite database url, if you're using docker do not change this |
|
| HBOX_STORAGE_SQLITE_URL | /data/homebox.db?_fk=1 | sqlite database url, if you're using docker do not change this |
|
||||||
| HBOX_LOG_LEVEL | info | log level to use, can be one of: trace, debug, info, warn, error, critical |
|
| HBOX_LOG_LEVEL | info | log level to use, can be one of: trace, debug, info, warn, error, critical |
|
||||||
|
|
Loading…
Reference in a new issue