livebook/config/runtime.exs
2021-04-19 19:50:09 +02:00

20 lines
596 B
Elixir

import Config
require Logger
config :livebook, LivebookWeb.Endpoint,
secret_key_base:
Livebook.Config.secret!("LIVEBOOK_SECRET_KEY_BASE") ||
Base.encode64(:crypto.strong_rand_bytes(48))
config :livebook, :root_path, Livebook.Config.root_path!("LIVEBOOK_ROOT_PATH")
if password = Livebook.Config.password!("LIVEBOOK_PASSWORD") do
config :livebook, authentication_mode: :password, password: password
else
config :livebook, token: Livebook.Utils.random_id()
end
if port = Livebook.Config.port!("LIVEBOOK_PORT") do
config :livebook, LivebookWeb.Endpoint, http: [port: port]
end