mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-01-11 17:38:46 +08:00
52e5273401
This commit lets you customize Livebook shutdown to gracefully power off. One use case is for Nerves-based devices that need to do more than call `System.stop/0` to power off. This doesn't change the `LIVEBOOK_SHUTDOWN_ENABLED` environment variable. It still works the same. The `:shutdown_enabled` configuration is now `:shutdown_callback`. Valid values are `nil` or an MFA. An unset or `nil` callback hides the shutdown button in the UI.
37 lines
976 B
Elixir
37 lines
976 B
Elixir
import Config
|
|
|
|
# Configures the endpoint
|
|
config :livebook, LivebookWeb.Endpoint,
|
|
url: [host: "localhost"],
|
|
pubsub_server: Livebook.PubSub,
|
|
live_view: [signing_salt: "livebook"]
|
|
|
|
# Configures Elixir's Logger
|
|
config :logger, :console,
|
|
format: "$time $metadata[$level] $message\n",
|
|
metadata: [:request_id]
|
|
|
|
# Use Jason for JSON parsing in Phoenix
|
|
config :phoenix, :json_library, Jason
|
|
|
|
# Add mime type to upload notebooks with `Phoenix.LiveView.Upload`
|
|
config :mime, :types, %{
|
|
"text/plain" => ["livemd"]
|
|
}
|
|
|
|
config :livebook,
|
|
app_service_name: nil,
|
|
app_service_url: nil,
|
|
authentication_mode: :token,
|
|
feature_flags: [],
|
|
force_ssl_host: nil,
|
|
learn_notebooks: [],
|
|
plugs: [],
|
|
shutdown_callback: nil,
|
|
storage: Livebook.Storage.Ets,
|
|
update_instructions_url: nil,
|
|
within_iframe: false
|
|
|
|
# Import environment specific config. This must remain at the bottom
|
|
# of this file so it overrides the configuration defined above.
|
|
import_config "#{Mix.env()}.exs"
|