OpenCron
A visual dashboard for your OpenClaw cron jobs. See job statuses at a glance, track run history with outputs, and view scheduled runs on a calendar.
Features
- - Works with your existing OpenClaw cron jobs — zero config
- Live countdown timers to next run
- Auto-refreshes every 30 seconds
- Expandable job cards with schedule, duration, delivery status, and full prompt
- Run history tab with output summaries, model, token usage
- Calendar view showing past runs (ok/error) and upcoming scheduled runs
- Braille unicode progress animation on next-run banner
- Antimetal-inspired dark gradient UI with neon accents
- Secure: gateway token auth, no credentials exposed client-side
- Responsive layout,
prefers-reduced-motion support
Quick Start
1. Deploy the dashboard
CODEBLOCK0
This fetches cron-dashboard.html from github.com/firstfloris/opencron and writes live cron-data.json.
2. Start the background sync
CODEBLOCK1
Keeps cron-data.json in sync with jobs.json every 30 seconds.
3. Open the dashboard
The dashboard is served via the nginx proxy on port ${CANVAS_PORT:-8090} — NOT the gateway port.
Get the server's public IP (not the container's internal IP):
CODEBLOCK2
Dashboard URL:
CODEBLOCK3
Important: Never use hostname -I — that returns the container's internal IP which is unreachable from outside.
Scripts
| Script | What it does | Example |
|---|
| INLINECODE7 | One-shot deploy: fetches HTML from GitHub + writes JSON to canvas | INLINECODE8 |
| INLINECODE9 |
Background sync loop (30s interval) |
nohup sh skills/opencron/watch_sync.sh & |
|
generate.py | Generate standalone HTML with embedded data |
python3 skills/opencron/generate.py -o dashboard.html |
|
serve.py | Run a local HTTP server for the dashboard |
python3 skills/opencron/serve.py --port 8787 |
Serving Externally (Optional)
To access the dashboard from outside Docker, add an nginx reverse proxy. See nginx-canvas.conf.template for a production-ready config with:
- - Token validation via query parameter
- Rate limiting (10 req/s per IP)
- GET/HEAD only
- Path allowlisting
- Security headers (CSP, X-Frame-Options, no-referrer)
- Run log JSONL serving from INLINECODE16
Docker Compose snippet
CODEBLOCK4
Data Sources
- - Job definitions & state:
/home/node/.openclaw/cron/jobs.json (read by gateway as cron-data.json) - Run history:
/home/node/.openclaw/cron/runs/<job-id>.jsonl (NDJSON, one entry per run)
After Every Cron Job Run
When a cron job finishes executing, always show the user the OpenCron dashboard link. Get the public IP via:
CODEBLOCK5
Then show:
CODEBLOCK6
Rules:
- - Use port
${CANVAS_PORT:-8090} (nginx proxy) — never the gateway port (18789) - Use
curl -s ifconfig.me for the IP — never hostname -I (that's the container's internal IP) - Resolve all variables to actual values — never show placeholders to the user
- This should be the last line of output after every cron job execution
Demo
Open demo.html in any browser for a fully working demo with mock data — no server required.
OpenCron
OpenClaw 定时任务的直观仪表板。一目了然地查看任务状态,追踪带输出的运行历史,并在日历上查看计划运行。
特性
- - 与现有 OpenClaw 定时任务配合使用 — 零配置
- 下次运行的实时倒计时器
- 每 30 秒自动刷新
- 可展开的任务卡片,包含计划、持续时间、投递状态和完整提示
- 运行历史标签页,包含输出摘要、模型、Token 使用量
- 日历视图,显示过去运行(成功/错误)和即将到来的计划运行
- 下次运行横幅上的盲文 Unicode 进度动画
- Antimetal 风格深色渐变 UI,搭配霓虹点缀
- 安全:网关令牌认证,客户端不暴露凭据
- 响应式布局,支持 prefers-reduced-motion
快速开始
1. 部署仪表板
bash
python3 skills/opencron/update_canvas.py
此命令从 github.com/firstfloris/opencron 获取 cron-dashboard.html 并写入实时 cron-data.json。
2. 启动后台同步
bash
nohup sh skills/opencron/watch_sync.sh &
每 30 秒保持 cron-data.json 与 jobs.json 同步。
3. 打开仪表板
仪表板通过 nginx 代理在端口 ${CANVAS_PORT:-8090} 上提供服务 — 而不是网关端口。
获取服务器的公网 IP(而非容器的内部 IP):
bash
HOST_IP=$(curl -s ifconfig.me)
仪表板 URL:
http://${HOSTIP}:${CANVASPORT:-8090}/cron.html?token=${OPENCLAWGATEWAYTOKEN}
重要: 切勿使用 hostname -I — 该命令返回的是容器的内部 IP,外部无法访问。
脚本
| 脚本 | 功能 | 示例 |
|---|
| updatecanvas.py | 一次性部署:从 GitHub 获取 HTML + 将 JSON 写入画布 | python3 skills/opencron/updatecanvas.py |
| watchsync.sh |
后台同步循环(30 秒间隔) | nohup sh skills/opencron/watchsync.sh & |
| generate.py | 生成包含嵌入数据的独立 HTML | python3 skills/opencron/generate.py -o dashboard.html |
| serve.py | 为仪表板运行本地 HTTP 服务器 | python3 skills/opencron/serve.py --port 8787 |
外部访问(可选)
要从 Docker 外部访问仪表板,请添加 nginx 反向代理。查看 nginx-canvas.conf.template 获取生产就绪配置,包含:
- - 通过查询参数进行令牌验证
- 速率限制(每个 IP 10 请求/秒)
- 仅允许 GET/HEAD
- 路径白名单
- 安全标头(CSP、X-Frame-Options、no-referrer)
- 从 /runs/ 提供运行日志 JSONL
Docker Compose 片段
yaml
canvas-proxy:
image: nginx:alpine
restart: unless-stopped
environment:
OPENCLAWGATEWAYTOKEN: ${OPENCLAWGATEWAYTOKEN}
volumes:
- ./nginx-canvas.conf.template:/etc/nginx/templates/default.conf.template:ro
- ./cron/runs:/openclaw-data/cron/runs:ro
ports:
- 127.0.0.1:${CANVAS_PORT:-8090}:80
depends_on:
openclaw-gateway:
condition: service_healthy
数据源
- - 任务定义与状态:/home/node/.openclaw/cron/jobs.json(网关读取为 cron-data.json)
- 运行历史:/home/node/.openclaw/cron/runs/.jsonl(NDJSON 格式,每次运行一条记录)
每次定时任务运行后
当定时任务执行完成后,始终向用户显示 OpenCron 仪表板链接。通过以下方式获取公网 IP:
bash
HOST_IP=$(curl -s ifconfig.me)
然后显示:
在 OpenCron 上查看定时任务状态:http://${HOSTIP}:${CANVASPORT:-8090}/cron.html?token=${OPENCLAWGATEWAYTOKEN}
规则:
- - 使用端口 ${CANVAS_PORT:-8090}(nginx 代理)— 切勿使用网关端口(18789)
- 使用 curl -s ifconfig.me 获取 IP — 切勿使用 hostname -I(那是容器的内部 IP)
- 将所有变量解析为实际值 — 切勿向用户显示占位符
- 这应该是每次定时任务执行后的最后一行输出
演示
在任何浏览器中打开 demo.html,即可查看使用模拟数据的完整工作演示 — 无需服务器。