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