Skip to content

Commit

Permalink
rename LIVEBOOK_PUBLIC_BASE_URL_PATH_OVERRIDE to LIVEBOOK_PUBLIC_BA…
Browse files Browse the repository at this point in the history
…SE_URL_PATH
  • Loading branch information
elepedus committed Jul 16, 2024
1 parent a4d8ecd commit 06e0a7e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 17 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,10 @@ The following environment variables can be used to configure Livebook on boot:
* `LIVEBOOK_BASE_URL_PATH` - sets the base url path the web application is
served on. Useful when deploying behind a reverse proxy.

* `LIVEBOOK_PUBLIC_BASE_URL_PATH_OVERRIDE` - overrides the base url path for the public
asset routes only. Useful to create exceptions when deploying behind a reverse proxy
that requires authentication.
* `LIVEBOOK_PUBLIC_BASE_URL_PATH` - sets the base url path the `/public/*` routes
are served on. Note that this takes precedence over `LIVEBOOK_BASE_URL_PATH`,
if both are set. Setting this may be useful to create exceptions when deploying
behind a reverse proxy that requires authentication.

* `LIVEBOOK_CACERTFILE` - path to a local file containing CA certificates.
Those certificates are used during for server authentication when Livebook
Expand Down
6 changes: 3 additions & 3 deletions lib/livebook.ex
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ defmodule Livebook do
config :livebook, LivebookWeb.Endpoint, url: [path: base_url_path]
end

if public_base_url_path_override =
Livebook.Config.public_base_url_path_override!("LIVEBOOK_PUBLIC_BASE_URL_PATH_OVERRIDE") do
config :livebook, :public_base_url_path_override, public_base_url_path_override
if public_base_url_path =
Livebook.Config.base_url_path!("LIVEBOOK_PUBLIC_BASE_URL_PATH") do
config :livebook, :public_base_url_path, public_base_url_path
end

if password = Livebook.Config.password!("LIVEBOOK_PASSWORD") do
Expand Down
11 changes: 1 addition & 10 deletions lib/livebook/config.ex
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ defmodule Livebook.Config do
"""
@spec public_base_url_path() :: String.t()
def public_base_url_path() do
case Application.get_env(:livebook, :public_base_url_path_override) do
case Application.get_env(:livebook, :public_base_url_path) do
nil -> base_url_path()
path -> String.trim_trailing(path, "/")
end
Expand Down Expand Up @@ -536,15 +536,6 @@ defmodule Livebook.Config do
end
end

@doc """
Parses and validates the public base url path override from env
"""
def public_base_url_path_override!(env) do
if override = System.get_env(env) do
String.trim_trailing(override, "/")
end
end

@doc """
Parses and validates the ip from env.
"""
Expand Down
Loading

0 comments on commit 06e0a7e

Please sign in to comment.