Frigate Notify 部署文档
文章摘要
|
1 Frigate Notify 部署文档 - 通过 Gotify 推送 Frigate 事件通知
本文档记录了在群晖 Docker 中部署
frigate-notify,将 Frigate 的检测/警报事件通过 Gotify 推送到手机的全过程。
1.1 服务架构
| 组件 | 作用 |
|---|---|
| Frigate | NVR 系统,负责摄像头画面分析与事件检测。 |
| frigate-notify | 事件监听与转发中间件,监听 Frigate 事件并推送至 Gotify。 |
| Gotify | 自托管消息推送服务,最终将通知送达手机 App。 |
1.2 前置条件
- Frigate 容器已运行,版本 ≥ 0.14(本文使用 0.17.0)
- Gotify 服务已部署并运行,已创建用于接收通知的应用并获取 Token
- Frigate 和
frigate-notify均连接到同一 Docker 网络(traefik_public) - 已准备子域名(如 `fnotify.com)并解析到群晖公网 IP
1.3 部署步骤
1.3.1 创建数据目录与配置文件
# 创建目录
mkdir -p /docker/frigate-notify
# 创建并编辑 config.yml
vi /docker/frigate-notify/config.yml
1.3.2 config.yml 完整配置
# ==================== 核心模式 ====================
app:
mode: reviews # Frigate 0.14+ 必须使用 reviews 模式
# ==================== 数据源 ====================
frigate:
server: http://frigate:5000 # 容器间通信地址
public_url: https://frigate.com # 外部访问地址(生成推送链接用)
webapi:
enabled: true # 启用 Web API 轮询
mqtt:
enabled: false # 禁用 MQTT(二选一)
# ==================== 通知渠道 ====================
alerts:
general:
notify_detections: true # 允许推送所有检测事件(不限于警报)
gotify:
enabled: true
server: http://gotify:80
token: 你的Gotify应用Token
priority: 5
1.3.3 docker-compose.yml
version: '3.8'
services:
frigate-notify:
image: ghcr.io/0x2142/frigate-notify:latest
container_name: frigate-notify
restart: unless-stopped
networks:
- traefik_public
expose:
- "8000"
volumes:
- /docker/frigate-notify/config.yml:/app/config.yml:ro # 设置自己的挂载路径
environment:
- TZ=Asia/Shanghai
- FN_CONFIGFILE=/app/config.yml
labels: # traefik自动路由地址
- "traefik.enable=true"
- "traefik.http.routers.frigate-notify.rule=Host(`fnotify.com`)"
- "traefik.http.routers.frigate-notify.entrypoints=websecure"
- "traefik.http.routers.frigate-notify.tls=true"
- "traefik.http.routers.frigate-notify.tls.certresolver=letsencrypt"
- "traefik.http.services.frigate-notify.loadbalancer.server.port=8000"
networks:
traefik_public:
external: true
1.3.4 启动服务
cd /docker/frigate-notify #之前挂载的路径
docker-compose down # 如果之前有旧容器
docker-compose up -d # 可以使用portainer等管理
1.4 验证与调试
1.4.1 检查日志
docker logs frigate-notify
成功日志应包含:
INF Successfully connected to http://frigate:5000
INF Config file validated!
INF App ready!
1.4.2 触发测试事件
在 Frigate 摄像头前走动触发检测,日志应出现:
INF Processing review...
INF Review processed # 如果配置了 notify_detections: true
1.4.3 检查 Gotify 手机端
确认手机 Gotify App 能收到带快照/视频链接的通知。
1.5 常见问题排查
| 问题现象 | 可能原因 | 解决方法 |
|---|---|---|
No Frigate server specified! | 配置文件未正确挂载或格式错误 | 检查 volumes 挂载路径;用 docker run --rm ... cat 验证文件内容 |
Please configure only one polling method | 同时启用了 Web API 和 MQTT | 在 frigate 下显式设置 webapi.enabled: true 和 mqtt.enabled: false |
Review dropped - Event is detection only | 默认只推送警报事件 | 在 alerts.general 中添加 notify_detections: true |
| 推送链接无法访问 | public_url 未配置或配置为容器内网地址 | 设置 frigate.public_url 为外部可访问的域名或 IP |
WebSocket connection closed | 连接断开,自动重连中 | 正常行为,30秒后自动恢复,无需干预 |
1.7 更新日志
| 日期 | 内容 |
|---|---|
| 2026-06-19 | 初始部署完成,打通 Frigate → frigate-notify → Gotify 通知链路 |