Skip to content

Commit 441aa47

Browse files
committed
Added cloudary config
1 parent 309b3e7 commit 441aa47

File tree

8 files changed

+46
-7
lines changed

8 files changed

+46
-7
lines changed

Diff for: Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - && \
33
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
44
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
55
apt-get update && \
6-
apt-get install -qq -y build-essential nodejs yarn \
6+
apt-get install -qq -y build-essential nodejs yarn vim \
77
libpq-dev postgresql-client
88
RUN mkdir /myapp
99
RUN mkdir /storage

Diff for: Gemfile

+3-1
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,6 @@ gem 'logstash-logger'
7171
gem 'redis'
7272
gem 'redis-namespace'
7373
gem 'redis-rails'
74-
gem 'redis-rack-cache'
74+
gem 'redis-rack-cache'
75+
gem 'cloudinary', require: false
76+
gem 'activestorage-cloudinary-service'

Diff for: Gemfile.lock

+25-1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ GEM
5555
activejob (= 6.0.2.1)
5656
activerecord (= 6.0.2.1)
5757
marcel (~> 0.3.1)
58+
activestorage-cloudinary-service (0.2.3)
5859
activesupport (6.0.2.1)
5960
concurrent-ruby (~> 1.0, >= 1.0.2)
6061
i18n (>= 0.7, < 2)
@@ -63,18 +64,24 @@ GEM
6364
zeitwerk (~> 2.2)
6465
addressable (2.7.0)
6566
public_suffix (>= 2.0.2, < 5.0)
67+
aws_cf_signer (0.1.3)
6668
bcrypt (3.1.13)
6769
bootsnap (1.4.5)
6870
msgpack (~> 1.0)
6971
builder (3.2.4)
7072
byebug (11.0.1)
7173
case_transform (0.2)
7274
activesupport
75+
cloudinary (1.13.2)
76+
aws_cf_signer
77+
rest-client
7378
concurrent-ruby (1.1.5)
7479
crass (1.0.5)
7580
database_cleaner (1.7.0)
7681
diff-lcs (1.3)
7782
docker-postgres-rails (0.0.1)
83+
domain_name (0.5.20190701)
84+
unf (>= 0.0.5, < 1.0.0)
7885
erubi (1.9.0)
7986
factory_bot (5.1.1)
8087
activesupport (>= 4.2.0)
@@ -86,6 +93,9 @@ GEM
8693
ffi (1.11.3)
8794
globalid (0.4.2)
8895
activesupport (>= 4.2.0)
96+
http-accept (1.7.0)
97+
http-cookie (1.0.3)
98+
domain_name (~> 0.5)
8999
i18n (1.7.0)
90100
concurrent-ruby (~> 1.0)
91101
json-schema (2.8.1)
@@ -125,11 +135,15 @@ GEM
125135
marcel (0.3.3)
126136
mimemagic (~> 0.3.2)
127137
method_source (0.9.2)
138+
mime-types (3.3.1)
139+
mime-types-data (~> 3.2015)
140+
mime-types-data (3.2019.1009)
128141
mimemagic (0.3.3)
129142
mini_mime (1.0.2)
130143
mini_portile2 (2.4.0)
131144
minitest (5.13.0)
132145
msgpack (1.3.1)
146+
netrc (0.11.0)
133147
nio4r (2.5.2)
134148
nokogiri (1.10.8)
135149
mini_portile2 (~> 2.4.0)
@@ -196,6 +210,11 @@ GEM
196210
redis (>= 4, < 5)
197211
request_store (1.5.0)
198212
rack (>= 1.4)
213+
rest-client (2.1.0)
214+
http-accept (>= 1.7.0, < 2.0)
215+
http-cookie (>= 1.0.2, < 2.0)
216+
mime-types (>= 1.16, < 4.0)
217+
netrc (~> 0.8)
199218
rspec-core (3.9.1)
200219
rspec-support (~> 3.9.1)
201220
rspec-expectations (3.9.0)
@@ -238,6 +257,9 @@ GEM
238257
thread_safe (0.3.6)
239258
tzinfo (1.2.6)
240259
thread_safe (~> 0.1)
260+
unf (0.1.4)
261+
unf_ext
262+
unf_ext (0.0.7.7)
241263
websocket-driver (0.7.1)
242264
websocket-extensions (>= 0.1.0)
243265
websocket-extensions (0.1.4)
@@ -248,9 +270,11 @@ PLATFORMS
248270

249271
DEPENDENCIES
250272
active_model_serializers
273+
activestorage-cloudinary-service
251274
bcrypt (~> 3.1.7)
252275
bootsnap (>= 1.4.2)
253276
byebug
277+
cloudinary
254278
database_cleaner
255279
docker-postgres-rails (~> 0.0.1)
256280
factory_bot_rails
@@ -281,4 +305,4 @@ RUBY VERSION
281305
ruby 2.6.0p0
282306

