diff --git a/apps/centralcloud_my/lib/centralcloud_my/release.ex b/apps/centralcloud_my/lib/centralcloud_my/release.ex index b97abf1..78464f8 100644 --- a/apps/centralcloud_my/lib/centralcloud_my/release.ex +++ b/apps/centralcloud_my/lib/centralcloud_my/release.ex @@ -13,7 +13,7 @@ defmodule CentralcloudMy.Release do {:ok, _, _} = Ecto.Migrator.with_repo(repo, &Ecto.Migrator.run(&1, :down, to: version)) end - defp repos, do: Application.fetch_env!(@app, :ecto_repos) + defp repos, do: Application.get_env(@app, :ecto_repos, []) defp load_app do Application.ensure_all_started(:ssl) diff --git a/config/runtime.exs b/config/runtime.exs index 838a1d4..987df92 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -1,12 +1,14 @@ import Config -# Runtime secrets — all required in production, optional in dev (defaults used) +# Runtime secrets — each release only requires its own secret key if config_env() == :prod do config :centralcloud_my, CentralcloudMy.Endpoint, - secret_key_base: System.fetch_env!("MY_SECRET_KEY_BASE") + secret_key_base: System.get_env("MY_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") + # OPS_SECRET_KEY_BASE only required when running the centralcloud_ops release + if ops_key = System.get_env("OPS_SECRET_KEY_BASE") do + config :centralcloud_ops, CentralcloudOps.Endpoint, secret_key_base: ops_key + end end config :centralcloud_core, :hostbill,