Redirect health check monitoring to /ping

We previously optimized the SQL queries, so that anonymous users without any cookie sent no longer result in a database query. This is generally awesome, but it also allows our health check monitoring to pass even when no database connection can be established.
This commit is contained in:
Sebastian Serth
2023-03-13 22:11:53 +01:00
parent 7f0f2a64d1
commit 0643bc8c0c

View File

@ -7,6 +7,7 @@ class ApplicationController < ActionController::Base
MEMBER_ACTIONS = %i[destroy edit show update].freeze
RENDER_HOST = CodeOcean::Config.new(:code_ocean).read[:render_host]
LEGAL_SETTINGS = CodeOcean::Config.new(:code_ocean).read[:legal] || {}
MONITORING_USER_AGENT = Regexp.compile(/updown\.io/).freeze
before_action :deny_access_from_render_host
after_action :verify_authorized, except: %i[welcome]
@ -134,6 +135,7 @@ class ApplicationController < ActionController::Base
def welcome
# Show root page
redirect_to ping_index_path if MONITORING_USER_AGENT.match?(request.user_agent)
end
def load_embed_options