From 253c5138620b8982e41ca06fa5288a3824fb2844 Mon Sep 17 00:00:00 2001 From: guidojw <35309288+guidojw@users.noreply.github.com> Date: Wed, 11 Oct 2023 23:01:06 +0200 Subject: [PATCH 01/23] refactor: remove RAILS_MASTER_KEY from ci --- .github/workflows/continuous-delivery.yml | 3 - .github/workflows/continuous-integration.yml | 31 +-- .github/workflows/publish-image.yml | 5 - Dockerfile | 7 +- Gemfile | 2 +- Gemfile.lock | 232 +++++++++++-------- config/environments/production.rb | 2 +- 7 files changed, 150 insertions(+), 132 deletions(-) diff --git a/.github/workflows/continuous-delivery.yml b/.github/workflows/continuous-delivery.yml index 7dbc05c27..4fb90bfc8 100644 --- a/.github/workflows/continuous-delivery.yml +++ b/.github/workflows/continuous-delivery.yml @@ -105,8 +105,6 @@ jobs: uses: csvalpha/sofia/.github/workflows/continuous-integration.yml@staging with: sha: ${{ needs.merge.outputs.sha }} - secrets: - rails_master_key: ${{ secrets.RAILS_MASTER_KEY }} publish_image: name: Publish Image @@ -116,7 +114,6 @@ jobs: with: sha: ${{ needs.merge.outputs.sha }} secrets: - rails_master_key: ${{ secrets.RAILS_MASTER_KEY }} sentry_auth_token: ${{ secrets.SENTRY_AUTH_TOKEN }} deploy: diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 1de1b42e1..398582e38 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -11,10 +11,6 @@ on: description: The commit SHA to run the workflow on required: false type: string - secrets: - rails_master_key: - description: The Rails master key - required: true jobs: build: @@ -73,14 +69,19 @@ jobs: name: app - name: Lint - env: - RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} run: | EXIT_STATUS=0 - ./actionlint -ignore 'property "gh_app_private_key" is not defined' -ignore 'SC2153:' \ - -ignore 'property "sha" is not defined in object type {}' || EXIT_STATUS=$? - docker run -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_HOST=localhost -e \ - RAILS_MASTER_KEY --network=host app bin/ci.sh lint || EXIT_STATUS=$? + ./actionlint \ + -ignore 'property "gh_app_private_key" is not defined' \ + -ignore 'SC2153:' \ + -ignore 'property "sha" is not defined in object type {}' \ + || EXIT_STATUS=$? + docker run \ + -e POSTGRES_USER=postgres \ + -e POSTGRES_PASSWORD=postgres \ + -e POSTGRES_HOST=localhost \ + --network=host \ + app bin/ci.sh lint || EXIT_STATUS=$? exit $EXIT_STATUS test: @@ -116,8 +117,10 @@ jobs: name: app - name: Test - env: - RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} run: | - docker run -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_HOST=localhost -e \ - RAILS_MASTER_KEY --network=host app bin/ci.sh spec + docker run \ + -e POSTGRES_USER=postgres \ + -e POSTGRES_PASSWORD=postgres \ + -e POSTGRES_HOST=localhost + --network=host \ + app bin/ci.sh spec diff --git a/.github/workflows/publish-image.yml b/.github/workflows/publish-image.yml index 8acf8cb68..ebf659bdc 100644 --- a/.github/workflows/publish-image.yml +++ b/.github/workflows/publish-image.yml @@ -10,9 +10,6 @@ on: required: false type: string secrets: - rails_master_key: - description: The Rails master key - required: true sentry_auth_token: description: The Sentry integration's token required: true @@ -73,8 +70,6 @@ jobs: push: true context: . build-args: ${{ needs.metadata.outputs.build_args }} - secrets: | - rails_master_key=${{ secrets.RAILS_MASTER_KEY }} cache-from: type=gha,scope=main cache-to: type=gha,scope=main tags: | diff --git a/Dockerfile b/Dockerfile index fa8dec243..fb770e6aa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,7 +24,6 @@ ARG BUILD_HASH='unknown' ENV BUILD_HASH=$BUILD_HASH ARG RAILS_ENV='production' ARG NODE_ENV='production' -ARG RAILS_MASTER_KEY # Pre-install gems, so that they can be cached. COPY Gemfile* /app/ @@ -43,10 +42,8 @@ RUN yarn install --immutable COPY . /app/ # Precompile assets after copying app because whole Rails pipeline is needed. -RUN --mount=type=secret,id=rails_master_key \ - if [ "$RAILS_ENV" = 'production' ] || [ "$RAILS_ENV" = 'staging' ]; then \ - # Use secret if RAILS_MASTER_KEY build arg is not set. - RAILS_MASTER_KEY="${RAILS_MASTER_KEY:-$(cat /run/secrets/rails_master_key)}" bundle exec rails assets:precompile; \ +RUN if [ "$RAILS_ENV" = 'production' ] || [ "$RAILS_ENV" = 'staging' ]; then \ + SECRET_KEY_BASE_DUMMY=1 bundle exec rails assets:precompile; \ else \ echo "Skipping assets:precompile"; \ fi diff --git a/Gemfile b/Gemfile index a667c3383..f31b81412 100644 --- a/Gemfile +++ b/Gemfile @@ -26,7 +26,7 @@ gem 'pg', '~> 1.3.0' gem 'puma', '~> 6.1.1' gem 'pundit', '~> 2.2.0' gem 'rack-attack', '~> 6.6.0' -gem 'rails', '~> 7.0.4', '>= 7.0.4.3' +gem 'rails', '~> 7.1.0' gem 'rails-i18n', '~> 7.0.0' gem 'redis-rails', '~> 5.0.0' gem 'rest-client', '~> 2.1.0' diff --git a/Gemfile.lock b/Gemfile.lock index 51bf9782c..901a81fe3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,70 +1,78 @@ GEM remote: https://rubygems.org/ specs: - actioncable (7.0.4.3) - actionpack (= 7.0.4.3) - activesupport (= 7.0.4.3) + actioncable (7.1.0) + actionpack (= 7.1.0) + activesupport (= 7.1.0) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.4.3) - actionpack (= 7.0.4.3) - activejob (= 7.0.4.3) - activerecord (= 7.0.4.3) - activestorage (= 7.0.4.3) - activesupport (= 7.0.4.3) + zeitwerk (~> 2.6) + actionmailbox (7.1.0) + actionpack (= 7.1.0) + activejob (= 7.1.0) + activerecord (= 7.1.0) + activestorage (= 7.1.0) + activesupport (= 7.1.0) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.0.4.3) - actionpack (= 7.0.4.3) - actionview (= 7.0.4.3) - activejob (= 7.0.4.3) - activesupport (= 7.0.4.3) + actionmailer (7.1.0) + actionpack (= 7.1.0) + actionview (= 7.1.0) + activejob (= 7.1.0) + activesupport (= 7.1.0) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp - rails-dom-testing (~> 2.0) - actionpack (7.0.4.3) - actionview (= 7.0.4.3) - activesupport (= 7.0.4.3) - rack (~> 2.0, >= 2.2.0) + rails-dom-testing (~> 2.2) + actionpack (7.1.0) + actionview (= 7.1.0) + activesupport (= 7.1.0) + nokogiri (>= 1.8.5) + rack (>= 2.2.4) + rack-session (>= 1.0.1) rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.4.3) - actionpack (= 7.0.4.3) - activerecord (= 7.0.4.3) - activestorage (= 7.0.4.3) - activesupport (= 7.0.4.3) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + actiontext (7.1.0) + actionpack (= 7.1.0) + activerecord (= 7.1.0) + activestorage (= 7.1.0) + activesupport (= 7.1.0) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.4.3) - activesupport (= 7.0.4.3) + actionview (7.1.0) + activesupport (= 7.1.0) builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (7.0.4.3) - activesupport (= 7.0.4.3) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (7.1.0) + activesupport (= 7.1.0) globalid (>= 0.3.6) - activemodel (7.0.4.3) - activesupport (= 7.0.4.3) - activerecord (7.0.4.3) - activemodel (= 7.0.4.3) - activesupport (= 7.0.4.3) - activestorage (7.0.4.3) - actionpack (= 7.0.4.3) - activejob (= 7.0.4.3) - activerecord (= 7.0.4.3) - activesupport (= 7.0.4.3) + activemodel (7.1.0) + activesupport (= 7.1.0) + activerecord (7.1.0) + activemodel (= 7.1.0) + activesupport (= 7.1.0) + timeout (>= 0.4.0) + activestorage (7.1.0) + actionpack (= 7.1.0) + activejob (= 7.1.0) + activerecord (= 7.1.0) + activesupport (= 7.1.0) marcel (~> 1.0) - mini_mime (>= 1.1.0) - activesupport (7.0.4.3) + activesupport (7.1.0) + base64 + bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) minitest (>= 5.1) + mutex_m tzinfo (~> 2.0) addressable (2.8.0) public_suffix (>= 2.0.2, < 5.0) @@ -72,11 +80,13 @@ GEM sshkit (>= 1.6.1, != 1.7.0) ast (2.4.2) awesome_print (1.9.2) + base64 (0.1.1) bcrypt (3.1.18) better_errors (2.9.1) coderay (>= 1.0.0) erubi (>= 1.0.0) rack (>= 0.9.0) + bigdecimal (3.1.4) bindex (0.8.1) bootsnap (1.12.0) msgpack (~> 1.2) @@ -104,6 +114,7 @@ GEM connection_pool (2.3.0) consistency_fail (0.3.7) crass (1.0.6) + date (3.3.3) devise (4.8.1) bcrypt (~> 3.0) orm_adapter (~> 0.1) @@ -113,7 +124,6 @@ GEM devise-i18n (1.10.2) devise (>= 4.8.0) diff-lcs (1.5.0) - digest (3.1.0) docile (1.4.0) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) @@ -121,6 +131,8 @@ GEM dotenv-rails (2.7.6) dotenv (= 2.7.6) railties (>= 3.2) + drb (2.1.1) + ruby2_keywords em-websocket (0.5.3) eventmachine (>= 0.12.9) http_parser.rb (~> 0) @@ -151,8 +163,8 @@ GEM fugit (1.8.1) et-orbi (~> 1, >= 1.2.7) raabro (~> 1.4) - globalid (1.1.0) - activesupport (>= 5.0) + globalid (1.2.1) + activesupport (>= 6.1) guard (2.18.0) formatador (>= 0.2.4) listen (>= 2.7, < 4.0) @@ -183,8 +195,12 @@ GEM domain_name (~> 0.5) http-form_data (2.3.0) http_parser.rb (0.8.0) - i18n (1.13.0) + i18n (1.14.1) concurrent-ruby (~> 1.0) + io-console (0.6.0) + irb (1.8.1) + rdoc + reline (>= 0.3.8) jbuilder (2.11.5) actionview (>= 5.0.0) activesupport (>= 5.0.0) @@ -213,9 +229,9 @@ GEM llhttp-ffi (0.4.0) ffi-compiler (~> 1.0) rake (~> 13.0) - loofah (2.20.0) + loofah (2.21.4) crass (~> 1.0.2) - nokogiri (>= 1.5.9) + nokogiri (>= 1.12.0) lumberjack (1.2.8) mail (2.8.1) mini_mime (>= 0.1.1) @@ -230,39 +246,35 @@ GEM mina (1.2.4) open4 (~> 1.3.4) rake - mini_mime (1.1.2) - mini_portile2 (2.8.2) + mini_mime (1.1.5) + mini_portile2 (2.8.4) mini_racer (0.6.2) libv8-node (~> 16.10.0.0) - minitest (5.18.0) + minitest (5.20.0) mollie-api-ruby (4.7.1) msgpack (1.5.2) multi_json (1.15.0) multi_xml (0.6.0) + mutex_m (0.1.2) nenv (0.3.0) - net-imap (0.2.3) - digest + net-imap (0.4.1) + date net-protocol - strscan - net-pop (0.1.1) - digest + net-pop (0.1.2) net-protocol - timeout - net-protocol (0.1.3) + net-protocol (0.2.1) timeout net-scp (3.0.0) net-ssh (>= 2.6.5, < 7.0.0) - net-smtp (0.3.1) - digest + net-smtp (0.4.0) net-protocol - timeout net-ssh (6.1.0) netrc (0.11.0) - nio4r (2.5.8) - nokogiri (1.14.3) - mini_portile2 (~> 2.8.0) + nio4r (2.5.9) + nokogiri (1.15.4) + mini_portile2 (~> 2.8.2) racc (~> 1.4) - nokogiri (1.14.3-x86_64-linux) + nokogiri (1.15.4-x86_64-linux) racc (~> 1.4) notiffany (0.1.3) nenv (~> 0.1) @@ -289,8 +301,8 @@ GEM activerecord (>= 6.0) request_store (~> 1.4) parallel (1.22.1) - paranoia (2.6.0) - activerecord (>= 5.1, < 7.1) + paranoia (2.6.3) + activerecord (>= 5.1, < 7.2) parser (3.1.2.0) ast (~> 2.4.1) pg (1.3.5) @@ -302,61 +314,73 @@ GEM pry (>= 0.13, < 0.15) pry-rails (0.3.9) pry (>= 0.10.4) + psych (5.1.1) + stringio public_suffix (4.0.7) puma (6.1.1) nio4r (~> 2.0) pundit (2.2.0) activesupport (>= 3.0.0) raabro (1.4.0) - racc (1.6.2) - rack (2.2.7) + racc (1.7.1) + rack (2.2.8) rack-attack (6.6.1) rack (>= 1.0, < 3) rack-protection (3.0.2) rack rack-proxy (0.7.2) rack + rack-session (1.0.1) + rack (< 3) rack-test (2.1.0) rack (>= 1.3) - rails (7.0.4.3) - actioncable (= 7.0.4.3) - actionmailbox (= 7.0.4.3) - actionmailer (= 7.0.4.3) - actionpack (= 7.0.4.3) - actiontext (= 7.0.4.3) - actionview (= 7.0.4.3) - activejob (= 7.0.4.3) - activemodel (= 7.0.4.3) - activerecord (= 7.0.4.3) - activestorage (= 7.0.4.3) - activesupport (= 7.0.4.3) + rackup (1.0.0) + rack (< 3) + webrick + rails (7.1.0) + actioncable (= 7.1.0) + actionmailbox (= 7.1.0) + actionmailer (= 7.1.0) + actionpack (= 7.1.0) + actiontext (= 7.1.0) + actionview (= 7.1.0) + activejob (= 7.1.0) + activemodel (= 7.1.0) + activerecord (= 7.1.0) + activestorage (= 7.1.0) + activesupport (= 7.1.0) bundler (>= 1.15.0) - railties (= 7.0.4.3) + railties (= 7.1.0) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) activesupport (>= 5.0.1.rc1) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.5.0) - loofah (~> 2.19, >= 2.19.1) + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) rails-i18n (7.0.3) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 8) - railties (7.0.4.3) - actionpack (= 7.0.4.3) - activesupport (= 7.0.4.3) - method_source + railties (7.1.0) + actionpack (= 7.1.0) + activesupport (= 7.1.0) + irb + rackup (>= 1.0.0) rake (>= 12.2) - thor (~> 1.0) - zeitwerk (~> 2.5) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) rainbow (3.1.1) rake (13.0.6) rb-fsevent (0.11.1) rb-inotify (0.10.1) ffi (~> 1.0) rb-readline (0.5.5) + rdoc (6.5.0) + psych (>= 4.0.0) redis (4.8.1) redis-actionpack (5.3.0) actionpack (>= 5, < 8) @@ -377,6 +401,8 @@ GEM redis-store (1.9.1) redis (>= 4, < 5) regexp_parser (2.5.0) + reline (0.3.9) + io-console (~> 0.5) request_store (1.5.1) rack (>= 1.4) responders (3.0.1) @@ -486,13 +512,13 @@ GEM sshkit (1.21.2) net-scp (>= 1.1.2) net-ssh (>= 2.8.0) - strscan (3.0.3) + stringio (3.0.8) terminal-notifier-guard (1.7.0) - thor (1.2.1) + thor (1.2.2) tilt (2.1.0) timecop (0.9.5) timeliness (0.4.5) - timeout (0.3.0) + timeout (0.4.0) turbolinks (5.2.1) turbolinks-source (~> 5.2) turbolinks-source (5.2.0) @@ -520,13 +546,14 @@ GEM rack-proxy (>= 0.6.1) railties (>= 5.2) semantic_range (>= 2.3.0) - websocket-driver (0.7.5) + webrick (1.8.1) + websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) wicked_pdf (2.6.3) activesupport wkhtmltopdf-binary (0.12.6.5) - zeitwerk (2.6.8) + zeitwerk (2.6.12) PLATFORMS ruby @@ -558,7 +585,6 @@ DEPENDENCIES kaminari (~> 1.2.0) listen mina (~> 1.2.0) - mini_racer (~> 0.6.0) mollie-api-ruby (~> 4.7.0) net-imap net-pop @@ -574,7 +600,7 @@ DEPENDENCIES puma (~> 6.1.1) pundit (~> 2.2.0) rack-attack (~> 6.6.0) - rails (~> 7.0.4, >= 7.0.4.3) + rails (~> 7.1.0) rails-controller-testing (~> 1.0.0) rails-i18n (~> 7.0.0) rb-readline @@ -609,4 +635,4 @@ DEPENDENCIES wkhtmltopdf-binary BUNDLED WITH - 2.2.15 + 2.4.14 diff --git a/config/environments/production.rb b/config/environments/production.rb index 4fb19b381..79cd813de 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -19,7 +19,7 @@ # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"] # or in config/master.key. This key is used to decrypt credentials (and other encrypted files). - config.require_master_key = true + # config.require_master_key = true # Disable serving static files from the `/public` folder by default since # Apache or NGINX already handles this. From 30fd4cc3c61654b559cbfd2946466ce597d392a7 Mon Sep 17 00:00:00 2001 From: guidojw <35309288+guidojw@users.noreply.github.com> Date: Wed, 11 Oct 2023 23:25:05 +0200 Subject: [PATCH 02/23] fix(ci): update indentation --- .github/workflows/continuous-integration.yml | 47 +++++++++----------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 398582e38..9857cbdf2 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -12,6 +12,10 @@ on: required: false type: string +env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + jobs: build: name: Build @@ -37,9 +41,6 @@ jobs: services: db: image: postgres:14.7 - env: - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres options: >- --health-cmd pg_isready --health-interval 10s @@ -70,19 +71,19 @@ jobs: - name: Lint run: | - EXIT_STATUS=0 - ./actionlint \ - -ignore 'property "gh_app_private_key" is not defined' \ - -ignore 'SC2153:' \ - -ignore 'property "sha" is not defined in object type {}' \ - || EXIT_STATUS=$? - docker run \ - -e POSTGRES_USER=postgres \ - -e POSTGRES_PASSWORD=postgres \ - -e POSTGRES_HOST=localhost \ - --network=host \ - app bin/ci.sh lint || EXIT_STATUS=$? - exit $EXIT_STATUS + EXIT_STATUS=0 + ./actionlint \ + -ignore 'property "gh_app_private_key" is not defined' \ + -ignore 'SC2153:' \ + -ignore 'property "sha" is not defined in object type {}' || \ + EXIT_STATUS=$? + docker run \ + -e POSTGRES_USER \ + -e POSTGRES_PASSWORD \ + --network=host \ + app bin/ci.sh lint || \ + EXIT_STATUS=$? + exit $EXIT_STATUS test: name: Test @@ -91,9 +92,6 @@ jobs: services: db: image: postgres:14.7 - env: - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres options: >- --health-cmd pg_isready --health-interval 10s @@ -118,9 +116,8 @@ jobs: - name: Test run: | - docker run \ - -e POSTGRES_USER=postgres \ - -e POSTGRES_PASSWORD=postgres \ - -e POSTGRES_HOST=localhost - --network=host \ - app bin/ci.sh spec + docker run \ + -e POSTGRES_USER \ + -e POSTGRES_PASSWORD \ + --network=host \ + app bin/ci.sh spec From b9c0efc2ff8030704cc70c6a3783692ca79dd0a7 Mon Sep 17 00:00:00 2001 From: guidojw <35309288+guidojw@users.noreply.github.com> Date: Wed, 11 Oct 2023 23:25:54 +0200 Subject: [PATCH 03/23] test: precompile assets on test too --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index fb770e6aa..144212eff 100644 --- a/Dockerfile +++ b/Dockerfile @@ -42,7 +42,7 @@ RUN yarn install --immutable COPY . /app/ # Precompile assets after copying app because whole Rails pipeline is needed. -RUN if [ "$RAILS_ENV" = 'production' ] || [ "$RAILS_ENV" = 'staging' ]; then \ +RUN if [ "$RAILS_ENV" = 'test' ] || [ "$RAILS_ENV" = 'production' ] || [ "$RAILS_ENV" = 'staging' ]; then \ SECRET_KEY_BASE_DUMMY=1 bundle exec rails assets:precompile; \ else \ echo "Skipping assets:precompile"; \ From a7dba8a8857f08bbbd65e36ce95c3272e9eb9383 Mon Sep 17 00:00:00 2001 From: guidojw <35309288+guidojw@users.noreply.github.com> Date: Wed, 11 Oct 2023 23:29:42 +0200 Subject: [PATCH 04/23] fix(ci): update indentation --- .github/workflows/continuous-integration.yml | 36 ++++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 9857cbdf2..3cc2ada2f 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -71,19 +71,19 @@ jobs: - name: Lint run: | - EXIT_STATUS=0 - ./actionlint \ - -ignore 'property "gh_app_private_key" is not defined' \ - -ignore 'SC2153:' \ - -ignore 'property "sha" is not defined in object type {}' || \ - EXIT_STATUS=$? - docker run \ - -e POSTGRES_USER \ - -e POSTGRES_PASSWORD \ - --network=host \ - app bin/ci.sh lint || \ - EXIT_STATUS=$? - exit $EXIT_STATUS + EXIT_STATUS=0 + ./actionlint + -ignore 'property "gh_app_private_key" is not defined' + -ignore 'SC2153:' + -ignore 'property "sha" is not defined in object type {}' || + EXIT_STATUS=$? + docker run + -e POSTGRES_USER + -e POSTGRES_PASSWORD + --network=host + app bin/ci.sh lint || + EXIT_STATUS=$? + exit $EXIT_STATUS test: name: Test @@ -116,8 +116,8 @@ jobs: - name: Test run: | - docker run \ - -e POSTGRES_USER \ - -e POSTGRES_PASSWORD \ - --network=host \ - app bin/ci.sh spec + docker run + -e POSTGRES_USER + -e POSTGRES_PASSWORD + --network=host + app bin/ci.sh spec From 8e1feea79a66d983471e9af35a6090ee6a1a5f89 Mon Sep 17 00:00:00 2001 From: guidojw <35309288+guidojw@users.noreply.github.com> Date: Wed, 11 Oct 2023 23:38:08 +0200 Subject: [PATCH 05/23] chore: bundle update bullet --- Gemfile.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 901a81fe3..4f41f7085 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -93,7 +93,7 @@ GEM brakeman (5.2.3) browser (5.3.1) builder (3.2.4) - bullet (7.0.2) + bullet (7.1.1) activesupport (>= 3.0.0) uniform_notifier (~> 1.11) byebug (11.1.3) @@ -111,7 +111,7 @@ GEM coderay (1.1.3) colorize (0.8.1) concurrent-ruby (1.2.2) - connection_pool (2.3.0) + connection_pool (2.4.1) consistency_fail (0.3.7) crass (1.0.6) date (3.3.3) @@ -221,7 +221,7 @@ GEM activerecord kaminari-core (= 1.2.2) kaminari-core (1.2.2) - libv8-node (16.10.0.0) +libv8-node (16.10.0.0) libv8-node (16.10.0.0-x86_64-linux) listen (3.7.1) rb-fsevent (~> 0.10, >= 0.10.3) @@ -248,7 +248,7 @@ GEM rake mini_mime (1.1.5) mini_portile2 (2.8.4) - mini_racer (0.6.2) +mini_racer (0.6.2) libv8-node (~> 16.10.0.0) minitest (5.20.0) mollie-api-ruby (4.7.1) From 764b89834d349fa595aa56ae7b913ae9b2456aac Mon Sep 17 00:00:00 2001 From: guidojw <35309288+guidojw@users.noreply.github.com> Date: Wed, 11 Oct 2023 23:44:51 +0200 Subject: [PATCH 06/23] fix: comment bundle config --- Dockerfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 144212eff..185657d99 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,11 +27,11 @@ ARG NODE_ENV='production' # Pre-install gems, so that they can be cached. COPY Gemfile* /app/ -RUN if [ "$RAILS_ENV" = 'production' ] || [ "$RAILS_ENV" = 'staging' ]; then \ - bundle config set --local without 'development test'; \ - else \ - bundle config set --local without 'development'; \ - fi +# RUN if [ "$RAILS_ENV" = 'production' ] || [ "$RAILS_ENV" = 'staging' ]; then \ +# bundle config set --local without 'development test'; \ +# else \ +# bundle config set --local without 'development'; \ +# fi RUN bundle install # Pre-install npm packages, so that they can be cached. From 6f17a4b06d783d1034712085088dfb6fa6815997 Mon Sep 17 00:00:00 2001 From: guidojw <35309288+guidojw@users.noreply.github.com> Date: Thu, 12 Oct 2023 00:07:05 +0200 Subject: [PATCH 07/23] revert: test: precompile assets on test too --- Dockerfile | 12 ++++++------ Gemfile.lock | 3 ++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 185657d99..fb770e6aa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,11 +27,11 @@ ARG NODE_ENV='production' # Pre-install gems, so that they can be cached. COPY Gemfile* /app/ -# RUN if [ "$RAILS_ENV" = 'production' ] || [ "$RAILS_ENV" = 'staging' ]; then \ -# bundle config set --local without 'development test'; \ -# else \ -# bundle config set --local without 'development'; \ -# fi +RUN if [ "$RAILS_ENV" = 'production' ] || [ "$RAILS_ENV" = 'staging' ]; then \ + bundle config set --local without 'development test'; \ + else \ + bundle config set --local without 'development'; \ + fi RUN bundle install # Pre-install npm packages, so that they can be cached. @@ -42,7 +42,7 @@ RUN yarn install --immutable COPY . /app/ # Precompile assets after copying app because whole Rails pipeline is needed. -RUN if [ "$RAILS_ENV" = 'test' ] || [ "$RAILS_ENV" = 'production' ] || [ "$RAILS_ENV" = 'staging' ]; then \ +RUN if [ "$RAILS_ENV" = 'production' ] || [ "$RAILS_ENV" = 'staging' ]; then \ SECRET_KEY_BASE_DUMMY=1 bundle exec rails assets:precompile; \ else \ echo "Skipping assets:precompile"; \ diff --git a/Gemfile.lock b/Gemfile.lock index 4f41f7085..b5840d9b2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -248,7 +248,7 @@ libv8-node (16.10.0.0) rake mini_mime (1.1.5) mini_portile2 (2.8.4) -mini_racer (0.6.2) + mini_racer (0.6.2) libv8-node (~> 16.10.0.0) minitest (5.20.0) mollie-api-ruby (4.7.1) @@ -586,6 +586,7 @@ DEPENDENCIES listen mina (~> 1.2.0) mollie-api-ruby (~> 4.7.0) + mini_racer (~> 0.6.0) net-imap net-pop net-smtp From 6d53ea7d6f570a5df138b7bf3f2fc2efb0c15470 Mon Sep 17 00:00:00 2001 From: guidojw <35309288+guidojw@users.noreply.github.com> Date: Thu, 12 Oct 2023 00:27:03 +0200 Subject: [PATCH 08/23] fix: revert env changes in continuous-integration.yml --- .github/workflows/continuous-integration.yml | 18 ++-- config/application.rb | 92 ++++++++++---------- 2 files changed, 56 insertions(+), 54 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 3cc2ada2f..3dc82a0e3 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -12,10 +12,6 @@ on: required: false type: string -env: - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres - jobs: build: name: Build @@ -41,6 +37,9 @@ jobs: services: db: image: postgres:14.7 + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres options: >- --health-cmd pg_isready --health-interval 10s @@ -78,8 +77,8 @@ jobs: -ignore 'property "sha" is not defined in object type {}' || EXIT_STATUS=$? docker run - -e POSTGRES_USER - -e POSTGRES_PASSWORD + -e POSTGRES_USER=postgres + -e POSTGRES_PASSWORD=postgres --network=host app bin/ci.sh lint || EXIT_STATUS=$? @@ -92,6 +91,9 @@ jobs: services: db: image: postgres:14.7 + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres options: >- --health-cmd pg_isready --health-interval 10s @@ -117,7 +119,7 @@ jobs: - name: Test run: | docker run - -e POSTGRES_USER - -e POSTGRES_PASSWORD + -e POSTGRES_USER=postgres + -e POSTGRES_PASSWORD=postgres --network=host app bin/ci.sh spec diff --git a/config/application.rb b/config/application.rb index 38ac15da1..1b6af8c29 100644 --- a/config/application.rb +++ b/config/application.rb @@ -24,58 +24,58 @@ class Application < Rails::Application # See https://github.com/kickstarter/rack-attack#getting-started config.middleware.use Rack::Attack - config.x.amber_api_host = credentials.dig(Rails.env.to_sym, :amber_host) - config.x.amber_api_url = "#{Rails.env.development? ? 'http' : 'https'}://#{credentials.dig(Rails.env.to_sym, :amber_host)}" + config.x.amber_api_host = credentials.dig(Rails.env.to_sym, :amber_host) + config.x.amber_api_url = "#{Rails.env.development? ? 'http' : 'https'}://#{credentials.dig(Rails.env.to_sym, :amber_host)}" - config.x.amber_client_id = credentials.dig(Rails.env.to_sym, :amber_client_id) || ENV.fetch('AMBER_CLIENT_ID', nil) + config.x.amber_client_id = credentials.dig(Rails.env.to_sym, :amber_client_id) || ENV.fetch('AMBER_CLIENT_ID', nil) config.x.amber_client_secret = credentials.dig( Rails.env.to_sym, :amber_client_secret ) || ENV.fetch('AMBER_CLIENT_SECRET', nil) config.x.amber_host = credentials.dig(Rails.env.to_sym, :amber_host) - config.x.tomato_host = credentials.dig(Rails.env.to_sym, :tomato_host) - - config.x.slack_webhook = credentials.dig(Rails.env.to_sym, :slack_webhook) || '' - config.x.slack_channel = '#monitoring' - - config.x.smtp_username = credentials.dig(:production, :smtp_username) - config.x.smtp_password = credentials.dig(:production, :smtp_password) - config.x.sentry_dsn = credentials.dig(Rails.env.to_sym, :sentry_dsn) - config.x.sumup_key = credentials.dig(Rails.env.to_sym, :sumup_affiliate_key) - config.x.healthcheck_ids = credentials.dig(Rails.env.to_sym, :healthcheck_ids) - config.x.mollie_api_key = credentials.dig(Rails.env.to_sym, :mollie_api_key) - - config.x.authorize_url = ENV.fetch('AUTHORIZE_URL', '/oauth/authorize') - config.x.token_url = ENV.fetch('TOKEN_URL', '/api/v1/oauth/token') - config.x.me_url = ENV.fetch('ME_URL', '/api/v1/users?filter[me]&include="active_groups"') - - config.x.from_email = ENV.fetch('FROM_EMAIL', 'noreply@example.com') - config.x.ict_email = ENV.fetch('ICT_EMAIL', 'ict@example.com') - config.x.admin_email = ENV.fetch('ADMIN_EMAIL', 'admin@example.com') - config.x.treasurer_email = ENV.fetch('TREASURER_EMAIL', 'treasurer@example.com') - config.x.treasurer_name = ENV.fetch('TREASURER_NAME', nil) - config.x.treasurer_phone = ENV.fetch('TREASURER_PHONE', nil) - - config.x.company_name = ENV.fetch('COMPANY_NAME', nil) - config.x.company_iban = ENV.fetch('COMPANY_IBAN', nil) - config.x.company_address = ENV.fetch('COMPANY_ADDRESS', nil) - config.x.company_website = ENV.fetch('COMPANY_WEBSITE', nil) - config.x.company_kvk = ENV.fetch('COMPANY_KVK', nil) - - config.x.site_name = ENV.fetch('SITE_NAME', 'S.O.F.I.A.') - config.x.site_short_name = ENV.fetch('SITE_SHORT_NAME', 'SOFIA') - config.x.site_association = ENV.fetch('SITE_ASSOCIATION', 'C.S.V. Alpha') - - config.x.code_beer = ENV.fetch('CODE_BEER', nil) - config.x.code_craft_beer = ENV.fetch('CODE_CRAFT_BEER', nil) - config.x.code_non_alcoholic = ENV.fetch('CODE_NON_ALCOHOLIC', nil) - config.x.code_distilled = ENV.fetch('CODE_DISTILLED', nil) - config.x.code_wine = ENV.fetch('CODE_WINE', nil) - config.x.code_food = ENV.fetch('CODE_FOOD', nil) - config.x.code_tobacco = ENV.fetch('CODE_TOBACCO', nil) - config.x.code_donation = ENV.fetch('CODE_DONATION', nil) + config.x.tomato_host = credentials.dig(Rails.env.to_sym, :tomato_host) + + config.x.slack_webhook = credentials.dig(Rails.env.to_sym, :slack_webhook) || '' + config.x.slack_channel = '#monitoring' + + config.x.smtp_username = credentials.dig(:production, :smtp_username) + config.x.smtp_password = credentials.dig(:production, :smtp_password) + config.x.sentry_dsn = credentials.dig(Rails.env.to_sym, :sentry_dsn) + config.x.sumup_key = credentials.dig(Rails.env.to_sym, :sumup_affiliate_key) + config.x.healthcheck_ids = credentials.dig(Rails.env.to_sym, :healthcheck_ids) + config.x.mollie_api_key = credentials.dig(Rails.env.to_sym, :mollie_api_key) + + config.x.authorize_url = ENV.fetch('AUTHORIZE_URL', '/oauth/authorize') + config.x.token_url = ENV.fetch('TOKEN_URL', '/api/v1/oauth/token') + config.x.me_url = ENV.fetch('ME_URL', '/api/v1/users?filter[me]&include="active_groups"') + + config.x.from_email = ENV.fetch('FROM_EMAIL', 'noreply@example.com') + config.x.ict_email = ENV.fetch('ICT_EMAIL', 'ict@example.com') + config.x.admin_email = ENV.fetch('ADMIN_EMAIL', 'admin@example.com') + config.x.treasurer_email = ENV.fetch('TREASURER_EMAIL', 'treasurer@example.com') + config.x.treasurer_name = ENV.fetch('TREASURER_NAME', nil) + config.x.treasurer_phone = ENV.fetch('TREASURER_PHONE', nil) + + config.x.company_name = ENV.fetch('COMPANY_NAME', nil) + config.x.company_iban = ENV.fetch('COMPANY_IBAN', nil) + config.x.company_address = ENV.fetch('COMPANY_ADDRESS', nil) + config.x.company_website = ENV.fetch('COMPANY_WEBSITE', nil) + config.x.company_kvk = ENV.fetch('COMPANY_KVK', nil) + + config.x.site_name = ENV.fetch('SITE_NAME', 'S.O.F.I.A.') + config.x.site_short_name = ENV.fetch('SITE_SHORT_NAME', 'SOFIA') + config.x.site_association = ENV.fetch('SITE_ASSOCIATION', 'C.S.V. Alpha') + + config.x.code_beer = ENV.fetch('CODE_BEER', nil) + config.x.code_craft_beer = ENV.fetch('CODE_CRAFT_BEER', nil) + config.x.code_non_alcoholic = ENV.fetch('CODE_NON_ALCOHOLIC', nil) + config.x.code_distilled = ENV.fetch('CODE_DISTILLED', nil) + config.x.code_wine = ENV.fetch('CODE_WINE', nil) + config.x.code_food = ENV.fetch('CODE_FOOD', nil) + config.x.code_tobacco = ENV.fetch('CODE_TOBACCO', nil) + config.x.code_donation = ENV.fetch('CODE_DONATION', nil) config.x.code_credit_mutation = ENV.fetch('CODE_CREDIT_MUTATION', nil) - config.x.code_cash = ENV.fetch('CODE_CASH', nil) - config.x.code_pin = ENV.fetch('CODE_PIN', nil) + config.x.code_cash = ENV.fetch('CODE_CASH', nil) + config.x.code_pin = ENV.fetch('CODE_PIN', nil) end end From 4f9205bdb5dee91d4c6cb085f668a9e696f8d9d1 Mon Sep 17 00:00:00 2001 From: guidojw <35309288+guidojw@users.noreply.github.com> Date: Thu, 12 Oct 2023 00:46:12 +0200 Subject: [PATCH 09/23] fix: indentation --- .github/workflows/continuous-integration.yml | 30 ++++++++++---------- Gemfile.lock | 4 +-- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 3dc82a0e3..24c187a7a 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -71,17 +71,17 @@ jobs: - name: Lint run: | EXIT_STATUS=0 - ./actionlint - -ignore 'property "gh_app_private_key" is not defined' - -ignore 'SC2153:' - -ignore 'property "sha" is not defined in object type {}' || - EXIT_STATUS=$? - docker run - -e POSTGRES_USER=postgres - -e POSTGRES_PASSWORD=postgres - --network=host - app bin/ci.sh lint || - EXIT_STATUS=$? + ./actionlint \ + -ignore 'property "gh_app_private_key" is not defined' \ + -ignore 'SC2153:' \ + -ignore 'property "sha" is not defined in object type {}' || \ + EXIT_STATUS=$? + docker run \ + -e POSTGRES_USER=postgres \ + -e POSTGRES_PASSWORD=postgres \ + --network=host \ + app bin/ci.sh lint || \ + EXIT_STATUS=$? exit $EXIT_STATUS test: @@ -118,8 +118,8 @@ jobs: - name: Test run: | - docker run - -e POSTGRES_USER=postgres - -e POSTGRES_PASSWORD=postgres - --network=host + docker run \ + -e POSTGRES_USER=postgres \ + -e POSTGRES_PASSWORD=postgres \ + --network=host \ app bin/ci.sh spec diff --git a/Gemfile.lock b/Gemfile.lock index b5840d9b2..81f7bdf5d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -221,7 +221,7 @@ GEM activerecord kaminari-core (= 1.2.2) kaminari-core (1.2.2) -libv8-node (16.10.0.0) + libv8-node (16.10.0.0) libv8-node (16.10.0.0-x86_64-linux) listen (3.7.1) rb-fsevent (~> 0.10, >= 0.10.3) @@ -585,8 +585,8 @@ DEPENDENCIES kaminari (~> 1.2.0) listen mina (~> 1.2.0) - mollie-api-ruby (~> 4.7.0) mini_racer (~> 0.6.0) + mollie-api-ruby (~> 4.7.0) net-imap net-pop net-smtp From ab3e193e9fda4cef11f70b4387fff17cc32ae1c5 Mon Sep 17 00:00:00 2001 From: guidojw <35309288+guidojw@users.noreply.github.com> Date: Thu, 12 Oct 2023 00:46:33 +0200 Subject: [PATCH 10/23] fix: indentation --- .github/workflows/continuous-integration.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 24c187a7a..2cee311a8 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -119,7 +119,7 @@ jobs: - name: Test run: | docker run \ - -e POSTGRES_USER=postgres \ - -e POSTGRES_PASSWORD=postgres \ - --network=host \ - app bin/ci.sh spec + -e POSTGRES_USER=postgres \ + -e POSTGRES_PASSWORD=postgres \ + --network=host \ + app bin/ci.sh spec From 3cd2bfba8fe62d2e6be7662366b17b7536b0c38e Mon Sep 17 00:00:00 2001 From: guidojw <35309288+guidojw@users.noreply.github.com> Date: Thu, 12 Oct 2023 01:04:07 +0200 Subject: [PATCH 11/23] fix: readd POSTGRES_HOST --- .github/workflows/continuous-integration.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 2cee311a8..b3a7499d1 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -79,6 +79,7 @@ jobs: docker run \ -e POSTGRES_USER=postgres \ -e POSTGRES_PASSWORD=postgres \ + -e POSTGRES_HOST=localhost \ --network=host \ app bin/ci.sh lint || \ EXIT_STATUS=$? @@ -121,5 +122,6 @@ jobs: docker run \ -e POSTGRES_USER=postgres \ -e POSTGRES_PASSWORD=postgres \ + -e POSTGRES_HOST=localhost \ --network=host \ app bin/ci.sh spec From 0dd8b9fa722d5e3cf1e7353b8eb372cb20d68ecb Mon Sep 17 00:00:00 2001 From: guidojw <35309288+guidojw@users.noreply.github.com> Date: Thu, 21 Nov 2024 23:53:09 +0100 Subject: [PATCH 12/23] fix: pass RAILS_MASTER_KEY to ci step --- .github/workflows/continuous-delivery.yml | 2 ++ .github/workflows/continuous-integration.yml | 7 +++++++ Dockerfile | 1 - Gemfile | 1 - Gemfile.lock | 6 ------ 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/continuous-delivery.yml b/.github/workflows/continuous-delivery.yml index 48e006727..14de73672 100644 --- a/.github/workflows/continuous-delivery.yml +++ b/.github/workflows/continuous-delivery.yml @@ -123,6 +123,8 @@ jobs: uses: csvalpha/sofia/.github/workflows/continuous-integration.yml@staging with: sha: ${{ needs.merge.outputs.sha }} + secrets: + rails_master_key: ${{ secrets.RAILS_MASTER_KEY }} publish_image: name: Publish Image diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 6e16ac4a1..e3eb73ec6 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -11,6 +11,10 @@ on: description: The commit SHA to run the workflow on required: false type: string + secrets: + rails_master_key: + description: The Rails master key + required: true jobs: build: @@ -118,8 +122,11 @@ jobs: name: app - name: Test + env: + RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} run: | docker run \ + -e RAILS_MASTER_KEY \ -e POSTGRES_USER=postgres \ -e POSTGRES_PASSWORD=postgres \ -e POSTGRES_HOST=localhost \ diff --git a/Dockerfile b/Dockerfile index dfe81b68c..18a260e8b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -44,7 +44,6 @@ COPY . /app/ # Precompile assets after copying app because whole Rails pipeline is needed. RUN --mount=type=secret,id=rails_master_key \ if [ "$RAILS_ENV" = 'production' ] || [ "$RAILS_ENV" = 'staging' ] || [ "$RAILS_ENV" = 'luxproduction' ]; then \ - # Use secret if RAILS_MASTER_KEY build arg is not set. SECRET_KEY_BASE_DUMMY=1 bundle exec rails assets:precompile; \ else \ echo "Skipping assets:precompile"; \ diff --git a/Gemfile b/Gemfile index f31b81412..4b9f74f04 100644 --- a/Gemfile +++ b/Gemfile @@ -12,7 +12,6 @@ gem 'http', '~> 5.0.0' gem 'jbuilder', '~> 2.11.0' gem 'jquery-rails', '~> 4.5.0' gem 'kaminari', '~> 1.2.0' -gem 'mini_racer', '~> 0.6.0' gem 'mollie-api-ruby', '~> 4.7.0' gem 'net-imap', require: false gem 'net-pop', require: false diff --git a/Gemfile.lock b/Gemfile.lock index b14da200f..1c4353fd4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -124,7 +124,6 @@ GEM devise-i18n (1.10.2) devise (>= 4.8.0) diff-lcs (1.5.0) - digest (3.1.1) docile (1.4.0) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) @@ -222,8 +221,6 @@ GEM activerecord kaminari-core (= 1.2.2) kaminari-core (1.2.2) - libv8-node (16.10.0.0) - libv8-node (16.10.0.0-x86_64-linux) listen (3.7.1) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) @@ -249,8 +246,6 @@ GEM rake mini_mime (1.1.5) mini_portile2 (2.8.4) - mini_racer (0.6.2) - libv8-node (~> 16.10.0.0) minitest (5.20.0) mollie-api-ruby (4.7.1) msgpack (1.5.2) @@ -586,7 +581,6 @@ DEPENDENCIES kaminari (~> 1.2.0) listen mina (~> 1.2.0) - mini_racer (~> 0.6.0) mollie-api-ruby (~> 4.7.0) net-imap net-pop From d894a75f0a46dccb48e589ba575bcd4984d352ef Mon Sep 17 00:00:00 2001 From: guidojw <35309288+guidojw@users.noreply.github.com> Date: Thu, 21 Nov 2024 23:58:00 +0100 Subject: [PATCH 13/23] chore: trigger build From 5786b9cd5c125296c353c4002b42c44c68e560f3 Mon Sep 17 00:00:00 2001 From: guidojw <35309288+guidojw@users.noreply.github.com> Date: Fri, 22 Nov 2024 00:24:10 +0100 Subject: [PATCH 14/23] chore: fix lint --- config/application.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/application.rb b/config/application.rb index c80c30907..5e1a91874 100644 --- a/config/application.rb +++ b/config/application.rb @@ -67,7 +67,7 @@ class Application < Rails::Application config.x.site_long_name = ENV.fetch('SITE_LONG_NAME', 'Streepsysteem voor de Ordentelijke Festiviteiten van Inleggend Alpha') config.x.site_association = ENV.fetch('SITE_ASSOCIATION', 'C.S.V. Alpha') - config.x.codes = { + config.x.codes = { beer: ENV.fetch('CODE_BEER', nil), low_alcohol_beer: ENV.fetch('CODE_LOW_ALCOHOL_BEER', nil), craft_beer: ENV.fetch('CODE_CRAFT_BEER', nil), From dc188674c643c3d285e881f5608d6065b5d67339 Mon Sep 17 00:00:00 2001 From: guidojw <35309288+guidojw@users.noreply.github.com> Date: Fri, 22 Nov 2024 17:48:01 +0100 Subject: [PATCH 15/23] chore: remove unnecessary secret mount --- Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 18a260e8b..3b4a79010 100644 --- a/Dockerfile +++ b/Dockerfile @@ -42,8 +42,7 @@ RUN yarn install --immutable COPY . /app/ # Precompile assets after copying app because whole Rails pipeline is needed. -RUN --mount=type=secret,id=rails_master_key \ - if [ "$RAILS_ENV" = 'production' ] || [ "$RAILS_ENV" = 'staging' ] || [ "$RAILS_ENV" = 'luxproduction' ]; then \ +RUN if [ "$RAILS_ENV" = 'production' ] || [ "$RAILS_ENV" = 'staging' ] || [ "$RAILS_ENV" = 'luxproduction' ]; then \ SECRET_KEY_BASE_DUMMY=1 bundle exec rails assets:precompile; \ else \ echo "Skipping assets:precompile"; \ From c8090360e2680b246cf354cd9fe2ab7072bc21be Mon Sep 17 00:00:00 2001 From: lodewiges <131907615+lodewiges@users.noreply.github.com> Date: Tue, 31 Dec 2024 01:04:22 +0100 Subject: [PATCH 16/23] remove spaces continuous-integration.yml --- .github/workflows/continuous-integration.yml | 26 +++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 9733aeef2..50c6ce736 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -125,18 +125,20 @@ jobs: name: app - name: Test - env: - RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} - run: | - mkdir coverage - docker run \ - -e RAILS_MASTER_KEY \ - -e POSTGRES_USER=postgres \ - -e POSTGRES_PASSWORD=postgres \ - -e POSTGRES_HOST=localhost \ - --network=host \ - -v "$(pwd)"'/coverage:/app/coverage' \ - app bin/ci.sh spec + - name: Test + env: + RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} + run: | + mkdir coverage + docker run \ + -e RAILS_MASTER_KEY \ + -e POSTGRES_USER=postgres \ + -e POSTGRES_PASSWORD=postgres \ + -e POSTGRES_HOST=localhost \ + --network=host \ + -v "$(pwd)"'/coverage:/app/coverage' \ + app bin/ci.sh spec + - name: Upload coverage report to Codecov if: ${{ !cancelled() }} From 4c1fa3a4faa25ae3ea6194dd5403d891ddcbd671 Mon Sep 17 00:00:00 2001 From: lodewiges <131907615+lodewiges@users.noreply.github.com> Date: Tue, 31 Dec 2024 01:05:58 +0100 Subject: [PATCH 17/23] Update continuous-integration.yml --- .github/workflows/continuous-integration.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 50c6ce736..7a52d7adf 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -125,7 +125,6 @@ jobs: name: app - name: Test - - name: Test env: RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} run: | From 4946b3ced3219ad94a19f7cc1243712d2a69f252 Mon Sep 17 00:00:00 2001 From: lodewiges <131907615+lodewiges@users.noreply.github.com> Date: Tue, 31 Dec 2024 01:15:40 +0100 Subject: [PATCH 18/23] Update continuous-integration.yml --- .github/workflows/continuous-integration.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 7a52d7adf..ec6e0d67a 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -132,8 +132,8 @@ jobs: docker run \ -e RAILS_MASTER_KEY \ -e POSTGRES_USER=postgres \ - -e POSTGRES_PASSWORD=postgres \ - -e POSTGRES_HOST=localhost \ + -e POSTGRES_PASSWORD=postgres \ + -e POSTGRES_HOST=localhost \ --network=host \ -v "$(pwd)"'/coverage:/app/coverage' \ app bin/ci.sh spec From 99fce793425aa5d0e282f9f61898aad72ffdf154 Mon Sep 17 00:00:00 2001 From: lodewiges <131907615+lodewiges@users.noreply.github.com> Date: Tue, 31 Dec 2024 01:22:40 +0100 Subject: [PATCH 19/23] Fix? --- .github/workflows/continuous-integration.yml | 24 ++++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index ec6e0d67a..b13fcc254 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -125,18 +125,18 @@ jobs: name: app - name: Test - env: - RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} - run: | - mkdir coverage - docker run \ - -e RAILS_MASTER_KEY \ - -e POSTGRES_USER=postgres \ - -e POSTGRES_PASSWORD=postgres \ - -e POSTGRES_HOST=localhost \ - --network=host \ - -v "$(pwd)"'/coverage:/app/coverage' \ - app bin/ci.sh spec + env: + RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} + run: | + mkdir coverage + docker run \ + -e RAILS_MASTER_KEY \ + -e POSTGRES_USER=postgres \ + -e POSTGRES_PASSWORD=postgres \ + -e POSTGRES_HOST=localhost \ + --network=host \ + -v "$(pwd)"'/coverage:/app/coverage' \ + app bin/ci.sh spec - name: Upload coverage report to Codecov From 758f2e7993a036dde549996945a38062ac4ff206 Mon Sep 17 00:00:00 2001 From: lodewiges <131907615+lodewiges@users.noreply.github.com> Date: Tue, 31 Dec 2024 01:41:25 +0100 Subject: [PATCH 20/23] Update continuous-integration.yml --- .github/workflows/continuous-integration.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index b13fcc254..dbdbe1a78 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -129,13 +129,13 @@ jobs: RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} run: | mkdir coverage - docker run \ + docker run \ -e RAILS_MASTER_KEY \ -e POSTGRES_USER=postgres \ -e POSTGRES_PASSWORD=postgres \ -e POSTGRES_HOST=localhost \ --network=host \ - -v "$(pwd)"'/coverage:/app/coverage' \ + -v "$(pwd)"'/coverage:/app/coverage' \ app bin/ci.sh spec From 8bfdf35a98c3b1881b76268479e1c7bb37899adc Mon Sep 17 00:00:00 2001 From: Jorai Geertsema Date: Wed, 8 Jan 2025 18:43:57 +0100 Subject: [PATCH 21/23] updated gemfile --- .rubocop.yml | 2 +- Gemfile | 2 +- Gemfile.lock | 164 ++++++++++++++++++++++++------------------ config/application.rb | 2 +- 4 files changed, 97 insertions(+), 73 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 1a742be2e..9644b14d7 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -4,7 +4,7 @@ require: - rubocop-performance AllCops: - TargetRailsVersion: 7.0 + TargetRailsVersion: 7.1 TargetRubyVersion: 3.2 Exclude: - 'bin/**/*' diff --git a/Gemfile b/Gemfile index 386c89726..94bb523bb 100644 --- a/Gemfile +++ b/Gemfile @@ -25,7 +25,7 @@ gem 'pg', '~> 1.5.9' gem 'puma', '~> 6.5.0' gem 'pundit', '~> 2.4.0' gem 'rack-attack', '~> 6.7.0' -gem 'rails', '~> 7.1' +gem 'rails', '~> 7.1.0' gem 'rails-i18n', '~> 7.0.10' gem 'redis-rails', '~> 5.0.2' gem 'rest-client', '~> 2.1.0' diff --git a/Gemfile.lock b/Gemfile.lock index 4a4f66e75..3d144a9d2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,73 +1,82 @@ GEM remote: https://rubygems.org/ specs: - actioncable (7.0.8.7) - actionpack (= 7.0.8.7) - activesupport (= 7.0.8.7) + actioncable (7.1.5.1) + actionpack (= 7.1.5.1) + activesupport (= 7.1.5.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.8.7) - actionpack (= 7.0.8.7) - activejob (= 7.0.8.7) - activerecord (= 7.0.8.7) - activestorage (= 7.0.8.7) - activesupport (= 7.0.8.7) + zeitwerk (~> 2.6) + actionmailbox (7.1.5.1) + actionpack (= 7.1.5.1) + activejob (= 7.1.5.1) + activerecord (= 7.1.5.1) + activestorage (= 7.1.5.1) + activesupport (= 7.1.5.1) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.0.8.7) - actionpack (= 7.0.8.7) - actionview (= 7.0.8.7) - activejob (= 7.0.8.7) - activesupport (= 7.0.8.7) + actionmailer (7.1.5.1) + actionpack (= 7.1.5.1) + actionview (= 7.1.5.1) + activejob (= 7.1.5.1) + activesupport (= 7.1.5.1) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp - rails-dom-testing (~> 2.0) - actionpack (7.0.8.7) - actionview (= 7.0.8.7) - activesupport (= 7.0.8.7) - rack (~> 2.0, >= 2.2.4) + rails-dom-testing (~> 2.2) + actionpack (7.1.5.1) + actionview (= 7.1.5.1) + activesupport (= 7.1.5.1) + nokogiri (>= 1.8.5) + racc + rack (>= 2.2.4) + rack-session (>= 1.0.1) rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.8.7) - actionpack (= 7.0.8.7) - activerecord (= 7.0.8.7) - activestorage (= 7.0.8.7) - activesupport (= 7.0.8.7) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + actiontext (7.1.5.1) + actionpack (= 7.1.5.1) + activerecord (= 7.1.5.1) + activestorage (= 7.1.5.1) + activesupport (= 7.1.5.1) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.8.7) - activesupport (= 7.0.8.7) + actionview (7.1.5.1) + activesupport (= 7.1.5.1) builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (7.0.8.7) - activesupport (= 7.0.8.7) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (7.1.5.1) + activesupport (= 7.1.5.1) globalid (>= 0.3.6) - activemodel (7.0.8.7) - activesupport (= 7.0.8.7) - activerecord (7.0.8.7) - activemodel (= 7.0.8.7) - activesupport (= 7.0.8.7) - activestorage (7.0.8.7) - actionpack (= 7.0.8.7) - activejob (= 7.0.8.7) - activerecord (= 7.0.8.7) - activesupport (= 7.0.8.7) + activemodel (7.1.5.1) + activesupport (= 7.1.5.1) + activerecord (7.1.5.1) + activemodel (= 7.1.5.1) + activesupport (= 7.1.5.1) + timeout (>= 0.4.0) + activestorage (7.1.5.1) + actionpack (= 7.1.5.1) + activejob (= 7.1.5.1) + activerecord (= 7.1.5.1) + activesupport (= 7.1.5.1) marcel (~> 1.0) - mini_mime (>= 1.1.0) - activesupport (7.0.8.7) + activesupport (7.1.5.1) + base64 + benchmark (>= 0.3) + bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) connection_pool (>= 2.2.5) drb i18n (>= 1.6, < 2) + logger (>= 1.4.2) minitest (>= 5.1) mutex_m + securerandom (>= 0.3) tzinfo (~> 2.0) addressable (2.8.0) public_suffix (>= 2.0.2, < 5.0) @@ -77,6 +86,7 @@ GEM awesome_print (1.9.2) base64 (0.2.0) bcrypt (3.1.20) + benchmark (0.4.0) better_errors (2.9.1) coderay (>= 1.0.0) erubi (>= 1.0.0) @@ -193,6 +203,10 @@ GEM http_parser.rb (0.8.0) i18n (1.14.6) concurrent-ruby (~> 1.0) + io-console (0.8.0) + irb (1.14.3) + rdoc (>= 4.0.0) + reline (>= 0.4.2) jbuilder (2.13.0) actionview (>= 5.0.0) activesupport (>= 5.0.0) @@ -214,8 +228,6 @@ GEM activerecord kaminari-core (= 1.2.2) kaminari-core (1.2.2) - libv8-node (18.19.0.0) - libv8-node (18.19.0.0-x86_64-linux) listen (3.7.1) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) @@ -241,8 +253,6 @@ GEM rake mini_mime (1.1.5) mini_portile2 (2.8.8) - mini_racer (0.16.0) - libv8-node (~> 18.19.0.0) minitest (5.25.4) mollie-api-ruby (4.15.0) bigdecimal (~> 3.1, >= 3.1.8) @@ -254,6 +264,9 @@ GEM nenv (0.3.0) date net-protocol + net-imap (0.5.5) + date + net-protocol net-pop (0.1.2) net-protocol net-protocol (0.2.2) @@ -309,7 +322,8 @@ GEM pry (>= 0.13, < 0.15) pry-rails (0.3.9) pry (>= 0.10.4) - psych (5.1.1) + psych (5.2.2) + date stringio public_suffix (4.0.7) puma (6.5.0) @@ -325,22 +339,27 @@ GEM rack rack-proxy (0.7.2) rack + rack-session (1.0.2) + rack (< 3) rack-test (2.2.0) rack (>= 1.3) - rails (7.0.8.7) - actioncable (= 7.0.8.7) - actionmailbox (= 7.0.8.7) - actionmailer (= 7.0.8.7) - actionpack (= 7.0.8.7) - actiontext (= 7.0.8.7) - actionview (= 7.0.8.7) - activejob (= 7.0.8.7) - activemodel (= 7.0.8.7) - activerecord (= 7.0.8.7) - activestorage (= 7.0.8.7) - activesupport (= 7.0.8.7) + rackup (1.0.1) + rack (< 3) + webrick + rails (7.1.5.1) + actioncable (= 7.1.5.1) + actionmailbox (= 7.1.5.1) + actionmailer (= 7.1.5.1) + actionpack (= 7.1.5.1) + actiontext (= 7.1.5.1) + actionview (= 7.1.5.1) + activejob (= 7.1.5.1) + activemodel (= 7.1.5.1) + activerecord (= 7.1.5.1) + activestorage (= 7.1.5.1) + activesupport (= 7.1.5.1) bundler (>= 1.15.0) - railties (= 7.0.8.7) + railties (= 7.1.5.1) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -355,10 +374,11 @@ GEM rails-i18n (7.0.10) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 8) - railties (7.0.8.7) - actionpack (= 7.0.8.7) - activesupport (= 7.0.8.7) - method_source + railties (7.1.5.1) + actionpack (= 7.1.5.1) + activesupport (= 7.1.5.1) + irb + rackup (>= 1.0.0) rake (>= 12.2) thor (~> 1.0, >= 1.2.2) zeitwerk (~> 2.6) @@ -368,7 +388,7 @@ GEM rb-inotify (0.10.1) ffi (~> 1.0) rb-readline (0.5.5) - rdoc (6.5.0) + rdoc (6.10.0) psych (>= 4.0.0) redis (4.8.1) redis-actionpack (5.3.0) @@ -390,6 +410,8 @@ GEM redis-store (1.9.1) redis (>= 4, < 5) regexp_parser (2.10.0) + reline (0.6.0) + io-console (~> 0.5) request_store (1.7.0) rack (>= 1.4) responders (3.0.1) @@ -455,6 +477,7 @@ GEM sprockets (> 3.0) sprockets-rails tilt + securerandom (0.4.1) semantic_range (3.0.0) sentry-rails (5.22.1) railties (>= 5.0) @@ -502,6 +525,7 @@ GEM sshkit (1.21.2) net-scp (>= 1.1.2) net-ssh (>= 2.8.0) + stringio (3.1.2) terminal-notifier-guard (1.7.0) thor (1.3.2) tilt (2.1.0) @@ -535,6 +559,7 @@ GEM rack-proxy (>= 0.6.1) railties (>= 5.2) semantic_range (>= 2.3.0) + webrick (1.9.1) websocket-driver (0.7.7) base64 websocket-extensions (>= 0.1.0) @@ -574,7 +599,6 @@ DEPENDENCIES kaminari (~> 1.2.2) listen mina (~> 1.2.5) - mini_racer (~> 0.16.0) mollie-api-ruby (~> 4.15.0) net-imap net-pop @@ -590,7 +614,7 @@ DEPENDENCIES puma (~> 6.5.0) pundit (~> 2.4.0) rack-attack (~> 6.7.0) - rails (~> 7.0.4, >= 7.0.4.3) + rails (~> 7.1.0) rails-controller-testing (~> 1.0.5) rails-i18n (~> 7.0.10) rb-readline diff --git a/config/application.rb b/config/application.rb index bf31a59e8..ec4cb57f1 100644 --- a/config/application.rb +++ b/config/application.rb @@ -7,7 +7,7 @@ module Sofia class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. - config.load_defaults 7.0 + config.load_defaults 7.1 config.time_zone = 'Europe/Amsterdam' From 7de4d105cfbf6875884a3863637ab7858af884a3 Mon Sep 17 00:00:00 2001 From: Jorai Geertsema Date: Wed, 8 Jan 2025 22:05:37 +0100 Subject: [PATCH 22/23] edited ablication.rb --- config/application.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/config/application.rb b/config/application.rb index ec4cb57f1..69b6ee8e4 100644 --- a/config/application.rb +++ b/config/application.rb @@ -24,14 +24,14 @@ class Application < Rails::Application # See https://github.com/kickstarter/rack-attack#getting-started config.middleware.use Rack::Attack - config.x.amber_api_host = credentials.dig(Rails.env.to_sym, :amber_host) - config.x.amber_api_url = "#{Rails.env.development? ? 'http' : 'https'}://#{credentials.dig(Rails.env.to_sym, :amber_host)}" + config.x.amber_api_host = credentials.dig(Rails.env.to_sym, :amber_host) + config.x.amber_api_url = "#{Rails.env.development? ? 'http' : 'https'}://#{credentials.dig(Rails.env.to_sym, :amber_host)}" - config.x.amber_client_id = credentials.dig(Rails.env.to_sym, :amber_client_id) || ENV.fetch('AMBER_CLIENT_ID', nil) - config.x.amber_client_secret = credentials.dig(Rails.env.to_sym, :amber_client_secret) || ENV.fetch('AMBER_CLIENT_SECRET', nil) + config.x.amber_client_id = credentials.dig(Rails.env.to_sym, :amber_client_id) || ENV.fetch('AMBER_CLIENT_ID', nil) + config.x.amber_client_secret = credentials.dig(Rails.env.to_sym, :amber_client_secret) || ENV.fetch('AMBER_CLIENT_SECRET', nil) - config.x.amber_host = credentials.dig(Rails.env.to_sym, :amber_host) - config.x.sofia_host = credentials.dig(Rails.env.to_sym, :sofia_host) + config.x.amber_host = credentials.dig(Rails.env.to_sym, :amber_host) + config.x.sofia_host = credentials.dig(Rails.env.to_sym, :sofia_host) config.x.slack_webhook = credentials.dig(Rails.env.to_sym, :slack_webhook) || '' config.x.slack_channel = '#monitoring' From 6cac46aae9a23adf2f955e5db888cd194b4c0c76 Mon Sep 17 00:00:00 2001 From: Jorai Geertsema Date: Thu, 9 Jan 2025 14:42:50 +0100 Subject: [PATCH 23/23] Remove depraction error --- config/environments/production.rb | 2 +- config/initializers/devise.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/config/environments/production.rb b/config/environments/production.rb index 97ba0a7e3..6ade5d8ed 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -19,7 +19,7 @@ # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"] # or in config/master.key. This key is used to decrypt credentials (and other encrypted files). - # config.require_master_key = true + config.require_master_key = true # Disable serving static files from the `/public` folder by default since # Apache or NGINX already handles this. diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 5b3584d5a..ba1ea2a26 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -1,4 +1,5 @@ Devise.setup do |config| + config.secret_key = Rails.application.secret_key_base config.mailer_sender = Rails.application.config.x.ict_email # ==> ORM configuration