mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-10 17:21:38 -05:00
Use constants for metrics username and password.
This commit is contained in:
parent
f8c509912b
commit
b995594b8b
2 changed files with 6 additions and 1 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class MetricsController < ApplicationController
|
class MetricsController < ApplicationController
|
||||||
http_basic_authenticate_with name: ENV['METRICS_USERNAME'], password: ENV['METRICS_PASSWORD'], only: :index
|
http_basic_authenticate_with name: METRICS_USERNAME, password: METRICS_PASSWORD, only: :index
|
||||||
|
|
||||||
def index
|
def index
|
||||||
result = PrometheusMetrics.fetch_data
|
result = PrometheusMetrics.fetch_data
|
||||||
|
|
|
||||||
|
|
@ -31,3 +31,8 @@ STORE_GEODATA = ENV.fetch('STORE_GEODATA', 'true') == 'true'
|
||||||
|
|
||||||
SENTRY_DSN = ENV.fetch('SENTRY_DSN', nil)
|
SENTRY_DSN = ENV.fetch('SENTRY_DSN', nil)
|
||||||
MANAGER_URL = SELF_HOSTED ? nil : ENV.fetch('MANAGER_URL', nil)
|
MANAGER_URL = SELF_HOSTED ? nil : ENV.fetch('MANAGER_URL', nil)
|
||||||
|
|
||||||
|
# Prometheus metrics
|
||||||
|
METRICS_USERNAME = ENV.fetch('METRICS_USERNAME', 'prometheus')
|
||||||
|
METRICS_PASSWORD = ENV.fetch('METRICS_PASSWORD', 'prometheus')
|
||||||
|
# /Prometheus metrics
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue