From 9645fd20d6532881440c896323cf1f3dc00f4ad8 Mon Sep 17 00:00:00 2001 From: moustachu Date: Wed, 4 Oct 2023 14:27:51 +0200 Subject: [PATCH] fix: disable Rack Attack when ENABLE_RACK_ATTACK=0 (#37) (#38) * fix: disable Rack Attack when ENABLE_RACK_ATTACK=0 * update chromedirver version to 117.0.5938.132 --- .github/workflows/ci_cd.yml | 4 ++-- config/initializers/rack_attack.rb | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 7e2ff3b3..a4744a97 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -91,7 +91,7 @@ jobs: # TODO: Use latest version - uses: nanasess/setup-chromedriver@v2 with: - chromedriver-version: "114.0.5735.90" + chromedriver-version: "117.0.5938.132" - run: bundle exec rake "test:run[exclude, spec/system/**/*_spec.rb, ${{ matrix.slice }}]" name: RSpec - run: ./.github/upload_coverage.sh decidim-app $GITHUB_EVENT_PATH @@ -159,7 +159,7 @@ jobs: # TODO: Use latest version - uses: nanasess/setup-chromedriver@v2 with: - chromedriver-version: "114.0.5735.90" + chromedriver-version: "117.0.5938.132" - run: bundle exec rake "test:run[include, spec/system/**/*_spec.rb, ${{ matrix.slice }}]" name: RSpec - run: ./.github/upload_coverage.sh decidim-app $GITHUB_EVENT_PATH diff --git a/config/initializers/rack_attack.rb b/config/initializers/rack_attack.rb index 62de9c45..8d0994a3 100644 --- a/config/initializers/rack_attack.rb +++ b/config/initializers/rack_attack.rb @@ -6,4 +6,8 @@ # Enabled by default in production # Can be deactivated with 'ENABLE_RACK_ATTACK=0' -DecidimApp::RackAttack.apply_configuration if DecidimApp::RackAttack.rack_enabled? +if DecidimApp::RackAttack.rack_enabled? + DecidimApp::RackAttack.apply_configuration +else + Rack::Attack.enabled = false +end