nodebb.py draws its password box on the terminal, not in the hook's pipe #17

Open
marcos-mendez wants to merge 1 commit from fix/nodebb-draws-on-the-terminal into main
marcos-mendez commented 2026-09-30 01:35:50 -03:00 (Migrated from github.com)

firstboot.d/40nodebb reads bin/nodebb.py's standard output for APP_PASS=, and dialog draws on standard output, so an interactive first boot would freeze with the box drawn into the hook's pipe: the bug keel-wordpress 19.0-3 hit on Proxmox on 2026-09-30, fixed for dbpass.py in Keel-Linux/keel-mariadb#20.

Fix: the same pattern. nodebb.py keeps a duplicate of the pipe for the KEY=value answers and points standard output, which dialog inherits, at the terminal the hook checked on standard input (else /dev/tty). Without any terminal it exits with a message naming secrets.app_password instead of a traceback. The hook is unchanged.

Tests: tests/dialog.bats runs the script as the hook does, output redirected, inside a real pseudo terminal (script(1)), with a libinithooks stand-in whose get_password refuses unless fd 1 is a terminal; it fails on the old code and passes on the new.

`firstboot.d/40nodebb` reads `bin/nodebb.py`'s standard output for `APP_PASS=`, and dialog draws on standard output, so an interactive first boot would freeze with the box drawn into the hook's pipe: the bug keel-wordpress 19.0-3 hit on Proxmox on 2026-09-30, fixed for dbpass.py in Keel-Linux/keel-mariadb#20. Fix: the same pattern. nodebb.py keeps a duplicate of the pipe for the KEY=value answers and points standard output, which dialog inherits, at the terminal the hook checked on standard input (else /dev/tty). Without any terminal it exits with a message naming secrets.app_password instead of a traceback. The hook is unchanged. Tests: `tests/dialog.bats` runs the script as the hook does, output redirected, inside a real pseudo terminal (script(1)), with a libinithooks stand-in whose get_password refuses unless fd 1 is a terminal; it fails on the old code and passes on the new.
Some required checks are missing.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin fix/nodebb-draws-on-the-terminal:fix/nodebb-draws-on-the-terminal
git switch fix/nodebb-draws-on-the-terminal
Sign in to join this conversation.
No description provided.