feat: add more

This commit is contained in:
Sun-ZhenXing
2025-10-06 21:48:39 +08:00
parent f330e00fa0
commit 3c609b5989
120 changed files with 7698 additions and 59 deletions

89
src/kodbox/README.md Normal file
View File

@@ -0,0 +1,89 @@
# Kodbox
[English](./README.md) | [中文](./README.zh.md)
This service deploys Kodbox, a powerful web-based file manager and cloud storage platform with Windows-like user experience.
## Services
- `kodbox`: The main Kodbox application server.
- `kodbox-db`: MySQL database for Kodbox.
- `kodbox-redis`: Redis for caching and session management.
## Environment Variables
| Variable Name | Description | Default Value |
| ------------------- | ------------------------------------------ | ------------------ |
| KODBOX_VERSION | Kodbox image version | `1.62` |
| KODBOX_PORT | Host port mapping for Kodbox web interface | `80` |
| MYSQL_VERSION | MySQL image version | `9.4.0` |
| MYSQL_HOST | MySQL host | `kodbox-db` |
| MYSQL_PORT | MySQL port | `3306` |
| MYSQL_DATABASE | MySQL database name | `kodbox` |
| MYSQL_USER | MySQL username | `kodbox` |
| MYSQL_PASSWORD | MySQL password | `kodbox123` |
| MYSQL_ROOT_PASSWORD | MySQL root password | `root123` |
| REDIS_VERSION | Redis image version | `8.2.1-alpine3.22` |
| REDIS_HOST | Redis host | `kodbox-redis` |
| REDIS_PORT | Redis port | `6379` |
| REDIS_PASSWORD | Redis password (leave empty for no auth) | `""` |
Please create a `.env` file and modify it as needed for your use case.
## Volumes
- `kodbox_data`: A volume for storing Kodbox application and user files.
- `kodbox_db_data`: A volume for storing MySQL data.
- `kodbox_redis_data`: A volume for storing Redis data.
## Getting Started
1. (Optional) Create a `.env` file to customize settings:
```env
KODBOX_PORT=8080
MYSQL_PASSWORD=your-secure-password
MYSQL_ROOT_PASSWORD=your-secure-root-password
```
2. Start the services:
```bash
docker compose up -d
```
3. Access Kodbox at `http://localhost` (or your configured port)
4. Follow the installation wizard on first access
## Initial Setup
On first access, the installation wizard will guide you through:
- Database configuration (automatically filled from environment variables)
- Admin account creation
- Basic settings configuration
**Note**: If you change database credentials in `.env`, make sure to update them during the installation wizard as well.
## Features
- **Windows-like Interface**: Familiar desktop experience in web browser
- **Multi-cloud Support**: Connect to local disk, FTP, WebDAV, and various cloud storage services
- **File Management**: Full-featured file operations with drag-and-drop support
- **Online Preview**: Preview 100+ file formats including Office, PDF, images, videos
- **Online Editing**: Built-in text editor with syntax highlighting for 120+ languages
- **Team Collaboration**: Fine-grained permission control and file sharing
- **Plugin System**: Extend functionality with plugins
## Documentation
For more information, visit the [official Kodbox documentation](https://doc.kodcloud.com/).
## Security Notes
- Change all default passwords in production
- Use HTTPS in production environments
- Regularly backup all data volumes
- Keep Kodbox, MySQL, and Redis updated to the latest stable versions
- Consider setting a Redis password in production environments

88
src/kodbox/README.zh.md Normal file
View File

@@ -0,0 +1,88 @@
# Kodbox
[English](./README.md) | [中文](./README.zh.md)
此服务部署 Kodbox,一个功能强大的 Web 文件管理器和云存储平台,具有类似 Windows 的用户体验。
## 服务
- `kodbox`: Kodbox 主应用服务器。
- `kodbox-db`: Kodbox 的 MySQL 数据库。
- `kodbox-redis`: 用于缓存和会话管理的 Redis。
## 环境变量
| 变量名 | 描述 | 默认值 |
| ------------------- | ------------------------------ | ------------------ |
| KODBOX_VERSION | Kodbox 镜像版本 | `1.62` |
| KODBOX_PORT | Kodbox Web 界面的主机端口映射 | `80` |
| MYSQL_VERSION | MySQL 镜像版本 | `9.4.0` |
| MYSQL_HOST | MySQL 主机 | `kodbox-db` |
| MYSQL_PORT | MySQL 端口 | `3306` |
| MYSQL_DATABASE | MySQL 数据库名 | `kodbox` |
| MYSQL_USER | MySQL 用户名 | `kodbox` |
| MYSQL_PASSWORD | MySQL 密码 | `kodbox123` |
| MYSQL_ROOT_PASSWORD | MySQL root 密码 | `root123` |
| REDIS_VERSION | Redis 镜像版本 | `8.2.1-alpine3.22` |
| REDIS_HOST | Redis 主机 | `kodbox-redis` |
| REDIS_PORT | Redis 端口 | `6379` |
| REDIS_PASSWORD | Redis 密码(留空表示不需要认证) | `""` |
请创建 `.env` 文件并根据需要进行修改。
## 数据卷
- `kodbox_data`: 用于存储 Kodbox 应用和用户文件的卷。
- `kodbox_db_data`: 用于存储 MySQL 数据的卷。
- `kodbox_redis_data`: 用于存储 Redis 数据的卷。
## 快速开始
1. (可选)创建 `.env` 文件以自定义设置:
```env
KODBOX_PORT=8080
MYSQL_PASSWORD=your-secure-password
MYSQL_ROOT_PASSWORD=your-secure-root-password
```
2. 启动服务:
```bash
docker compose up -d
```
3. 访问 `http://localhost`(或您配置的端口)
4. 首次访问时按照安装向导操作
## 初始设置
首次访问时,安装向导将引导您完成:
- 数据库配置(从环境变量自动填充)
- 创建管理员账户
- 基本设置配置
**注意**: 如果您在 `.env` 中更改了数据库凭据,请确保在安装向导中也进行相应更新。
## 功能特性
- **类 Windows 界面**: 在 Web 浏览器中提供熟悉的桌面体验
- **多云支持**: 连接本地磁盘、FTP、WebDAV 和各种云存储服务
- **文件管理**: 支持拖放的全功能文件操作
- **在线预览**: 预览 100+ 种文件格式,包括 Office、PDF、图片、视频
- **在线编辑**: 内置文本编辑器,支持 120+ 种语言的语法高亮
- **团队协作**: 细粒度权限控制和文件共享
- **插件系统**: 通过插件扩展功能
## 文档
更多信息请访问 [Kodbox 官方文档](https://doc.kodcloud.com/)。
## 安全提示
- 在生产环境中更改所有默认密码
- 在生产环境中使用 HTTPS
- 定期备份所有数据卷
- 保持 Kodbox、MySQL 和 Redis 更新到最新稳定版本
- 在生产环境中考虑为 Redis 设置密码

View File

@@ -0,0 +1,101 @@
x-default: &default
restart: unless-stopped
volumes:
- &localtime /etc/localtime:/etc/localtime:ro
- &timezone /etc/timezone:/etc/timezone:ro
logging:
driver: json-file
options:
max-size: 100m
services:
kodbox:
<<: *default
image: kodcloud/kodbox:${KODBOX_VERSION:-1.62}
container_name: kodbox
ports:
- "${KODBOX_PORT:-80}:80"
volumes:
- kodbox_data:/var/www/html
environment:
- MYSQL_HOST=${MYSQL_HOST:-kodbox-db}
- MYSQL_PORT=${MYSQL_PORT:-3306}
- MYSQL_DATABASE=${MYSQL_DATABASE:-kodbox}
- MYSQL_USER=${MYSQL_USER:-kodbox}
- MYSQL_PASSWORD=${MYSQL_PASSWORD:-kodbox123}
- REDIS_HOST=${REDIS_HOST:-kodbox-redis}
- REDIS_PORT=${REDIS_PORT:-6379}
- REDIS_PASSWORD=${REDIS_PASSWORD:-}
depends_on:
kodbox-db:
condition: service_healthy
kodbox-redis:
condition: service_healthy
deploy:
resources:
limits:
cpus: '2.0'
memory: 2G
reservations:
cpus: '0.5'
memory: 256M
kodbox-db:
<<: *default
image: mysql:${MYSQL_VERSION:-9.4.0}
container_name: kodbox-db
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-root123}
- MYSQL_DATABASE=${MYSQL_DATABASE:-kodbox}
- MYSQL_USER=${MYSQL_USER:-kodbox}
- MYSQL_PASSWORD=${MYSQL_PASSWORD:-kodbox123}
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci
- --default-authentication-plugin=mysql_native_password
volumes:
- kodbox_db_data:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${MYSQL_ROOT_PASSWORD:-root123}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
deploy:
resources:
limits:
cpus: '1.0'
memory: 1G
reservations:
cpus: '0.25'
memory: 256M
kodbox-redis:
<<: *default
image: redis:${REDIS_VERSION:-8.2.1-alpine3.22}
container_name: kodbox-redis
command:
- redis-server
- --requirepass
- ${REDIS_PASSWORD:-}
volumes:
- kodbox_redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
start_period: 10s
deploy:
resources:
limits:
cpus: '0.50'
memory: 512M
reservations:
cpus: '0.25'
memory: 128M
volumes:
kodbox_data:
kodbox_db_data:
kodbox_redis_data: