0
0
Fork 0

Add config of multipart threshold for S3 (#11924)

This commit is contained in:
Yamagishi Kazutoshi 2019-09-23 22:37:45 +09:00 committed by Eugen Rochko
parent 637cc7bf78
commit 172eaeba3f
3 changed files with 44 additions and 1 deletions

View file

@ -135,7 +135,7 @@ namespace :mastodon do
prompt.say "\n"
if prompt.yes?('Do you want to store uploaded files on the cloud?', default: false)
case prompt.select('Provider', ['Amazon S3', 'Wasabi', 'Minio'])
case prompt.select('Provider', ['Amazon S3', 'Wasabi', 'Minio', 'Google Cloud Storage'])
when 'Amazon S3'
env['S3_ENABLED'] = 'true'
env['S3_PROTOCOL'] = 'https'
@ -217,6 +217,34 @@ namespace :mastodon do
q.required true
q.modify :strip
end
when 'Google Cloud Storage'
env['S3_ENABLED'] = 'true'
env['S3_PROTOCOL'] = 'https'
env['S3_HOSTNAME'] = 'storage.googleapis.com'
env['S3_ENDPOINT'] = 'https://storage.googleapis.com'
env['S3_MULTIPART_THRESHOLD'] = 50.megabytes
env['S3_BUCKET'] = prompt.ask('GCS bucket name:') do |q|
q.required true
q.default "files.#{env['LOCAL_DOMAIN']}"
q.modify :strip
end
env['S3_REGION'] = prompt.ask('GCS region:') do |q|
q.required true
q.default 'us-west1'
q.modify :strip
end
env['AWS_ACCESS_KEY_ID'] = prompt.ask('GCS access key:') do |q|
q.required true
q.modify :strip
end
env['AWS_SECRET_ACCESS_KEY'] = prompt.ask('GCS secret key:') do |q|
q.required true
q.modify :strip
end
end
if prompt.yes?('Do you want to access the uploaded files from your own domain?')