owncast/core/storage.go
Gabe Kangas 0b5d7c8a4d
Config repository (#3988)
* WIP

* fix(test): fix ap test failing

* fix: fix unkeyed fields being used

* chore(tests): clean up browser tests by splitting out federation UI tests
2024-11-15 19:20:58 -08:00

25 lines
486 B
Go

package core
import (
"github.com/owncast/owncast/core/storageproviders"
"github.com/owncast/owncast/persistence/configrepository"
)
func setupStorage() error {
configRepository := configrepository.Get()
s3Config := configRepository.GetS3Config()
if s3Config.Enabled {
_storage = storageproviders.NewS3Storage()
} else {
_storage = storageproviders.NewLocalStorage()
}
if err := _storage.Setup(); err != nil {
return err
}
handler.Storage = _storage
return nil
}