fix(web-install): tolerate missing /dev/tty in non-interactive curl|bash
E2E (curl install.keisei.app | bash, no controlling terminal) died at
`exec < /dev/tty` — "No such device or address". `[ -r /dev/tty ]` stat's
the path readable but the device can't be opened without a controlling
terminal (CI/cron/ssh non-interactive) — the documented `| bash -s -- --yes`
CI path. Now probes a real open via `{ : < /dev/tty; }` and reattaches only
on success; else proceeds non-interactively. Verified RC=0 end-to-end.
This commit is contained in:
parent
1dd4bad97a
commit
126783d84d
1 changed files with 8 additions and 3 deletions
|
|
@ -91,10 +91,15 @@ say "delegating to $KEISEI_ROOT/bootstrap.sh ${PASS_THROUGH[*]:-}"
|
|||
cd "$KEISEI_ROOT"
|
||||
|
||||
# curl|bash сценарий: stdin = pipe от curl, поэтому wizard'у read нечего читать.
|
||||
# Если есть /dev/tty (т.е. сессия реально интерактивная), переподключаем stdin
|
||||
# Если /dev/tty реально ОТКРЫВАЕТСЯ (сессия интерактивная), переподключаем stdin
|
||||
# к терминалу — иначе onboarding/whiptail падают на первом prompt.
|
||||
# audit 2026-05-18 bug #4.
|
||||
if [ -r /dev/tty ] && [ ! -t 0 ]; then
|
||||
# ВАЖНО: `[ -r /dev/tty ]` недостаточно — путь может stat'иться readable, но
|
||||
# `exec < /dev/tty` падает с "No such device or address" когда нет управляющего
|
||||
# терминала (ssh non-interactive, CI, cron). Поэтому пробуем реально открыть его
|
||||
# через `{ : < /dev/tty; }` и реаттачим ТОЛЬКО при успехе. Иначе установка идёт
|
||||
# неинтерактивно (рассчитано на --yes / KEISEI_SKIP_ONBOARD).
|
||||
# audit 2026-05-18 bug #4; non-TTY e2e fix 2026-05-21.
|
||||
if [ ! -t 0 ] && { : < /dev/tty; } 2>/dev/null; then
|
||||
exec < /dev/tty
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue