Add config to check if Livebook started from CLI

This commit is contained in:
Alexandre de Souza 2025-06-23 17:25:26 -03:00
parent b31b95315d
commit 4a79a5e6e1
No known key found for this signature in database
GPG key ID: E39228FFBA346545
3 changed files with 3 additions and 1 deletions

View file

@ -24,6 +24,7 @@ config :mime, :types, %{
config :livebook,
agent_name: "default",
mode: :app,
allowed_uri_schemes: [],
app_service_name: nil,
app_service_url: nil,

View file

@ -324,7 +324,7 @@ defmodule Livebook.Application do
Application.put_env(:livebook, :apps_path_hub_id, hub_id)
fun
teams_key || auth ->
Application.get_env(:livebook, :mode) == :app and (teams_key || auth) ->
Livebook.Config.abort!(
"You must specify both LIVEBOOK_TEAMS_KEY and LIVEBOOK_TEAMS_AUTH."
)

View file

@ -52,6 +52,7 @@ defmodule LivebookCLI.Deploy do
@impl true
def call(args) do
Application.put_env(:livebook, :mode, :cli)
config = config_from_args(args)
with :ok <- validate_config(config),