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>
This commit is contained in:
parent
54dd3e2199
commit
12c20e12e8
1 changed files with 8 additions and 4 deletions
|
|
@ -161,7 +161,7 @@ cat << "EOF"
|
||||||
\____\__,_|_|\__,_|\__, |\___/| .__/ \__,_|___/
|
\____\__,_|_|\__,_|\__, |\___/| .__/ \__,_|___/
|
||||||
|___/ |_|
|
|___/ |_|
|
||||||
|
|
||||||
Calagopus Wings Installer | v1.2
|
Calagopus Wings Installer | v1.3
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|
@ -251,9 +251,13 @@ extract_join_data() {
|
||||||
# Strip a single layer of surrounding single or double quotes, if present.
|
# Strip a single layer of surrounding single or double quotes, if present.
|
||||||
out="$(printf '%s' "$out" | sed -E "s/^['\"]//; s/['\"]\$//")"
|
out="$(printf '%s' "$out" | sed -E "s/^['\"]//; s/['\"]\$//")"
|
||||||
|
|
||||||
# In case the command was pasted with trailing shell noise (e.g. a
|
# The join-data token is base64 and never legitimately contains whitespace.
|
||||||
# trailing backslash/newline continuation), just take the first token.
|
# Strip EVERY whitespace character, not just the first token: a paste can
|
||||||
out="$(printf '%s' "$out" | awk '{print $1}')"
|
# 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"
|
printf '%s' "$out"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue