From 62ff21363fb331b6d8a95c39c6d245451b0331bb Mon Sep 17 00:00:00 2001 From: Chris Raible Date: Mon, 14 Jul 2025 17:17:10 -0700 Subject: [PATCH] Added check for interactive mode in tinybird-login service --- compose.yml | 2 +- tinybird/handleLogin.sh | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/compose.yml b/compose.yml index 0ebc9c0..35bd2f5 100644 --- a/compose.yml +++ b/compose.yml @@ -135,7 +135,7 @@ services: profiles: [analytics] networks: - ghost_network - tty: true + tty: false restart: no tinybird-sync: diff --git a/tinybird/handleLogin.sh b/tinybird/handleLogin.sh index 087ed39..6b97aac 100755 --- a/tinybird/handleLogin.sh +++ b/tinybird/handleLogin.sh @@ -19,5 +19,13 @@ then exit 0 fi +# Check if running in interactive environment +## If not logged in and running in non-interactive mode (i.e. `docker compose up -d`), the tinybird-login service will hang indefinitely +if [[ ! -t 0 ]] || [[ ! -t 1 ]]; then + echo "Not logged in to Tinybird and running in non-interactive mode." + echo "Please run 'docker compose run --rm tinybird-login' to login interactively." + exit 1 +fi + # Login to Tinybird tb login --method code