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-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
|
2021-04-27 22:34:02 +08:00
|
|
|
|
|
|
|
if ip = Livebook.Config.ip!("LIVEBOOK_IP") do
|
|
|
|
config :livebook, LivebookWeb.Endpoint, http: [ip: ip]
|
|
|
|
end
|
|
|
|
|
|
|
|
config :livebook,
|
|
|
|
:cookie,
|
2021-07-31 16:09:21 +08:00
|
|
|
Livebook.Config.cookie!("LIVEBOOK_COOKIE") ||
|
|
|
|
Livebook.Config.cookie!("RELEASE_COOKIE") ||
|
|
|
|
Livebook.Utils.random_cookie()
|
2021-05-10 20:37:38 +08:00
|
|
|
|
|
|
|
config :livebook,
|
|
|
|
:default_runtime,
|
|
|
|
Livebook.Config.default_runtime!("LIVEBOOK_DEFAULT_RUNTIME") ||
|
2021-06-09 22:24:02 +08:00
|
|
|
{Livebook.Runtime.ElixirStandalone, []}
|
2021-08-14 03:17:43 +08:00
|
|
|
|
|
|
|
root_path =
|
|
|
|
Livebook.Config.root_path!("LIVEBOOK_ROOT_PATH")
|
|
|
|
|> Livebook.FileSystem.Utils.ensure_dir_path()
|
|
|
|
|
|
|
|
local_file_system = Livebook.FileSystem.Local.new(default_path: root_path)
|
2021-08-18 20:41:57 +08:00
|
|
|
configured_file_systems = Livebook.Config.file_systems!("LIVEBOOK_FILE_SYSTEM_")
|
|
|
|
|
|
|
|
config :livebook, :file_systems, [local_file_system | configured_file_systems]
|