Add HTTPFS implementation ()

This commit is contained in:
Antonio Navarro Perez 2021-11-23 13:05:49 +01:00 committed by GitHub
parent 1d769673ca
commit 47198b3bc6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 549 additions and 44 deletions
cmd/distribyted

View file

@ -212,9 +212,15 @@ func load(configPath string, port, webDAVPort int, fuseAllowOther bool) error {
log.Warn().Msg("webDAV configuration not found!")
}()
cfs, err := fs.NewContainerFs(fss)
if err != nil {
return fmt.Errorf("error when loading torrents: %w", err)
}
httpfs := torrent.NewHTTPFS(cfs)
logFilename := filepath.Join(conf.Log.Path, dlog.FileName)
err = http.New(fc, ss, ts, ch, servers, port, logFilename)
err = http.New(fc, ss, ts, ch, servers, httpfs, logFilename, conf.HTTPGlobal)
log.Error().Err(err).Msg("error initializing HTTP server")
return err
}