2025-01-07 07:12:14 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
|
|
class DawarichSettings
|
|
|
|
|
class << self
|
|
|
|
|
def reverse_geocoding_enabled?
|
2025-01-07 07:41:09 -05:00
|
|
|
@reverse_geocoding_enabled ||= photon_enabled? || geoapify_enabled?
|
2025-01-07 07:12:14 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def photon_enabled?
|
2025-01-07 07:41:09 -05:00
|
|
|
@photon_enabled ||= PHOTON_API_HOST.present?
|
2025-01-07 07:12:14 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def photon_uses_komoot_io?
|
2025-01-07 07:41:09 -05:00
|
|
|
@photon_uses_komoot_io ||= PHOTON_API_HOST == 'photon.komoot.io'
|
2025-01-07 07:12:14 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def geoapify_enabled?
|
2025-01-07 07:41:09 -05:00
|
|
|
@geoapify_enabled ||= GEOAPIFY_API_KEY.present?
|
2025-01-07 07:12:14 -05:00
|
|
|
end
|
2025-01-24 06:01:54 -05:00
|
|
|
|
2025-02-11 14:45:36 -05:00
|
|
|
def prometheus_exporter_enabled?
|
|
|
|
|
@prometheus_exporter_enabled ||=
|
|
|
|
|
ENV['PROMETHEUS_EXPORTER_ENABLED'].to_s == 'true' &&
|
|
|
|
|
ENV['PROMETHEUS_EXPORTER_HOST'].present? &&
|
|
|
|
|
ENV['PROMETHEUS_EXPORTER_PORT'].present?
|
2025-01-24 06:01:54 -05:00
|
|
|
end
|
2025-01-07 07:12:14 -05:00
|
|
|
end
|
|
|
|
|
end
|