diff options
| author | James Mills <prologic@shortcircuit.net.au> | 2020-03-29 19:02:52 +1000 |
|---|---|---|
| committer | James Mills <prologic@shortcircuit.net.au> | 2020-03-29 19:02:52 +1000 |
| commit | 980a3edf63551b60a85307005cdb6f0380932d83 (patch) | |
| tree | f654806f165b3ba40affd4cc6bc4eb834d5371a3 /app | |
| parent | a22a2ae031f2c02b41aa9a7c1746b2989bcf0126 (diff) | |
Fix default server config and ensure upload and video paths exist
Diffstat (limited to 'app')
| -rw-r--r-- | app/app.go | 6 | ||||
| -rw-r--r-- | app/config.go | 3 |
2 files changed, 8 insertions, 1 deletions
@@ -162,6 +162,12 @@ func (a *App) Run() error { } a.Watcher.Add(p.Path) } + if err := os.MkdirAll(a.Config.Server.UploadPath, 0755); err != nil { + return fmt.Errorf( + "error creating upload path %s: %w", + a.Config.Server.UploadPath, err, + ) + } buildFeed(a) go startWatcher(a) return http.Serve(a.Listener, a.Router) diff --git a/app/config.go b/app/config.go index 4d72657..9c0e733 100644 --- a/app/config.go +++ b/app/config.go @@ -64,6 +64,7 @@ func DefaultConfig() *Config { Server: &ServerConfig{ Host: "0.0.0.0", Port: 8000, + StorePath: "tube.db", UploadPath: "uploads", MaxUploadSize: 104857600, }, @@ -74,7 +75,7 @@ func DefaultConfig() *Config { Timeout: 300, }, Feed: &FeedConfig{ - ExternalURL: "http://localhost", + ExternalURL: "http://localhost:8000", }, } } |
