From 57db6ac82a970c09a8769107786cca2baa08b2ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=87=8C?= Date: Wed, 18 Mar 2026 20:53:24 +0800 Subject: [PATCH] =?UTF-8?q?Paste=20your=20existing=20shared=20secret=20?= =?UTF-8?q?=E4=B8=8D=E7=94=A8=E7=94=A8=E9=9A=90=E8=97=8F=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=EF=BC=8C=E7=84=B6=E5=90=8E=E5=A6=82=E6=9E=9C=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E5=B7=B2=E7=BB=8F=E6=9C=89=E4=BA=86=E5=86=85?= =?UTF-8?q?=E5=AE=B9=EF=BC=8C=E4=BD=A0=E4=B9=9F=E8=A6=81=E6=94=BE=E5=88=B0?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E9=87=8C=E9=9D=A2=E7=9A=84=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E9=87=8C=E9=9D=A2=E5=A6=82=E6=9E=9C=E4=B8=8D?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B0=B1=E7=9B=B4=E6=8E=A5=E5=9B=9E=E8=BD=A6?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E9=BB=98=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Paste your existing shared secret 不用用隐藏字符,然后如果默认目录已经有了内容,你也要放到脚本里面的默认提示里面如果不修改就直接回车选择默认值 --- setup-relay.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/setup-relay.sh b/setup-relay.sh index 59a03f4..da80f02 100644 --- a/setup-relay.sh +++ b/setup-relay.sh @@ -109,7 +109,7 @@ if ask_yn "Generate a new random secret automatically?" "y"; then success "Generated secret: ${BOLD}${AUTH_SECRET}${RESET}" warn "Save this — you'll need it for every relay and your main server config." else - ask_secret AUTH_SECRET "Paste your existing shared secret" + ask AUTH_SECRET "Paste your existing shared secret" "" success "Using supplied secret." fi @@ -245,7 +245,13 @@ for (( i=1; i<=RELAY_COUNT; i++ )); do fi # ── Output directory ────────────────────────────────────────────────────── - ask RELAY_DIR " Output directory for this relay's files" "/opt/netbird-relay" + _DEFAULT_RELAY_DIR="/opt/netbird-relay" + # If the default dir already has relay files, surface it as the default so + # the user can confirm with Enter rather than retyping the path. + if [[ -f "${_DEFAULT_RELAY_DIR}/relay.env" || -f "${_DEFAULT_RELAY_DIR}/docker-compose.yml" ]]; then + warn " ${_DEFAULT_RELAY_DIR} already contains relay files (will be overwritten if confirmed)." + fi + ask RELAY_DIR " Output directory for this relay's files" "${_DEFAULT_RELAY_DIR}" # For self-signed mode, certs live inside the relay dir [[ "$TLS_MODE" == "3" ]] && CERT_HOST_PATH="${RELAY_DIR}/certs" RELAY_DIRS+=("$RELAY_DIR")