2021-02-16 19:29:41 +08:00
|
|
|
import Config
|
2021-04-15 21:50:29 +08:00
|
|
|
require Logger
|
2021-02-16 19:29:41 +08:00
|
|
|
|
2021-04-15 21:50:29 +08:00
|
|
|
config :livebook, LivebookWeb.Endpoint,
|
|
|
|
secret_key_base:
|
|
|
|
Livebook.Config.secret!("LIVEBOOK_SECRET_KEY_BASE") ||
|
|
|
|
Base.encode64(:crypto.strong_rand_bytes(48))
|
2021-04-08 17:41:52 +08:00
|
|
|
|
2021-04-20 01:50:09 +08:00
|
|
|
config :livebook, :root_path, Livebook.Config.root_path!("LIVEBOOK_ROOT_PATH")
|
|
|
|
|
2021-04-15 21:50:29 +08:00
|
|
|
if password = Livebook.Config.password!("LIVEBOOK_PASSWORD") do
|
|
|
|
config :livebook, authentication_mode: :password, password: password
|
|
|
|
else
|
|
|
|
config :livebook, token: Livebook.Utils.random_id()
|
2021-04-15 20:15:56 +08:00
|
|
|
end
|
|
|
|
|
2021-04-15 21:50:29 +08:00
|
|
|
if port = Livebook.Config.port!("LIVEBOOK_PORT") do
|
|
|
|
config :livebook, LivebookWeb.Endpoint, http: [port: port]
|
2021-02-16 19:29:41 +08:00
|
|
|
end
|