2021-02-16 19:29:41 +08:00
|
|
|
import Config
|
|
|
|
|
2021-04-08 17:41:52 +08:00
|
|
|
# Configure the type of names used for distribution and the node name.
|
|
|
|
# By default a random short name is used.
|
|
|
|
# config :livebook, :node, {:shortnames, "livebook"}
|
2021-04-14 20:28:00 +08:00
|
|
|
# config :livebook, :node, {:longnames, :"livebook@127.0.0.1"}
|
2021-04-08 17:41:52 +08:00
|
|
|
|
2021-04-15 20:15:56 +08:00
|
|
|
if password = System.get_env("LIVEBOOK_PASSWORD") do
|
|
|
|
config :livebook,
|
|
|
|
authentication_mode: :password,
|
|
|
|
password: password
|
|
|
|
end
|
|
|
|
|
2021-02-16 19:29:41 +08:00
|
|
|
if config_env() == :prod do
|
2021-04-15 20:15:56 +08:00
|
|
|
# In order to persist sessions between deployments (desirable when using password authentication mode)
|
|
|
|
# allow to customize secret_key_base. Otherwise the secret will change every time app starts.
|
|
|
|
secret_key_base =
|
|
|
|
if secret = System.get_env("SECRET_KEY_BASE") do
|
|
|
|
secret
|
|
|
|
else
|
|
|
|
:crypto.strong_rand_bytes(48) |> Base.encode64()
|
|
|
|
end
|
2021-02-16 19:29:41 +08:00
|
|
|
|
2021-04-08 17:41:52 +08:00
|
|
|
config :livebook, LivebookWeb.Endpoint, secret_key_base: secret_key_base
|
2021-02-16 19:29:41 +08:00
|
|
|
end
|