diff --git a/.github/workflows/continuous-delivery.yml b/.github/workflows/continuous-delivery.yml index bd9f8856..a3a9b172 100644 --- a/.github/workflows/continuous-delivery.yml +++ b/.github/workflows/continuous-delivery.yml @@ -107,8 +107,7 @@ jobs: sha: ${{ needs.merge.outputs.sha }} secrets: codecov_token: ${{ secrets.CODECOV_TOKEN }} - rails_master_key: ${{ secrets.RAILS_MASTER_KEY }} - + publish_image: name: Publish Image needs: [metadata, merge] diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 1c37eafe..c0ac46cd 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -15,10 +15,6 @@ on: codecov_token: description: Codecov token required: true - rails_master_key: - description: The Rails master key - required: true - jobs: build: @@ -76,21 +72,33 @@ 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: name: Test runs-on: ubuntu-latest needs: build + env: + CAMO_KEY: camo_key_123 services: + camo: + image: rx14/camo.cr:latest + env: + PORT: 9090 db: image: postgres:14.7 env: @@ -120,11 +128,18 @@ jobs: - name: Test env: - RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} + CAMO_HOST: localhost:9090 run: | mkdir coverage - docker run -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_HOST=localhost -e \ - RAILS_MASTER_KEY --network=host -v "$(pwd)"'/coverage:/app/coverage' app bin/ci.sh spec + docker run \ + -e CAMO_KEY \ + -e CAMO_HOST \ + -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() }} diff --git a/Gemfile b/Gemfile index 3d9c3724..6e2be809 100644 --- a/Gemfile +++ b/Gemfile @@ -32,7 +32,7 @@ gem 'puma', '~> 6.0' gem 'pundit', '~> 2.4' gem 'rack-attack', '~> 6.7' gem 'rack-cors', '~> 2.0', '>= 2.0.2', require: 'rack/cors' -gem 'rails', '~> 7.0', '>= 7.0.4.3' +gem 'rails', '~> 7.1.0' gem 'rails-i18n', '~> 7.0', '>= 7.0.10' gem 'redis', '~> 4.8', '>= 4.8.1' gem 'roo', '~> 2.10', '>= 2.10.1' diff --git a/Gemfile.lock b/Gemfile.lock index 91d1eb57..036fe7ce 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -22,70 +22,78 @@ GIT 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) @@ -98,13 +106,15 @@ GEM coderay (>= 1.0.0) erubi (>= 1.0.0) rack (>= 0.9.0) + bigdecimal (3.1.8) + bigdecimal (3.1.8-java) binding_of_caller (1.0.0) debug_inspector (>= 0.0.1) bootsnap (1.18.4) msgpack (~> 1.2) brakeman (5.2.3) builder (3.2.4) - bullet (7.0.1) + bullet (8.0.0) activesupport (>= 3.0.0) uniform_notifier (~> 1.11) byebug (11.1.3) @@ -129,7 +139,7 @@ GEM coderay (1.1.3) colorize (0.8.1) concurrent-ruby (1.3.4) - connection_pool (2.3.0) + connection_pool (2.4.1) consistency_fail (0.3.7) counter_culture (3.8.2) activerecord (>= 4.2) @@ -156,6 +166,7 @@ GEM dotenv-rails (2.7.6) dotenv (= 2.7.6) railties (>= 3.2) + drb (2.2.1) erubi (1.12.0) et-orbi (1.2.11) tzinfo @@ -188,8 +199,8 @@ GEM fuubar (2.5.1) rspec-core (~> 3.0) ruby-progressbar (~> 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) @@ -218,7 +229,7 @@ GEM http_router (0.11.2) rack (>= 1.0.0) url_mount (~> 0.2.1) - i18n (1.14.5) + i18n (1.14.6) concurrent-ruby (~> 1.0) iban-tools (1.2.1) icalendar (2.10.3) @@ -230,8 +241,14 @@ GEM ruby-vips (>= 2.0.17, < 3) improvmx (0.2.1) rest-client (~> 2.0) + io-console (0.6.0) + io-console (0.6.0-java) + irb (1.8.1) + rdoc + reline (>= 0.3.8) isbn_validation (1.2.2) activerecord (>= 3) + jar-dependencies (0.4.1) jsonapi-authorization (3.0.2) jsonapi-resources (~> 0.9.0) pundit (>= 1.0.0, < 3.0.0) @@ -245,9 +262,9 @@ GEM llhttp-ffi (0.5.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) @@ -267,18 +284,19 @@ GEM mini_magick (4.13.2) mini_mime (1.1.2) mini_portile2 (2.8.2) - minitest (5.24.1) + minitest (5.25.2) msgpack (1.7.5) msgpack (1.7.5-java) + mutex_m (0.3.0) nenv (0.3.0) - net-imap (0.3.4) + net-imap (0.4.1) date net-protocol net-pop (0.1.2) net-protocol net-protocol (0.2.1) timeout - net-smtp (0.3.3) + net-smtp (0.4.0) net-protocol netrc (0.11.0) nio4r (2.7.4) @@ -319,6 +337,10 @@ GEM pry (~> 0.13.0) pry-rails (0.3.9) pry (>= 0.10.4) + psych (5.1.1) + stringio + psych (5.1.1-java) + jar-dependencies (>= 0.1.7) public_suffix (4.0.6) puma (6.4.3) nio4r (~> 2.0) @@ -336,45 +358,57 @@ GEM rack (>= 2.0.0) rack-mini-profiler (3.0.0) rack (>= 1.2.0) + 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) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) + railties (= 7.1.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.10) 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) regexp_parser (2.2.1) + reline (0.3.9) + io-console (~> 0.5) request_store (1.5.1) rack (>= 1.4) rest-client (2.1.0) @@ -487,12 +521,13 @@ GEM listen (>= 2.7, < 4.0) spring (>= 1.2, < 3.0) ssrf_filter (1.0.7) + stringio (3.0.8) terminal-notifier-guard (1.7.0) - thor (1.2.1) + thor (1.2.2) tilt (2.4.0) timecop (0.9.5) timeliness (0.4.5) - timeout (0.3.2) + timeout (0.4.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) tzinfo-data (1.2022.1) @@ -519,9 +554,9 @@ GEM crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) webrick (1.7.0) - websocket-driver (0.7.5) + websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) - websocket-driver (0.7.5-java) + websocket-driver (0.7.6-java) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) zeitwerk (2.6.8) @@ -582,7 +617,7 @@ DEPENDENCIES rack-attack (~> 6.7) rack-cors (~> 2.0, >= 2.0.2) rack-mini-profiler - rails (~> 7.0, >= 7.0.4.3) + rails (~> 7.1.0) rails-i18n (~> 7.0, >= 7.0.10) rb-readline redis (~> 4.8, >= 4.8.1) diff --git a/config/application.rb b/config/application.rb index 7158b5ae..230d2d94 100644 --- a/config/application.rb +++ b/config/application.rb @@ -72,8 +72,9 @@ class Application < Rails::Application config.x.sentry_dsn = credentials.dig(Rails.env.to_sym, :sentry_dsn) - config.x.camo_host = credentials.dig(Rails.env.to_sym, :camo_host) - config.x.camo_key = credentials.dig(Rails.env.to_sym, :camo_key) + config.x.camo_host = ENV.fetch('CAMO_HOST', credentials.dig(Rails.env.to_sym, :camo_host)) + config.x.camo_key = ENV.fetch('CAMO_KEY', credentials.dig(Rails.env.to_sym, :camo_key)) + config.x.daily_verse_user = credentials.dig(Rails.env.to_sym, :daily_verse_user) config.x.daily_verse_password = credentials.dig(Rails.env.to_sym, :daily_verse_password) diff --git a/config/environments/production.rb b/config/environments/production.rb index cd2b9bed..f3304dd2 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -2,7 +2,7 @@ # Settings specified here will take precedence over those in config/application.rb. # Require master key for secrets - config.require_master_key = true + # config.require_master_key = true # Code is not reloaded between requests. config.cache_classes = true