import Config

# Runtime secrets — all required in production, optional in dev (defaults used)
if config_env() == :prod do
  config :centralcloud_my, CentralcloudMy.Endpoint,
    secret_key_base: System.fetch_env!("MY_SECRET_KEY_BASE")

  config :centralcloud_ops, CentralcloudOps.Endpoint,
    secret_key_base: System.fetch_env!("OPS_SECRET_KEY_BASE")
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")

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")
