Skip to content

Commit 032a52a

Browse files
CopilotSilianZ
andcommitted
Restructure and enhance documentation with detailed setup and configuration guides
Co-authored-by: SilianZ <113701655+SilianZ@users.noreply.github.com>
1 parent 5f0afb5 commit 032a52a

2 files changed

Lines changed: 393 additions & 21 deletions

File tree

README.md

Lines changed: 193 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,210 @@
3535

3636
</div>
3737

38-
# 简介
38+
## 目录
39+
40+
- [简介](#简介)
41+
- [核心特性](#核心特性)
42+
- [快速开始](#快速开始)
43+
- [前置要求](#前置要求)
44+
- [安装步骤](#安装步骤)
45+
- [Docker 部署](#docker-部署)
46+
- [配置说明](#配置说明)
47+
- [基础配置](#基础配置)
48+
- [存储配置](#存储配置)
49+
- [贡献](#贡献)
50+
- [鸣谢](#鸣谢)
51+
52+
## 简介
3953

4054
本项目是 [OpenBMCLAPI](https://github.com/bangbang93/openbmclapi) 的 Python 版本,OpenBMCLAPI 是通过分布式集群帮助 [BMCLAPI](https://bmclapidoc.bangbang93.com/) 进行文件分发、加速中国大陆 Minecraft 下载的公益项目。
4155

4256
如果你想加入 OpenBMCLAPI,可以寻找 [bangbang93](https://github.com/bangbang93) 获取 `CLUSTER_ID``CLUSTER_SECRET`
4357

44-
# 贡献
58+
## 核心特性
59+
60+
### 🎯 多存储后端支持
61+
62+
- **本地存储** - 传统的本地文件系统存储
63+
- **AList** - 支持通过 AList 进行文件管理和分发
64+
- **S3 兼容存储** - 支持 AWS S3、MinIO、阿里云 OSS 等 S3 兼容的对象存储服务
65+
66+
### 📊 实时监控仪表盘
67+
68+
- 实时性能监控(CPU、内存、连接数)
69+
- 多维度请求统计(小时/天/月)
70+
- 用户分布可视化
71+
- 响应式设计,支持移动设备访问
72+
73+
### 🚀 高性能架构
74+
75+
- 异步 I/O 处理,提高并发性能
76+
- 智能文件同步机制
77+
- 自动回收过期文件
78+
- 支持断点续传
79+
80+
### 🌍 国际化支持
81+
82+
- 多语言界面支持
83+
- 通过 Crowdin 协作翻译
84+
85+
## 快速开始
86+
87+
### 前置要求
88+
89+
- Python 3.12 或更高版本
90+
- pip 包管理器
91+
- (可选)Docker 和 Docker Compose
92+
93+
### 安装步骤
94+
95+
1. **克隆仓库**
96+
97+
```bash
98+
git clone https://github.com/TTB-Network/python-openbmclapi-v2.git
99+
cd python-openbmclapi-v2
100+
```
101+
102+
2. **安装依赖**
103+
104+
```bash
105+
pip install -r requirements.txt
106+
# 或使用 Poetry
107+
poetry install
108+
```
109+
110+
3. **配置应用**
111+
112+
编辑 `config/config.yml` 文件,填入你的集群配置:
113+
114+
```yaml
115+
cluster:
116+
id: "你的集群ID"
117+
secret: "你的集群密钥"
118+
host: "你的域名或IP"
119+
port: 8800
120+
```
121+
122+
4. **启动应用**
123+
124+
```bash
125+
python main.py
126+
```
127+
128+
### Docker 部署
129+
130+
使用 Docker 是最简单的部署方式:
131+
132+
```bash
133+
docker run -d \
134+
--name python-openbmclapi \
135+
-p 8800:8800 \
136+
-v /path/to/cache:/app/cache \
137+
-v /path/to/config:/app/config \
138+
silianz/python-openbmclapi-v2:latest
139+
```
140+
141+
或使用 Docker Compose:
142+
143+
```yaml
144+
version: '3'
145+
services:
146+
openbmclapi:
147+
image: silianz/python-openbmclapi-v2:latest
148+
ports:
149+
- "8800:8800"
150+
volumes:
151+
- ./cache:/app/cache
152+
- ./config:/app/config
153+
restart: unless-stopped
154+
```
155+
156+
## 配置说明
157+
158+
### 基础配置
159+
160+
配置文件位于 `config/config.yml`:
161+
162+
```yaml
163+
cluster:
164+
base_url: "https://openbmclapi.bangbang93.com" # 主控地址
165+
id: "" # 集群 ID
166+
secret: "" # 集群密钥
167+
host: "" # 公网访问地址
168+
byoc: false # 是否使用自己的证书
169+
public_port: -1 # 公网端口(-1 表示使用 port)
170+
port: 8800 # 监听端口
171+
172+
advanced:
173+
lang: "zh_cn" # 语言设置
174+
debug: false # 调试模式
175+
retry: 5 # 重试次数
176+
delay: 15 # 重试延迟(秒)
177+
keep_alive: 60 # 保活间隔(秒)
178+
sync_interval: 120 # 同步间隔(秒)
179+
```
180+
181+
### 存储配置
182+
183+
支持配置多个存储后端,系统会依次尝试从各存储读取文件:
184+
185+
#### 本地存储
186+
187+
```yaml
188+
storages:
189+
- type: "local"
190+
path: "./cache"
191+
```
192+
193+
#### AList 存储
194+
195+
```yaml
196+
storages:
197+
- type: "alist"
198+
url: "http://your-alist-server.com"
199+
username: "admin"
200+
password: "password"
201+
path: "/openbmclapi/"
202+
```
203+
204+
#### S3 兼容存储
205+
206+
```yaml
207+
storages:
208+
- type: "s3"
209+
endpoint: "https://s3.amazonaws.com" # S3 端点地址
210+
access_key_id: "your-access-key" # 访问密钥 ID
211+
secret_access_key: "your-secret-key" # 访问密钥
212+
bucket: "your-bucket-name" # 存储桶名称
213+
signature_version: "s3v4" # 签名版本(可选)
214+
addressing_style: "auto" # 寻址样式:auto/path/virtual(可选)
215+
session_token: null # 会话令牌(可选)
216+
```
217+
218+
**S3 配置说明:**
219+
220+
- `endpoint`: S3 服务端点
221+
- AWS S3: `https://s3.amazonaws.com` 或区域端点如 `https://s3.us-west-2.amazonaws.com`
222+
- MinIO: `http://your-minio-server:9000`
223+
- 阿里云 OSS: `https://oss-cn-hangzhou.aliyuncs.com`
224+
- `signature_version`: 签名版本,通常使用 `s3v4`
225+
- `addressing_style`:
226+
- `auto`: 自动选择
227+
- `path`: 路径样式(`endpoint/bucket/key`)
228+
- `virtual`: 虚拟主机样式(`bucket.endpoint/key`)
229+
230+
## 贡献
45231

46232
如果你有能力,你可以向我们的仓库提交 Pull Request 或 Issue。
47233

48234
如果你想帮助我们进行多语言翻译,请前往 [Crowdin](https://translate.bugungu.top)。
49235

50236
在贡献之前,请先阅读我们的[贡献准则](./CONTRIBUTING.md)。
51237

52-
# 鸣谢
53-
54-
[LiterMC/go-openbmclapi](https://github.com/LiterMC/go-openbmclapi)
238+
## 鸣谢
55239

56-
[bangbang93/openbmclapi](https://github.com/bangbang93/openbmclapi)
240+
感谢以下项目为本项目提供的灵感和参考:
57241

58-
[SALTWOOD/CSharp-OpenBMCLAPI](https://github.com/SALTWOOD/CSharp-OpenBMCLAPI)
242+
- [LiterMC/go-openbmclapi](https://github.com/LiterMC/go-openbmclapi)
243+
- [bangbang93/openbmclapi](https://github.com/bangbang93/openbmclapi)
244+
- [SALTWOOD/CSharp-OpenBMCLAPI](https://github.com/SALTWOOD/CSharp-OpenBMCLAPI)

0 commit comments

Comments
 (0)