2026-05-09 19:55:48 +02:00
|
|
|
import Config
|
|
|
|
|
|
2026-05-09 20:49:09 +02:00
|
|
|
# Runtime secrets — each release only requires its own secret key
|
2026-05-09 19:55:48 +02:00
|
|
|
if config_env() == :prod do
|
2026-05-11 13:57:07 +02:00
|
|
|
# RELEASE_NAME is set by the Elixir release scripts at startup.
|
|
|
|
|
# Each release only requires its own secret key.
|
|
|
|
|
release = System.get_env("RELEASE_NAME", "")
|
2026-05-09 19:55:48 +02:00
|
|
|
|
2026-05-11 13:57:07 +02:00
|
|
|
if release != "centralcloud_staff" do
|
|
|
|
|
config :centralcloud_my, CentralcloudMy.Endpoint,
|
|
|
|
|
secret_key_base: System.fetch_env!("MY_SECRET_KEY_BASE")
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if release != "centralcloud_my" do
|
|
|
|
|
config :centralcloud_staff, CentralcloudStaff.Endpoint,
|
|
|
|
|
secret_key_base: System.fetch_env!("OPS_SECRET_KEY_BASE")
|
2026-05-09 20:49:09 +02:00
|
|
|
end
|
2026-05-09 19:55:48 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
config :centralcloud_core, :hostbill,
|
|
|
|
|
base_url: System.get_env("HOSTBILL_URL", "https://portal.centralcloud.com"),
|
|
|
|
|
api_id: System.get_env("HOSTBILL_API_ID"),
|
|
|
|
|
api_key: System.get_env("HOSTBILL_API_KEY")
|
|
|
|
|
|
|
|
|
|
config :centralcloud_core, :dr_portal,
|
|
|
|
|
base_url: System.get_env("DR_PORTAL_URL", "https://dr.centralcloud.com"),
|
|
|
|
|
api_key: System.get_env("DR_PORTAL_API_KEY")
|
|
|
|
|
|
2026-05-10 22:54:33 +02:00
|
|
|
config :centralcloud_core, :oncall,
|
|
|
|
|
base_url: System.get_env("ONCALL_URL", "https://oncall.centralcloud.com"),
|
|
|
|
|
token: System.get_env("ONCALL_API_TOKEN")
|
|
|
|
|
|
2026-05-09 19:55:48 +02:00
|
|
|
config :centralcloud_core, :oidc,
|
|
|
|
|
issuer: System.get_env("AUTHENTIK_ISSUER", "https://sso.centralcloud.com/application/o/centralcloud/"),
|
|
|
|
|
client_id: System.get_env("OIDC_CLIENT_ID"),
|
|
|
|
|
client_secret: System.get_env("OIDC_CLIENT_SECRET")
|
2026-05-11 11:23:14 +02:00
|
|
|
|
2026-05-11 13:06:21 +02:00
|
|
|
config :centralcloud_staff, :router_agent,
|
2026-05-11 11:23:14 +02:00
|
|
|
url: System.get_env("ROUTER_AGENT_URL", "http://router-agent.router-agent.svc:8642"),
|
|
|
|
|
api_key: System.get_env("ROUTER_AGENT_API_KEY", "")
|
2026-05-11 13:34:05 +02:00
|
|
|
|
|
|
|
|
config :centralcloud_staff, :ops_engine,
|
|
|
|
|
url: System.get_env("OPS_ENGINE_URL", "http://centralcloud-ops.centralcloud-ops.svc.cluster.local")
|
2026-05-13 01:30:33 +02:00
|
|
|
|
|
|
|
|
# Security monitoring — only available in centralcloud_my release
|
|
|
|
|
if config_env() == :prod and System.get_env("SECURITY_URL") do
|
|
|
|
|
config :centralcloud_core, :security,
|
|
|
|
|
url: System.get_env("SECURITY_URL"),
|
|
|
|
|
username: System.get_env("SECURITY_USERNAME"),
|
|
|
|
|
password: System.get_env("SECURITY_PASSWORD"),
|
|
|
|
|
verify_ssl: System.get_env("SECURITY_VERIFY_SSL", "true") != "false"
|
|
|
|
|
end
|