From c4445976329bb090ca8fc9baadfc588a210288e6 Mon Sep 17 00:00:00 2001 From: Schuwi Date: Sun, 21 Sep 2025 12:13:20 +0200 Subject: [PATCH] fix: auth password for production - set password with runtime env variable --- config/config.exs | 3 +-- config/runtime.exs | 3 ++- docker-compose.yml.example | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/config/config.exs b/config/config.exs index 5b4e7d2..a621b91 100644 --- a/config/config.exs +++ b/config/config.exs @@ -9,8 +9,7 @@ import Config config :components_elixir, ecto_repos: [ComponentsElixir.Repo], - generators: [timestamp_type: :utc_datetime], - auth_password: System.get_env("AUTH_PASSWORD", "changeme") + generators: [timestamp_type: :utc_datetime] # Configures the endpoint config :components_elixir, ComponentsElixirWeb.Endpoint, diff --git a/config/runtime.exs b/config/runtime.exs index 01d08b4..2116b4c 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -2,7 +2,8 @@ import Config # Runtime configuration for uploads directory config :components_elixir, - uploads_dir: System.get_env("UPLOADS_DIR", "./uploads") + uploads_dir: System.get_env("UPLOADS_DIR", "./uploads"), + auth_password: System.get_env("AUTH_PASSWORD", "changeme") # config/runtime.exs is executed for all environments, including # during releases. It is executed after compilation and before the diff --git a/docker-compose.yml.example b/docker-compose.yml.example index 8ad71d2..dd6d231 100644 --- a/docker-compose.yml.example +++ b/docker-compose.yml.example @@ -26,6 +26,7 @@ services: PHX_SERVER: "true" PORT: "4000" UPLOADS_DIR: "/data/uploads" + AUTH_PASSWORD: "changeme!" depends_on: db: condition: service_healthy