用了一年多Komari,越来越感觉臃肿,很多用不到的功能越加越多

另外最担心的还是安全问题,最近更换成了 https://github.com/monitor-probe/monitor

一款极简,克制的探针,轻量,安全都很好

Komari一键删除脚本如下,终端直接执行即可

bash <<'EOF'
set -Eeuo pipefail
trap 'echo "卸载未完成,请查看上方错误信息。" >&2' ERR

if [[ "$EUID" -ne 0 ]]; then
  echo "请使用 root 执行此脚本。"
  exit 1
fi

echo "[1/3] 停止客户端并取消自启动..."
systemctl daemon-reload
if systemctl cat komari-agent.service >/dev/null 2>&1; then
  systemctl disable --now komari-agent.service
  systemctl reset-failed komari-agent.service 2>/dev/null || true
fi

command -v pgrep >/dev/null
if pgrep -f '^/opt/komari/agent([[:space:]]|$)' >/dev/null; then
  echo "仍有客户端进程运行,卸载已停止。"
  exit 1
fi

echo "[2/3] 删除客户端和服务配置..."
rm -f /etc/systemd/system/komari-agent.service
rm -rf /etc/systemd/system/komari-agent.service.d
rm -f /opt/komari/agent

# 删除空目录,避免误删后来放入的其他文件
if [[ -d /opt/komari ]]; then
  rmdir /opt/komari
fi

systemctl daemon-reload

echo "[3/3] 检查卸载结果..."
if systemctl cat komari-agent.service >/dev/null 2>&1 ||
   pgrep -f '^/opt/komari/agent([[:space:]]|$)' >/dev/null; then
  echo "检查未通过:仍有服务或客户端进程残留。"
  exit 1
fi

echo "✅ Komari 客户端已卸载完成,无需重启。"
echo "最后请在 Komari 管理后台删除对应节点。"
EOF

使用了cloudflare的网站,可能会莫名的在网站的代码底部出现

https://static.cloudflareinsights.com/beacon.min.js

这个JS脚本,这个脚本是cloudflare的统计分析脚本

如何删除这个脚本呢?

登录cloudflare,点击左侧列表的分析和日志,然后点击Web Analytics

可以看到开启了统计的网站,点击管理站点,点开高级选项之后,就可以看到删除按钮了。

点击删除后,就不会再有这个脚本出现了。

Websites using Cloudflare may inexplicably have the following JS script appear at the bottom of their code:

https://static.cloudflareinsights.com/beacon.min.js

This script is Cloudflare's analytics script.

How can you remove this script?

Log in to Cloudflare, click on "Analytics" and "Logs" in the left sidebar, then click on "Web Analytics."

You will see the websites that have analytics enabled. Click on "Manage Site," open the "Advanced Options," and you will find the delete button.

After clicking delete, this script will no longer appear.

sudo apt update

sudo apt install -y build-essential libssl-dev libssh2-1-dev libpsl-dev libidn2-dev libnghttp2-dev libzstd-dev

cd /tmp

wget https://curl.se/download/curl-8.12.1.tar.gz

tar -xzf curl-8.12.1.tar.gz

cd curl-8.12.1

./configure --with-openssl

make

sudo make install

sudo ldconfig

hash -r

curl -V

网站在使用CloudFlare后,nginx的日志的就无法记录到用户真实的IP地址了

会造成很多问题,无法正确的分析日志

解决办法很简单

在nginx的配置文件:/usr/local/nginx/conf/nginx.conf

http {

下面添加

set_real_ip_from 0.0.0.0/0;
real_ip_header X-Forwarded-For;

重启nginx即可正确获取访客的真实IP地址