fix(deploy): 过滤 WireGuard 安装阶段标准输出
节点首次安装 wireguard-tools 时 apt 输出会混入公钥命令替换,导致格式门禁误判并安全停止。仅取远端输出最后一行作为公钥,同时保留原有长度和字符校验。 验证:bash -n、ShellCheck、远端公钥长度与权限只读检查。
This commit is contained in:
@@ -15,7 +15,7 @@ public_keys=()
|
|||||||
|
|
||||||
for host in "${hosts[@]}"; do
|
for host in "${hosts[@]}"; do
|
||||||
echo "[wireguard] preparing $host"
|
echo "[wireguard] preparing $host"
|
||||||
public_key=$(cluster_ssh "$host" 'bash -s' <<'REMOTE'
|
public_key=$(cluster_ssh "$host" 'bash -s' <<'REMOTE' | tail -n 1
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
export DEBIAN_FRONTEND=noninteractive
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
if ! command -v wg >/dev/null 2>&1; then
|
if ! command -v wg >/dev/null 2>&1; then
|
||||||
|
|||||||
Reference in New Issue
Block a user