34 lines
1.2 KiB
Elixir
34 lines
1.2 KiB
Elixir
import Config
|
|
|
|
if System.get_env("PHX_SERVER") do
|
|
config :cortex_status, CortexStatusWeb.Endpoint, server: true
|
|
end
|
|
|
|
if config_env() == :prod do
|
|
secret_key_base =
|
|
System.get_env("SECRET_KEY_BASE") ||
|
|
raise """
|
|
environment variable SECRET_KEY_BASE is missing.
|
|
You can generate one by calling: mix phx.gen.secret
|
|
"""
|
|
|
|
host = System.get_env("PHX_HOST") || "status.hydrascale.net"
|
|
port = String.to_integer(System.get_env("PORT") || "4000")
|
|
|
|
config :cortex_status, CortexStatusWeb.Endpoint,
|
|
url: [host: host, port: 443, scheme: "https"],
|
|
http: [ip: {127, 0, 0, 1}, port: port],
|
|
secret_key_base: secret_key_base
|
|
|
|
# Override service URLs in prod if env vars are set
|
|
config :cortex_status, :services,
|
|
symbiont_url: System.get_env("SYMBIONT_URL") || "http://127.0.0.1:8111",
|
|
dendrite_url: System.get_env("DENDRITE_URL") || "http://localhost:3000",
|
|
dendrite_api_key: System.get_env("DENDRITE_API_KEY") || "8dc5e8f7a02745ee8db90c94b2481fd9e1deeea1e2ce74420f54047859ea7edf",
|
|
monitored_sites: [
|
|
{"hydrascale.net", "https://hydrascale.net"},
|
|
{"browser.hydrascale.net", "https://browser.hydrascale.net/health"},
|
|
{"cortex.hydrascale.net", "https://cortex.hydrascale.net"}
|
|
]
|
|
end
|