fix: install TLS certs before sing-box check

Hysteria2 inbound validates certificate paths during check; copy
acme.sh certs to /etc/sing-box/certs before running sing-box check.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-16 09:01:06 +08:00
parent 9293e242be
commit ad9787942f
+6 -1
View File
@@ -101,6 +101,11 @@ if [[ ! -f "/root/.acme.sh/${DOMAIN}_ecc/fullchain.cer" ]]; then
/root/.acme.sh/acme.sh --issue -d "$DOMAIN" -w /var/www/acme --force /root/.acme.sh/acme.sh --issue -d "$DOMAIN" -w /var/www/acme --force
fi fi
log "安装 TLS 证书到 sing-box ..."
/root/.acme.sh/acme.sh --install-cert -d "$DOMAIN" \
--key-file /etc/sing-box/certs/privkey.pem \
--fullchain-file /etc/sing-box/certs/fullchain.pem
log "生成 sing-box 服务端配置 ..." log "生成 sing-box 服务端配置 ..."
mkdir -p /etc/sing-box/certs mkdir -p /etc/sing-box/certs
sed -e "s|\${UUID}|${UUID}|g" \ sed -e "s|\${UUID}|${UUID}|g" \
@@ -134,7 +139,7 @@ UNIT
systemctl daemon-reload systemctl daemon-reload
systemctl enable sing-box systemctl enable sing-box
log "安装 TLS 证书到 sing-box ..." log "注册证书续期 reload 命令 ..."
/root/.acme.sh/acme.sh --install-cert -d "$DOMAIN" \ /root/.acme.sh/acme.sh --install-cert -d "$DOMAIN" \
--key-file /etc/sing-box/certs/privkey.pem \ --key-file /etc/sing-box/certs/privkey.pem \
--fullchain-file /etc/sing-box/certs/fullchain.pem \ --fullchain-file /etc/sing-box/certs/fullchain.pem \