Skip to content

Commit

Permalink
make secret key base runtime config for prod only - pr feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Adzz committed Oct 28, 2024
1 parent ad536cd commit ad544ef
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ if host = System.get_env("HOST") do
config :document_viewer, DocumentViewerWeb.Endpoint, url: [host: host, port: 80]
end

config :document_viewer, DocumentViewerWeb.Endpoint,
secret_key_base: System.get_env("SECRET_KEY_BASE")
if config_env() == :prod do
config :document_viewer, DocumentViewerWeb.Endpoint,
secret_key_base: System.get_env("SECRET_KEY_BASE")
end

if guardian_secret_key = System.get_env("GUARDIAN_SECRET_KEY") do
config :document_viewer, DocumentViewerWeb.AuthManager, secret_key: guardian_secret_key
Expand All @@ -17,14 +19,3 @@ config :ueberauth, Ueberauth.Strategy.Cognito,
client_secret: System.get_env("COGNITO_CLIENT_SECRET"),
user_pool_id: System.get_env("COGNITO_USER_POOL_ID"),
aws_region: System.get_env("COGNITO_AWS_REGION")

if config_env() == :dev do
config(:document_viewer, DocumentViewerWeb.Endpoint,
secret_key_base: "GQz2AbfSliQp6FYTncpcZJgM7skJdhKH6refgghsdE9gOz0TQ5u5+Er+tzH6XmUt"
)
end

if config_env() == :test do
config :document_viewer, DocumentViewerWeb.Endpoint,
secret_key_base: "GQz2AbfSliQp6FYTncpcZJgM7skJdhKH6refgghsdE9gOz0TQ5u5+Er+tzH6XmUt"
end

0 comments on commit ad544ef

Please sign in to comment.