From a0e0b2fd0d46afb9f6882fcbf2dc282d45e8bdca Mon Sep 17 00:00:00 2001 From: buttercat1791 Date: Wed, 25 Feb 2026 21:08:51 -0600 Subject: [PATCH] Read DB connection details from env --- config/dev.exs | 10 +++++----- config/test.exs | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/config/dev.exs b/config/dev.exs index d2f6b3a..7b2e2db 100644 --- a/config/dev.exs +++ b/config/dev.exs @@ -2,11 +2,11 @@ import Config # Configure your database config :gc_index_relay, GcIndexRelay.Repo, - port: 5432, - username: "postgres", - password: "postgres", - hostname: "localhost", - database: "gc_index_relay_dev", + username: System.get_env("POSTGRES_USER"), + password: System.get_env("POSTGRES_PASSWORD"), + database: System.get_env("POSTGRES_DB"), + hostname: System.get_env("POSTGRES_HOST"), + port: System.get_env("POSTGRES_PORT"), stacktrace: true, show_sensitive_data_on_connection_error: true, pool_size: 10 diff --git a/config/test.exs b/config/test.exs index 5cb6f7c..9a1f564 100644 --- a/config/test.exs +++ b/config/test.exs @@ -8,11 +8,11 @@ config :gc_index_relay, :start_repo, true # to provide built-in test partitioning in CI environment. # Run `mix help test` for more information. config :gc_index_relay, GcIndexRelay.Repo, - port: 5432, - username: "postgres", - password: "postgres", - hostname: "localhost", - database: "gc_index_relay_test#{System.get_env("MIX_TEST_PARTITION")}", + username: System.get_env("POSTGRES_USER"), + password: System.get_env("POSTGRES_PASSWORD"), + hostname: System.get_env("POSTGRES_HOST"), + port: System.get_env("POSTGRES_PORT"), + database: "#{System.get_env("POSTGRES_DB")}#{System.get_env("MIX_TEST_PARTITION")}", pool: Ecto.Adapters.SQL.Sandbox, pool_size: System.schedulers_online() * 2