Skip to content

Commit ab19a12

Browse files
author
naraesk
authored
Merge pull request #9 from schilbach/development
Update to Rails 5.2 including encrypted secrets
2 parents aa0caed + 25ea19c commit ab19a12

11 files changed

Lines changed: 107 additions & 97 deletions

File tree

evaluationserver/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,6 @@ coverage
3333
# Ignore encrypted secrets key file.
3434
config/secrets.yml.key
3535
config/initializers/01_env.rb
36+
37+
# Ignore master key for decrypting credentials and more.
38+
/config/master.key

evaluationserver/Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ gem "therubyracer"
7575
gem "less-rails" #Sprockets (what Rails 3.1 uses for its asset pipeline) supports LESS
7676
gem 'bootstrap-sass', '~> 3.2.0'
7777
gem "paperclip", "~> 4.1"
78-
gem "nokogiri"
78+
gem "nokogiri", '1.8.1'
7979
gem "rubyzip"
8080
gem "actionmailer"
8181
#gem "jquery-sortable-rails"

evaluationserver/Gemfile.lock

Lines changed: 95 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,67 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
actioncable (5.1.4)
5-
actionpack (= 5.1.4)
4+
actioncable (5.2.0)
5+
actionpack (= 5.2.0)
66
nio4r (~> 2.0)
7-
websocket-driver (~> 0.6.1)
8-
actionmailer (5.1.4)
9-
actionpack (= 5.1.4)
10-
actionview (= 5.1.4)
11-
activejob (= 5.1.4)
7+
websocket-driver (>= 0.6.1)
8+
actionmailer (5.2.0)
9+
actionpack (= 5.2.0)
10+
actionview (= 5.2.0)
11+
activejob (= 5.2.0)
1212
mail (~> 2.5, >= 2.5.4)
1313
rails-dom-testing (~> 2.0)
14-
actionpack (5.1.4)
15-
actionview (= 5.1.4)
16-
activesupport (= 5.1.4)
14+
actionpack (5.2.0)
15+
actionview (= 5.2.0)
16+
activesupport (= 5.2.0)
1717
rack (~> 2.0)
1818
rack-test (>= 0.6.3)
1919
rails-dom-testing (~> 2.0)
2020
rails-html-sanitizer (~> 1.0, >= 1.0.2)
21-
actionview (5.1.4)
22-
activesupport (= 5.1.4)
21+
actionview (5.2.0)
22+
activesupport (= 5.2.0)
2323
builder (~> 3.1)
2424
erubi (~> 1.4)
2525
rails-dom-testing (~> 2.0)
2626
rails-html-sanitizer (~> 1.0, >= 1.0.3)
27-
activejob (5.1.4)
28-
activesupport (= 5.1.4)
27+
activejob (5.2.0)
28+
activesupport (= 5.2.0)
2929
globalid (>= 0.3.6)
30-
activemodel (5.1.4)
31-
activesupport (= 5.1.4)
32-
activerecord (5.1.4)
33-
activemodel (= 5.1.4)
34-
activesupport (= 5.1.4)
35-
arel (~> 8.0)
36-
activesupport (5.1.4)
30+
activemodel (5.2.0)
31+
activesupport (= 5.2.0)
32+
activerecord (5.2.0)
33+
activemodel (= 5.2.0)
34+
activesupport (= 5.2.0)
35+
arel (>= 9.0)
36+
activestorage (5.2.0)
37+
actionpack (= 5.2.0)
38+
activerecord (= 5.2.0)
39+
marcel (~> 0.3.1)
40+
activesupport (5.2.0)
3741
concurrent-ruby (~> 1.0, >= 1.0.2)
38-
i18n (~> 0.7)
42+
i18n (>= 0.7, < 2)
3943
minitest (~> 5.1)
4044
tzinfo (~> 1.1)
41-
acts_as_list (0.9.10)
45+
acts_as_list (0.9.12)
4246
activerecord (>= 3.0)
4347
addressable (2.5.2)
4448
public_suffix (>= 2.0.2, < 4.0)
45-
arel (8.0.0)
49+
arel (9.0.0)
4650
ast (2.4.0)
4751
bootstrap-multiselect-rails4 (0.0.1)
4852
rails (>= 4.0.0)
4953
bootstrap-sass (3.2.0.2)
5054
sass (~> 3.2)
51-
brakeman (4.1.1)
55+
brakeman (4.3.0)
5256
builder (3.2.3)
53-
capybara (2.18.0)
57+
capybara (3.1.1)
5458
addressable
5559
mini_mime (>= 0.1.3)
56-
nokogiri (>= 1.3.3)
57-
rack (>= 1.0.0)
58-
rack-test (>= 0.5.4)
59-
xpath (>= 2.0, < 4.0)
60-
capybara-screenshot (1.0.19)
60+
nokogiri (~> 1.8)
61+
rack (>= 1.6.0)
62+
rack-test (>= 0.6.3)
63+
xpath (~> 3.0)
64+
capybara-screenshot (1.0.21)
6165
capybara (>= 1.0, < 4)
6266
launchy
6367
climate_control (0.2.0)
@@ -66,30 +70,30 @@ GEM
6670
cocoon (1.2.11)
6771
commonjs (0.2.7)
6872
concurrent-ruby (1.0.5)
69-
crass (1.0.3)
70-
database_cleaner (1.6.2)
73+
crass (1.0.4)
74+
database_cleaner (1.7.0)
7175
diff-lcs (1.3)
72-
docile (1.1.5)
76+
docile (1.3.1)
7377
easy_translate (0.5.1)
7478
thread
7579
thread_safe
76-
erubi (1.7.0)
80+
erubi (1.7.1)
7781
execjs (2.7.0)
78-
factory_bot (4.8.2)
82+
factory_bot (4.10.0)
7983
activesupport (>= 3.0.0)
80-
factory_bot_rails (4.8.2)
81-
factory_bot (~> 4.8.2)
84+
factory_bot_rails (4.10.0)
85+
factory_bot (~> 4.10.0)
8286
railties (>= 3.0.0)
8387
faker (1.8.7)
8488
i18n (>= 0.7)
85-
ffi (1.9.18)
86-
font-awesome-rails (4.7.0.2)
87-
railties (>= 3.2, < 5.2)
89+
ffi (1.9.23)
90+
font-awesome-rails (4.7.0.4)
91+
railties (>= 3.2, < 6.0)
8892
globalid (0.4.1)
8993
activesupport (>= 4.2.0)
9094
grease (0.3.1)
9195
highline (1.7.10)
92-
i18n (0.9.1)
96+
i18n (1.0.1)
9397
concurrent-ruby (~> 1.0)
9498
i18n-tasks (0.9.21)
9599
activesupport (>= 4.0.2)
@@ -104,11 +108,11 @@ GEM
104108
jbuilder (2.7.0)
105109
activesupport (>= 4.2.0)
106110
multi_json (>= 1.2)
107-
jquery-rails (4.3.1)
111+
jquery-rails (4.3.3)
108112
rails-dom-testing (>= 1, < 3)
109113
railties (>= 4.2.0)
110114
thor (>= 0.14, < 2.0)
111-
json (1.8.6)
115+
json (2.1.0)
112116
launchy (2.4.3)
113117
addressable (~> 2.3)
114118
less (2.6.0)
@@ -124,71 +128,73 @@ GEM
124128
rb-fsevent (~> 0.9, >= 0.9.4)
125129
rb-inotify (~> 0.9, >= 0.9.7)
126130
ruby_dep (~> 1.2)
127-
loofah (2.1.1)
131+
loofah (2.2.2)
128132
crass (~> 1.0.2)
129133
nokogiri (>= 1.5.9)
130134
mail (2.7.0)
131135
mini_mime (>= 0.1.1)
136+
marcel (0.3.2)
137+
mimemagic (~> 0.3.2)
132138
method_source (0.9.0)
133139
mime-types (3.1)
134140
mime-types-data (~> 3.2015)
135141
mime-types-data (3.2016.0521)
136-
mimemagic (0.3.0)
142+
mimemagic (0.3.2)
137143
mini_mime (1.0.0)
138144
mini_portile2 (2.3.0)
139-
minitest (5.10.3)
145+
minitest (5.11.3)
140146
multi-select-rails (0.9.12)
141147
railties (>= 3.0)
142-
multi_json (1.12.2)
143-
mysql2 (0.4.10)
144-
nio4r (2.2.0)
148+
multi_json (1.13.1)
149+
mysql2 (0.5.1)
150+
nio4r (2.3.1)
145151
nokogiri (1.8.1)
146152
mini_portile2 (~> 2.3.0)
147-
paperclip (4.3.7)
153+
paperclip (4.2.4)
148154
activemodel (>= 3.2.0)
149155
activesupport (>= 3.2.0)
150156
cocaine (~> 0.5.5)
151157
mime-types
152-
mimemagic (= 0.3.0)
153-
parser (2.5.0.5)
158+
parser (2.5.1.0)
154159
ast (~> 2.4.0)
155160
public_suffix (3.0.2)
156-
puma (3.11.0)
157-
rack (2.0.3)
158-
rack-test (0.8.2)
161+
puma (3.11.4)
162+
rack (2.0.5)
163+
rack-test (1.0.0)
159164
rack (>= 1.0, < 3)
160-
rails (5.1.4)
161-
actioncable (= 5.1.4)
162-
actionmailer (= 5.1.4)
163-
actionpack (= 5.1.4)
164-
actionview (= 5.1.4)
165-
activejob (= 5.1.4)
166-
activemodel (= 5.1.4)
167-
activerecord (= 5.1.4)
168-
activesupport (= 5.1.4)
165+
rails (5.2.0)
166+
actioncable (= 5.2.0)
167+
actionmailer (= 5.2.0)
168+
actionpack (= 5.2.0)
169+
actionview (= 5.2.0)
170+
activejob (= 5.2.0)
171+
activemodel (= 5.2.0)
172+
activerecord (= 5.2.0)
173+
activestorage (= 5.2.0)
174+
activesupport (= 5.2.0)
169175
bundler (>= 1.3.0)
170-
railties (= 5.1.4)
176+
railties (= 5.2.0)
171177
sprockets-rails (>= 2.0.0)
172178
rails-dom-testing (2.0.3)
173179
activesupport (>= 4.2.0)
174180
nokogiri (>= 1.6)
175-
rails-html-sanitizer (1.0.3)
176-
loofah (~> 2.0)
181+
rails-html-sanitizer (1.0.4)
182+
loofah (~> 2.2, >= 2.2.2)
177183
rails_serve_static_assets (0.0.5)
178-
railties (5.1.4)
179-
actionpack (= 5.1.4)
180-
activesupport (= 5.1.4)
184+
railties (5.2.0)
185+
actionpack (= 5.2.0)
186+
activesupport (= 5.2.0)
181187
method_source
182188
rake (>= 0.8.7)
183189
thor (>= 0.18.1, < 2.0)
184190
rainbow (3.0.0)
185-
rake (12.3.0)
191+
rake (12.3.1)
186192
ranked-model (0.4.0)
187193
activerecord (>= 3.1.12)
188-
rb-fsevent (0.10.2)
194+
rb-fsevent (0.10.3)
189195
rb-inotify (0.9.10)
190196
ffi (>= 0.5.0, < 2)
191-
rdoc (4.3.0)
197+
rdoc (6.0.4)
192198
ref (2.0.0)
193199
rspec-core (3.7.1)
194200
rspec-support (~> 3.7.0)
@@ -209,7 +215,7 @@ GEM
209215
rspec-support (3.7.1)
210216
ruby_dep (1.5.0)
211217
rubyzip (1.2.1)
212-
sass (3.5.4)
218+
sass (3.5.6)
213219
sass-listen (~> 4.0.0)
214220
sass-listen (4.0.0)
215221
rb-fsevent (~> 0.9, >= 0.9.4)
@@ -220,11 +226,10 @@ GEM
220226
sprockets (>= 2.8, < 4.0)
221227
sprockets-rails (>= 2.0, < 4.0)
222228
tilt (>= 1.1, < 3)
223-
sdoc (0.4.2)
224-
json (~> 1.7, >= 1.7.7)
225-
rdoc (~> 4.0)
226-
simplecov (0.15.1)
227-
docile (~> 1.1.0)
229+
sdoc (1.0.0)
230+
rdoc (>= 5.0)
231+
simplecov (0.16.1)
232+
docile (~> 1.1)
228233
json (>= 1.8, < 3)
229234
simplecov-html (~> 0.10.0)
230235
simplecov-html (0.10.2)
@@ -244,20 +249,20 @@ GEM
244249
thread (0.2.2)
245250
thread_safe (0.3.6)
246251
tilt (2.0.8)
247-
tinymce-rails (4.7.4)
252+
tinymce-rails (4.7.13)
248253
railties (>= 3.1.1)
249-
turbolinks (5.0.1)
250-
turbolinks-source (~> 5)
251-
turbolinks-source (5.0.3)
252-
tzinfo (1.2.4)
254+
turbolinks (5.1.1)
255+
turbolinks-source (~> 5.1)
256+
turbolinks-source (5.1.0)
257+
tzinfo (1.2.5)
253258
thread_safe (~> 0.1)
254-
uglifier (4.1.2)
259+
uglifier (4.1.10)
255260
execjs (>= 0.3.0, < 3)
256-
unicode-display_width (1.3.0)
257-
websocket-driver (0.6.5)
261+
unicode-display_width (1.3.3)
262+
websocket-driver (0.7.0)
258263
websocket-extensions (>= 0.1.0)
259264
websocket-extensions (0.1.3)
260-
xpath (3.0.0)
265+
xpath (3.1.0)
261266
nokogiri (~> 1.8)
262267

