Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Disable HSTS for pullpreview

Christophe Bliard7b726c479bba
diff --git a/.github/workflows/pullpreview.yml b/.github/workflows/pullpreview.yml
index 241cfd8ba2b..0210c60e8bf 100644
--- a/.github/workflows/pullpreview.yml
+++ b/.github/workflows/pullpreview.yml
@@ -28,6 +28,7 @@ jobs:
echo "OP_ADMIN_USER_SEEDER_FORCE_PASSWORD_CHANGE=off" >> .env.pullpreview
echo "OPENPROJECT_SHOW__SETTING__MISMATCH__WARNING=false" >> .env.pullpreview
echo "OPENPROJECT_FEATURE__STORAGES__MODULE__ACTIVE=true" >> .env.pullpreview
+ echo "OPENPROJECT_HSTS=false" >> .env.pullpreview
- name: Boot as BIM edition
if: contains(github.ref, 'bim/') || contains(github.head_ref, 'bim/')
run: |
diff --git a/config/environments/production.rb b/config/environments/production.rb
index 535b4dcb600..3d2f14c5629 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -78,9 +78,9 @@ OpenProject::Application.configure do
# Allow disabling HSTS redirect by using OPENPROJECT_HSTS=false
config.force_ssl = OpenProject::Configuration.https?
config.ssl_options = {
+ hsts: OpenProject::Configuration.hsts_enabled?,
# Disable redirect on the internal SYS API
redirect: {
- hsts: OpenProject::Configuration.hsts_enabled?,
exclude: ->(request) do
# Disable redirects when hsts is disabled
return true unless OpenProject::Configuration.hsts_enabled?