forked from x1wins/tutorial-rails-rest-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
storage.yml
58 lines (50 loc) · 1.98 KB
/
storage.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
test:
service: Disk
root: /storage/test
local:
service: Disk
root: /storage
# https://github.com/0sc/activestorage-cloudinary-service
#cloudinary:
# service: Cloudinary
# cloud_name: <%= ENV['CLOUDINARY_CLOUD_NAME'] %>
# api_key: <%= ENV['CLOUDINARY_API_KEY'] %>
# api_secret: <%= ENV['CLOUDINARY_API_SECRET'] %>
# cloudinary://APIKey:APISecret@Cloudname
# cloudinary://666943398939854:wxs4tIE31NBD3tznII3bRI306n0@hxckhbuje
# (s.match(/(\w+):\/\/(\w+):(\w+)@(\w+)/)[4] unless s.to_s.empty?)
<%
cloudinary_url = ENV['CLOUDINARY_URL']
uri = URI.parse(cloudinary_url) unless cloudinary_url.nil?
cloudinary_cloud_name = uri&.host || Rails.application.credentials.dig(:cloudinary, :cloud_name)
cloudinary_api_key = uri&.user || Rails.application.credentials.dig(:cloudinary, :api_key)
cloudinary_api_secret = uri&.password || Rails.application.credentials.dig(:cloudinary, :api_secret)
%>
cloudinary:
service: Cloudinary
cloud_name: <%= cloudinary_cloud_name %>
api_key: <%= cloudinary_api_key %>
api_secret: <%= cloudinary_api_secret %>
# Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
# amazon:
# service: S3
# access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
# secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
# region: us-east-1
# bucket: your_own_bucket
# Remember not to checkin your GCS keyfile to a repository
# google:
# service: GCS
# project: your_project
# credentials: <%= Rails.root.join("path/to/gcs.keyfile") %>
# bucket: your_own_bucket
# Use rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key)
# microsoft:
# service: AzureStorage
# storage_account_name: your_account_name
# storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %>
# container: your_container_name
# mirror:
# service: Mirror
# primary: local
# mirrors: [ amazon, google, microsoft ]