File tree 6 files changed +29
-46
lines changed
6 files changed +29
-46
lines changed Original file line number Diff line number Diff line change 1
1
LEGACY_DB_URL = you_only_need_this_to_migrate
2
2
LEGACY_REDIS_URL = you_only_need_this_to_migrate
3
3
GOOGLE_ANALYTICS_UA = UA-XXXXXXXX-X
4
- AWS_ACCESS_KEY_ID =
5
- AWS_SECRET_ACCESS_KEY =
6
- FOG_DIRECTORY =
4
+ AWS_ACCESS_ID =
5
+ AWS_ACCESS_SECRET =
6
+ AWS_BUCKET =
7
+ AWS_REGION =
Original file line number Diff line number Diff line change @@ -20,9 +20,8 @@ gem 'github-markup'
20
20
gem 'clearance'
21
21
gem 'kaminari'
22
22
gem 'mini_magick'
23
- gem 'carrierwave'
23
+ gem 'carrierwave-aws '
24
24
gem 'carrierwave_backgrounder'
25
- gem 'fog-aws'
26
25
gem 'friendly_id'
27
26
gem 'browser'
28
27
gem 'postmark-rails'
Original file line number Diff line number Diff line change 38
38
tzinfo (~> 1.1 )
39
39
addressable (2.4.0 )
40
40
arel (6.0.3 )
41
+ aws-sdk (2.2.18 )
42
+ aws-sdk-resources (= 2.2.18 )
43
+ aws-sdk-core (2.2.18 )
44
+ jmespath (~> 1.0 )
45
+ aws-sdk-resources (2.2.18 )
46
+ aws-sdk-core (= 2.2.18 )
41
47
babel-source (5.8.26 )
42
48
babel-transpiler (0.7.0 )
43
49
babel-source (>= 4.0 , < 6 )
60
66
activesupport (>= 3.2.0 )
61
67
json (>= 1.7 )
62
68
mime-types (>= 1.16 )
69
+ carrierwave-aws (1.0.0 )
70
+ aws-sdk (~> 2.0 )
71
+ carrierwave (~> 0.7 )
63
72
carrierwave_backgrounder (0.4.2 )
64
73
carrierwave (~> 0.5 )
65
74
chronic_duration (0.10.6 )
87
96
email_validator (1.6.0 )
88
97
activemodel
89
98
erubis (2.7.0 )
90
- excon (0.45.4 )
91
99
execjs (2.6.0 )
92
- fog-aws (0.8.1 )
93
- fog-core (~> 1.27 )
94
- fog-json (~> 1.0 )
95
- fog-xml (~> 0.1 )
96
- ipaddress (~> 0.8 )
97
- fog-core (1.35.0 )
98
- builder
99
- excon (~> 0.45 )
100
- formatador (~> 0.2 )
101
- fog-json (1.0.2 )
102
- fog-core (~> 1.0 )
103
- multi_json (~> 1.10 )
104
- fog-xml (0.1.2 )
105
- fog-core
106
- nokogiri (~> 1.5 , >= 1.5.11 )
107
- formatador (0.2.5 )
108
100
friendly_id (5.1.0 )
109
101
activerecord (>= 4.0.0 )
110
102
github-markup (1.4.0 )
128
120
nokogiri (~> 1.6.0 )
129
121
ruby_parser (~> 3.5 )
130
122
i18n (0.7.0 )
131
- ipaddress ( 0.8 .3 )
123
+ jmespath ( 1.1 .3 )
132
124
jquery-rails (4.1.0 )
133
125
rails-dom-testing (~> 1.0 )
134
126
railties (>= 4.2.0 )
154
146
mini_magick (4.4.0 )
155
147
mini_portile2 (2.0.0 )
156
148
minitest (5.8.4 )
157
- multi_json (1.11.2 )
158
149
nokogiri (1.6.7.2 )
159
150
mini_portile2 (~> 2.0.0.rc2 )
160
151
numerizer (0.1.1 )
@@ -270,13 +261,12 @@ DEPENDENCIES
270
261
bcrypt (~> 3.1.7 )
271
262
browser
272
263
capybara
273
- carrierwave
264
+ carrierwave-aws
274
265
carrierwave_backgrounder
275
266
clearance
276
267
coderay
277
268
coffee-rails (~> 4.1.0 )
278
269
dotenv-rails
279
- fog-aws
280
270
friendly_id
281
271
github-markup
282
272
green_monkey
Original file line number Diff line number Diff line change 1
1
module UsersHelper
2
2
3
3
def current_user_liked_list
4
- # what it was on protip
5
- #signed-in-user-liked-payload.hide=current_user.likes?(@protip) && [dom_id(@protip)]
6
4
if signed_in?
7
5
current_user . liked
8
6
else
Original file line number Diff line number Diff line change 10
10
config . storage = :file
11
11
else
12
12
config . enable_processing = true
13
- config . storage = :fog
14
- config . asset_host = "https://#{ [ 'FOG_DIRECTORY '] } .s3.amazonaws.com"
15
- config . fog_directory = ENV [ 'FOG_DIRECTORY' ]
16
- config . fog_attributes = { 'Cache-Control' => "max-age= #{ 365 . day . to_i } " }
17
- config . fog_credentials = {
18
- provider : 'AWS' ,
19
- aws_access_key_id : ENV [ 'AWS_ACCESS_KEY_ID ' ] ,
20
- aws_secret_access_key : ENV [ 'AWS_SECRET_ACCESS_KEY ' ]
13
+ config . storage = :aws
14
+ config . asset_host = "https://#{ ENV [ 'AWS_BUCKET '] } .s3.amazonaws.com"
15
+ config . aws_acl = 'public-read'
16
+ config . aws_bucket = ENV [ 'AWS_BUCKET' ]
17
+ config . aws_credentials = {
18
+ access_key_id : ENV [ 'AWS_ACCESS_ID' ] ,
19
+ secret_access_key : ENV [ 'AWS_ACCESS_SECRET ' ] ,
20
+ region : ENV [ 'AWS_REGION ' ]
21
21
}
22
- # config.asset_host = proc do |file|
23
- # identifier = ENV['FOG_DIRECTORY']
24
- # "http://#{identifier}.cdn.rackspacecloud.com"
25
- # end
22
+ config . aws_attributes = {
23
+ expires : 1 . week . from_now . httpdate ,
24
+ cache_control : 'max-age=604800'
25
+ }
26
+ config . aws_authenticated_url_expiration = 60 * 60 * 24 * 7
26
27
end
27
28
end
28
29
Original file line number Diff line number Diff line change @@ -2,12 +2,6 @@ class AvatarUploader < CarrierWave::Uploader::Base
2
2
include CarrierWave ::MiniMagick
3
3
4
4
process resize_and_pad : [ 100 , 100 ]
5
- # storage :fog
6
-
7
- def default_url
8
- model_name = model . class . name . downcase
9
- ActionController ::Base . helpers . asset_path "#{ model_name } -avatar.png"
10
- end
11
5
12
6
def extension_white_list
13
7
%w( jpg jpeg gif png )
You can’t perform that action at this time.
0 commit comments