Skip to content
Snippets Groups Projects
Unverified Commit 490a3ba8 authored by Samuel Couillard's avatar Samuel Couillard Committed by GitHub
Browse files

Add S3 (#4029)

* Initial commit

* Add s3 integration

* Add Amazon storage
parent 48d06761
No related branches found
No related tags found
No related merge requests found
...@@ -7,6 +7,7 @@ ruby '>= 3.0' ...@@ -7,6 +7,7 @@ ruby '>= 3.0'
gem 'active_model_serializers' gem 'active_model_serializers'
gem 'active_storage_validations' gem 'active_storage_validations'
gem 'aws-sdk-s3', require: false
gem 'bcrypt', '~> 3.1.7' gem 'bcrypt', '~> 3.1.7'
gem 'bigbluebutton-api-ruby', '1.8' gem 'bigbluebutton-api-ruby', '1.8'
gem 'bootsnap', require: false gem 'bootsnap', require: false
......
...@@ -40,7 +40,13 @@ Rails.application.configure do ...@@ -40,7 +40,13 @@ Rails.application.configure do
# config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX
# Store uploaded files on the local file system (see config/storage.yml for options). # Store uploaded files on the local file system (see config/storage.yml for options).
config.active_storage.service = :local config.active_storage.service = if ENV['S3_ACCESS_KEY_ID'].present? && ENV['S3_ENDPOINT'].present?
:s3
elsif ENV['S3_ACCESS_KEY_ID'].present?
:amazon
else
:local
end
if ENV['SMTP_SERVER'].present? if ENV['SMTP_SERVER'].present?
config.action_mailer.perform_deliveries = true config.action_mailer.perform_deliveries = true
......
...@@ -6,13 +6,20 @@ local: ...@@ -6,13 +6,20 @@ local:
service: Disk service: Disk
root: <%= Rails.root.join("storage") %> root: <%= Rails.root.join("storage") %>
# Use bin/rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key) # Simple Storage Service (S3)
# amazon: amazon:
# service: S3 service: S3
# access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %> access_key_id: <%= ENV['S3_ACCESS_KEY_ID'] %>
# secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %> secret_access_key: <%= ENV['S3_SECRET_ACCESS_KEY'] %>
# region: us-east-1 region: <%= ENV['S3_REGION'] %>
# bucket: your_own_bucket-<%= Rails.env %> bucket: <%= ENV['S3_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 # Remember not to checkin your GCS keyfile to a repository
# google: # google:
......
...@@ -16,6 +16,15 @@ BIGBLUEBUTTON_SECRET= ...@@ -16,6 +16,15 @@ BIGBLUEBUTTON_SECRET=
HCAPTCHA_SITE_KEY= HCAPTCHA_SITE_KEY=
HCAPTCHA_SECRET_KEY= HCAPTCHA_SECRET_KEY=
# Set these if you are using a Simple Storage Service (S3)
# Uncomment S3_ENDPOINT only if you are using a S3 OTHER than Amazon Web Service (AWS) S3.
#
#S3_ACCESS_KEY_ID=
#S3_SECRET_ACCESS_KEY=
#S3_REGION=
#S3_BUCKET=
#S3_ENDPOINT=
PORT= PORT=
SECRET_KEY_BASE= SECRET_KEY_BASE=
RAILS_ENV= RAILS_ENV=
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment