Fakultas Ilmu Komputer UI

Commit a0db0308 authored by Muhammad Rafif Elfazri's avatar Muhammad Rafif Elfazri
Browse files

Add GUARDIAN_SECRET_KEY_BASE variables for production

parent a4e7016a
SECRET_KEY_BASE=REALLY_LONG_SECRET SECRET_KEY_BASE=REALLY_LONG_SECRET
GUARDIAN_SECRET_KEY_BASE=REALLY_LONG_SECRET
DATABASE_HOST=db DATABASE_HOST=db
DATABASE_URL=ecto://postgres:postgres@db/postgres DATABASE_URL=ecto://postgres:postgres@db/postgres
PORT=4000 PORT=4000
......
...@@ -23,6 +23,13 @@ secret_key_base = ...@@ -23,6 +23,13 @@ secret_key_base =
You can generate one by calling: mix phx.gen.secret You can generate one by calling: mix phx.gen.secret
""" """
guardian_secret_key_base =
System.get_env("GUARDIAN_SECRET_KEY_BASE") ||
raise """
environment variable GUARDIAN_SECRET_KEY_BASE is missing.
You can generate one by calling: mix guardian.gen.secret
"""
config :diskuy, DiskuyWeb.Endpoint, config :diskuy, DiskuyWeb.Endpoint,
http: [ http: [
port: String.to_integer(System.get_env("PORT") || "4000"), port: String.to_integer(System.get_env("PORT") || "4000"),
...@@ -30,6 +37,11 @@ config :diskuy, DiskuyWeb.Endpoint, ...@@ -30,6 +37,11 @@ config :diskuy, DiskuyWeb.Endpoint,
], ],
secret_key_base: secret_key_base secret_key_base: secret_key_base
config :diskuy, DiskuyWeb.Auth.Guardian,
issuer: "diskuy",
secret_key: guardian_secret_key_base
# ## Using releases (Elixir v1.9+) # ## Using releases (Elixir v1.9+)
# #
# If you are doing OTP releases, you need to instruct Phoenix # If you are doing OTP releases, you need to instruct Phoenix
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment