Skip to content

Commit a19b8ae

Browse files
committed
Merge docs into monorepo (VitePress site + AI docs)
2 parents b9e42f9 + 8e42450 commit a19b8ae

44 files changed

Lines changed: 6550 additions & 2 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Full documentation is available at: **[document](https://gocron-docs.pages.dev/e
2626
- **2FA Security**: Two-Factor Authentication support
2727
- **Agent Auto-Registration**: One-click installation for Linux/macOS
2828
- **MCP Support**: Remote management by AI clients (Claude Desktop, Cursor, etc.) via the Model Context Protocol, secured with web-managed access tokens
29-
- **AI Assist**: Natural-language to cron expression and AI-powered failure-log diagnosis, backed by any OpenAI-compatible model (configurable endpoint, also works with self-hosted/local models)
29+
- **AI Assist**: Natural-language to cron expression, AI-powered failure-log diagnosis, and an in-app AI ops chat assistant (query tasks/logs/hosts/templates, diagnose failures), backed by any OpenAI-compatible model (configurable endpoint, also works with self-hosted/local models)
3030
- **Multi-Database**: MySQL / PostgreSQL / SQLite support
3131
- **Log Management**: Complete execution logs with auto-cleanup
3232
- **Notifications**: Email, Slack, Webhook support

README_ZH.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
- **双因素认证**:支持 2FA,提升系统安全性
2727
- **Agent 自动注册**:支持 Linux/macOS 一键安装注册
2828
- **MCP 支持**:AI 客户端(Claude Desktop、Cursor 等)可通过 Model Context Protocol 远程管理任务,使用 Web 端管理的访问令牌鉴权
29-
- **AI 辅助**:自然语言转 cron 表达式、失败日志 AI 诊断,对接任意 OpenAI 兼容模型(接入地址可配置,亦支持自建/本地模型)
29+
- **AI 辅助**:自然语言转 cron 表达式、失败日志 AI 诊断、产品内 AI 运维助手对话(查询任务/日志/节点/模板、诊断失败),对接任意 OpenAI 兼容模型(接入地址可配置,亦支持自建/本地模型)
3030
- **多数据库支持**:MySQL / PostgreSQL / SQLite
3131
- **日志管理**:完整的任务执行日志,支持自动清理
3232
- **消息通知**:支持邮件、Slack、Webhook 等多种通知方式

docs/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
.vitepress/dist
3+
.vitepress/cache
4+
*.local
5+
.DS_Store

docs/.vitepress/config.ts

Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
import { defineConfig } from "vitepress";
2+
3+
const description = "gocron - Lightweight distributed scheduled task management system";
4+
5+
// https://vitepress.dev/reference/site-config
6+
export default defineConfig({
7+
title: "gocron",
8+
description: description,
9+
cleanUrls: false,
10+
lastUpdated: true,
11+
ignoreDeadLinks: true,
12+
13+
// 国际化配置
14+
locales: {
15+
root: {
16+
label: 'English',
17+
lang: 'en-US',
18+
link: '/en/',
19+
themeConfig: {
20+
nav: [
21+
{ text: 'Home', link: '/en/' },
22+
{ text: 'Guide', link: '/en/guide/introduction' },
23+
],
24+
sidebar: {
25+
'/en/guide/': [
26+
{
27+
text: 'Getting Started',
28+
items: [
29+
{ text: 'Introduction', link: '/en/guide/introduction' },
30+
{ text: 'Quick Start', link: '/en/guide/quick-start' },
31+
{ text: 'Configuration', link: '/en/guide/configuration' },
32+
]
33+
},
34+
{
35+
text: 'Core Features',
36+
items: [
37+
{ text: 'Scheduled Tasks', link: '/en/guide/scheduled-tasks' },
38+
{ text: 'Agent Auto-Registration', link: '/en/guide/agent-registration' },
39+
{ text: 'Log Management', link: '/en/guide/log-management' },
40+
{ text: 'AI Features', link: '/en/guide/ai-features' },
41+
{ text: 'API Documentation', link: '/en/guide/api' },
42+
]
43+
},
44+
{
45+
text: 'Deployment',
46+
items: [
47+
{ text: 'Kubernetes (Helm)', link: '/en/guide/kubernetes' },
48+
{ text: 'High Availability', link: '/en/guide/high-availability' },
49+
]
50+
},
51+
{
52+
text: 'Security',
53+
items: [
54+
{ text: 'Two-Factor Authentication (2FA)', link: '/en/guide/security-2fa' },
55+
{ text: 'TLS Mutual Authentication', link: '/en/guide/security-tls' },
56+
{ text: 'Password Reset (CLI)', link: '/en/guide/password-reset' },
57+
]
58+
},
59+
{
60+
text: 'About',
61+
items: [
62+
{ text: 'Contributing Guide', link: '/en/guide/contributing' },
63+
{ text: 'About Project', link: '/en/guide/about' },
64+
]
65+
}
66+
]
67+
},
68+
outline: {
69+
level: [2, 4],
70+
label: 'On this page',
71+
},
72+
docFooter: {
73+
prev: 'Previous',
74+
next: 'Next',
75+
},
76+
darkModeSwitchLabel: 'Theme',
77+
sidebarMenuLabel: 'Menu',
78+
returnToTopLabel: 'Return to top',
79+
lastUpdatedText: 'Last updated',
80+
editLink: {
81+
text: 'Edit this page on GitHub',
82+
pattern: 'https://github.com/gocronx-team/gocron/edit/master/docs/:path',
83+
},
84+
}
85+
},
86+
zh: {
87+
label: '简体中文',
88+
lang: 'zh-CN',
89+
link: '/zh/',
90+
themeConfig: {
91+
nav: [
92+
{ text: '首页', link: '/zh/' },
93+
{ text: '指南', link: '/zh/guide/introduction' },
94+
],
95+
sidebar: {
96+
'/zh/guide/': [
97+
{
98+
text: '开始',
99+
items: [
100+
{ text: '简介', link: '/zh/guide/introduction' },
101+
{ text: '快速开始', link: '/zh/guide/quick-start' },
102+
{ text: '配置文件', link: '/zh/guide/configuration' },
103+
]
104+
},
105+
{
106+
text: '核心功能',
107+
items: [
108+
{ text: '定时任务', link: '/zh/guide/scheduled-tasks' },
109+
{ text: 'Agent 自动注册', link: '/zh/guide/agent-registration' },
110+
{ text: '日志管理', link: '/zh/guide/log-management' },
111+
{ text: 'AI 功能', link: '/zh/guide/ai-features' },
112+
{ text: 'API 文档', link: '/zh/guide/api' },
113+
]
114+
},
115+
{
116+
text: '部署',
117+
items: [
118+
{ text: 'Kubernetes (Helm)', link: '/zh/guide/kubernetes' },
119+
{ text: '高可用部署', link: '/zh/guide/high-availability' },
120+
]
121+
},
122+
{
123+
text: '安全',
124+
items: [
125+
{ text: '双因素认证 (2FA)', link: '/zh/guide/security-2fa' },
126+
{ text: 'TLS 双向认证', link: '/zh/guide/security-tls' },
127+
{ text: '密码重置 (CLI)', link: '/zh/guide/password-reset' },
128+
]
129+
},
130+
{
131+
text: '关于',
132+
items: [
133+
{ text: '贡献指南', link: '/zh/guide/contributing' },
134+
{ text: '关于项目', link: '/zh/guide/about' },
135+
]
136+
}
137+
]
138+
},
139+
outline: {
140+
level: [2, 4],
141+
label: '本页导航',
142+
},
143+
docFooter: {
144+
prev: '上一页',
145+
next: '下一页',
146+
},
147+
darkModeSwitchLabel: '主题',
148+
sidebarMenuLabel: '菜单',
149+
returnToTopLabel: '返回顶部',
150+
lastUpdatedText: '上次更新时间',
151+
editLink: {
152+
text: '在 GitHub 上编辑此页',
153+
pattern: 'https://github.com/gocronx-team/gocron/edit/master/docs/:path',
154+
},
155+
}
156+
}
157+
},
158+
159+
head: [
160+
["link", { rel: "icon", type: "image/x-icon", href: "/favicon.ico" }],
161+
["meta", { property: "og:type", content: "website" }],
162+
["meta", { property: "og:title", content: "gocron | Distributed Scheduled Task System" }],
163+
["meta", { property: "og:site_name", content: "gocron" }],
164+
["meta", { property: "og:description", content: description }],
165+
["meta", { name: "description", content: description }],
166+
["meta", { name: "author", content: "gocron" }],
167+
["meta", { name: "keywords", content: "gocron,定时任务,scheduled tasks,cron,distributed" }],
168+
],
169+
170+
markdown: {
171+
lineNumbers: true,
172+
image: {
173+
lazyLoading: true,
174+
},
175+
},
176+
177+
sitemap: {
178+
hostname: "https://gocron.io",
179+
},
180+
181+
themeConfig: {
182+
socialLinks: [
183+
{
184+
icon: "github",
185+
link: "https://github.com/gocronx-team/gocron",
186+
},
187+
],
188+
search: {
189+
provider: "local",
190+
options: {
191+
locales: {
192+
zh: {
193+
translations: {
194+
button: {
195+
buttonText: '搜索文档',
196+
buttonAriaLabel: '搜索文档'
197+
},
198+
modal: {
199+
noResultsText: '无法找到相关结果',
200+
resetButtonTitle: '清除查询条件',
201+
footer: {
202+
selectText: '选择',
203+
navigateText: '切换'
204+
}
205+
}
206+
}
207+
}
208+
}
209+
}
210+
},
211+
},
212+
});

docs/.vitepress/theme/custom.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/* 防止首页标题换行 */
2+
.VPHero .text {
3+
white-space: nowrap;
4+
}
5+
6+
/* 如果屏幕太小,允许适当缩小字体而不是换行 */
7+
@media (max-width: 768px) {
8+
.VPHero .text {
9+
white-space: normal;
10+
}
11+
}

docs/.vitepress/theme/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import DefaultTheme from 'vitepress/theme'
2+
import './custom.css'
3+
4+
export default DefaultTheme

docs/Makefile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Makefile:本地构建 / 预览 / 发布 gocron 文档到 Cloudflare Pages
2+
# 在 docs/ 目录下执行(docs/ 是独立 pnpm 工作区)。
3+
4+
PROJECT_NAME := gocron-docs
5+
OUTPUT_DIR := .vitepress/dist
6+
PACKAGE_MANAGER := pnpm
7+
8+
.PHONY: help install dev build preview deploy clean
9+
10+
help:
11+
@echo "Available commands:"
12+
@echo " make install - 安装依赖"
13+
@echo " make dev - 启动本地开发服务器 (http://localhost:5173)"
14+
@echo " make build - 构建文档站点"
15+
@echo " make preview - 本地预览构建产物"
16+
@echo " make deploy - 构建并发布到 Cloudflare Pages"
17+
@echo " make clean - 清理构建产物"
18+
19+
install:
20+
$(PACKAGE_MANAGER) install
21+
22+
dev:
23+
$(PACKAGE_MANAGER) run docs:dev
24+
25+
build:
26+
$(PACKAGE_MANAGER) run docs:build
27+
28+
preview:
29+
$(PACKAGE_MANAGER) run docs:preview
30+
31+
# 构建并部署到 Cloudflare Pages(项目不存在时会创建)
32+
deploy: build
33+
npx wrangler pages deploy $(OUTPUT_DIR) --project-name $(PROJECT_NAME) --branch production --no-bundle
34+
35+
clean:
36+
rm -rf $(OUTPUT_DIR)

docs/en/guide/about.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# About Project
2+
3+
## Project Origin
4+
5+
This project is developed and refactored based on [gocron](https://github.com/ouqiang/gocron).
6+
7+
We really appreciate the design philosophy of the original project, but since the original author is no longer maintaining it, we have done extensive refactoring work on this foundation to build a more modern, secure, and easy-to-use distributed scheduled task management system.
8+
9+
### Key Improvements
10+
11+
We have made significant improvements based on the original project:
12+
13+
- **Internationalization**: Complete Chinese/English interface switching support
14+
- **Security Enhancements**:
15+
- Added Two-Factor Authentication (2FA)
16+
- Added TLS Mutual Authentication support
17+
- **Log System**: Added automatic log cleanup, supporting both database and file logs
18+
- **Frontend Refactoring**: Adopted modern Vue3 + Element Plus + Vite architecture
19+
- **Backend Refactoring**:
20+
- Upgraded Web framework to [Gin](https://github.com/gin-gonic/gin)
21+
- Upgraded ORM to [GORM](https://github.com/go-gorm/gorm)
22+
- Implemented GORM-based automatic database migration
23+
- **Database Support**: Added SQLite support (pure Go driver, no CGO required) for lightweight deployment
24+
- **Kubernetes Deployment**: Helm Chart for one-click deployment to K8s clusters
25+
- **Automated Release**: GoReleaser + GitHub Actions, tag-triggered multi-platform builds with auto-generated changelog
26+
- **Bug Fixes**: Fixed critical issues such as Shell task stop functionality and orphaned task handling after restart
27+
- **Experience Optimization**: Brand new UI design and interaction experience
28+
29+
## Tech Stack
30+
31+
### Backend (Go)
32+
33+
- **Web Framework**: [Gin](https://github.com/gin-gonic/gin) - High-performance HTTP Web framework
34+
- **ORM Framework**: [GORM](https://github.com/go-gorm/gorm) - The fantastic ORM library for Golang
35+
- **RPC Framework**: [gRPC](https://github.com/grpc/grpc-go) - High performance, open source universal RPC framework
36+
- **Cron Library**: [cron](https://github.com/gocronx-team/cron) - Robust cron library (Forked)
37+
- **JWT**: [golang-jwt](https://github.com/golang-jwt/jwt) - JSON Web Token implementation
38+
- **2FA**: [otp](https://github.com/pquerna/otp) - One-time password library for 2FA
39+
- **CLI**: [cli](https://github.com/urfave/cli) - Simple, fast, and fun package for building command line apps
40+
- **Logger**: [logrus](https://github.com/sirupsen/logrus) - Structured logger for Golang
41+
- **Static Assets**: [statik](https://github.com/rakyll/statik) - Embeds static files into a Go executable
42+
43+
### Frontend (Vue 3)
44+
45+
- **Core Framework**: [Vue 3](https://github.com/vuejs/core) - The Progressive JavaScript Framework
46+
- **Build Tool**: [Vite](https://github.com/vitejs/vite) - Next Generation Frontend Tooling
47+
- **UI Library**: [Element Plus](https://github.com/element-plus/element-plus) - A Vue 3 based component library
48+
- **Router**: [Vue Router](https://github.com/vuejs/router) - The official router for Vue.js
49+
- **State Management**: [Pinia](https://github.com/vuejs/pinia) - The Vue Store that you will enjoy using
50+
- **HTTP Client**: [Axios](https://github.com/axios/axios) - Promise based HTTP client
51+
- **I18n**: [Vue I18n](https://github.com/intlify/vue-i18n-next) - Internationalization plugin for Vue.js
52+
- **Utilities**: [VueUse](https://github.com/vueuse/vueuse) - Collection of Essential Vue Composition Utilities
53+
54+
## Acknowledgments & Support
55+
56+
The development of gocron relies on the support of the open source community.
57+
58+
If you find this project helpful, please give it a **Star** ⭐. This is not only a recognition of our work but also helps more people discover this project.
59+
60+
We also warmly welcome you to submit **Issues** for feedback or suggestions, or submit **Pull Requests** to contribute code. Let's work together to build an even better distributed scheduled task management system!
61+
62+

0 commit comments

Comments
 (0)