Skip to content

Commit

Permalink
allow configuring upload object prefixes and temp dir
Browse files Browse the repository at this point in the history
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
  • Loading branch information
butonic committed Sep 18, 2023
1 parent 35bcb9c commit 8489b20
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/storage/fs/s3ng/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ type Options struct {
// Secret key for the s3 blobstore
S3SecretKey string `mapstructure:"s3.secret_key"`

// UploadObjectPrefix for the s3 blobstore
S3UploadObjectPrefix string `mapstructure:"s3.upload_object_prefix"`

// UploadMetadataPrefix for the s3 blobstore
S3UploadMetadataPrefix string `mapstructure:"s3.upload_metadata_prefix"`

// UploadTemporaryDirectory for the s3 blobstore
S3UploadTemporaryDirectory string `mapstructure:"s3.upload_temporary_directory"`

// DisableSSL for the s3 blobstore
S3DisableSSL bool `mapstructure:"s3.disable_ssl"`

Expand Down
3 changes: 3 additions & 0 deletions pkg/storage/fs/s3ng/s3ng.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ func New(m map[string]interface{}, stream events.Stream) (storage.FS, error) {
WithDisableSSL(o.S3DisableSSL)

tusDataStore := s3store.New(o.S3Bucket, s3.New(session.Must(session.NewSession()), s3Config))
tusDataStore.ObjectPrefix = o.S3UploadObjectPrefix
tusDataStore.MetadataObjectPrefix = o.S3UploadMetadataPrefix
tusDataStore.TemporaryDirectory = o.S3UploadTemporaryDirectory

return decomposedfs.NewDefault(m, bs, tusDataStore, stream)
}

0 comments on commit 8489b20

Please sign in to comment.