一、ChangeDetection.io 是什么?(介绍)
ChangeDetection.io 是一个 网页内容变更监控系统,可以自动监控任意网站的变化,例如:
网页文本更新
商品价格变动
抢购按钮出现
政策页面变更
网页关键词监控
动态网页(JS)监控(需要浏览器容器)
支持通知:
Telegram
Email
Webhook
Discord
企业微信等
部署后,你输入想监控的 URL,它会自动抓取并对比变化。
二、Docker 一键部署(核心步骤)
创建目录:
mkdir -p /opt/changedetection
cd /opt/changedetection
创建 compose 文件:
nano docker-compose.yml
写入:
version: '3'
services:
changedetection:
image: ghcr.io/dgtlmoon/changedetection.io
ports:
- 127.0.0.1:5000:5000
volumes:
- ./datastore:/datastore
restart: unless-stopped
browser:
image: ghcr.io/dgtlmoon/sockpuppetbrowser:latest
environment:
- PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
- SCREEN_WIDTH=1920
- SCREEN_HEIGHT=1024
- SCREEN_DEPTH=16
cap_add:
- SYS_ADMIN
restart: unless-stopped
启动:
docker-compose up -d
此时服务只监听:
http://127.0.0.1:5000
我们接下来配置域名访问。
三、设置域名(DNS)
例如你的域名是:
watch.yourdomain.com
到域名 DNS 解析添加:
如果经过 Cloudflare:
小云朵建议关闭(灰色)避免 WebSocket 监控问题
若必须开,可后来调整设置
DNS 生效后,就能绑定到服务器上。
四、Nginx 反向代理(让域名访问)
在服务器安装 Nginx:
apt install -y nginx
创建配置文件:
nano /etc/nginx/sites-available/changedetection.conf
写入:
server {
listen 80;
server_name watch.yourdomain.com;
location / {
proxy_pass http://127.0.0.1:5000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
启用配置:
ln -s /etc/nginx/sites-available/changedetection.conf /etc/nginx/sites-enabled/
nginx -t
systemctl reload nginx
现在浏览器访问:
http://watch.yourdomain.com
能打开 ChangeDetection。
五、申请 HTTPS 证书(自动续期)
使用 Certbot 最简单:
apt install -y certbot python3-certbot-nginx
一键申请:
certbot --nginx -d watch.yourdomain.com
成功后会自动生成 HTTPS 配置和自动续期任务。
以后证书会自动更新,无需手动处理。
六、完成!现在你的访问方式是:
https://watch.yourdomain.com
是真正的生产环境部署。
七、添加监控目标(如何添加 URL)
进入后台 → 添加监控(Add watch):
输入要监控的 URL
选择检查方式(文本 / 浏览器渲染)
设置变化通知
保存即可自动开始监控
评论