- 每任务一目录结构,统一开关与日志 - cronctl CLI:enable/disable/toggle/status/run/sync-cron - 公共库 lib/shumengya_cron:runner/manager/notify/ssh - _template 示例任务(hello world + 复制模板) - webui 管理面板:FastAPI 后端 + 文档式响应式前端
17 lines
419 B
Bash
17 lines
419 B
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
BACKEND="$ROOT/webui/backend"
|
|
VENV="$BACKEND/.venv"
|
|
|
|
if [[ ! -d "$VENV" ]]; then
|
|
python3 -m venv "$VENV"
|
|
"$VENV/bin/pip" install -r "$BACKEND/requirements.txt"
|
|
fi
|
|
|
|
HOST="${SPROUTCLAW_CRON_WEB_HOST:-0.0.0.0}"
|
|
PORT="${SPROUTCLAW_CRON_WEB_PORT:-8765}"
|
|
|
|
exec "$VENV/bin/uvicorn" main:app --app-dir "$BACKEND" --host "$HOST" --port "$PORT"
|