Change protocol mismatch warning bar to print correct warning

We can only link to the installation guides now that the protocol
setting can no longer be controlled in the UI.
pull/11157/head
Oliver Günther 2 years ago
parent 4d097daceb
commit 4da4099261
No known key found for this signature in database
GPG Key ID: A3A8BDAD7C0C552C
  1. 11
      app/helpers/static_links_helper.rb
  2. 7
      app/views/warning_bar/_host_and_protocol_mismatch.html.erb
  3. 3
      config/configuration.yml.example
  4. 10
      config/locales/en.yml
  5. 16
      lib/open_project/static/links.rb

@ -32,9 +32,18 @@ module StaticLinksHelper
def static_link_to(key, label: nil)
item = OpenProject::Static::Links.links.fetch key
link_to label || t(item[:label]),
link_to label || t(item[:label], default: item[:label]),
item[:href],
class: 'openproject--static-link',
target: '_blank', rel: 'noopener'
end
##
# Link to the correct installation guides for the current selected method
def installation_guide_link
val = OpenProject::Configuration.installation_type
link = OpenProject::Static::Links.links[:"#{val}_installation"] || OpenProject::Static::Links.links[:installation_guides]
link[:href]
end
end

@ -3,12 +3,13 @@
<% if setting_protocol_mismatched? %>
<p>
<strong><%= t 'warning_bar.protocol_mismatch.title' %></strong>
<strong><%= t 'warning_bar.https_mismatch.title' %></strong>
<br/>
<%= t 'warning_bar.protocol_mismatch.text_html',
<%= t 'warning_bar.https_mismatch.text_html',
set_protocol: Setting.protocol,
actual_protocol: request.ssl? ? 'https' : 'http',
setting_path: admin_settings_general_path
setting_value: request.ssl? ? 'OPENPROJECT_HTTPS=true' : 'OPENPROJECT_HTTPS=false',
more_info_path: installation_guide_link
%>
</p>
<% end %>

@ -208,9 +208,6 @@ default:
#
# rails_relative_url_root: ""
# whether to force ssl in production
rails_force_ssl: false
# Absolute path to the directory where attachments are stored.
# The default is the 'files' directory in your OpenProject instance.
# Your OpenProject instance needs to have write permission on this

@ -1685,6 +1685,7 @@ en:
label_index_by_title: "Index by title"
label_information: "Information"
label_information_plural: "Information"
label_installation_guides: 'Installation guides'
label_integer: "Integer"
label_internal: "Internal"
label_introduction_video: "Introduction video"
@ -3053,12 +3054,13 @@ en:
warning_protocol_mismatch_html: >
warning_bar:
protocol_mismatch:
title: 'Protocol setting mismatch'
https_mismatch:
title: 'HTTPS mode setup mismatch'
text_html: >
Your application is running with its protocol setting set to <code>%{set_protocol}</code>, but the request
Your application is running with HTTPS mode set to <code>%{set_protocol}</code>, but the request
is an <code>%{actual_protocol}</code> request.
This will result in errors! Go to <a href="%{setting_path}">System settings</a> and change the "Protocol" setting to correct this.
This will result in errors! You will need to set the following configuration value: <code>%{setting_value}</code>.
Please see <a href="%{more_info_path}">the installation documentation</a> on how to set this configuration.
hostname_mismatch:
title: 'Hostname setting mismatch'
text_html: >

@ -98,6 +98,22 @@ module OpenProject
href: 'https://www.openproject.org/docs/user-guide/',
label: 'homescreen.links.user_guides'
},
installation_guides: {
href: 'https://www.openproject.org/docs/installation-and-operations/installation/',
label: :label_installation_guides
},
packager_installation: {
href: 'https://www.openproject.org/docs/installation-and-operations/installation/packaged/',
label: 'Packaged installation'
},
docker_installation: {
href: 'https://www.openproject.org/docs/installation-and-operations/installation/docker/',
label: 'Docker installation'
},
manual_installation: {
href: 'https://www.openproject.org/docs/installation-and-operations/installation/manual/',
label: 'Manual installation'
},
upgrade_guides: {
href: 'https://www.openproject.org/docs/installation-and-operations/operation/upgrading/',
label: :label_upgrade_guides

Loading…
Cancel
Save