diff --git a/app/models/upright/service.rb b/app/models/upright/service.rb index 8d5b46e..6703f86 100644 --- a/app/models/upright/service.rb +++ b/app/models/upright/service.rb @@ -2,7 +2,7 @@ class Upright::Service < FrozenRecord::Base include Upright::Services::LiveStatus def self.file_path - Rails.root.join("config", "services.yml").to_s + Upright.configuration.services_path.to_s end scope :public_facing, -> { where(public: true) } diff --git a/lib/upright/configuration.rb b/lib/upright/configuration.rb index e4c359e..5588606 100644 --- a/lib/upright/configuration.rb +++ b/lib/upright/configuration.rb @@ -21,6 +21,9 @@ class Upright::Configuration attr_writer :probes_path attr_writer :authenticators_path + # Public status page services definition (env-overridable, like probes_path) + attr_writer :services_path + # Playwright attr_accessor :playwright_cli_path @@ -57,6 +60,7 @@ def initialize @frozen_record_path = nil @probes_path = nil @authenticators_path = nil + @services_path = nil @probe_types = Upright::ProbeTypeRegistry.new @@ -120,6 +124,10 @@ def probes_path @probes_path || Rails.root.join("probes") end + def services_path + @services_path || Rails.root.join("config", "services.yml") + end + def authenticators_path @authenticators_path || Rails.root.join("probes", "authenticators") end