diff --git a/ChangeLog.md b/ChangeLog.md new file mode 100644 index 0000000..71df49c --- /dev/null +++ b/ChangeLog.md @@ -0,0 +1,29 @@ +### v1.2.4 + +1. 搜索增强,毫秒级响应,关键字高亮显示 +2. 修复版本显示不正确的问题 +3. 配置项新增Meilisearch配置 + +### v1.2.3 +1. 添加图片上传功能 +2. 添加Logo配置项,首页Logo显示 +3. 后台界面体验优化 + +### v1.2.1 +1. 修复转存移除广告失败的问题和添加广告失败的问题 +2. 管理后台UI优化 +3. 首页添加描述显示 + +### v1.2.0 +1. 新增手动批量转存 +2. 新增QQ机器人 +3. 新增任务管理功能 +4. 自动转存改版(批量转存修改为,显示二维码时自动转存) +5. 新增支持第三方统计代码配置 + +### v1.0.0 +1. 支持API,手动批量录入资源 +2. 支持,自动判断资源有效性 +3. 支持自动转存 +4. 支持平台多账号管理(Quark) +5. 支持简单的数据统计 \ No newline at end of file diff --git a/README.md b/README.md index a64c074..ad6903e 100644 --- a/README.md +++ b/README.md @@ -41,30 +41,15 @@ 2. 修复版本显示不正确的问题 3. 配置项新增Meilisearch配置 -### v1.2.3 -1. 添加图片上传功能 -2. 添加Logo配置项,首页Logo显示 -3. 后台界面体验优化 +[详细改动记录](https://github.com/ctwj/urldb/blob/main/ChangeLog.md) -### v1.2.1 -1. 修复转存移除广告失败的问题和添加广告失败的问题 -2. 管理后台UI优化 -3. 首页添加描述显示 - -### v1.2.0 -1. 新增手动批量转存 -2. 新增QQ机器人 -3. 新增任务管理功能 -4. 自动转存改版(批量转存修改为,显示二维码时自动转存) -5. 新增支持第三方统计代码配置 - -### v1.0.0 +当前特性 1. 支持API,手动批量录入资源 2. 支持,自动判断资源有效性 -3. 支持自动转存 +3. 支持自动转存(Quark) 4. 支持平台多账号管理(Quark) 5. 支持简单的数据统计 - +6. 支持Meilisearch --- @@ -72,7 +57,6 @@ ## 📸 项目截图 - ### 🏠 首页 ![首页](https://raw.githubusercontent.com/ctwj/urldb/refs/heads/main/github/index.webp) diff --git a/docs/CNAME b/docs/CNAME deleted file mode 100644 index 6c64dd4..0000000 --- a/docs/CNAME +++ /dev/null @@ -1 +0,0 @@ -doc.l9.lc \ No newline at end of file diff --git a/docs/README.md b/docs/README.md deleted file mode 100644 index 927df81..0000000 --- a/docs/README.md +++ /dev/null @@ -1,51 +0,0 @@ -# 🚀 urlDB - 老九网盘资源数据库 - -> 一个现代化的老九网盘资源数据库,支持多网盘自动化转存分享,支持百度网盘,阿里云盘,夸克网盘, 天翼云盘,迅雷云盘,123云盘,115网盘,UC网盘 - -
- -![Go Version](https://img.shields.io/badge/Go-1230?logo=go&logoColor=white) -![Vue Version](https://img.shields.io/badge/Vue-334FC08D?logo=vue.js&logoColor=white) -![Nuxt Version](https://img.shields.io/badge/Nuxt-300.8+-00DC82?logo=nuxt.js&logoColor=white) -![License](https://img.shields.io/badge/License-GPL%20v3-blue.svg) -![PostgreSQL](https://img.shields.io/badge/PostgreSQL-15+-336791go=postgresql&logoColor=white) - -
- -## 🎯 支持的网盘平台 - -| 平台 | 录入 | 转存 | 分享 | -|------|-------|-----|------| -| 百度网盘 | ✅ 支持 | 🚧 开发中 | 🚧 开发中 | -| 阿里云盘 | ✅ 支持 | 🚧 开发中 | 🚧 开发中 | -| 夸克网盘 | ✅ 支持 | ✅ 支持 | ✅ 支持 | -| 天翼云盘 | ✅ 支持 | 🚧 开发中 | 🚧 开发中 | -| 迅雷云盘 | ✅ 支持 | 🚧 开发中 | 🚧 开发中 | -| UC网盘 | ✅ 支持 | 🚧 开发中 | 🚧 开发中 | -| 123云盘 | ✅ 支持 | 🚧 开发中 | 🚧 开发中 | -| 115网盘 | ✅ 支持 | 🚧 开发中 | 🚧 开发中 | - -## ✨ 功能特性 - -### 🎯 核心功能 -- **📁 多平台网盘支持** - 支持多种主流网盘平台 -- **🔍 公开API** - 支持API数据录入,资源搜索 -- **🏷️ 自动预处理** - 系统自动处理资源,对数据进行有效性判断 -- **📊 自动转存分享** - 有效资源,如果属于支持类型将自动转存分享 -- **📱 多账号管理** - 同平台支持多账号管理 - -## 📞 联系我们 - -- **项目地址**: [https://github.com/ctwj/urldb](https://github.com/ctwj/urldb) -- **问题反馈**: [Issues](https://github.com/ctwj/urldb/issues) -- **邮箱**: 510199617@qq.com - ---- - -
- -**如果这个项目对您有帮助,请给我们一个 ⭐ Star!** - -Made with ❤️ by [老九] - -
\ No newline at end of file diff --git a/docs/README_DOCS.md b/docs/README_DOCS.md deleted file mode 100644 index 9325df4..0000000 --- a/docs/README_DOCS.md +++ /dev/null @@ -1,177 +0,0 @@ -# 文档使用说明 - -## 概述 - -本项目使用 [docsify](https://docsify.js.org/) 生成文档网站。docsify 是一个轻量级的文档生成器,无需构建静态文件,只需要一个 `index.html` 文件即可。 - -## 文档结构 - -``` -docs/ -├── index.html # 文档主页 -├── docsify.config.js # docsify 配置文件 -├── README.md # 首页内容 -├── _sidebar.md # 侧边栏导航 -├── start-docs.sh # 启动脚本 -├── guide/ # 使用指南 -│ ├── quick-start.md # 快速开始 -│ ├── local-development.md # 本地开发 -│ └── docker-deployment.md # Docker 部署 -├── api/ # API 文档 -│ └── overview.md # API 概览 -├── architecture/ # 架构文档 -│ └── overview.md # 架构概览 -├── faq.md # 常见问题 -├── changelog.md # 更新日志 -└── license.md # 许可证 -``` - -## 快速启动 - -### 方法一:使用启动脚本(推荐) - -```bash -# 进入文档目录 -cd docs - -# 运行启动脚本 -./start-docs.sh -``` - -脚本会自动: -- 检查是否安装了 docsify-cli -- 如果没有安装,会自动安装 -- 启动文档服务 -- 在浏览器中打开文档 - -### 方法二:手动启动 - -```bash -# 安装 docsify-cli(如果未安装) -npm install -g docsify-cli - -# 进入文档目录 -cd docs - -# 启动服务 -docsify serve . --port 3000 --open -``` - -## 访问文档 - -启动成功后,文档将在以下地址可用: -- 本地访问:http://localhost:3000 -- 局域网访问:http://[你的IP]:3000 - -## 文档特性 - -### 1. 搜索功能 -- 支持全文搜索 -- 搜索结果高亮显示 -- 支持中文搜索 - -### 2. 代码高亮 -支持多种编程语言的语法高亮: -- Go -- JavaScript/TypeScript -- SQL -- YAML -- JSON -- Bash - -### 3. 代码复制 -- 一键复制代码块 -- 复制成功提示 - -### 4. 页面导航 -- 侧边栏导航 -- 页面间导航 -- 自动回到顶部 - -### 5. 响应式设计 -- 支持移动端访问 -- 自适应屏幕尺寸 - -## 自定义配置 - -### 修改主题 -在 `docsify.config.js` 中修改配置: - -```javascript -window.$docsify = { - name: '你的项目名称', - repo: '你的仓库地址', - // 其他配置... -} -``` - -### 添加新页面 -1. 在相应目录下创建 `.md` 文件 -2. 在 `_sidebar.md` 中添加导航链接 -3. 刷新页面即可看到新页面 - -### 修改样式 -可以通过添加自定义 CSS 来修改样式: - -```html - - -``` - -## 部署到生产环境 - -### 静态部署 -docsify 生成的文档可以部署到任何静态文件服务器: - -```bash -# 构建静态文件(可选) -docsify generate docs docs/_site - -# 部署到 GitHub Pages -git subtree push --prefix docs origin gh-pages -``` - -### Docker 部署 -```bash -# 使用 nginx 镜像 -docker run -d -p 80:80 -v $(pwd)/docs:/usr/share/nginx/html nginx -``` - -## 常见问题 - -### Q: 启动时提示端口被占用 -A: 可以指定其他端口: -```bash -docsify serve . --port 3001 -``` - -### Q: 搜索功能不工作 -A: 确保在 `index.html` 中引入了搜索插件: -```html - -``` - -### Q: 代码高亮不显示 -A: 确保引入了相应的 Prism.js 组件: -```html - -``` - -## 维护说明 - -### 更新文档 -1. 修改相应的 `.md` 文件 -2. 刷新浏览器即可看到更新 - -### 添加新功能 -1. 在 `docsify.config.js` 中添加插件配置 -2. 在 `index.html` 中引入相应的插件文件 - -### 版本控制 -建议将文档与代码一起进行版本控制,确保文档与代码版本同步。 - -## 相关链接 - -- [docsify 官方文档](https://docsify.js.org/) -- [docsify 插件市场](https://docsify.js.org/#/plugins) -- [Markdown 语法指南](https://docsify.js.org/#/zh-cn/markdown) \ No newline at end of file diff --git a/docs/_sidebar.md b/docs/_sidebar.md deleted file mode 100644 index a463f95..0000000 --- a/docs/_sidebar.md +++ /dev/null @@ -1,15 +0,0 @@ - - -* [🏠 首页](/) -* [🚀 快速开始](guide/quick-start.md) -* [🐳 Docker部署](guide/docker-deployment.md) -* [💻 本地开发](guide/local-development.md) - -* 📚 API 文档 - * [公开API](api/overview.md) - -* 📄 其他 - * [常见问题](faq.md) - * [更新日志](changelog.md) - * [许可证](license.md) - * [版本管理](github-version-management.md) \ No newline at end of file diff --git a/docs/api/overview.md b/docs/api/overview.md deleted file mode 100644 index 85efbc2..0000000 --- a/docs/api/overview.md +++ /dev/null @@ -1,418 +0,0 @@ -# API 文档概览 - -## 概述 - -老九网盘资源数据库提供了一套完整的 RESTful API 接口,支持资源管理、搜索、热门剧获取等功能。所有 API 都需要进行认证,使用 API Token 进行身份验证。 - -## 基础信息 - -- **基础URL**: `http://localhost:8080/api` -- **认证方式**: API Token -- **数据格式**: JSON -- **字符编码**: UTF-8 - -## 认证说明 - -### 认证方式 - -所有 API 都需要提供 API Token 进行认证,支持两种方式: - -1. **请求头方式**(推荐) - ``` - X-API-Token: your_token_here - ``` - -2. **查询参数方式** - ``` - ?api_token=your_token_here - ``` - -### 获取 Token - -请联系管理员在系统配置中设置 API Token。 - -## API 接口列表 - -### 1. 单个添加资源 - -**接口描述**: 添加单个资源到待处理列表 - -**请求信息**: -- **方法**: `POST` -- **路径**: `/api/public/resources/add` -- **认证**: 必需 - -**请求参数**: -```json -{ - "title": "资源标题", - "description": "资源描述", - "url": "资源链接", - "category": "分类名称", - "tags": "标签1,标签2", - "img": "封面图片链接", - "source": "数据来源", - "extra": "额外信息" -} -``` - -**响应示例**: -```json -{ - "success": true, - "message": "资源添加成功,已进入待处理列表", - "data": { - "id": 123 - }, - "code": 200 -} -``` - -### 2. 批量添加资源 - -**接口描述**: 批量添加多个资源到待处理列表 - -**请求信息**: -- **方法**: `POST` -- **路径**: `/api/public/resources/batch-add` -- **认证**: 必需 - -**请求参数**: -```json -{ - "resources": [ - { - "title": "资源1", - "url": "链接1", - "description": "描述1" - }, - { - "title": "资源2", - "url": "链接2", - "description": "描述2" - } - ] -} -``` - -**响应示例**: -```json -{ - "success": true, - "message": "批量添加成功,共添加 2 个资源", - "data": { - "created_count": 2, - "created_ids": [123, 124] - }, - "code": 200 -} -``` - -### 3. 资源搜索 - -**接口描述**: 搜索资源,支持关键词、标签、分类过滤 - -**请求信息**: -- **方法**: `GET` -- **路径**: `/api/public/resources/search` -- **认证**: 必需 - -**查询参数**: -- `keyword` - 搜索关键词 -- `tag` - 标签过滤 -- `category` - 分类过滤 -- `page` - 页码(默认1) -- `page_size` - 每页数量(默认20,最大100) - -**响应示例**: -```json -{ - "success": true, - "message": "搜索成功", - "data": { - "resources": [ - { - "id": 1, - "title": "资源标题", - "url": "资源链接", - "description": "资源描述", - "view_count": 100, - "created_at": "2024-12-19 10:00:00", - "updated_at": "2024-12-19 10:00:00" - } - ], - "total": 50, - "page": 1, - "page_size": 20 - }, - "code": 200 -} -``` - -### 4. 热门剧列表 - -**接口描述**: 获取热门剧列表,支持分页 - -**请求信息**: -- **方法**: `GET` -- **路径**: `/api/public/hot-dramas` -- **认证**: 必需 - -**查询参数**: -- `page` - 页码(默认1) -- `page_size` - 每页数量(默认20,最大100) - -**响应示例**: -```json -{ - "success": true, - "message": "获取热门剧成功", - "data": { - "hot_dramas": [ - { - "id": 1, - "title": "剧名", - "description": "剧集描述", - "img": "封面图片", - "url": "详情链接", - "rating": 8.5, - "year": "2024", - "region": "中国大陆", - "genres": "剧情,悬疑", - "category": "电视剧", - "created_at": "2024-12-19 10:00:00", - "updated_at": "2024-12-19 10:00:00" - } - ], - "total": 20, - "page": 1, - "page_size": 20 - }, - "code": 200 -} -``` - -## 错误码说明 - -### HTTP 状态码 - -| 状态码 | 说明 | -|--------|------| -| 200 | 请求成功 | -| 400 | 请求参数错误 | -| 401 | 认证失败(Token无效或缺失) | -| 500 | 服务器内部错误 | -| 503 | 系统维护中或API Token未配置 | - -### 响应格式 - -所有 API 响应都遵循统一的格式: - -```json -{ - "success": true/false, - "message": "响应消息", - "data": {}, // 响应数据 - "code": 200 // 状态码 -} -``` - -## 使用示例 - -### cURL 示例 - -```bash -# 设置API Token -API_TOKEN="your_api_token_here" - -# 单个添加资源 -curl -X POST "http://localhost:8080/api/public/resources/add" \ - -H "Content-Type: application/json" \ - -H "X-API-Token: $API_TOKEN" \ - -d '{ - "title": "测试资源", - "url": "https://example.com/resource", - "description": "测试描述" - }' - -# 搜索资源 -curl -X GET "http://localhost:8080/api/public/resources/search?keyword=测试" \ - -H "X-API-Token: $API_TOKEN" - -# 获取热门剧 -curl -X GET "http://localhost:8080/api/public/hot-dramas?page=1&page_size=5" \ - -H "X-API-Token: $API_TOKEN" -``` - -### JavaScript 示例 - -```javascript -const API_TOKEN = 'your_api_token_here'; -const BASE_URL = 'http://localhost:8080/api'; - -// 添加资源 -async function addResource(resourceData) { - const response = await fetch(`${BASE_URL}/public/resources/add`, { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - 'X-API-Token': API_TOKEN - }, - body: JSON.stringify(resourceData) - }); - return await response.json(); -} - -// 搜索资源 -async function searchResources(keyword, page = 1) { - const response = await fetch( - `${BASE_URL}/public/resources/search?keyword=${encodeURIComponent(keyword)}&page=${page}`, - { - headers: { - 'X-API-Token': API_TOKEN - } - } - ); - return await response.json(); -} - -// 获取热门剧 -async function getHotDramas(page = 1, pageSize = 20) { - const response = await fetch( - `${BASE_URL}/public/hot-dramas?page=${page}&page_size=${pageSize}`, - { - headers: { - 'X-API-Token': API_TOKEN - } - } - ); - return await response.json(); -} -``` - -### Python 示例 - -```python -import requests - -API_TOKEN = 'your_api_token_here' -BASE_URL = 'http://localhost:8080/api' - -headers = { - 'X-API-Token': API_TOKEN, - 'Content-Type': 'application/json' -} - -# 添加资源 -def add_resource(resource_data): - response = requests.post( - f'{BASE_URL}/public/resources/add', - headers=headers, - json=resource_data - ) - return response.json() - -# 搜索资源 -def search_resources(keyword, page=1): - params = { - 'keyword': keyword, - 'page': page - } - response = requests.get( - f'{BASE_URL}/public/resources/search', - headers={'X-API-Token': API_TOKEN}, - params=params - ) - return response.json() - -# 获取热门剧 -def get_hot_dramas(page=1, page_size=20): - params = { - 'page': page, - 'page_size': page_size - } - response = requests.get( - f'{BASE_URL}/public/hot-dramas', - headers={'X-API-Token': API_TOKEN}, - params=params - ) - return response.json() -``` - -## 最佳实践 - -### 1. 错误处理 - -始终检查响应的 `success` 字段和 HTTP 状态码: - -```javascript -const response = await fetch(url, options); -const data = await response.json(); - -if (!response.ok || !data.success) { - console.error('API调用失败:', data.message); - // 处理错误 -} -``` - -### 2. 分页处理 - -对于支持分页的接口,建议实现分页逻辑: - -```javascript -async function getAllResources(keyword) { - let allResources = []; - let page = 1; - let hasMore = true; - - while (hasMore) { - const response = await searchResources(keyword, page); - if (response.success) { - allResources.push(...response.data.resources); - hasMore = response.data.resources.length > 0; - page++; - } else { - break; - } - } - - return allResources; -} -``` - -### 3. 请求频率限制 - -避免过于频繁的 API 调用,建议实现请求间隔: - -```javascript -function delay(ms) { - return new Promise(resolve => setTimeout(resolve, ms)); -} - -async function searchWithDelay(keyword) { - const result = await searchResources(keyword); - await delay(1000); // 等待1秒 - return result; -} -``` - -## 注意事项 - -1. **Token 安全**: 请妥善保管您的 API Token,不要泄露给他人 -2. **请求限制**: 避免过于频繁的请求,以免影响系统性能 -3. **数据格式**: 确保请求数据格式正确,特别是 JSON 格式 -4. **错误处理**: 始终实现适当的错误处理机制 -5. **版本兼容**: API 可能会进行版本更新,请关注更新通知 - -## 技术支持 - -如果您在使用 API 过程中遇到问题,请: - -1. 检查 API Token 是否正确 -2. 确认请求格式是否符合要求 -3. 查看错误响应中的详细信息 -4. 联系技术支持团队 - ---- - -**注意**: 本站内容由网络爬虫自动抓取。本站不储存、复制、传播任何文件,仅作个人公益学习,请在获取后24小时内删除! \ No newline at end of file diff --git a/docs/changelog.md b/docs/changelog.md deleted file mode 100644 index 5a63e9a..0000000 --- a/docs/changelog.md +++ /dev/null @@ -1,100 +0,0 @@ -# 📝 更新日志 - -本项目遵循 [语义化版本](https://semver.org/lang/zh-CN/) 规范。 - -## [未发布] - -### 新增 -- 自动转存调度功能 -- 支持更多网盘平台 -- 性能优化和监控 - -### 修复 -- 修复已知问题 -- 改进用户体验 - -## [1.0.0] - 2024-01-01 - -### 新增 -- 🎉 首次发布 -- ✨ 完整的网盘资源管理系统 -- 🔐 JWT 用户认证系统 -- 📁 多平台网盘支持 -- 🔍 资源搜索和管理 -- 🏷️ 分类和标签系统 -- 📊 统计和监控功能 -- 🐳 Docker 容器化部署 -- 📱 响应式前端界面 -- 🌙 深色模式支持 - -### 支持的网盘平台 -- 百度网盘 -- 阿里云盘 -- 夸克网盘 -- 天翼云盘 -- 迅雷云盘 -- UC网盘 -- 123云盘 -- 115网盘 - -### 技术特性 -- **后端**: Go + Gin + GORM + PostgreSQL -- **前端**: Nuxt.js 3 + Vue 3 + TypeScript + Tailwind CSS -- **部署**: Docker + Docker Compose -- **认证**: JWT Token -- **架构**: 前后端分离 - -## [0.9.0] - 2024-12-15 - -### 新增 -- 🚀 项目初始化 -- 📋 基础功能开发 -- 🏗️ 架构设计完成 -- 🔧 开发环境搭建 - -### 技术栈确定 -- 后端技术栈选型 -- 前端技术栈选型 -- 数据库设计 -- API 接口设计 - ---- - -## 版本说明 - -### 版本号格式 -- **主版本号**: 不兼容的 API 修改 -- **次版本号**: 向下兼容的功能性新增 -- **修订号**: 向下兼容的问题修正 - -### 更新类型 -- 🎉 **重大更新**: 新版本发布 -- ✨ **新增功能**: 新功能添加 -- 🔧 **功能改进**: 现有功能优化 -- 🐛 **问题修复**: Bug 修复 -- 📝 **文档更新**: 文档改进 -- 🚀 **性能优化**: 性能提升 -- 🔒 **安全更新**: 安全相关更新 -- 🎨 **界面优化**: UI/UX 改进 - -## 贡献指南 - -如果您想为项目做出贡献,请: - -1. Fork 项目 -2. 创建功能分支 (`git checkout -b feature/AmazingFeature`) -3. 提交更改 (`git commit -m 'Add some AmazingFeature'`) -4. 推送到分支 (`git push origin feature/AmazingFeature`) -5. 打开 Pull Request - -## 反馈 - -如果您发现任何问题或有建议,请: - -- 提交 [Issue](https://github.com/ctwj/urldb/issues) -- 发送邮件到 510199617@qq.com -- 在 [讨论区](https://github.com/ctwj/urldb/discussions) 交流 - ---- - -**注意**: 此更新日志记录了项目的重要变更。对于详细的开发日志,请查看 Git 提交历史。 \ No newline at end of file diff --git a/docs/docsify.config.js b/docs/docsify.config.js deleted file mode 100644 index 26aa07e..0000000 --- a/docs/docsify.config.js +++ /dev/null @@ -1,53 +0,0 @@ -// docsify 配置文件 -window.$docsify = { - name: '老九网盘链接数据库', - repo: 'https://github.com/ctwj/urldb', - loadSidebar: '_sidebar.md', - subMaxLevel: 3, - auto2top: true, - // 添加侧边栏配置 - sidebarDisplayLevel: 1, - // 添加错误处理 - notFoundPage: true, - search: { - maxAge: 86400000, - paths: 'auto', - placeholder: '搜索文档...', - noData: '找不到结果', - depth: 6 - }, - copyCode: { - buttonText: '复制', - errorText: '错误', - successText: '已复制' - }, - pagination: { - previousText: '上一页', - nextText: '下一页', - crossChapter: true, - crossChapterText: true, - }, - plugins: [ - function(hook, vm) { - hook.beforeEach(function (html) { - // 添加页面标题 - var url = '#' + vm.route.path; - var title = vm.route.path === '/' ? '首页' : vm.route.path.replace('/', ''); - return html + '\n\n---\n\n' + - '
' + - '最后更新: ' + new Date().toLocaleDateString('zh-CN') + - '
'; - }); - - // 添加侧边栏加载调试 - hook.doneEach(function() { - console.log('Docsify loaded, sidebar should be visible'); - if (document.querySelector('.sidebar-nav')) { - console.log('Sidebar element found'); - } else { - console.log('Sidebar element not found'); - } - }); - } - ] -}; \ No newline at end of file diff --git a/docs/faq.md b/docs/faq.md deleted file mode 100644 index bcd1bd8..0000000 --- a/docs/faq.md +++ /dev/null @@ -1,26 +0,0 @@ -# ❓ 常见问题 - -## 部署相关 - -### Q: 默认账号密码是多少? - -**A:** 可以通过以下方式解决: - -1. admin/password - -### Q: 批量添加了资源,但是系统里面没有出现,也搜索不到? - -**A:** 可以通过以下方式解决: - -1. 需要先开启自动处理待处理任务的开关 -2. 定时任务每5分钟执行一次,可能需要等待 -3. 如果添加的链接地址无效, 会被程序过滤 - -### Q: 没有自动转存? - -**A:** 可以通过以下方式解决: - -1. 需要先添加账号 -2. 开启定时任务 -3. 等待任务完成 -4. 只要支持的网盘地址才会被自动转存并分享 \ No newline at end of file diff --git a/docs/github-version-management.md b/docs/github-version-management.md deleted file mode 100644 index 74aedce..0000000 --- a/docs/github-version-management.md +++ /dev/null @@ -1,253 +0,0 @@ -# GitHub版本管理指南 - -本项目使用GitHub进行版本管理,支持自动创建Release和标签。 - -## 版本管理流程 - -### 1. 版本号规范 - -遵循[语义化版本](https://semver.org/lang/zh-CN/)规范: - -- **主版本号** (Major): 不兼容的API修改 -- **次版本号** (Minor): 向下兼容的功能性新增 -- **修订号** (Patch): 向下兼容的问题修正 - -### 2. 版本管理命令 - -#### 显示版本信息 -```bash -./scripts/version.sh show -``` - -#### 更新版本号 -```bash -# 修订版本 (1.0.0 -> 1.0.1) -./scripts/version.sh patch - -# 次版本 (1.0.0 -> 1.1.0) -./scripts/version.sh minor - -# 主版本 (1.0.0 -> 2.0.0) -./scripts/version.sh major -``` - -#### 发布版本到GitHub -```bash -./scripts/version.sh release -``` - -### 3. 自动发布流程 - -当执行版本更新命令时,脚本会: - -1. **更新版本号**: 修改 `VERSION` 文件 -2. **同步文件**: 更新 `package.json`、`docker-compose.yml`、`README.md` -3. **创建Git标签**: 自动创建版本标签 -4. **推送代码**: 推送代码和标签到GitHub -5. **创建Release**: 自动创建GitHub Release - -### 4. 手动发布流程 - -如果自动发布失败,可以手动发布: - -#### 步骤1: 更新版本号 -```bash -./scripts/version.sh patch # 或 minor, major -``` - -#### 步骤2: 提交更改 -```bash -git add . -git commit -m "chore: bump version to v1.0.1" -``` - -#### 步骤3: 创建标签 -```bash -git tag v1.0.1 -``` - -#### 步骤4: 推送到GitHub -```bash -git push origin main -git push origin v1.0.1 -``` - -#### 步骤5: 创建Release -在GitHub网页上: -1. 进入项目页面 -2. 点击 "Releases" -3. 点击 "Create a new release" -4. 选择标签 `v1.0.1` -5. 填写Release说明 -6. 发布 - -### 5. GitHub CLI工具 - -#### 安装GitHub CLI -```bash -# macOS -brew install gh - -# Ubuntu/Debian -sudo apt install gh - -# Windows -winget install GitHub.cli -``` - -#### 登录GitHub -```bash -gh auth login -``` - -#### 创建Release -```bash -gh release create v1.0.1 \ - --title "Release v1.0.1" \ - --notes "修复了一些bug" \ - --draft=false \ - --prerelease=false -``` - -### 6. 版本检查 - -#### API接口 -- `GET /api/version/check-update` - 检查GitHub上的最新版本 - -#### 前端页面 -- 访问 `/version` 页面查看版本信息和更新状态 - -### 7. 版本历史 - -#### 查看所有标签 -```bash -git tag -l -``` - -#### 查看标签详情 -```bash -git show v1.0.1 -``` - -#### 查看版本历史 -```bash -git log --oneline --decorate -``` - -### 8. 回滚版本 - -如果需要回滚到之前的版本: - -#### 删除本地标签 -```bash -git tag -d v1.0.1 -``` - -#### 删除远程标签 -```bash -git push origin :refs/tags/v1.0.1 -``` - -#### 回滚代码 -```bash -git reset --hard v1.0.0 -git push --force origin main -``` - -### 9. 最佳实践 - -#### 提交信息规范 -```bash -# 功能开发 -git commit -m "feat: 添加新功能" - -# Bug修复 -git commit -m "fix: 修复某个bug" - -# 文档更新 -git commit -m "docs: 更新文档" - -# 版本更新 -git commit -m "chore: bump version to v1.0.1" -``` - -#### 分支管理 -- `main`: 主分支,用于发布 -- `develop`: 开发分支 -- `feature/*`: 功能分支 -- `hotfix/*`: 热修复分支 - -#### Release说明模板 -```markdown -## Release v1.0.1 - -**发布日期**: 2024-01-15 - -### 更新内容 - -- 修复了某个bug -- 添加了新功能 -- 优化了性能 - -### 下载 - -- [源码 (ZIP)](https://github.com/ctwj/urldb/archive/v1.0.1.zip) -- [源码 (TAR.GZ)](https://github.com/ctwj/urldb/archive/v1.0.1.tar.gz) - -### 安装 - -```bash -# 克隆项目 -git clone https://github.com/ctwj/urldb.git -cd urldb - -# 切换到指定版本 -git checkout v1.0.1 - -# 使用Docker部署 -docker-compose up --build -d -``` - -### 更新日志 - -详细更新日志请查看 [CHANGELOG.md](https://github.com/ctwj/urldb/blob/v1.0.1/CHANGELOG.md) -``` - -### 10. 故障排除 - -#### 常见问题 - -1. **GitHub CLI未安装** - ```bash - # 安装GitHub CLI - brew install gh # macOS - ``` - -2. **GitHub CLI未登录** - ```bash - # 登录GitHub - gh auth login - ``` - -3. **标签已存在** - ```bash - # 删除本地标签 - git tag -d v1.0.1 - - # 删除远程标签 - git push origin :refs/tags/v1.0.1 - ``` - -4. **推送失败** - ```bash - # 检查远程仓库 - git remote -v - - # 重新设置远程仓库 - git remote set-url origin https://github.com/ctwj/urldb.git - ``` - -#### 获取帮助 -```bash -./scripts/version.sh help -``` \ No newline at end of file diff --git a/docs/guide/docker-deployment.md b/docs/guide/docker-deployment.md deleted file mode 100644 index f47732a..0000000 --- a/docs/guide/docker-deployment.md +++ /dev/null @@ -1,352 +0,0 @@ -# 🐳 Docker 部署 - -## 概述 - -urlDB 支持使用 Docker 进行容器化部署,提供了完整的前后端分离架构。 - -## 系统架构 - -| 服务 | 端口 | 说明 | -|------|------|------| -| frontend | 3000 | Nuxt.js 前端应用 | -| backend | 8080 | Go API 后端服务 | -| postgres | 5432 | PostgreSQL 数据库 | - -## 快速部署 - -### 1. 克隆项目 - -```bash -git clone https://github.com/ctwj/urldb.git -cd urldb -``` - -### 2. 使用启动脚本(推荐) - -```bash -# 给脚本执行权限 -chmod +x docker-start.sh - -# 启动服务 -./docker-start.sh -``` - -### 3. 手动启动 - -```bash -# 构建并启动所有服务 -docker compose up --build -d - -# 查看服务状态 -docker compose ps -``` - -## 配置说明 - -### 环境变量 - -可以通过修改 `docker-compose.yml` 文件中的环境变量来配置服务: - -后端 backend -```yaml -environment: - DB_HOST: postgres - DB_PORT: 5432 - DB_USER: postgres - DB_PASSWORD: password - DB_NAME: url_db - PORT: 8080 -``` - -前端 frontend -```yaml -environment: - API_BASE: /api -``` - -### 端口映射 - -如果需要修改端口映射,可以编辑 `docker-compose.yml`: - -```yaml -ports: - - "3001:3000" # 前端端口 - - "8081:8080" # API端口 - - "5433:5432" # 数据库端口 -``` - -## 常用命令 - -### 服务管理 - -```bash -# 启动服务 -docker compose up -d - -# 停止服务 -docker compose down - -# 重启服务 -docker compose restart - -# 查看服务状态 -docker compose ps - -# 查看日志 -docker compose logs -f [service_name] -``` - -### 数据管理 - -```bash -# 备份数据库 -docker compose exec postgres pg_dump -U postgres url_db > backup.sql - -# 恢复数据库 -docker compose exec -T postgres psql -U postgres url_db < backup.sql - -# 进入数据库 -docker compose exec postgres psql -U postgres url_db -``` - -### 容器管理 - -```bash -# 进入容器 -docker compose exec [service_name] sh - -# 查看容器资源使用 -docker stats - -# 清理未使用的资源 -docker system prune -a -``` - -## 生产环境部署 - -### 1. 环境准备 - -```bash -# 安装 Docker 和 Docker Compose -# 确保服务器有足够资源(建议 4GB+ 内存) - -# 创建部署目录 -mkdir -p /opt/urldb -cd /opt/urldb -``` - -### 2. 配置文件 - -创建生产环境配置文件: - -```bash -# 复制项目文件 -git clone https://github.com/ctwj/urldb.git . - -# 创建环境变量文件 -cp env.example .env.prod - -# 编辑生产环境配置 -vim .env.prod -``` - -### 3. 启动服务 - -```bash -# 使用生产环境配置启动 -docker compose -f docker-compose.yml --env-file .env.prod up -d - -# 检查服务状态 -docker compose ps -``` - -### 4. 配置反向代理 - -#### Nginx 配置示例 - -```nginx -server { - listen 80; - server_name your-domain.com; - - # 前端代理 - location / { - proxy_pass http://localhost:3000; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - } - - # API 代理 - location /api/ { - proxy_pass http://localhost:8080; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - } -} -``` - -### 5. SSL 配置 - -```bash -# 使用 Let's Encrypt 获取证书 -sudo certbot --nginx -d your-domain.com - -# 或使用自签名证书 -openssl req -x509 -nodes -days 365 -newkey rsa:2048 \ - -keyout /etc/ssl/private/urldb.key \ - -out /etc/ssl/certs/urldb.crt -``` - -## 监控和维护 - -### 1. 日志管理 - -```bash -# 查看所有服务日志 -docker compose logs -f - -# 查看特定服务日志 -docker compose logs -f backend - -# 导出日志 -docker compose logs > urldb.log -``` - -### 2. 性能监控 - -```bash -# 查看容器资源使用 -docker stats - -# 查看系统资源 -htop -df -h -free -h -``` - -### 3. 备份策略 - -```bash -#!/bin/bash -# 创建备份脚本 backup.sh - -DATE=$(date +%Y%m%d_%H%M%S) -BACKUP_DIR="/backup/urldb" - -# 创建备份目录 -mkdir -p $BACKUP_DIR - -# 备份数据库 -docker compose exec -T postgres pg_dump -U postgres url_db > $BACKUP_DIR/db_$DATE.sql - -# 备份上传文件 -tar -czf $BACKUP_DIR/uploads_$DATE.tar.gz uploads/ - -# 删除7天前的备份 -find $BACKUP_DIR -name "*.sql" -mtime +7 -delete -find $BACKUP_DIR -name "*.tar.gz" -mtime +7 -delete -``` - -### 4. 自动更新 - -```bash -#!/bin/bash -# 创建更新脚本 update.sh - -cd /opt/urldb - -# 拉取最新代码 -git pull origin main - -# 重新构建并启动 -docker compose down -docker compose up --build -d - -# 检查服务状态 -docker compose ps -``` - -## 故障排除 - -### 1. 服务启动失败 - -```bash -# 查看详细错误信息 -docker compose logs [service_name] - -# 检查端口占用 -netstat -tulpn | grep :3000 -netstat -tulpn | grep :8080 - -# 检查磁盘空间 -df -h -``` - -### 2. 数据库连接问题 - -```bash -# 检查数据库状态 -docker compose exec postgres pg_isready -U postgres - -# 检查数据库日志 -docker compose logs postgres - -# 重启数据库服务 -docker compose restart postgres -``` - -### 3. 前端无法访问后端 - -```bash -# 检查网络连接 -docker compose exec frontend ping backend - -# 检查 API 配置 -docker compose exec frontend env | grep API_BASE - -# 测试 API 连接 -curl http://localhost:8080/api/health -``` - -### 4. 内存不足 - -```bash -# 查看内存使用 -free -h - -# 增加 swap 空间 -sudo fallocate -l 2G /swapfile -sudo chmod 600 /swapfile -sudo mkswap /swapfile -sudo swapon /swapfile -``` - -## 安全建议 - -### 1. 网络安全 - -- 使用防火墙限制端口访问 -- 配置 SSL/TLS 加密 -- 定期更新系统和 Docker 版本 - -### 2. 数据安全 - -- 定期备份数据库 -- 使用强密码 -- 限制数据库访问权限 - -### 3. 容器安全 - -- 使用非 root 用户运行容器 -- 定期更新镜像 -- 扫描镜像漏洞 - -## 下一步 - -- [了解系统配置](../guide/configuration.md) -- [查看 API 文档](../api/overview.md) -- [学习监控和维护](../development/deployment.md) \ No newline at end of file diff --git a/docs/guide/local-development.md b/docs/guide/local-development.md deleted file mode 100644 index 7f73206..0000000 --- a/docs/guide/local-development.md +++ /dev/null @@ -1,302 +0,0 @@ -# 💻 本地开发 - -## 环境准备 - -### 1. 安装必需软件 - -#### Go 环境 -```bash -# 下载并安装 Go 1.23+ -# 访问 https://golang.org/dl/ -# 或使用包管理器安装 - -# 验证安装 -go version -``` - -#### Node.js 环境 -```bash -# 下载并安装 Node.js 18+ -# 访问 https://nodejs.org/ -# 或使用 nvm 安装 - -# 验证安装 -node --version -npm --version -``` - -#### PostgreSQL 数据库 -```bash -# Ubuntu/Debian -sudo apt update -sudo apt install postgresql postgresql-contrib - -# macOS (使用 Homebrew) -brew install postgresql - -# 启动服务 -sudo systemctl start postgresql # Linux -brew services start postgresql # macOS -``` - -#### pnpm (推荐) -```bash -# 安装 pnpm -npm install -g pnpm - -# 验证安装 -pnpm --version -``` - -### 2. 克隆项目 - -```bash -git clone https://github.com/ctwj/urldb.git -cd urldb -``` - -## 后端开发 - -### 1. 环境配置 - -```bash -# 复制环境变量文件 -cp env.example .env - -# 编辑环境变量 -vim .env -``` - -### 2. 数据库设置 - -```sql --- 登录 PostgreSQL -sudo -u postgres psql - --- 创建数据库 -CREATE DATABASE url_db; - --- 创建用户(可选) -CREATE USER url_user WITH PASSWORD 'your_password'; -GRANT ALL PRIVILEGES ON DATABASE url_db TO url_user; - --- 退出 -\q -``` - -### 3. 安装依赖 - -```bash -# 安装 Go 依赖 -go mod tidy - -# 验证依赖 -go mod verify -``` - -### 4. 启动后端服务 - -```bash -# 开发模式启动 -go run main.go - -# 或使用 air 热重载(推荐) -go install github.com/cosmtrek/air@latest -air -``` - -## 前端开发 - -### 1. 进入前端目录 - -```bash -cd web -``` - -### 2. 安装依赖 - -```bash -# 使用 pnpm (推荐) -pnpm install - -# 或使用 npm -npm install -``` - -### 3. 启动开发服务器 - -```bash -# 开发模式 -pnpm dev - -# 或使用 npm -npm run dev -``` - -### 4. 访问前端 - -前端服务启动后,访问 http://localhost:3000 - -## 开发工具 - -### 推荐的 IDE 和插件 - -#### VS Code -- **Go** - Go 语言支持 -- **Vetur** 或 **Volar** - Vue.js 支持 -- **PostgreSQL** - 数据库支持 -- **Docker** - Docker 支持 -- **GitLens** - Git 增强 - -#### GoLand / IntelliJ IDEA -- 内置 Go 和 Vue.js 支持 -- 数据库工具 -- Docker 集成 - -### 代码格式化 - -```bash -# Go 代码格式化 -go fmt ./... - -# 前端代码格式化 -cd web -pnpm format -``` - -### 代码检查 - -```bash -# Go 代码检查 -go vet ./... - -# 前端代码检查 -cd web -pnpm lint -``` - -## 调试技巧 - -### 后端调试 - -```bash -# 使用 delve 调试器 -go install github.com/go-delve/delve/cmd/dlv@latest -dlv debug main.go - -# 或使用 VS Code 调试配置 -``` - -### 前端调试 - -```bash -# 启动开发服务器时开启调试 -cd web -pnpm dev --inspect -``` - -### 数据库调试 - -```bash -# 连接数据库 -psql -h localhost -U postgres -d url_db - -# 查看表结构 -\dt - -# 查看数据 -SELECT * FROM users LIMIT 5; -``` - -## 测试 - -### 后端测试 - -```bash -# 运行所有测试 -go test ./... - -# 运行特定测试 -go test ./handlers - -# 生成测试覆盖率报告 -go test -cover ./... -``` - -### 前端测试 - -```bash -cd web - -# 运行单元测试 -pnpm test - -# 运行 E2E 测试 -pnpm test:e2e -``` - -## 构建 - -### 后端构建 - -```bash -# 构建二进制文件 -go build -o urlDB main.go - -# 交叉编译 -GOOS=linux GOARCH=amd64 go build -o urlDB-linux main.go -``` - -### 前端构建 - -```bash -cd web - -# 构建生产版本 -pnpm build - -# 预览构建结果 -pnpm preview -``` - -## 常见问题 - -### 1. 端口冲突 - -如果遇到端口被占用的问题: - -```bash -# 查看端口占用 -lsof -i :8080 -lsof -i :3000 - -# 杀死进程 -kill -9 -``` - -### 2. 数据库连接失败 - -检查 `.env` 文件中的数据库配置: - -```bash -DB_HOST=localhost -DB_PORT=5432 -DB_USER=postgres -DB_PASSWORD=your_password -DB_NAME=url_db -``` - -### 3. 前端依赖安装失败 - -```bash -# 清除缓存 -pnpm store prune -rm -rf node_modules -pnpm install -``` - -## 下一步 - -- [了解项目架构](../architecture/overview.md) -- [查看 API 文档](../api/overview.md) -- [学习代码规范](../development/coding-standards.md) \ No newline at end of file diff --git a/docs/guide/quick-start.md b/docs/guide/quick-start.md deleted file mode 100644 index af6466e..0000000 --- a/docs/guide/quick-start.md +++ /dev/null @@ -1,36 +0,0 @@ -# 🚀 快速开始 - -## 环境要求 - -在开始使用 urlDB 之前,请确保您的系统满足以下要求: - -### 推荐配置 -- **CPU**: 2核 -- **内存**: 2GB+ -- **存储**: 20GB+ 可用空间 - -## 🐳 Docker 部署 - -### 1. 克隆项目 - -```bash -git clone https://github.com/ctwj/urldb.git -cd urldb -docker compose up --build -d -``` - -### 2. 访问应用 - -启动成功后,您可以通过以下地址访问: - -- **前端界面**: http://localhost:3030 -默认用户密码: admin/password - - -## 🆘 遇到问题? - -如果您在部署过程中遇到问题,请: - -1. 查看 [常见问题](../faq.md) -2. 检查 [更新日志](../changelog.md) -3. 提交 [Issue](https://github.com/ctwj/urldb/issues) \ No newline at end of file diff --git a/docs/index.html b/docs/index.html deleted file mode 100644 index 8d1bf91..0000000 --- a/docs/index.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - urlDB - 老九网盘资源数据库 - - - - - - - - -
- - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/license.md b/docs/license.md deleted file mode 100644 index 45174c3..0000000 --- a/docs/license.md +++ /dev/null @@ -1,84 +0,0 @@ -# 许可证 - -## GNU General Public License v3.0 - -本项目采用 GNU General Public License v3.0 (GPL-3.0) 许可证。 - -### 许可证概述 - -GPL-3.0 是一个自由软件许可证,它确保软件保持自由和开放。该许可证的主要特点包括: - -- **自由使用**: 您可以自由地运行、研究、修改和分发软件 -- **源代码开放**: 修改后的代码必须同样开源 -- **专利保护**: 包含专利授权条款 -- **兼容性**: 与大多数开源许可证兼容 - -### 主要条款 - -1. **自由使用和分发** - - 您可以自由地使用、复制、分发和修改本软件 - - 您可以商业使用本软件 - -2. **源代码要求** - - 如果您分发修改后的版本,必须同时提供源代码 - - 源代码必须采用相同的许可证 - -3. **专利授权** - - 贡献者自动授予用户专利使用权 - - 保护用户免受专利诉讼 - -4. **免责声明** - - 软件按"原样"提供,不提供任何保证 - - 作者不承担任何责任 - -### 完整许可证文本 - -``` - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - -[... 完整许可证文本请访问 https://www.gnu.org/licenses/gpl-3.0.html ...] -``` - -### 如何遵守许可证 - -如果您使用或修改本项目: - -1. **保留许可证信息**: 不要删除或修改许可证文件 -2. **注明修改**: 在修改的代码中添加适当的注释 -3. **分发源代码**: 如果分发修改版本,必须提供源代码 -4. **使用相同许可证**: 修改版本必须使用相同的GPL-3.0许可证 - -### 贡献代码 - -当您向本项目贡献代码时,您同意: - -- 您的贡献将采用GPL-3.0许可证 -- 您拥有或有权许可您贡献的代码 -- 您授予项目维护者使用您贡献代码的权利 - -### 联系方式 - -如果您对许可证有任何疑问,请联系项目维护者。 - ---- - -**注意**: 本许可证信息仅供参考,完整和权威的许可证文本请参考 [GNU General Public License v3.0](https://www.gnu.org/licenses/gpl-3.0.html)。 \ No newline at end of file diff --git a/docs/start-docs.sh b/docs/start-docs.sh deleted file mode 100755 index 8400227..0000000 --- a/docs/start-docs.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -# 启动 docsify 文档服务脚本 - -echo "🚀 启动 docsify 文档服务..." - -# 检查是否安装了 docsify-cli -if ! command -v docsify &> /dev/null; then - echo "❌ 未检测到 docsify-cli,正在安装..." - npm install -g docsify-cli - if [ $? -ne 0 ]; then - echo "❌ docsify-cli 安装失败,请手动安装:" - echo " npm install -g docsify-cli" - exit 1 - fi -fi - -# 获取当前脚本所在目录 -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" - -echo "📖 文档目录: $SCRIPT_DIR" -echo "🌐 启动文档服务..." - -# 启动 docsify 服务 -docsify serve "$SCRIPT_DIR" --port 3000 --open - -echo "✅ 文档服务已启动!" -echo "📱 访问地址: http://localhost:3000" -echo "🛑 按 Ctrl+C 停止服务" \ No newline at end of file