From 12c20e12e8d5e7eee561c3e53bd3b1cc31005406 Mon Sep 17 00:00:00 2001 From: Sebastian Cabrera Date: Wed, 9 Sep 2026 21:19:14 -0400 Subject: [PATCH] Strip all whitespace from join-data instead of just the first token extract_join_data() previously used `awk '{print $1}'` as its final step, which only keeps the first whitespace-delimited chunk. Since the join-data token is base64 and never legitimately contains whitespace, any paste that gets hard-wrapped across multiple lines (long tokens wrapped by a terminal or the panel UI, or CRLF line endings) was silently truncated at the first space/newline, even when the raw input already contained the rest of the token. This produced a valid but incomplete base64 string that decoded into a config.yml missing trailing fields such as `remote`, causing wings to fail at startup with "invalid remote configuration, cannot connect to panel". Now strips every whitespace character from the token instead of only keeping the first token, so wrapped/multi-line pastes are captured in full regardless of how prompt() received them. Also bumps the installer banner to v1.3. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- install-wings.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/install-wings.sh b/install-wings.sh index 9ff0adc..441bbae 100644 --- a/install-wings.sh +++ b/install-wings.sh @@ -161,7 +161,7 @@ cat << "EOF" \____\__,_|_|\__,_|\__, |\___/| .__/ \__,_|___/ |___/ |_| - Calagopus Wings Installer | v1.2 + Calagopus Wings Installer | v1.3 EOF @@ -251,9 +251,13 @@ extract_join_data() { # Strip a single layer of surrounding single or double quotes, if present. out="$(printf '%s' "$out" | sed -E "s/^['\"]//; s/['\"]\$//")" - # In case the command was pasted with trailing shell noise (e.g. a - # trailing backslash/newline continuation), just take the first token. - out="$(printf '%s' "$out" | awk '{print $1}')" + # The join-data token is base64 and never legitimately contains whitespace. + # Strip EVERY whitespace character, not just the first token: a paste can + # get hard-wrapped across multiple lines (long tokens wrapped by a terminal + # or the panel's UI, or CRLF line endings), which previously left the token + # silently truncated at the first space/newline (via `awk '{print $1}'`) + # even when the raw input still contained the rest of it. + out="$(printf '%s' "$out" | tr -d '[:space:]')" printf '%s' "$out" }