diff --git a/go.mod b/go.mod index 0f7e9510..3343622f 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/livekit/egress -go 1.22.1 +go 1.23.1 require ( cloud.google.com/go/storage v1.43.0 @@ -25,7 +25,7 @@ require ( github.com/livekit/mageutil v0.0.0-20230125210925-54e8a70427c1 github.com/livekit/protocol v1.26.1-0.20241017190602-ef6fc8f9c752 github.com/livekit/psrpc v0.6.1-0.20240924010758-9f0a4268a3b9 - github.com/livekit/server-sdk-go/v2 v2.2.1 + github.com/livekit/server-sdk-go/v2 v2.2.2-0.20241015094126-b8538ae5d67b github.com/pion/rtp v1.8.9 github.com/pion/webrtc/v3 v3.3.1 github.com/prometheus/client_golang v1.20.3 @@ -39,7 +39,7 @@ require ( golang.org/x/oauth2 v0.23.0 google.golang.org/api v0.196.0 google.golang.org/grpc v1.66.1 - google.golang.org/protobuf v1.34.2 + google.golang.org/protobuf v1.35.1 gopkg.in/yaml.v3 v3.0.1 ) diff --git a/go.sum b/go.sum index 8f30c5c3..ba9282bd 100644 --- a/go.sum +++ b/go.sum @@ -222,8 +222,8 @@ github.com/livekit/protocol v1.26.1-0.20241017190602-ef6fc8f9c752 h1:EgULMfdFSW/ github.com/livekit/protocol v1.26.1-0.20241017190602-ef6fc8f9c752/go.mod h1:nxRzmQBKSYK64gqr7ABWwt78hvrgiO2wYuCojRYb7Gs= github.com/livekit/psrpc v0.6.1-0.20240924010758-9f0a4268a3b9 h1:33oBjGpVD9tYkDXQU42tnHl8eCX9G6PVUToBVuCUyOs= github.com/livekit/psrpc v0.6.1-0.20240924010758-9f0a4268a3b9/go.mod h1:CQUBSPfYYAaevg1TNCc6/aYsa8DJH4jSRFdCeSZk5u0= -github.com/livekit/server-sdk-go/v2 v2.2.1 h1:MK6H52X/k5FA3d613qAawAVvWPwyzxS5CLpxfKd/pD4= -github.com/livekit/server-sdk-go/v2 v2.2.1/go.mod h1:Oqv4EYIqLWjdgWXw8HuxN79QDy77vws1vI9YMkBxSMM= +github.com/livekit/server-sdk-go/v2 v2.2.2-0.20241015094126-b8538ae5d67b h1:R1GpKwVbSYsG08k5sIkNCukvnrkOE18R8IO1YeujR8o= +github.com/livekit/server-sdk-go/v2 v2.2.2-0.20241015094126-b8538ae5d67b/go.mod h1:m2IukIyPCvJCdx04mdWIud9FoCBUAWc3526x3KgT8qY= github.com/mackerelio/go-osstat v0.2.5 h1:+MqTbZUhoIt4m8qzkVoXUJg1EuifwlAJSk4Yl2GXh+o= github.com/mackerelio/go-osstat v0.2.5/go.mod h1:atxwWF+POUZcdtR1wnsUcQxTytoHG4uhl2AKKzrOajY= github.com/magefile/mage v1.15.0 h1:BvGheCMAsG3bWUDbZ8AyXXpCNwU9u5CB6sM+HNb9HYg= @@ -488,8 +488,8 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= -google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= -google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA= +google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= diff --git a/pkg/config/storage.go b/pkg/config/storage.go index 4b40ebb3..d96590ab 100644 --- a/pkg/config/storage.go +++ b/pkg/config/storage.go @@ -21,14 +21,13 @@ import ( ) type StorageConfig struct { - PathPrefix string `yaml:"prefix"` // prefix applied to all filenames + PathPrefix string `yaml:"prefix"` // prefix applied to all filenames + GeneratePresignedUrl bool `yaml:"generate_presigned_url"` S3 *S3Config `yaml:"s3"` // upload to s3 Azure *AzureConfig `yaml:"azure"` // upload to azure GCP *GCPConfig `yaml:"gcp"` // upload to gcp AliOSS *S3Config `yaml:"alioss"` // upload to aliyun - - GeneratePresignedUrl bool `yaml:"generate_presigned_url"` } type S3Config struct { @@ -66,6 +65,7 @@ func (p *PipelineConfig) getStorageConfig(req egress.UploadRequest) *StorageConf sc := &StorageConfig{} if p.StorageConfig != nil { sc.PathPrefix = p.StorageConfig.PathPrefix + sc.GeneratePresignedUrl = p.StorageConfig.GeneratePresignedUrl } if s3 := req.GetS3(); s3 != nil { diff --git a/pkg/pipeline/sink/uploader/alioss.go b/pkg/pipeline/sink/uploader/alioss.go index 5e416186..6e60fcad 100644 --- a/pkg/pipeline/sink/uploader/alioss.go +++ b/pkg/pipeline/sink/uploader/alioss.go @@ -33,6 +33,10 @@ type AliOSSUploader struct { } func newAliOSSUploader(c *config.StorageConfig) (uploader, error) { + if c.GeneratePresignedUrl { + return nil, errors.ErrUploadFailed("AliOSS", fmt.Errorf("presigned URLs not supported")) + } + conf := c.AliOSS return &AliOSSUploader{ conf: conf, diff --git a/pkg/pipeline/sink/uploader/azure.go b/pkg/pipeline/sink/uploader/azure.go index a85026b4..d8d46c41 100644 --- a/pkg/pipeline/sink/uploader/azure.go +++ b/pkg/pipeline/sink/uploader/azure.go @@ -36,6 +36,10 @@ type AzureUploader struct { } func newAzureUploader(c *config.StorageConfig) (uploader, error) { + if c.GeneratePresignedUrl { + return nil, errors.ErrUploadFailed("Azure", fmt.Errorf("presigned URLs not supported")) + } + conf := c.Azure return &AzureUploader{ conf: conf, diff --git a/pkg/pipeline/sink/uploader/gcp.go b/pkg/pipeline/sink/uploader/gcp.go index 3f26b8e6..4d0114fb 100644 --- a/pkg/pipeline/sink/uploader/gcp.go +++ b/pkg/pipeline/sink/uploader/gcp.go @@ -44,6 +44,10 @@ type GCPUploader struct { } func newGCPUploader(c *config.StorageConfig) (uploader, error) { + if c.GeneratePresignedUrl { + return nil, errors.ErrUploadFailed("GCP", fmt.Errorf("presigned URLs not supported")) + } + conf := c.GCP u := &GCPUploader{ conf: conf,