263268
PLATFORMS
@@ -284,7 +289,7 @@ DEPENDENCIES
284289
listen
285290
multi-select-rails
286291
mysql2
287-
nokogiri
292+
nokogiri (= 1.8.1)
288293
paperclip (~> 4.1)
289294
puma
290295
rails

evaluationserver/app/controllers/application_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class ApplicationController < ActionController::Base
77

88
CREDENTIALS = {
99
:name => 'admin',
10-
:password => ENV['ADMIN_PASSWORD']
10+
:password => Rails.application.credentials.admin_password
1111

1212
}
1313

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
FTUFXD2ZlOTrgBhIsiyWNSI0+jynWKt2HgZ/QOcoU8CDvwBpTMUnuInLJhT4zWeGkAjoAQDBCdSVm2UN9bMDNXNx1pUh2MEjNiMPrLR4khCwyjBeEQU4HLWsMTwEygq4ityywwyxoFvivq1mMoOXI7nNJlj7fSPTBunZWFxIa8XnO6DdD88KlpYEsWztZ29MiX4VnAz4SQSYQ/Dn7zvQnLa2iXO3LdI+cjfKnn/SD6Vy+RHHSXsX5EiyTjnXY8iPAvgh5Ka4h7WooL/VYfSks3BEHogNqApiS0kEFc1a4KpMvCaw1RrZf5acE5cXNat6fsg0igWh4L4v178/yTHPkuRbqxxCIonEZubSO1nZU3wvbvfwkTtw+y7Ye6ajTEc7QmUQKtwn81qxHcbw5rWnWEpO0i3SG5Xab4JxvHSAoWPEmLiQ+eqQcQY=--h4+AiwgXsnjapqn1--NWJpV3kvUw/PH3HfNdipXw==

