From 90f9c9d95429299242eea0898b3f2c8072886298 Mon Sep 17 00:00:00 2001 From: Sebastian Cabrera Date: Wed, 9 Sep 2026 20:59:01 -0400 Subject: [PATCH 1/2] Fix prompt() silently truncating multi-line pasted input `prompt()` used a single `read -r`, which stops at the first newline. If a pasted value (most notably join-data copied from the panel UI) arrives with an embedded newline, everything after it was silently dropped, and the leftover fragment would be consumed by the *next* prompt instead. The truncated-but-still-valid-looking base64 could still decode successfully, just missing trailing fields like `remote`, producing a config.yml that fails at startup with "invalid remote configuration, cannot connect to panel". prompt() now drains any additional lines already buffered on the TTY after the first read, so a multi-line paste is captured in full without blocking on further keystrokes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- install-wings.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/install-wings.sh b/install-wings.sh index 7e4c922..9828f1d 100644 --- a/install-wings.sh +++ b/install-wings.sh @@ -34,9 +34,19 @@ need_tty() { prompt() { local msg="$1" - local out + local out line printf "${BOLD}%s${RESET}" "$msg" >"$TTY" IFS= read -r out <"$TTY" + + # A pasted value (e.g. join-data copied from the panel UI) can arrive with an + # embedded newline. `read` stops at the first one, which would otherwise + # silently truncate the rest onto a "phantom" line consumed by a later + # prompt. Drain any additional lines that are already buffered so nothing + # gets lost; this never blocks waiting on new keystrokes. + while IFS= read -r -t 0.1 line <"$TTY" 2>/dev/null; do + out+="$line" + done + printf "%s" "$out" } From 54dd3e21997e6471a1e77348eea527647a8dec71 Mon Sep 17 00:00:00 2001 From: Sebastian Cabrera Date: Wed, 9 Sep 2026 21:00:42 -0400 Subject: [PATCH 2/2] Update join-data prompt text to match panel's calagopus-wings prefix The panel now generates the auto-deploy command as "calagopus-wings configure --join-data ..." instead of "wings configure --join-data ...". extract_join_data() already handles any prefix (it matches on the --join-data flag itself), so this is a docs/prompt wording update only, keeping the on-screen instructions in sync with what users actually copy from the panel. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- install-wings.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/install-wings.sh b/install-wings.sh index 9828f1d..9ff0adc 100644 --- a/install-wings.sh +++ b/install-wings.sh @@ -233,7 +233,8 @@ section "Configuration" # Pulls just the base64 join-data token out of whatever the user pastes. # Accepts: # - the raw token by itself -# - the full "wings configure --join-data " command +# - the full "calagopus-wings configure --join-data " command as +# generated by the panel (or the older "wings configure --join-data ..." form) # - either wrapped in single/double quotes, with extra surrounding whitespace extract_join_data() { local raw="$1" @@ -258,7 +259,7 @@ extract_join_data() { } if confirm_default_no "Run wings configure --join-data now?"; then - JOIN_DATA_RAW="$(prompt "Paste join-data (raw token or the full 'wings configure --join-data ...' command): ")" + JOIN_DATA_RAW="$(prompt "Paste join-data (raw token or the full 'calagopus-wings configure --join-data ...' command): ")" JOIN_DATA="$(extract_join_data "$JOIN_DATA_RAW")" if [[ -n "$JOIN_DATA" ]]; then