Commit graph

24 commits

Author SHA1 Message Date
Jonatan Kłosko fc8799ef8f
Group public routes under a common prefix (#974) 2022-02-03 17:48:16 +01:00
José Valim efdbf67f59
Introduce LIVEBOOK_HOME and LIVEBOOK_DATA_PATH (#963)
And move the relevant configurations to settings.
2022-01-31 11:51:57 +01:00
Jakub Perżyło 86e4034f33
Persistent storage (#937)
Start moving filesystems as an initial implementation.
2022-01-30 19:51:03 +01:00
José Valim 849acd87a9
Reorder usage arguments 2022-01-30 18:58:09 +01:00
gpopides 0cae21e9e8
Remove --open-new option when starting server (#960) 2022-01-30 18:36:30 +01:00
José Valim 372f086044 Move from Helpers to Utils and add doctests 2022-01-29 10:39:26 +01:00
Sam 420284006a
Add url arg to the CLI (#947) 2022-01-29 10:36:32 +01:00
Wojtek Mach e8c80bf6a7
Add Mac app release (#865) 2022-01-17 17:34:38 +01:00
Jonatan Kłosko b422e1d98f
Revert to URI.new! (#784) 2021-12-09 20:46:45 +01:00
Jonatan Kłosko f0606b109d
Automatically back up notebooks without a file (#736)
* Improve file select layout on long paths

* Automatically back up notebooks without a file

* Run formatter

* Add margin when there are no sections

* Add an informative note about autosave directory

* Store autosave path instead of file in the config

* Rename autosave dir to autosave path

* Fix insert mode escape on section headlines

* Show ellipsis on selected file too

* Always create the default directory

* Apply review comments
2021-12-04 16:29:14 +01:00
Jonatan Kłosko 47d29cb389
Require Elixir 1.13 (#737)
* Bump required Elixir version to 1.13 and fix TODOs

* Fix tests

* Remove the deprecated URI.parse/1

* Bump Docker base image

* Bump Elixir on CI
2021-12-03 21:47:20 +01:00
José Valim d78a3cf865
Include reason if we can't start Livebook, closes #703 (#705) 2021-11-12 14:36:02 +01:00
Wojtek Mach 453eabb6d4
Fix urls on Elixir master (#647)
Before Elixir master, empty path is represented as `nil`:

    ~% asdf shell elixir 1.12.3-otp-24 ; elixir -e 'IO.inspect URI.parse("http://localhost")'
    %URI{
      authority: "localhost",
      fragment: nil,
      host: "localhost",
      path: nil,
      port: 80,
      query: nil,
      scheme: "http",
      userinfo: nil
    }

On Elixir master, it is an empty string:

    ~% asdf shell elixir git ; elixir -e 'IO.inspect URI.parse("http://localhost")'
    %URI{
      authority: "localhost",
      fragment: nil,
      host: "localhost",
      path: "",
      port: 80,
      query: nil,
      scheme: "http",
      userinfo: nil
    }

The new default, the empty string, caused a bug on this line:

    Map.update!(:path, &((&1 || "/") <> path))

because we never prepended the leading `/` and thus we ended up with
path `"health"`, not `"/health"`, which now on Elixir master crashes:

    iex> URI.parse("http://localhost") |> Map.replace!(:path, "health") |> to_string()
    ** (ArgumentError) :path in URI must be empty or an absolute path if URL has a :host, got: %URI{authority: "localhost", fragment: nil, host: "localhost", path: "health", port: 80, query: nil, scheme: "http", userinfo: nil}
        (elixir 1.13.0-dev) lib/uri.ex:863: String.Chars.URI.to_string/1
2021-10-26 16:48:17 +02:00
Jonatan Kłosko 2a338b6b83
Detect if Livebook or another application is running on the given port (#530)
* Detect if Livebook or another application is running on the given port

* Use json/2

* Print error when the port is taken
2021-08-30 23:23:05 +02:00
Wojtek Mach 01c079a697
livebook server: Add --open-new flag (#529)
* livebook server: Add `--open-new` flag

* Update lib/livebook_cli/server.ex

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>

* Update lib/livebook_cli/server.ex

* Update changelog

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2021-08-30 20:52:08 +02:00
Jonatan Kłosko 8e6558a83a
Introduce file system abstraction and an S3 implementation (#492)
* 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>
2021-08-13 21:17:43 +02:00
Wojtek Mach 6515629156
livebook server: Add --open flag (#417)
* livebook server: Add --open flag

* Update lib/livebook_cli/server.ex

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>

* Add LivebookWeb.Endpoint.access_url/0

Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
2021-07-01 12:17:49 +02:00
Jonatan Kłosko 0061facd64
Support configuring Attached as the default runtime (#397)
* Support configuring Attached as the default runtime

* Wrap env options section in the README
2021-06-24 18:03:00 +02:00
Jonatan Kłosko c4a96bc99c
Add support for Mix runtime as the default one (#334)
* 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
2021-06-09 16:24:02 +02:00
Jonatan Kłosko ac8e1e30f4
Setup Docker image with releases (#244)
* 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>
2021-04-27 16:34:02 +02:00
José Valim 81b123d5b5
Make root path configurable from outside (#217) 2021-04-19 19:50:09 +02:00
José Valim 57047f9c7f
Unify env variables and change auth to use session (#195) 2021-04-15 15:50:29 +02:00
José Valim 31e16f6b93 Fix typo on CLI entries 2021-04-15 09:06:01 +02:00
Jonatan Kłosko e9766ed7a5
Introduce token auth and add basic cli configuration (#148)
* 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>
2021-04-08 11:41:52 +02:00