Skip to content

Commit aa6f4f0

Browse files
committed
refactor: move environment variable configurations to runtime.exs
- Removed Plausible, assets, and ingest URL configurations from prod.exs. - Added the same configurations to runtime.exs for better environment handling. - Updated test.exs to maintain consistency in configuration structure.
1 parent 59b8a23 commit aa6f4f0

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

config/prod.exs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@ config :algora,
2727
dev_routes: true,
2828
require_admin_for_mailbox: true
2929

30-
config :algora,
31-
plausible_url: System.get_env("PLAUSIBLE_URL"),
32-
assets_url: System.get_env("ASSETS_URL"),
33-
ingest_url: System.get_env("INGEST_URL")
34-
3530
config :algora, AlgoraWeb.OGImageController, max_age: 600
3631

3732
# Runtime production configuration, including reading

config/runtime.exs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,4 +148,9 @@ if config_env() == :prod do
148148
config :algora, :login_code,
149149
ttl: String.to_integer(System.get_env("LOGIN_CODE_TTL", "3600")),
150150
salt: System.fetch_env!("LOGIN_CODE_SALT")
151+
152+
config :algora,
153+
plausible_url: System.get_env("PLAUSIBLE_URL"),
154+
assets_url: System.get_env("ASSETS_URL"),
155+
ingest_url: System.get_env("INGEST_URL")
151156
end

config/test.exs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ config :algora, :login_code,
6161
ttl: String.to_integer(System.get_env("LOGIN_CODE_TTL", "3600")),
6262
salt: System.get_env("LOGIN_CODE_SALT", "algora-login-code")
6363

64-
config :algora, :plausible_url, System.get_env("PLAUSIBLE_URL")
65-
66-
config :algora, :assets_url, System.get_env("ASSETS_URL")
67-
68-
config :algora, :ingest_url, System.get_env("INGEST_URL")
64+
config :algora,
65+
plausible_url: System.get_env("PLAUSIBLE_URL"),
66+
assets_url: System.get_env("ASSETS_URL"),
67+
ingest_url: System.get_env("INGEST_URL")

0 commit comments

Comments
 (0)