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.
* Add LIVEBOOK_SHUTDOWN_ENABLED
Previously we relied on code:get_mode(), but since
releases are starting in interactive mode to use
less memory, we need a clearer mechanism.
* Move shutdown feature check to Livebook.Config
Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
* Automate searching and adding new dependencies
* Restructure runtime management
* Leave search restrictions up to the runtime
* Support predefined dependencies in Embedded runtime dependency search
* Use the embedded runtime for dependency search test
* Fix typo
* Use module for loading embedded runtime dependencies
* Improve naming
* Create home and data_path directories if missing
* Update lib/livebook/config.ex
* Configure project-local data path for dev and test env
* Expand dev/test paths in compile config
Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
* Serve iframes from another local port when running on http
* Use relative hostname in local iframe URL
* Simplify server start check
* Use random iframe port when Livebook runs on a random port
* Rename space/ to iframe/
* LivebookWeb.IframePlug -> LivebookWeb.IframeEndpoint
* Introduce file system abstraction and an S3 implementation
* Support arbitrary absolute paths and delegate resolution to file system
* Remove accidental notebook file
* Apply suggestions from code review
Co-authored-by: José Valim <jose.valim@dashbit.co>
* Apply review comments
* Add missing path assertions
* Apply review comments
* Fix test saving notebook in project root
Co-authored-by: José Valim <jose.valim@dashbit.co>
* Add support for Mix runtime as a default
* Support default runtime options in the CLI
* Set cell status to queued while runtime is being started
* Clean up tests
* Add embedded runtime for evaluating code in the Livebook VM
* Update lib/livebook_web/live/session_live/embedded_live.ex
Co-authored-by: José Valim <jose.valim@dashbit.co>
* Use standard error proxy globally in the Livebook node
* Add configuration env variable for setting the default runtime
* Increase evaluation response assertion timeouts
Co-authored-by: José Valim <jose.valim@dashbit.co>
* Setup Docker image with releases
* Support ip env variable and use it for Docker deployment
* Autofocus auth forms
* Rename ip env var
* Update option lists
* Make distribution cookie configurable
* Update README.md
Co-authored-by: José Valim <jose.valim@dashbit.co>
* Include git in the final image
* Remove unnecessary build dependency
* Improve file permissions handling and add more comments
* Use namespaced home directory
* Update README with all running options
* Update base image
* Reference official Docker image in the README
Co-authored-by: José Valim <jose.valim@dashbit.co>
* Limit the number of Elixir nodes spawned at the same time in tests
* Increase timeout
* Update CI to Elixir 1.12
* Terminate unused runtimes
* Increase timeout on the spawning node side
* Cleanup
* Run test with --trace
* Up
* Up
* Run tests with long node names
* Just longnames CI
* Move CI dependent config to config/test.exs
* Add token authentication
* Restructure CLI
* Allow port configuration
* Further refactoring
* Make sure livebook node starts with unique name
* Improve startup error handling
* Further refactoring
* Add authentication tests
* Add authentication view for entering the token
* Fix auth tests
* Always use random Livebook name for distribution
* Don't enable ANSI on Windows
* Define CLI Task behaviour and move generic logic to the main module
* Generalize convertion from cli arguments to configuration
* Randomly generate secret key base
* Update test/livebook_web/plugs/auth_plug_test.exs
Co-authored-by: José Valim <jose.valim@dashbit.co>
* Override app config in persistent manner
* Update lib/litebook_cli.ex
Co-authored-by: José Valim <jose.valim@dashbit.co>
* Move auth error to ErrorView
* Unify node name configuration and allow it via CLI
* Set all applications configs at once
* Move token generation to application.ex to work outside CLI
* Clean up overriding configuration
* Store auth token in separate cookies
* Update lib/livebook_cli/server.ex
Co-authored-by: José Valim <jose.valim@dashbit.co>
* Update lib/livebook_web/endpoint.ex
Co-authored-by: José Valim <jose.valim@dashbit.co>
* Update lib/livebook_web/plugs/auth_plug.ex
Co-authored-by: José Valim <jose.valim@dashbit.co>
Co-authored-by: José Valim <jose.valim@dashbit.co>
* Render modal components at the end of live views
* Add error pages
* Restructure web module
* Update lib/livebook_web/templates/error/500.html.eex
Co-authored-by: José Valim <jose.valim@dashbit.co>
* Update lib/livebook_web/templates/error/500.html.eex
Co-authored-by: José Valim <jose.valim@dashbit.co>
* Update lib/livebook_web/views/error_view.ex
Co-authored-by: José Valim <jose.valim@dashbit.co>
Co-authored-by: José Valim <jose.valim@dashbit.co>
* Set up Escript packaging
* Use MD5 digest sa ETAG
* Make sure changes to the static files recompile the relevant module
* Manually start the application in Escript
* Set up basic CLI
* Run formatter
* Start Elixir app before anything else
* Improve version output
* Build Escript to project root directory
* Improve assets handling
* Move plug related modules under plugs directory
* Include bundled assets in the repository
* Use the same plug with different static providers in prod and dev
* Refactor providers
* Rename StaticProvidedPlug to StaticPlug
* Isolate evaluation in separate node for each session
* Start new remote upon first evaluation and handle nodedown
* Add UI for managing evaluation node, improve naming and structure
* Show runtime initialization errors and some fixes
* Improve standalone node initialization
* Correctly handle multiple sessions connecting to the same node
* Fix session tests concerning evaluation
* Documentation and some refactoring
* Various improvements
* Configure schedulers to get to sleep immediately after evaluation
* Move EvaluatorSpervisor into the Remote namespace
* Fix evaluators cleanup
* Add tests
* Improve flash messages
* Introduce remote genserver taking care of cleanup
* Redefine the Runtime protocol to serve as an interface for evaluation
* Cleanup operations
* Use reference for communication with a standalone node
* Use shortnames for distribution by default
* Update node configuration and make sure epmd is running
* Rename Remote to ErlDist