283307
BUNDLED WITH
284-
2.1.0
308+
2.1.2

Diff for: config/credentials.yml.enc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
zWcK+1qX81ZtzzpDKZw7TKAv9O/kNKpZIS3rji5P+UyMxQkCfeqPJ2hnKsP4OYfXgZbOSsfny6WFhZlTTuAqrmkMvXNGdZuBPSTYc6hCQa9xpbs+Hz0GdEPjjG06lpzqv+UdhS7kwRS1+VOYhfiCSuJ4Jrluh1WdT9I74A/6rW6XZN0N6JEAZiJHyBZMNhFJ1J7+eDqRkmyUPPiDrIfNsJsi9HwkNNI52j9tpPDCjmkue9kb5cJ8UqsNclqGv6WZ1KhnVYO7vpIJUv0Yv2z74qkrCToTS1ZUio1/aWCf9REUK03oH1j362Hfr/l9iYYXo55AZeRshXFWiMR84vhFyfZ+ohvPupJ5k10CVhAfTglGdA9E5fXyTryBBxP2qhE5afOgzxIwL2mYvm0wbMj7PEDkmJCZXmXcfzFV--MMMAwCYTWSiiHMM3--zkH8yr6pn866+OrwtWf1PQ==
1+
WgYAI39Cuc42mFExYyxsc11a3+FqQAdSgugm4mlFPqp4RqNR3oNSx34g0H8pzMB5y12Hh81ksp31ZpKrSIm9uF8vLzBqh9dVooAIitJxrWFxr71zyad5Cp598pLxFYy2fX9iVDB4kmFw1a7ykvS+7w2o3dIEu50MB3ErUN3Nsd8Yq1SnbtvDzOCck1/vzIYEqGwTRui6/Qs4DRHGLllVEc6AXBq7xDU3CL6Cldw5Ju8mg0B61ZMlybwCu/UaChQdKrXIZkhkWvG5l5dlvxcd+NeYlaoJC0VuSpBVp+1jBlhYHoKHiTWeQEWzpvAUS7CL7leDBLOvgbZYR+PiKe9SAxrYur+EGeZbbnTHE3+v4GhRkK/vEFFEofye9AM8LMpSkBDH3JGdJIs1a7y0G+sRz7pX/BxFDqqlyycJ11sO3KjWl3A9E29SLEsHhjnwOz7jZT9ZxhPi/Y3M15wdHrhdoqm1x044/ugMt+lrPZs8szbPQiIFlVkqdQaJ/W3vX+yn9IXIa03wmeTGP1dkI5hoE+mUSVdAfWOuK+g7yIL197tPZc0Vup1l6NMyIwTJtrm5dyDXlZ1S0gPA--Lz5wiUakqNCTIPOU--qTRGR36SE7PM/xC3HcY2fA==

Diff for: config/environments/development.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
end
2727

2828
# Store uploaded files on the local file system (see config/storage.yml for options).
29-
config.active_storage.service = :local
29+
config.active_storage.service = :cloudinary
3030

3131
# Don't care if the mailer can't send.
3232
# config.action_mailer.raise_delivery_errors = false

Diff for: config/environments/production.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
3030

3131
# Store uploaded files on the local file system (see config/storage.yml for options).
32-
config.active_storage.service = :local
32+
config.active_storage.service = :cloudinary
3333

3434
# Mount Action Cable outside main process or domain.
3535
# config.action_cable.mount_path = nil

Diff for: config/environments/test.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
config.action_controller.allow_forgery_protection = false
3232

3333
# Store uploaded files on the local file system in a temporary directory.
34-
config.active_storage.service = :test
34+
config.active_storage.service = :cloudinary
3535

3636
# config.action_mailer.perform_caching = false
3737

Diff for: config/storage.yml

+13
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,19 @@ local:
66
service: Disk
77
root: /storage
88

9+
# https://github.com/0sc/activestorage-cloudinary-service
10+
#cloudinary:
11+
# service: Cloudinary
12+
# cloud_name: <%= ENV['CLOUDINARY_CLOUD_NAME'] %>
13+
# api_key: <%= ENV['CLOUDINARY_API_KEY'] %>
14+
# api_secret: <%= ENV['CLOUDINARY_API_SECRET'] %>
15+
16+
cloudinary:
17+
service: Cloudinary
18+
cloud_name: <%= Rails.application.credentials.dig(:cloudinary, :cloud_name) %>
19+
api_key: <%= Rails.application.credentials.dig(:cloudinary, :api_key) %>
20+
api_secret: <%= Rails.application.credentials.dig(:cloudinary, :api_secret) %>
21+
922
# Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
1023
# amazon:
1124
# service: S3

0 commit comments

Comments
 (0)