Update start.sh

This commit is contained in:
wnlen
2026-01-15 00:32:19 +08:00
committed by GitHub
parent bb3fc6e11e
commit e5efca95d0

View File

@ -68,7 +68,12 @@ fi
# 兜底生成随机 secret
if [ -z "$Secret" ]; then
if command -v openssl >/dev/null 2>&1; then
Secret="$(openssl rand -hex 32)"
else
# 32 bytes -> 64 hex chars
Secret="$(head -c 32 /dev/urandom | od -An -tx1 | tr -d ' \n')"
fi
fi
# 强制写入 secret 到指定配置文件(存在则替换,不存在则追加)