# CronGo **Repository Path**: zouyikb/cron-go ## Basic Information - **Project Name**: CronGo - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-02-01 - **Last Updated**: 2025-02-01 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # CronGo [English](README.en.md) | 简体中文 [![Build Status](https://github.com/yourusername/CronGo/workflows/Go/badge.svg)](https://github.com/yourusername/CronGo/actions) [![codecov](https://codecov.io/gh/yourusername/CronGo/branch/main/graph/badge.svg)](https://codecov.io/gh/yourusername/CronGo) [![Go Report Card](https://goreportcard.com/badge/github.com/yourusername/CronGo)](https://goreportcard.com/report/github.com/yourusername/CronGo) [![GitHub release](https://img.shields.io/github/release/yourusername/CronGo.svg)](https://github.com/yourusername/CronGo/releases) [![License](https://img.shields.io/github/license/yourusername/CronGo.svg)](https://github.com/yourusername/CronGo/blob/main/LICENSE) > 本项目由人类开发者与 [Cursor](https://cursor.sh/) AI 结对编程共同开发而成。 CronGo 是一个基于 Go 语言开发的轻量级单机定时任务管理系统,提供友好的 Web 界面,支持定时任务的可视化管理。 ## 功能特性 - 🚀 简单易用的 Web 管理界面 - 📅 支持标准 Cron 表达式 - 📊 任务执行状态实时监控 - 📝 详细的任务执行日志 - 🔄 支持任务的启用/禁用 - 📋 支持任务分组管理 - 💾 使用 SQLite 数据库,无需额外部署 - 📤 支持导入导出 crontab 格式的任务配置 ## 详细功能说明 ### 任务管理 - 任务操作: - 创建、编辑、删除任务 - 启用/禁用任务 - 分组管理 - 批量导入导出 - 任务配置: - 支持标准 Cron 表达式 - 自定义任务名称和描述 - 灵活的分组设置 - Shell 命令执行 ### 执行监控 - 执行状态: - 实时执行状态 - 最近运行时间 - 执行时长统计 - 成功/失败状态 - 日志管理: - 实时执行日志 - 历史执行记录 - 执行输出查看 - 新窗口查看模式 ### 系统特性 - 安全认证: - 用户登录认证 - JWT Token 验证 - 配置管理: - 系统端口配置 - 数据库配置 - 日志配置 - 跨平台支持: - Linux - macOS - 支持多种CPU架构 ## 技术栈 - 后端: - Go 1.16+ - Gin Web 框架 - SQLite3 数据库 - Gorm ORM - JWT 认证 - 前端: - Bootstrap 5 - jQuery - 响应式设计 ## 快速开始 ### 环境要求 - Go 1.16+ - SQLite3 ### 安装 ```bash # 下载最新版本 git clone https://github.com/yourusername/CronGo.git # 进入项目目录 cd CronGo # 编译项目 ./build/build.sh # 运行服务 ./dist/$(uname -s | tr '[:upper:]' '[:lower:]')/$(uname -m)/crongo-server ``` 编译完成后,访问 `http://localhost:8080` 打开Web管理界面: - 默认用户名:admin - 默认密码:admin888 ## 使用说明 ### Web界面使用 1. 访问系统 - 打开浏览器访问 `http://localhost:8080` - 使用默认账号登录(用户名:admin,密码:admin888) 2. 任务管理 - 点击"添加任务"创建新任务 - 设置任务名称、分组、Cron表达式和执行命令 - 可以启用/禁用任务 - 支持查看任务执行历史和实时输出 3. 执行记录 - 查看任务的执行状态和历史记录 - 实时监控任务执行输出 - 统计任务执行时长和成功率 4. 分组管理 - 通过分组组织管理任务 - 支持按分组筛选任务 - 支持按分组导入导出 ### 命令行工具使用 1. 基本命令 ```bash # 查看所有任务 ./crongo -l # 查看任务详情 ./crongo -i # 查看指定分组的任务 ./crongo -lg ``` 2. 导入导出功能 - [查看完整的导入导出使用指南](docs/crontab-import-export.md) - [Import/Export Guide in English](docs/crontab-import-export.en.md) ```bash # 导入任务示例 cat my-crontab | ./crongo -g "my-group" # 导出任务示例 ./crongo -export > tasks.crontab ``` ## 配置说明 配置文件位于 `config.toml`: ```toml [server] host = "0.0.0.0" port = 8080 [auth] username = "admin" # 登录用户名 password = "admin888" # 登录密码 secret = "your-jwt-secret" # JWT密钥 [database] type = "sqlite" dsn = "crongo.db" log_level = "info" [log] dir = "logs" max_days = 30 ``` ## 开发计划 - [ ] 支持任务执行超时控制 - [ ] 添加任务执行结果通知 - [ ] 支持任务依赖关系 - [ ] 优化任务执行性能 - [ ] 添加任务执行统计图表 ## 开发指南 - [开发指南](docs/development.md) - [Development Guide (English)](docs/development.en.md) ## 贡献指南 1. Fork 本仓库 2. 创建特性分支 (`git checkout -b feature/AmazingFeature`) 3. 提交改动 (`git commit -m 'Add some AmazingFeature'`) 4. 推送到分支 (`git push origin feature/AmazingFeature`) 5. 提交 Pull Request ## 许可证 ``` MIT License Copyright (c) 2024 CronGo Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ``` ## 感谢 特别感谢以下贡献者和工具: - 人类开发者们的智慧和创造力 - [Cursor](https://cursor.sh/) - AI 结对编程助手 - Go 语言及其社区 - 所有开源依赖项目的贡献者们