core: 日志网址使用随机路径

This commit is contained in:
bin456789
2026-09-06 11:31:38 +08:00
parent 388bf257e9
commit d44c2017fd
4 changed files with 32 additions and 12 deletions
+8 -3
View File
@@ -425,13 +425,18 @@ setup_nginx() {
setup_websocketd() {
apk add websocketd
wget $confhome/logviewer.html -O /tmp/index.html
apk add coreutils
mkdir -p /tmp/web
echo 'Wrong Path' >/tmp/web/index.html
# shellcheck disable=SC2154
wget $confhome/logviewer.html -O /tmp/web$web_path
killall -q websocketd || true
# websocketd 遇到 \n 才推送,因此要转换 \r 为 \n
websocketd --port "$web_port" --loglevel=fatal --staticdir=/tmp \
stdbuf -oL -eL sh -c "tail -fn+0 /reinstall.log | tr '\r' '\n' | grep -Fiv -e password -e token" &
websocketd --port "$web_port" --loglevel=fatal --staticdir=/tmp/web \
stdbuf -oL -eL \
sh -c "if [ \"\$PATH_INFO\" = \"$web_path\" ]; then tail -fn+0 /reinstall.log | tr '\r' '\n' | grep -Fiv -e password -e token; fi" &
}
get_approximate_ram_size() {