S3-compatible object storage API (#2720)

* s3 active_storage

* updated readme
This commit is contained in:
Moritz 2021-06-18 20:28:33 +02:00 committed by GitHub
parent cb3e597a61
commit e54208f710
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 0 deletions

View File

@ -63,6 +63,8 @@ Rails.application.configure do
# Store uploaded files on the local file system (see config/storage.yml for options)
config.active_storage.service = if ENV["AWS_ACCESS_KEY_ID"].present?
:amazon
elsif ENV["S3_ACCESS_KEY_ID"].present?
:s3
elsif ENV["GCS_PRIVATE_KEY_ID"].present?
:google
else

View File

@ -13,6 +13,13 @@ amazon:
secret_access_key: <%= ENV['AWS_SECRET_ACCESS_KEY'] %>
region: <%= ENV['AWS_REGION'] %>
bucket: <%= ENV['AWS_BUCKET'] %>
s3:
service: S3
endpoint: <%= ENV['S3_ENDPOINT'] %>
access_key_id: <%= ENV['S3_ACCESS_KEY_ID'] %>
secret_access_key: <%= ENV['S3_SECRET_ACCESS_KEY'] %>
region: <%= ENV['S3_REGION'] %>
bucket: <%= ENV['S3_BUCKET'] %>
# Remember not to checkin your GCS keyfile to a repository
google:

View File

@ -326,6 +326,13 @@ DEFAULT_REGISTRATION=open
# AWS_REGION=
# AWS_BUCKET=
#
# For S3-compatible API:
# S3_ENDPOINT=
# S3_ACCESS_KEY_ID=
# S3_SECRET_ACCESS_KEY=
# S3_REGION=
# S3_BUCKET=
#
# For GCS Storage:
# GCS_PROJECT_ID=
# GCS_PRIVATE_KEY_ID=