diff --git a/cmd/litestream/main.go b/cmd/litestream/main.go index bc75bf8..d6d145e 100644 --- a/cmd/litestream/main.go +++ b/cmd/litestream/main.go @@ -309,10 +309,12 @@ func NewDBFromConfigWithPath(dbc *DBConfig, path string) (*litestream.DB, error) // Attach upstream HTTP client if specified. if upstreamURL := dbc.Upstream.URL; upstreamURL != "" { - if dbc.Upstream.Path == "" { - return nil, fmt.Errorf("upstream path required") + // Use local database path if upstream path is not specified. + upstreamPath := dbc.Upstream.Path + if upstreamPath == "" { + upstreamPath = db.Path() } - db.StreamClient = http.NewClient(upstreamURL, dbc.Upstream.Path) + db.StreamClient = http.NewClient(upstreamURL, upstreamPath) } // Override default database settings if specified in configuration.