Better long name hints (#2234)

This commit is contained in:
José Valim 2023-09-28 10:52:21 +02:00 committed by GitHub
parent a1a1c7c6f1
commit 990949e3ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -150,6 +150,41 @@ defmodule Livebook.Application do
:ok :ok
else else
_ -> _ ->
hint =
cond do
is_nil(System.get_env("LIVEBOOK_DESKTOP")) ->
"""
* If you are using Livebook's CLI or from source, consider using longnames:
livebook server --name livebook@127.0.0.1
elixir --name livebook@127.0.0.1 -S mix phx.server
"""
match?({:win32, _}, :os.type()) ->
path =
Path.join(
System.get_env("USERPROFILE", "%USERPROFILE%"),
".livebookdesktop.bat"
)
"""
* Configure your Livebook Desktop to use long names by creating a file at #{path} with:
set LIVEBOOK_DISTRIBUTION=name
set LIVEBOOK_NODE=livebook@127.0.0.1
"""
true ->
path = Path.join(System.get_env("HOME", "~"), ".livebookdesktop.sh")
"""
* Configure your Livebook Desktop to use long names by creating a file at #{path} with:
export LIVEBOOK_DISTRIBUTION=name
export LIVEBOOK_NODE=livebook@127.0.0.1
"""
end
Livebook.Config.abort!(""" Livebook.Config.abort!("""
Your hostname \"#{hostname}\" does not resolve to a loopback address (127.0.0.0/8), \ Your hostname \"#{hostname}\" does not resolve to a loopback address (127.0.0.0/8), \
which indicates something wrong in your OS configuration, or EPMD is not running. which indicates something wrong in your OS configuration, or EPMD is not running.
@ -159,10 +194,7 @@ defmodule Livebook.Application do
* Consult our Installation FAQ: * Consult our Installation FAQ:
https://github.com/livebook-dev/livebook/wiki/Installation-FAQ https://github.com/livebook-dev/livebook/wiki/Installation-FAQ
* If you are using Livebook's CLI or from source, consider using longnames: #{hint}\
livebook server --name livebook@127.0.0.1
elixir --name livebook@127.0.0.1 -S mix phx.server
* If the issue persists, please file a bug report * If the issue persists, please file a bug report