fix(server): only require DASHBOARD_PASSWORD_HASH in prod
Blocking bootstrap in dev meant you couldn't even run 'mix run' to generate the initial hash. Now dev/test accept an optional env override and boot without it; prod still raises when unset.
This commit is contained in:
parent
2f787ec31f
commit
fe7b07db4f
3 changed files with 3977 additions and 1 deletions
2081
docs/superpowers/plans/2026-04-21-phase2-metrics-und-collectors.md
Normal file
2081
docs/superpowers/plans/2026-04-21-phase2-metrics-und-collectors.md
Normal file
File diff suppressed because it is too large
Load diff
1889
docs/superpowers/plans/2026-04-21-phase3-liveview-dashboard.md
Normal file
1889
docs/superpowers/plans/2026-04-21-phase3-liveview-dashboard.md
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -1,6 +1,6 @@
|
||||||
import Config
|
import Config
|
||||||
|
|
||||||
if config_env() in [:prod, :dev] do
|
if config_env() == :prod do
|
||||||
hash =
|
hash =
|
||||||
System.get_env("DASHBOARD_PASSWORD_HASH") ||
|
System.get_env("DASHBOARD_PASSWORD_HASH") ||
|
||||||
raise """
|
raise """
|
||||||
|
|
@ -10,6 +10,12 @@ if config_env() in [:prod, :dev] do
|
||||||
"""
|
"""
|
||||||
|
|
||||||
config :server, :dashboard_password_hash, hash
|
config :server, :dashboard_password_hash, hash
|
||||||
|
else
|
||||||
|
# dev/test: accept an env var override, otherwise leave unset.
|
||||||
|
# Dev boot without it will crash only when someone POSTs /login.
|
||||||
|
if hash = System.get_env("DASHBOARD_PASSWORD_HASH") do
|
||||||
|
config :server, :dashboard_password_hash, hash
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# config/runtime.exs is executed for all environments, including
|
# config/runtime.exs is executed for all environments, including
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue