From 3902935f601832a8466df2b69993c6bc2ddd9ea6 Mon Sep 17 00:00:00 2001 From: NixReaper Date: Sun, 12 Apr 2026 04:39:14 -0500 Subject: [PATCH] fix(install): read from /dev/tty so curl | bash confirmation prompt works, bump v0.5.2 set -euo pipefail causes the script to exit when read gets EOF from the curl pipe instead of an interactive terminal. Fix by appending '< /dev/tty || CONFIRM=Y' so the prompt reads from the actual terminal regardless of how the script was invoked. --- CHANGELOG.md | 7 +++++++ package.json | 2 +- scripts/install.sh | 4 +++- server/src/app.ts | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e1a54e..27a59a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,13 @@ Pre-1.0 versions treat MINOR as feature releases and PATCH as bug fixes. --- +## [0.5.2] — 2026-04-11 + +### Bug Fixes +- **`curl | bash` aborts immediately at confirmation prompt** — `set -euo pipefail` caused the script to exit when `read` received EOF from the pipe instead of a terminal. Fixed by reading from `/dev/tty` directly so the prompt works correctly whether the script is piped or run from a file. + +--- + ## [0.5.1] — 2026-04-11 ### Bug Fixes diff --git a/package.json b/package.json index cf3f3ef..d1675f5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nixpanel-server", - "version": "0.5.1", + "version": "0.5.2", "private": true, "workspaces": [ "server", diff --git a/scripts/install.sh b/scripts/install.sh index 4a754d3..3bb3e12 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -82,6 +82,8 @@ if [[ -z "$ADMIN_EMAIL" ]]; then ADMIN_EMAIL="admin@$(hostname -f 2>/dev/null || echo localhost)" fi +# Redirect all interactive reads to /dev/tty so curl | bash works correctly + MARIADB_ROOT_PASS=$(openssl rand -base64 24 | tr -dc 'a-zA-Z0-9' | head -c 24) JWT_SECRET=$(gen_secret) JWT_REFRESH_SECRET=$(gen_secret) @@ -93,7 +95,7 @@ echo " Admin username : $ADMIN_USER" echo " Admin email : $ADMIN_EMAIL" echo " Admin password : $([ "$GENERATED_PASS" = "true" ] && echo "" || echo "$ADMIN_PASS")" echo "" -read -r -p "Continue? [Y/n] " CONFIRM +read -r -p "Continue? [Y/n] " CONFIRM < /dev/tty || CONFIRM="Y" CONFIRM="${CONFIRM:-Y}" [[ "$CONFIRM" =~ ^[Yy]$ ]] || { echo "Aborted."; exit 0; } diff --git a/server/src/app.ts b/server/src/app.ts index c4f6d59..7ff62c1 100644 --- a/server/src/app.ts +++ b/server/src/app.ts @@ -73,7 +73,7 @@ export async function buildApp() { fastify.get('/api/health', async () => ({ status: 'ok', - version: '0.5.1', + version: '0.5.2', timestamp: new Date().toISOString(), }))