{"id":31197915,"url":"https://github.com/tftg-cloud/flowrust","last_synced_at":"2025-09-20T06:51:39.303Z","repository":{"id":310305104,"uuid":"1038976175","full_name":"TFTG-CLOUD/FlowRust","owner":"TFTG-CLOUD","description":"Write a cross-platform, multifunctional CMS in Rust, supporting content such as videos, audio, image galleries, and comics. RUST编写全平台多功能CMS，支持视频、音频、图集漫画等内容。","archived":false,"fork":false,"pushed_at":"2025-09-11T03:58:04.000Z","size":56507,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-11T07:04:46.818Z","etag":null,"topics":["audio","cms","image","maccms10","video"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TFTG-CLOUD.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-16T07:54:08.000Z","updated_at":"2025-09-11T03:59:02.000Z","dependencies_parsed_at":"2025-08-17T08:24:41.858Z","dependency_job_id":"ca388e18-9272-4b43-9a0c-0e2e6358e19c","html_url":"https://github.com/TFTG-CLOUD/FlowRust","commit_stats":null,"previous_names":["tftg-cloud/maccms-rust","tftg-cloud/flowrust"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/TFTG-CLOUD/FlowRust","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TFTG-CLOUD%2FFlowRust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TFTG-CLOUD%2FFlowRust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TFTG-CLOUD%2FFlowRust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TFTG-CLOUD%2FFlowRust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TFTG-CLOUD","download_url":"https://codeload.github.com/TFTG-CLOUD/FlowRust/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TFTG-CLOUD%2FFlowRust/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276058106,"owners_count":25577867,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-20T02:00:10.207Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["audio","cms","image","maccms10","video"],"created_at":"2025-09-20T06:51:34.863Z","updated_at":"2025-09-20T06:51:39.287Z","avatar_url":"https://github.com/TFTG-CLOUD.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FlowRust CMS\n\n![FlowRust CMS](./static/lighthouse.png)\n\n## Video Screenshot\n\n[![Project Demo Video](screenshot.png)](https://raw.githubusercontent.com/TFTG-CLOUD/FlowRust/refs/heads/main/screenshot.mp4)\n\n## 🚀 Project Introduction / 项目简介\n\nFlowRust CMS is a high-performance multi-functional content management system (CMS) developed in Rust language, compatible with Mac CMS 10 collection APIs, focusing on performance, concurrent processing, and memory management, supporting various content forms including videos, audio, and image galleries.\n\nFlowRust CMS 是基于 Rust 语言开发的高性能多功能内容管理系统（CMS），兼容苹果 CMS 10 采集接口，注重性能、并发处理和内存管理，支持视频、音频和图集漫画等多种内容形式。\n\nIt comes with a complete multi-server system for storage + multimedia processing (audio, video, images, archives): https://github.com/TFTG-CLOUD/cms-back. The CMS can connect to unlimited processing servers for unlimited scaling and horizontal expansion, supporting expansion for videos, audio, and image galleries.\n\n拥有配套的完整储存+多媒体处理（音频，视频，图片，压缩包）的多服务器系统：https://github.com/TFTG-CLOUD/cms-back CMS 可对接无限个处理服务器，无限扩容，支持水平扩展，无论是视频、音频，图集漫画都能扩展。\n\n### ✨ Core Advantages / 核心优势\n\n- **🔥 Extreme Performance**: Under the same server configuration, concurrent processing capability is **10x+** that of traditional PHP CMS\n- **🛡️ Memory Safety**: Guaranteed by Rust language, eliminating memory leaks and buffer overflows\n- **⚡ Async Architecture**: Based on Tokio and Actix Web, supporting high-concurrency I/O operations\n- **📊 Real-time Monitoring**: Built-in task progress monitoring and performance statistics\n- **🎯 Backward Compatibility**: Fully compatible with Mac CMS database structure and APIs\n\n- **🔥 极致性能**: 相同配置服务器下，并发处理能力是传统 PHP CMS 的 **10 倍以上**\n- **🛡️ 内存安全**: Rust 语言保障，杜绝内存泄漏和缓冲区溢出\n- **⚡ 异步架构**: 基于 Tokio 和 Actix Web，支持高并发 I/O 操作\n- **📊 实时监控**: 内置任务进度监控和性能统计\n- **🎯 向后兼容**: 完全兼容苹果 CMS 数据库结构和 API\n\n## 📋 System Requirements / 系统要求\n\n- **Operating System**: Linux/macOS/Windows\n- **Memory**: Minimum 512MB, Recommended 2GB+\n- **Storage**: Minimum 1GB available space\n- **Database**: MongoDB 4.0+\n- **Network**: Support for high-concurrency connections\n\n- **操作系统**: Linux/macOS/Windows\n- **内存**: 最低 512MB，推荐 2GB+\n- **存储**: 最低 1GB 可用空间\n- **数据库**: MongoDB 4.0+\n- **网络**: 支持高并发连接\n\n## 🚀 Quick Start / 快速开始\n\nFor production environments, it's recommended to install MongoDB first and then use the Release package for installation.\n\n如果是生产环境，建议安装了 mongodb 之后，直接使用 Release 包安装。\n\n### 1. Environment Setup / 环境准备\n\n```bash\n# Install Rust toolchain\ncurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\n\n# Install MongoDB (Ubuntu/Debian)\nsudo apt-get install gnupg curl\ncurl -fsSL https://www.mongodb.org/static/pgp/server-8.0.asc | \\\n   sudo gpg -o /usr/share/keyrings/mongodb-server-8.0.gpg \\\n   --dearmor\n\n# Ubuntu 22.04 other versions refer to official documentation\necho \"deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/8.0 multiverse\" | sudo tee /etc/apt/sources.list.d/mongodb-org-8.0.list\n\nsudo apt update\nsudo apt-get install -y mongodb-org\n\n# Start MongoDB\nsudo systemctl start mongod\n```\n\n```bash\n# 安装 Rust 工具链\ncurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\n\n# 安装 MongoDB (Ubuntu/Debian)\nsudo apt-get install gnupg curl\ncurl -fsSL https://www.mongodb.org/static/pgp/server-8.0.asc | \\\n   sudo gpg -o /usr/share/keyrings/mongodb-server-8.0.gpg \\\n   --dearmor\n\n# Ubuntu 22.04 其他版本参考官方文档\necho \"deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/8.0 multiverse\" | sudo tee /etc/apt/sources.list.d/mongodb-org-8.0.list\n\nsudo apt update\nsudo apt-get install -y mongodb-org\n\n# 启动 MongoDB\nsudo systemctl start mongod\n```\n\n### 2. Clone Project / 克隆项目\n\n```bash\ngit clone https://github.com/TFTG-CLOUD/FlowRust\ncd FlowRust\n```\n\n### 3. Configure Environment Variables / 配置环境变量\n\n```bash\n# Edit configuration file\nnano .env\n```\n\nEnvironment variable configuration example:\n\n环境变量配置示例：\n\n```env\n# Database connection\nDATABASE_URL=mongodb://localhost:27017\nDATABASE_NAME=flowrust_cms\n\n# Server configuration\nSERVER_HOST=127.0.0.1\nSERVER_PORT=8080\n\n# Admin account\nADMIN_USER=admin\nADMIN_PASS=your_secure_password\n\n# Session secret key\nSESSION_SECRET_KEY=your_session_secret_key\n```\n\n```env\n# 数据库连接\nDATABASE_URL=mongodb://localhost:27017\nDATABASE_NAME=flowrust_cms\n\n# 服务器配置\nSERVER_HOST=127.0.0.1\nSERVER_PORT=8080\n\n# 管理员账户\nADMIN_USER=admin\nADMIN_PASS=your_secure_password\n\n# 会话密钥\nSESSION_SECRET_KEY=your_session_secret_key\n```\n\n### 4. Build and Run / 编译运行\n\n```bash\n# Run in development mode\ncargo run\n\n# Compile in production mode\ncargo build --release\n\n# Copy production version to root directory\ncp target/release/flowrust_cms ../../\n\n# Run production version\n./flowrust_cms\n```\n\n```bash\n# 开发模式运行\ncargo run\n\n# 生产模式编译\ncargo build --release\n\n# 复制生产版本到根目录\ncp target/release/flowrust_cms ../../\n\n# 运行生产版本\n./flowrust_cms\n```\n\n### 5. Access System / 访问系统\n\n- **Frontend**: http://localhost:8080\n- **Admin Backend**: http://localhost:8080/admin\n- **API Endpoints**: http://localhost:8080/api\n\n- **前台页面**: http://localhost:8080\n- **管理后台**: http://localhost:8080/admin\n- **API 接口**: http://localhost:8080/api\n\n## 🏗️ System Architecture / 系统架构\n\n### Technology Stack / 技术栈\n\n- **Backend Framework**: Actix Web 4.x\n- **Async Runtime**: Tokio 1.x\n- **Database**: MongoDB 8.x\n- **Template Engine**: Tera 1.x\n- **Serialization**: Serde + Serde JSON\n- **Password Encryption**: bcrypt\n- **HTTP Client**: reqwest\n- **Image Processing**: image + webp\n\n- **后端框架**: Actix Web 4.x\n- **异步运行时**: Tokio 1.x\n- **数据库**: MongoDB 8.x\n- **模板引擎**: Tera 1.x\n- **序列化**: Serde + Serde JSON\n- **密码加密**: bcrypt\n- **HTTP 客户端**: reqwest\n- **图片处理**: image + webp\n\n### Project Structure / 项目结构\n\n```\nsrc/\n├── main.rs              # Application entry point\n├── models.rs            # Data models (Vod, Type, Collection, Binding, Config, etc.)\n├── api_handlers.rs      # Frontend API interface handlers\n├── web_handlers.rs      # Web page handlers\n├── admin_handlers.rs    # Admin backend API handlers\n├── collect_handlers.rs  # Collection function handlers\n├── db.rs                # Database connection\n├── auth.rs              # Authentication module\n├── dto.rs               # Data transfer objects\n├── template.rs          # Template rendering\n├── index_manager.rs     # Index management\n├── init_data.rs         # Initial data\n└── site_data.rs         # Site data cache management\n```\n\n```\nsrc/\n├── main.rs              # 应用入口\n├── models.rs            # 数据模型（Vod、Type、Collection、Binding、Config等）\n├── api_handlers.rs      # 前台API接口处理器\n├── web_handlers.rs      # Web页面处理器\n├── admin_handlers.rs    # 管理后台API处理器\n├── collect_handlers.rs  # 采集功能处理器\n├── db.rs                # 数据库连接\n├── auth.rs              # 认证模块\n├── dto.rs               # 数据传输对象\n├── template.rs          # 模板渲染\n├── index_manager.rs     # 索引管理\n├── init_data.rs         # 初始数据\n└── site_data.rs         # 站点数据缓存管理\n```\n\n## 🔧 Core Features / 核心功能\n\n### 1. Video Management / 视频管理\n\n- ✅ Video CRUD operations\n- ✅ Batch operations\n- ✅ Status management (Published/Pending Review/Disabled)\n- ✅ Category management\n- ✅ Advanced search and filtering\n- ✅ Pagination support (20-100 items per page)\n- ✅ Sorting functionality\n\n- ✅ 视频增删改查\n- ✅ 批量操作\n- ✅ 状态管理（已发布/待审核/已禁用）\n- ✅ 分类管理\n- ✅ 高级搜索和筛选\n- ✅ 分页显示（支持每页 20-100 条）\n- ✅ 排序功能\n\n### 2. Category Management / 分类管理\n\n- ✅ Multi-level category support\n- ✅ Category binding\n- ✅ Sorting and status control\n- ✅ Template configuration\n\n- ✅ 多级分类支持\n- ✅ 分类绑定\n- ✅ 排序和状态控制\n- ✅ 模板配置\n\n### 3. Collection System / 采集系统\n\n- ✅ Multi-source collection support\n- ✅ Real-time task monitoring\n- ✅ Batch collection\n- ✅ Image localization\n- ✅ WebP format conversion\n- ✅ Retry mechanism\n- ✅ Progress tracking\n\n- ✅ 多源采集支持\n- ✅ 实时任务监控\n- ✅ 批量采集\n- ✅ 图片本地化\n- ✅ WebP 格式转换\n- ✅ 重试机制\n- ✅ 进度追踪\n\n### 4. Playback Source Management / 播放源管理\n\n- ✅ Multi-playback source support\n- ✅ Playback URL parsing\n- ✅ Source status monitoring\n- ✅ Automatic switching\n\n- ✅ 多播放源支持\n- ✅ 播放地址解析\n- ✅ 源状态监控\n- ✅ 自动切换\n\n### 5. User System / 用户系统\n\n- ✅ Admin login\n- ✅ Session management\n- ✅ Permission control\n- ✅ Security authentication\n\n- ✅ 管理员登录\n- ✅ 会话管理\n- ✅ 权限控制\n- ✅ 安全认证\n\n### 6. System Configuration / 系统配置\n\n- ✅ Website configuration\n- ✅ Collection configuration\n- ✅ Playback configuration\n- ✅ Template configuration\n\n- ✅ 网站配置\n- ✅ 采集配置\n- ✅ 播放配置\n- ✅ 模板配置\n\n## 📊 Performance Comparison / 性能对比\n\n### Benchmark Environment / 基准测试环境\n\n- **Server**: 4-core 8GB RAM VPS\n- **Database**: MongoDB 8.0\n- **Testing Tool**: Apache Bench (ab)\n- **Concurrency**: 1000\n- **Requests**: 10000\n\n- **服务器**: 4 核 8GB 内存 VPS\n- **数据库**: MongoDB 8.0\n- **测试工具**: Apache Bench (ab)\n- **并发数**: 1000\n- **请求数**: 10000\n\n### Performance Metrics / 性能指标\n\nActually, the performance of the FlowRust version is even higher than shown in the chart!\n\n实际上，FlowRust 版本的性能要比图示的更高！\n\n| Metric / 指标                        | Traditional PHP CMS | FlowRust CMS | Improvement / 提升倍数 |\n| ------------------------------------ | ------------------- | ------------ | ---------------------- |\n| Concurrent Processing / 并发处理能力 | ~100 QPS            | ~1200 QPS    | **12x**                |\n| Memory Usage / 内存使用              | ~512MB              | ~128MB       | **4x**                 |\n| Response Time / 响应时间             | ~200ms              | ~15ms        | **13x**                |\n| CPU Usage / CPU 使用率               | ~80%                | ~25%         | **3.2x**               |\n| Database Queries / 数据库查询        | ~50ms               | ~5ms         | **10x**                |\n\n### Performance Optimization Techniques / 性能优化技术\n\n1. **Async I/O**: Non-blocking I/O based on Tokio\n2. **Connection Pool**: MongoDB connection pool optimization\n3. **Memory Management**: Rust zero-cost abstractions\n4. **Index Optimization**: Automatic database index management\n5. **Caching Strategy**: Intelligent caching mechanism\n6. **Concurrency Model**: Actor model concurrent processing\n\n7. **异步 I/O**: 基于 Tokio 的非阻塞 I/O\n8. **连接池**: MongoDB 连接池优化\n9. **内存管理**: Rust 零成本抽象\n10. **索引优化**: 数据库索引自动管理\n11. **缓存策略**: 智能缓存机制\n12. **并发模型**: Actor 模型并发处理\n\n## 🌐 API Endpoints / API 接口\n\n### Admin Backend API / 管理后台 API\n\n```bash\n# Video Management / 视频管理\nGET    /api/admin/vods              # Get video list (supports pagination, filtering, search)\nPOST   /api/admin/vods              # Create video\nPUT    /api/admin/vods/{id}         # Update video\nDELETE /api/admin/vods/{id}         # Delete video\nDELETE /api/admin/vods              # Batch delete videos\n\n# Category Management / 分类管理\nGET    /api/admin/types             # Get category list\nPOST   /api/admin/types             # Create category\nPUT    /api/admin/types/{id}        # Update category\nDELETE /api/admin/types/{id}        # Delete category\n\n# Collection Management / 采集管理\nGET    /api/admin/collections       # Get collection source list\nPOST   /api/admin/collections       # Create collection source\nPUT    /api/admin/collections/{id}  # Update collection source\nDELETE /api/admin/collections/{id}  # Delete collection source\nPOST   /api/admin/collections/{id}/collect  # Start collection\nGET    /api/admin/collections/{id}/binding-status  # Get collection source binding status\n\n# Category Binding Management / 分类绑定管理\nGET    /api/admin/bindings          # Get binding list\nPOST   /api/admin/bindings          # Create/update binding\n\n# Website Configuration Management / 网站配置管理\nGET    /api/admin/configs           # Get configuration list\nPOST   /api/admin/configs           # Create configuration\nPUT    /api/admin/configs/{key}     # Update configuration\nDELETE /api/admin/configs/{key}     # Delete configuration\nGET    /api/admin/configs/{key}      # Get single configuration\n\n# Collection Task Management / 采集任务管理\nGET    /api/admin/collect/progress/{task_id}  # Get collection progress\nGET    /api/admin/running-tasks     # Get running tasks\nPOST   /api/admin/collect/stop/{task_id}     # Stop collection task\n\n# Index Management / 索引管理\nPOST   /api/admin/indexes/create    # Create indexes\nGET    /api/admin/indexes/status    # Index status check\nGET    /api/admin/indexes/list      # List all indexes\n\n# System Statistics / 系统统计\nGET    /api/admin/statistics        # Get system statistics\n\n# 视频管理\nGET    /api/admin/vods              # 获取视频列表（支持分页、筛选、搜索）\nPOST   /api/admin/vods              # 创建视频\nPUT    /api/admin/vods/{id}         # 更新视频\nDELETE /api/admin/vods/{id}         # 删除视频\nDELETE /api/admin/vods              # 批量删除视频\n\n# 分类管理\nGET    /api/admin/types             # 获取分类列表\nPOST   /api/admin/types             # 创建分类\nPUT    /api/admin/types/{id}        # 更新分类\nDELETE /api/admin/types/{id}        # 删除分类\n\n# 采集管理\nGET    /api/admin/collections       # 获取采集源列表\nPOST   /api/admin/collections       # 创建采集源\nPUT    /api/admin/collections/{id}  # 更新采集源\nDELETE /api/admin/collections/{id}  # 删除采集源\nPOST   /api/admin/collections/{id}/collect  # 启动采集\nGET    /api/admin/collections/{id}/binding-status  # 获取采集源绑定状态\n\n# 分类绑定管理\nGET    /api/admin/bindings          # 获取绑定列表\nPOST   /api/admin/bindings          # 创建/更新绑定\n\n# 网站配置管理\nGET    /api/admin/configs           # 获取配置列表\nPOST   /api/admin/configs           # 创建配置\nPUT    /api/admin/configs/{key}     # 更新配置\nDELETE /api/admin/configs/{key}     # 删除配置\nGET    /api/admin/configs/{key}      # 获取单个配置\n\n# 采集任务管理\nGET    /api/admin/collect/progress/{task_id}  # 获取采集进度\nGET    /api/admin/running-tasks     # 获取运行中的任务\nPOST   /api/admin/collect/stop/{task_id}     # 停止采集任务\n\n# 索引管理\nPOST   /api/admin/indexes/create    # 创建索引\nGET    /api/admin/indexes/status    # 索引状态检查\nGET    /api/admin/indexes/list      # 列出所有索引\n\n# 系统统计\nGET    /api/admin/statistics        # 获取系统统计信息\n```\n\n### Frontend API / 前台 API\n\n```bash\n# Video APIs / 视频接口\nGET    /api/provide/vod             # Video data provider interface (MacCMS compatible)\nGET    /api/videos/{type_id}        # Get videos by category\nGET    /api/videos/detail/{vod_id}  # Video details\nGET    /api/categories/hierarchy    # Category hierarchy structure\nGET    /api/filter-options          # Filter options\n\n# Basic APIs / 基础接口\nGET    /vods                        # Get video list (simplified version)\n\n# 视频接口\nGET    /api/provide/vod             # 视频数据提供接口（MacCMS兼容）\nGET    /api/videos/{type_id}        # 按分类获取视频\nGET    /api/videos/detail/{vod_id}  # 视频详情\nGET    /api/categories/hierarchy    # 分类层级结构\nGET    /api/filter-options          # 筛选选项\n\n# 基础接口\nGET    /vods                        # 获取视频列表（简化版）\n```\n\n### Collection API / 采集 API\n\n```bash\n# Collection APIs / 采集接口\nGET    /api/collect/categories      # Get collection source categories\nGET    /api/collect/videos          # Get collection source video list\nPOST   /api/collect/start           # Start collection task\nGET    /api/collect/progress/{task_id}  # Get collection progress\nPOST   /api/collect/stop/{task_id}  # Stop collection task\n\n# 采集接口\nGET    /api/collect/categories      # 获取采集源分类\nGET    /api/collect/videos          # 获取采集源视频列表\nPOST   /api/collect/start           # 开始采集任务\nGET    /api/collect/progress/{task_id}  # 获取采集进度\nPOST   /api/collect/stop/{task_id}  # 停止采集任务\n```\n\n### Pagination Query Example / 分页查询示例\n\n```javascript\n// Get video list (page 2, 20 items per page, category ID 1, status published)\n// 获取视频列表（第2页，每页20条，分类ID为1，状态为已发布）\nfetch(\"/api/admin/vods?page=2\u0026limit=20\u0026type_id=1\u0026status=1\u0026search=关键词\")\n  .then((response) =\u003e response.json())\n  .then((data) =\u003e {\n    console.log(data);\n    // {\n    //   \"code\": 1,\n    //   \"msg\": \"success\",\n    //   \"page\": 2,\n    //   \"limit\": 20,\n    //   \"total\": 100,\n    //   \"videos\": [...]\n    // }\n  });\n```\n\n## 🔧 Deployment Guide / 部署指南\n\n### Release Package Installation (Recommended) / Release 包安装（推荐）\n\nThis is the simplest deployment method, suitable for rapid production deployment.\n\n这是最简单的部署方式，适合生产环境快速部署。\n\n#### 1. Download Release Package / 下载 Release 包\n\n```bash\n# Download the latest Linux binary package\nwget https://github.com/TFTG-CLOUD/FlowRust/releases/latest/download/linux.zip\n\n# Extract to target directory\nsudo mkdir -p /opt/flowrust_cms\nsudo unzip linux.zip -d /opt/flowrust_cms\ncd /opt/flowrust_cms\n```\n\n```bash\n# 下载最新版本的 Linux 二进制包\nwget https://github.com/TFTG-CLOUD/FlowRust/releases/latest/download/linux.zip\n\n# 解压到目标目录\nsudo mkdir -p /opt/flowrust_cms\nsudo unzip linux.zip -d /opt/flowrust_cms\ncd /opt/flowrust_cms\n```\n\n#### 2. Create Configuration File / 创建配置文件\n\n```bash\n# Create environment variable configuration file\nsudo nano .env\n```\n\n```bash\n# 创建环境变量配置文件\nsudo nano .env\n```\n\nConfiguration file content:\n\n配置文件内容：\n\n```env\n# Database connection\nDATABASE_URL=mongodb://localhost:27017\nDATABASE_NAME=flowrust_cms\n\n# Server configuration\nSERVER_HOST=0.0.0.0\nSERVER_PORT=8080\n\n# Admin account\nADMIN_USER=admin\nADMIN_PASS=your_secure_password\n\n# Session secret key (please change to random string)\nSESSION_SECRET_KEY=your_random_session_secret_key_here\n\n# Log level\nRUST_LOG=info\n```\n\n```env\n# 数据库连接\nDATABASE_URL=mongodb://localhost:27017\nDATABASE_NAME=flowrust_cms\n\n# 服务器配置\nSERVER_HOST=0.0.0.0\nSERVER_PORT=8080\n\n# 管理员账户\nADMIN_USER=admin\nADMIN_PASS=your_secure_password\n\n# 会话密钥（请修改为随机字符串）\nSESSION_SECRET_KEY=your_random_session_secret_key_here\n\n# 日志级别\nRUST_LOG=info\n```\n\n#### 3. Set Permissions / 设置权限\n\n```bash\n# Set binary file execution permissions\nsudo chmod +x flowrust_cms\n\n# Create dedicated user (optional, recommended)\nsudo useradd -r -s /bin/false flowrust\nsudo chown -R flowrust:flowrust /opt/flowrust_cms\n```\n\n```bash\n# 设置二进制文件执行权限\nsudo chmod +x flowrust_cms\n\n# 创建专用用户（可选，推荐）\nsudo useradd -r -s /bin/false flowrust\nsudo chown -R flowrust:flowrust /opt/flowrust_cms\n```\n\n#### 4. Startup Methods / 启动方式\n\n**Method 1: Use nohup to run in background / 方式一：使用 nohup 后台运行**\n\n```bash\n# Switch to application directory\ncd /opt/flowrust_cms\n\n# Start in background\nnohup ./flowrust_cms \u003e flowrust.log 2\u003e\u00261 \u0026\n\n# Check process status\nps aux | grep flowrust_cms\n\n# View logs\ntail -f flowrust.log\n```\n\n```bash\n# 切换到应用目录\ncd /opt/flowrust_cms\n\n# 后台启动\nnohup ./flowrust_cms \u003e flowrust.log 2\u003e\u00261 \u0026\n\n# 查看进程状态\nps aux | grep flowrust_cms\n\n# 查看日志\ntail -f flowrust.log\n```\n\n**Method 2: Use systemctl service management (Recommended) / 方式二：使用 systemctl 服务管理（推荐）**\n\nCreate service user (read/write access to flowrust_cms folder only):\n\n创建服务用户（仅支持读写 flowrust_cms 文件夹）：\n\n```bash\nsudo useradd -r -s /bin/false -m -d /opt/flowrust_cms flowrust\nsudo groupadd flowrust\nsudo usermod -aG flowrust flowrust\nsudo chown -R flowrust:flowrust /opt/flowrust_cms\nsudo chmod -R u+rwX /opt/flowrust_cms\nsudo chmod +x /opt/flowrust_cms/flowrust_cms\n```\n\nCreate systemd service file:\n\n创建 systemd 服务文件：\n\n```bash\nsudo nano /etc/systemd/system/flowrust-cms.service\n```\n\nService configuration content:\n\n服务配置内容：\n\n```ini\n[Unit]\nDescription=FlowRust CMS\n\n[Service]\nType=simple\nUser=flowrust\nGroup=flowrust\nWorkingDirectory=/opt/flowrust_cms\nExecStart=/opt/flowrust_cms/flowrust_cms\nRestart=always\nRestartSec=10\nKillMode=mixed\nKillSignal=SIGTERM\n\n# Environment variables\nEnvironment=RUST_LOG=info\n\n# Security settings\nNoNewPrivileges=true\nPrivateTmp=true\nProtectSystem=strict\nReadWritePaths=/opt/flowrust_cms\n\n[Install]\nWantedBy=multi-user.target\n```\n\nStart and manage services:\n\n启动和管理服务：\n\n```bash\n# Reload systemd configuration\nsudo systemctl daemon-reload\n\n# Start service\nsudo systemctl start flowrust-cms\n\n# Enable auto-start on boot\nsudo systemctl enable flowrust-cms\n\n# Check service status\nsudo systemctl status flowrust-cms\n\n# View service logs\nsudo journalctl -u flowrust-cms -f\n\n# Restart service\nsudo systemctl restart flowrust-cms\n\n# Stop service\nsudo systemctl stop flowrust-cms\n```\n\n```bash\n# 重新加载 systemd 配置\nsudo systemctl daemon-reload\n\n# 启动服务\nsudo systemctl start flowrust-cms\n\n# 设置开机自启\nsudo systemctl enable flowrust-cms\n\n# 查看服务状态\nsudo systemctl status flowrust-cms\n\n# 查看服务日志\nsudo journalctl -u flowrust-cms -f\n\n# 重启服务\nsudo systemctl restart flowrust-cms\n\n# 停止服务\nsudo systemctl stop flowrust-cms\n```\n\n#### 5. Verify Deployment / 验证部署\n\n```bash\n# Check if service is running properly\ncurl http://localhost:8080/api/health\n\n# Access admin backend\n# Browser open: http://your-server-ip:8080/admin\n```\n\n```bash\n# 检查服务是否正常运行\ncurl http://localhost:8080/api/health\n\n# 访问管理后台\n# 浏览器打开: http://your-server-ip:8080/admin\n```\n\n#### 6. Firewall Configuration / 防火墙配置\n\n```bash\n# Ubuntu/Debian\nsudo ufw allow 8080\n\n# CentOS/RHEL\nsudo firewall-cmd --permanent --add-port=8080/tcp\nsudo firewall-cmd --reload\n```\n\n#### 7. Install Caddy Reverse Proxy / 安装 caddy 反代\n\n```bash\n# Ubuntu\nsudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl\ncurl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg\ncurl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list\nchmod o+r /usr/share/keyrings/caddy-stable-archive-keyring.gpg\nchmod o+r /etc/apt/sources.list.d/caddy-stable.list\nsudo apt update\nsudo apt install caddy\n```\n\nConfiguration content:\n\n配置内容：\n\n```\ncd /etc/caddy\nvim Caddyfile\n# First resolve domain to server IP at domain registrar\n# 先去域名注册商解析域名到服务器IP\n# Reverse proxy configuration\nhttps://rust-maccms.cc, https://www.rust-maccms.cc {\n    reverse_proxy 127.0.0.1:8080\n}\n# Restart caddy\ncaddy reload\n```\n\nStart Caddy:\n\n启动 caddy：\n\n```bash\nsystemctl start caddy\nsystemctl enable caddy\n```\n\n### Docker Deployment (Recommended) / Docker 部署（推荐）\n\nThis is the simplest deployment method, integrating MongoDB 8 with automatic configuration, suitable for rapid deployment and testing.\n\n这是最简单的部署方式，集成了 MongoDB 8 和自动配置，适合快速部署和测试。\n\n```bash\n# Install Docker\ncurl -sSL https://get.docker.com/ | sh\nsystemctl start docker\nsystemctl enable docker\n\n# Create project folder\nmkdir -p /home/flowrust-cms\n\n# Enter folder, download Dockerfile\ncd /home/flowrust-cms\nwget https://raw.githubusercontent.com/TFTG-CLOUD/FlowRust/refs/heads/main/Dockerfile\nwget https://raw.githubusercontent.com/TFTG-CLOUD/FlowRust/refs/heads/main/entrypoint.sh\n\n# Build Docker image\ndocker build -t flowrust-cms:latest .\n\n# Start container\ndocker run -d \\\n  --name flowrust-cms \\\n  -p 8080:8080 \\\n  -e ADMIN_USER=myuser \\\n  -e ADMIN_PASS=mypassword \\\n  -v ./flowrust_data:/var/lib/mongodb \\\n  -v ./flowrust-cms:/app \\\n  -v ./flowrust_logs:/var/log \\\n  --restart unless-stopped \\\n  flowrust-cms:latest\n\n# Parameter and folder descriptions\nADMIN_USER Set backend username\nADMIN_PASS Set backend password, recommend complexity\n./flowrust_data Database folder, can be backed up manually\n./flowrust-cms Program source code directory\n./flowrust_logs Related runtime logs\n\n# View container status\ndocker ps\n\n# View logs\ndocker logs flowrust-cms\n\n# Stop container\ndocker stop flowrust-cms\n\n# Start container\ndocker start flowrust-cms\n\n# Restart container\ndocker restart flowrust-cms\n\n# Delete container\ndocker rm flowrust-cms\n\n# Enter container\ndocker exec -it flowrust-cms /bin/bash\n```\n\n```bash\n# 安装docker\ncurl -sSL https://get.docker.com/ | sh\nsystemctl start docker\nsystemctl enable docker\n\n# 创建项目文件夹\nmkdir -p /home/flowrust-cms\n\n#进入文件夹，下载Dockerfile\ncd /home/flowrust-cms\nwget https://raw.githubusercontent.com/TFTG-CLOUD/FlowRust/refs/heads/main/Dockerfile\nwget https://raw.githubusercontent.com/TFTG-CLOUD/FlowRust/refs/heads/main/entrypoint.sh\n\n# 构建 Docker 镜像\ndocker build -t flowrust-cms:latest .\n#启动镜像\ndocker run -d \\\n  --name flowrust-cms \\\n  -p 8080:8080 \\\n  -e ADMIN_USER=myuser \\\n  -e ADMIN_PASS=mypassword \\\n  -v ./flowrust_data:/var/lib/mongodb \\\n  -v ./flowrust-cms:/app \\\n  -v ./flowrust_logs:/var/log \\\n  --restart unless-stopped \\\n  flowrust-cms:latest\n\n#相关参数和文件夹说明\nADMIN_USER 设置后台用户名\nADMIN_PASS 设置后台密码，推荐复杂点\n./flowrust_data 数据库文件夹，可自行备份\n./flowrust-cms 程序源码目录\n./flowrust_logs 相关运行日志\n\n# 查看容器状态\ndocker ps\n\n# 查看日志\ndocker logs flowrust-cms\n\n# 停止容器\ndocker stop flowrust-cms\n\n# 启动容器\ndocker start flowrust-cms\n\n# 重启容器\ndocker restart flowrust-cms\n\n# 删除容器\ndocker rm flowrust-cms\n\n# 进入容器\ndocker exec -it flowrust-cms /bin/bash\n```\n\n## 🛠️ Development Guide / 开发指南\n\n### Development Environment Setup / 开发环境设置\n\n```bash\n# Install development dependencies\ncargo install cargo-watch cargo-expand\n\n# Development mode with auto-reload\ncargo watch -x run\n\n# Code formatting\ncargo fmt\n\n# Code linting\ncargo clippy\n\n# Generate documentation\ncargo doc --no-deps\n```\n\n```bash\n# 安装开发依赖\ncargo install cargo-watch cargo-expand\n\n# 开发模式自动重载\ncargo watch -x run\n\n# 代码格式化\ncargo fmt\n\n# 代码检查\ncargo clippy\n\n# 生成文档\ncargo doc --no-deps\n```\n\n### Database Migration / 数据库迁移\n\n```bash\n# Create indexes\ncurl -X POST http://localhost:8080/api/admin/indexes/create\n\n# Check index status\ncurl -X GET http://localhost:8080/api/admin/indexes/status\n```\n\n```bash\n# 创建索引\ncurl -X POST http://localhost:8080/api/admin/indexes/create\n\n# 检查索引状态\ncurl -X GET http://localhost:8080/api/admin/indexes/status\n```\n\n### Testing / 测试\n\n```bash\n# Run all tests\ncargo test\n\n# Run integration tests\ncargo test --test integration_tests\n```\n\n```bash\n# 运行所有测试\ncargo test\n\n# 运行集成测试\ncargo test --test integration_tests\n```\n\n## 🔍 Monitoring and Logging / 监控和日志\n\n### Performance Monitoring / 性能监控\n\nThe system has built-in real-time monitoring capabilities:\n\n系统内置了实时监控功能：\n\n- **Task Progress**: Real-time display of collection task progress\n- **System Statistics**: Database statistics, user statistics\n- **Error Logs**: Detailed error information and stack traces\n- **Performance Metrics**: Response time, concurrency, memory usage\n\n- **任务进度**: 实时显示采集任务进度\n- **系统统计**: 数据库统计、用户统计\n- **错误日志**: 详细的错误信息和堆栈跟踪\n- **性能指标**: 响应时间、并发数、内存使用\n\n### Log Configuration / 日志配置\n\n```rust\n// Set log level\nRUST_LOG=info cargo run\n\n// Output to file\nRUST_LOG=info cargo run \u003e maccms.log 2\u003e\u00261\n```\n\n```rust\n// 设置日志级别\nRUST_LOG=info cargo run\n\n// 输出到文件\nRUST_LOG=info cargo run \u003e maccms.log 2\u003e\u00261\n```\n\n## 🤝 Contribution Guide / 贡献指南\n\n1. Fork the project\n2. Create a feature branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the branch (`git push origin feature/AmazingFeature`)\n5. Create a Pull Request\n\n6. Fork 项目\n7. 创建功能分支 (`git checkout -b feature/AmazingFeature`)\n8. 提交更改 (`git commit -m 'Add some AmazingFeature'`)\n9. 推送到分支 (`git push origin feature/AmazingFeature`)\n10. 创建 Pull Request\n\n## 📄 License / 许可证\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n本项目采用 MIT 许可证 - 查看 [LICENSE](LICENSE) 文件了解详情。\n\n## 🆘 Technical Support / 技术支持\n\nIf you encounter issues during use, please:\n\n如果您在使用过程中遇到问题，请：\n\n1. Check the FAQ section in this documentation\n2. Search existing Issues\n3. Create a new Issue describing the problem\n4. Contact the technical support team\n\n5. 查看本文档的常见问题部分\n6. 搜索已有的 Issues\n7. 创建新的 Issue 描述问题\n8. 联系技术支持团队\n\n## 🔄 Upgrade Guide / 升级指南\n\n### Migration from Traditional PHP CMS / 从传统 PHP CMS 迁移\n\n1. **Data Migration**: Use the collection API provided by Mac CMS directly for data migration\n\n1. **数据迁移**: 直接使用苹果 CMS 提供的采集 API 进行数据迁移\n\n### Version Upgrade / 版本升级\n\n```bash\n# Backup database\nmongodump --db flowrust_cms --out backup/\n\n# Update code\ngit pull origin main\n\n# Rebuild\ncargo build --release\n\n# Restart service\nsudo systemctl restart flowrust-cms\n```\n\n```bash\n# 备份数据库\nmongodump --db flowrust_cms --out backup/\n\n# 更新代码\ngit pull origin main\n\n# 重新编译\ncargo build --release\n\n# 重启服务\nsudo systemctl restart flowrust-cms\n```\n\n## 📈 Future Plans / 未来规划\n\n- [ ] Video transcoding service\n- [ ] CDN integration\n- [ ] Multi-language support\n- [ ] Mobile API\n- [ ] Plugin system\n- [ ] Microservices architecture\n- [ ] Containerized deployment\n- [ ] Load balancing\n\n- [ ] 视频转码服务\n- [ ] CDN 集成\n- [ ] 多语言支持\n- [ ] 移动端 API\n- [ ] 插件系统\n- [ ] 微服务架构\n- [ ] 容器化部署\n- [ ] 负载均衡\n\n---\n\n**FlowRust CMS** - A high-performance video content management system built for modern web\n\n**FlowRust CMS** - 为现代 Web 而生的高性能视频内容管理系统\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftftg-cloud%2Fflowrust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftftg-cloud%2Fflowrust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftftg-cloud%2Fflowrust/lists"}