diff options
| author | James Mills <prologic@shortcircuit.net.au> | 2020-03-29 17:41:10 +1000 |
|---|---|---|
| committer | James Mills <prologic@shortcircuit.net.au> | 2020-03-29 17:41:10 +1000 |
| commit | a22a2ae031f2c02b41aa9a7c1746b2989bcf0126 (patch) | |
| tree | 8af65c4e69a6661e7554330f6d0d61c60bdde6f3 /app/config.go | |
| parent | b8aee1d2b5f09ae68f46e00f83eccff2dcf0bb55 (diff) | |
Add maximum upload size saftey and guards
Diffstat (limited to 'app/config.go')
| -rw-r--r-- | app/config.go | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/app/config.go b/app/config.go index 73871eb..4d72657 100644 --- a/app/config.go +++ b/app/config.go @@ -22,10 +22,11 @@ type PathConfig struct { // ServerConfig settings for App Server. type ServerConfig struct { - Host string `json:"host"` - Port int `json:"port"` - StorePath string `json:"store_path"` - UploadPath string `json:"upload_path"` + Host string `json:"host"` + Port int `json:"port"` + StorePath string `json:"store_path"` + UploadPath string `json:"upload_path"` + MaxUploadSize int64 `json:"max_upload_size"` } // ThumbnailerConfig settings for Transcoder @@ -61,15 +62,16 @@ func DefaultConfig() *Config { }, }, Server: &ServerConfig{ - Host: "127.0.0.1", - Port: 0, - UploadPath: "uploads", + Host: "0.0.0.0", + Port: 8000, + UploadPath: "uploads", + MaxUploadSize: 104857600, }, Thumbnailer: &ThumbnailerConfig{ - Timeout: 30, + Timeout: 60, }, Transcoder: &TranscoderConfig{ - Timeout: 60, + Timeout: 300, }, Feed: &FeedConfig{ ExternalURL: "http://localhost", |
