Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting path-style access for object storage #4510

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions config/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ object_storage:
# You can also use AWS_SECRET_ACCESS_KEY env variable
secret_access_key: ''

# Reference buckets via path rather than subdomain
# (i.e. "my-endpoint.com/bucket" instead of "bucket.my-endpoint.com")
force_path_style: false

# Maximum amount to upload in one request to object storage
max_upload_part: 2GB

Expand Down
4 changes: 4 additions & 0 deletions config/production.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ object_storage:
# You can also use AWS_SECRET_ACCESS_KEY env variable
secret_access_key: ''

# Reference buckets via path rather than subdomain
# (i.e. "my-endpoint.com/bucket" instead of "bucket.my-endpoint.com")
force_path_style: false

# Maximum amount to upload in one request to object storage
max_upload_part: 2GB

Expand Down
1 change: 1 addition & 0 deletions server/initializers/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ const CONFIG = {
ACCESS_KEY_ID: config.get<string>('object_storage.credentials.access_key_id'),
SECRET_ACCESS_KEY: config.get<string>('object_storage.credentials.secret_access_key')
},
FORCE_PATH_STYLE: config.get<boolean>('object_storage.force_path_style'),
VIDEOS: {
BUCKET_NAME: config.get<string>('object_storage.videos.bucket_name'),
PREFIX: config.get<string>('object_storage.videos.prefix'),
Expand Down
3 changes: 2 additions & 1 deletion server/lib/object-storage/shared/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ function getClient () {
accessKeyId: OBJECT_STORAGE.CREDENTIALS.ACCESS_KEY_ID,
secretAccessKey: OBJECT_STORAGE.CREDENTIALS.SECRET_ACCESS_KEY
}
: undefined
: undefined,
forcePathStyle: CONFIG.OBJECT_STORAGE.FORCE_PATH_STYLE
})

logger.info('Initialized S3 client %s with region %s.', getEndpoint(), OBJECT_STORAGE.REGION, lTags())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ object_storage:

region: "PEERTUBE_OBJECT_STORAGE_REGION"

force_path_style: "PEERTUBE_OBJECT_STORAGE_FORCE_PATH_STYLE"

max_upload_part:
__name: "PEERTUBE_OBJECT_STORAGE_MAX_UPLOAD_PART"
__format: "json"
Expand Down