evaluationserver/config/environments/production.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,6 @@
8888

8989
# Do not dump schema after migrations.
9090
config.active_record.dump_schema_after_migration = false
91+
config.require_master_key = true
92+
9193
end

evaluationserver/config/initializers/example_credential.rb

Lines changed: 0 additions & 1 deletion
This file was deleted.

evaluationserver/config/initializers/secret_token.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99

1010
# Make sure your secret_key_base is kept private
1111
# if you're sharing your code publicly.
12-
EvalServer::Application.config.secret_key_base = '715eb86cac15abfacc1dc995e7cb88f562e0b8030608347d03d750bcefded2b6ad1e1b59076c53e7955452f2b7be6ceb84b9c5c6b579200459d88f4bb3784333'
12+
EvalServer::Application.config.secret_key_base = Rails.application.credentials.secret_key_base

evaluationserver/config/secrets.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ test:
2929
# and move the `production:` environment over there.
3030

3131
production:
32-
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
32+
secret_key_base: <%= Rails.application.credentials.secret_key_base %>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module BasicAuthHelper
22
def login_as_admin
33
user = 'admin'
4-
request.env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials(user,ENV['ADMIN_PASSWORD'])
4+
request.env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials(user,Rails.application.credentials.admin_password)
55
end
66
end

0 commit comments

Comments
 (0)