Skip to content

Commit

Permalink
Allow db to be configured by url (#1314)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljguarino authored Jun 23, 2024
1 parent 64ac910 commit 0097ac8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
1 change: 1 addition & 0 deletions plural/helm/plural/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ admin:
enabled: false

postgres:
create: true
plural:
resources: {}
size: 50Gi
Expand Down
23 changes: 16 additions & 7 deletions rel/config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,22 @@ config :core, Core.Guardian,
issuer: "plural",
secret_key: get_env("JWT_SECRET")

config :core, Core.Repo,
database: "plural",
username: "plural",
password: get_env("POSTGRES_PASSWORD"),
hostname: get_env("DBHOST") || "plural-postgresql",
ssl: String.to_existing_atom(get_env("DBSSL") || "false"),
pool_size: 5


if get_env("POSTGRES_URL") do
config :core, Core.Repo,
url: get_env("POSTGRES_URL"),
ssl: String.to_existing_atom(get_env("DBSSL") || "true"),
pool_size: 5
else
config :core, Core.Repo,
database: "plural",
username: "plural",
password: get_env("POSTGRES_PASSWORD"),
hostname: get_env("DBHOST") || "plural-postgresql",
ssl: String.to_existing_atom(get_env("DBSSL") || "false"),
pool_size: 5
end

config :cloudflare,
auth_token: get_env("CLOUDFLARE_AUTH_TOKEN")
Expand Down

0 comments on commit 0097ac8

Please sign in to comment.