Allow access to S3 filesystem via placeholder

This commit is contained in:
Ingo Oppermann
2022-08-23 09:37:18 +03:00
parent 96353aee3d
commit 85a7caffca

View File

@@ -423,8 +423,8 @@ func (a *api) start() error {
baseS3FS.Host = cfg.Address
}
if cfg.Storage.Memory.Auth.Enable {
baseS3FS.User = url.UserPassword(cfg.Storage.Memory.Auth.Username, cfg.Storage.Memory.Auth.Password)
if cfg.Storage.S3.Auth.Enable {
baseS3FS.User = url.UserPassword(cfg.Storage.S3.Auth.Username, cfg.Storage.S3.Auth.Password)
}
s3fs, err := fs.NewS3Filesystem(fs.S3Config{
@@ -485,6 +485,13 @@ func (a *api) start() error {
a.replacer.RegisterTemplate("diskfs", a.diskfs.Base())
a.replacer.RegisterTemplate("memfs", a.memfs.Base())
a.replacer.RegisterTemplate("fs:diskfs", a.diskfs.Base())
a.replacer.RegisterTemplate("fs:memfs", a.memfs.Base())
if a.s3fs != nil {
a.replacer.RegisterTemplate("fs:s3fs", a.s3fs.Base())
}
host, port, _ := gonet.SplitHostPort(cfg.RTMP.Address)
if len(host) == 0 {
host = "localhost"