* Support path-based S3 storage. Closes #1495 Revert "Remove forcing old path-style URLs with s3. Closes #497" This reverts commit b2953028cf6d9040dba2c41268fb3db62260b65a. * #1495 Path-style S3 compatibile URLs implemented https://github.com/owncast/owncast/issues/1495 It gives ability to use S3 compatibile providers that doesn't support virtual-host-style URLs (i.e. Oracle Cloud Object Storage) Co-authored-by: Artur Angiel <artur@angiel.ovh>
This commit is contained in:
parent
2600afa022
commit
2110dfd30c
@ -34,6 +34,7 @@ type S3Storage struct {
|
|||||||
s3AccessKey string
|
s3AccessKey string
|
||||||
s3Secret string
|
s3Secret string
|
||||||
s3ACL string
|
s3ACL string
|
||||||
|
s3ForcePathStyle bool
|
||||||
|
|
||||||
// If we try to upload a playlist but it is not yet on disk
|
// If we try to upload a playlist but it is not yet on disk
|
||||||
// then keep a reference to it here.
|
// then keep a reference to it here.
|
||||||
@ -67,6 +68,7 @@ func (s *S3Storage) Setup() error {
|
|||||||
s.s3AccessKey = s3Config.AccessKey
|
s.s3AccessKey = s3Config.AccessKey
|
||||||
s.s3Secret = s3Config.Secret
|
s.s3Secret = s3Config.Secret
|
||||||
s.s3ACL = s3Config.ACL
|
s.s3ACL = s3Config.ACL
|
||||||
|
s.s3ForcePathStyle = s3Config.ForcePathStyle
|
||||||
|
|
||||||
s.sess = s.connectAWS()
|
s.sess = s.connectAWS()
|
||||||
|
|
||||||
@ -184,9 +186,10 @@ func (s *S3Storage) connectAWS() *session.Session {
|
|||||||
|
|
||||||
sess, err := session.NewSession(
|
sess, err := session.NewSession(
|
||||||
&aws.Config{
|
&aws.Config{
|
||||||
Region: aws.String(s.s3Region),
|
Region: aws.String(s.s3Region),
|
||||||
Credentials: creds,
|
Credentials: creds,
|
||||||
Endpoint: aws.String(s.s3Endpoint),
|
Endpoint: aws.String(s.s3Endpoint),
|
||||||
|
S3ForcePathStyle: aws.Bool(s.s3ForcePathStyle),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -10,4 +10,5 @@ type S3 struct {
|
|||||||
Bucket string `json:"bucket,omitempty"`
|
Bucket string `json:"bucket,omitempty"`
|
||||||
Region string `json:"region,omitempty"`
|
Region string `json:"region,omitempty"`
|
||||||
ACL string `json:"acl,omitempty"`
|
ACL string `json:"acl,omitempty"`
|
||||||
|
ForcePathStyle bool `json:"forcePathStyle"`
|
||||||
}
|
}
|
||||||
|
@ -160,6 +160,8 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
acl:
|
acl:
|
||||||
type: string
|
type: string
|
||||||
|
forcePathStyle:
|
||||||
|
type: boolean
|
||||||
required:
|
required:
|
||||||
- enabled
|
- enabled
|
||||||
StreamQuality:
|
StreamQuality:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user