docbrown/config/initializers/s3_direct_upload.rb
Ben Halpern f72eba0fe1
[deploy] Attempt to get carrierwave configured correctly for containers and tests passing (#9558)
* Attempt to get tests passing

* Hardcode region

* Move keys

* Add region vars back in

* S3DirectUpload

* Fix asset host

* Carrierwave monkeypatch

* Add condition

* remove require

* Move carrierwave monkeypatch to initializer

* Remove aws secret and key from path that doesn't need it

* Put keys back in

* File storage location ENV var

* Move carrierwave around

* Change to placeholder on jdoss track

* Use config region

* File store path

* Remove AWS keys

* Change logic slightly

* Uncomment production.rb code

* Adjust carrierwave

* Adjust carrierwave
2020-07-29 17:27:13 -04:00

16 lines
791 B
Ruby

# @forem/systems: We only can load this if video flow is entirely configured in AWS.
# Which is something we're currently punting on to rethink.
# As far as we know this only works and is supported on dev.to and not other forems.
S3DirectUpload.config do |c|
if Rails.env.test?
ENV["AWS_S3_VIDEO_ID"] = "available"
ENV["AWS_S3_VIDEO_KEY"] = "available"
ENV["AWS_S3_INPUT_BUCKET"] = "available"
end
c.access_key_id = ENV["AWS_S3_VIDEO_ID"] # your access key id
c.secret_access_key = ENV["AWS_S3_VIDEO_KEY"] # your secret access key
c.bucket = ENV["AWS_S3_INPUT_BUCKET"] # your bucket name
c.region = nil # region prefix. _Required_ for non-default AWS region, eg. "eu-west-1"
c.url = nil # S3 API endpoint (optional), eg. "https://#{c.bucket}.s3.amazonaws.com"
end