Skip to content

Commit 2f5cc24

Browse files
committed
chore: 添加一些依赖项
1 parent bfb2e22 commit 2f5cc24

File tree

6 files changed

+318
-0
lines changed

6 files changed

+318
-0
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
open_collective: python-openbmclapi

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: "🐛 报告漏洞"
2+
description: 上报在使用 python-openbmclapi 时遇到的那些恼人的漏洞。
3+
labels: ["改进", "漏洞"]
4+
assignees: tianxiu2b2t, SilianZ
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
你是一位 python-openbmclapi 的长期使用者。在一个阳光明媚的早晨 ☀️,你打开了 OpenBMCLAPI 仪表盘,你发现你的一个正在使用 python-openbmclapi 的节点的信用值掉到了 -1800,一怒之下,你打开 GitHub 来到了本仓库,来提交这个问候 python-openbmclapi 的那些开发者全家人的友好 Issue。
10+
- type: checkboxes
11+
attributes:
12+
label: 在开始之前……
13+
description: 请确认你已做好以下准备。
14+
options:
15+
- label: 我已在 [Issue](https://github.com/TTB-Network/python-openbmclapi/issues) 中搜索过我的要上报的漏洞,确定没有人提出过此漏洞。
16+
required: true
17+
- label: 我是用的是最新的 [Release 版本](https://github.com/TTB-Network/python-openbmclapi/releases/latest)而不是最新的 [master 分支](https://github.com/TTB-Network/python-openbmclapi/tree/master)。
18+
required: true
19+
- type: textarea
20+
attributes:
21+
label: 问题描述
22+
description: 对遇到的漏洞进行清晰的描述。
23+
placeholder: 我的 trust 被你们干到了 -1800。
24+
validations:
25+
required: true
26+
- type: textarea
27+
attributes:
28+
label: 问题重现
29+
description: 重现问题的步骤。
30+
placeholder: |
31+
1. 我打开了程序。
32+
2. 程序开始疯狂报错。
33+
- type: textarea
34+
attributes:
35+
label: 运行环境
36+
description: 向我们提供你运行时的环境有助于更快地解决问题。
37+
placeholder: |
38+
Python 版本:3.12.3。
39+
运行系统:Windows 10。
40+
分片大小:30G。
41+
- type: dropdown
42+
attributes:
43+
label: 节点类型
44+
options:
45+
- 全量
46+
- 分片
47+
default: 0
48+
- type: textarea
49+
attributes:
50+
label: 运行日志或截图
51+
description: |
52+
“在没有错误日志的情况下诊断任何问题无异于闭眼开车。” —— Apache 文档《Getting Started》
53+
placeholder: |
54+
你可以上传错误日志文件,亦可以在这里粘贴你的错误日志信息。
55+
render: shell
56+
- type: textarea
57+
attributes:
58+
label: 备注
59+
description: 任何其他的内容。
60+
- type: checkboxes
61+
attributes:
62+
label: 如果……
63+
options:
64+
- label: 如果可以的话,我可以帮助或自行修复这个漏洞。
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: "✨ 功能请求"
2+
description: 为 python-openbmclapi 提出新的功能。
3+
labels: ["改进"]
4+
assignees: SilianZ, tianxiu2b2t, unify-z
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
你是一位 python-openbmclapi 的使用者,但是有些功能的缺失使你困扰,你打算提交一个功能请求。
10+
11+
- type: checkboxes
12+
attributes:
13+
label: 在开始之前……
14+
description: 请确认你已做好以下准备。
15+
options:
16+
- label: 我已在 [Issue](https://github.com/TTB-Network/python-openbmclapi/issues) 中搜索过我的建议,确定没有人提出过此建议。
17+
required: true
18+
- type: textarea
19+
attributes:
20+
label: 建议描述
21+
description: 请描述你的建议。
22+
placeholder: 使用 QQ 远程控制 python-openbmclapi 的行为。
23+
validations:
24+
required: true
25+
- type: textarea
26+
attributes:
27+
label: 实现方法
28+
description: 你认为可以实现的方法。
29+
placeholder: 使用 aiohttp 对接 nonebot。
30+
- type: textarea
31+
attributes:
32+
label: 备注
33+
description: 任何其他的内容。
34+
- type: checkboxes
35+
attributes:
36+
label: 如果……
37+
options:
38+
- label: 如果可以的话,我可以帮助或自行实现这个功能。
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
2+
name: Create tagged release
3+
4+
on:
5+
push:
6+
tags:
7+
- v*
8+
9+
jobs:
10+
release:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
- name: Set env
17+
run: |
18+
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
19+
- uses: actions/setup-node@v3
20+
with:
21+
node-version: 16.x
22+
- name: Create release
23+
run: npx changelogithub-chinese
24+
env:
25+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
26+
build:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v4
30+
- name: Set env
31+
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
32+
- name: Set up Docker Buildx
33+
uses: docker/setup-buildx-action@v3
34+
- name: Login to Docker Hub
35+
uses: docker/login-action@v3
36+
with:
37+
username: ${{secrets.HUB_USERNAME}}
38+
password: ${{secrets.HUB_PASSWORD}}
39+
- name: Build and push
40+
uses: docker/build-push-action@v5
41+
with:
42+
context: .
43+
push: true
44+
tags: |
45+
atianxiua/python-openbmclapi:latest
46+
atianxiua/python-openbmclapi:${{env.RELEASE_VERSION}}
47+
platforms: linux/amd64, linux/arm64

LICNESE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 TTB-Network
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
<div align="center">
2+
3+
# OpenBMCLAPI for Python v4
4+
5+
Python-OpenBMCLAPI v4 的发布!
6+
7+
简体中文 | [English](/i18n/README_en.md)
8+
9+
![GitHub Issues or Pull Requests](https://img.shields.io/github/issues-pr/TTB-Network/python-openbmclapi)
10+
![GitHub Issues or Pull Requests](https://img.shields.io/github/issues/TTB-Network/python-openbmclapi)
11+
![GitHub License](https://img.shields.io/github/license/TTB-Network/python-openbmclapi)
12+
![GitHub Release](https://img.shields.io/github/v/release/TTB-Network/python-openbmclapi)
13+
![GitHub Tag](https://img.shields.io/github/v/tag/TTB-Network/python-openbmclapi)
14+
![Docker Pulls](https://img.shields.io/docker/pulls/silianz/python-openbmclapi)
15+
[![Crowdin](https://badges.crowdin.net/python-openbmclapi-site/localized.svg)](https://crowdin.com/project/python-openbmclapi-site)
16+
![GitHub Repo stars](https://img.shields.io/github/stars/TTB-Network/python-openbmclapi)
17+
[![CodeQL](https://github.com/TTB-Network/python-openbmclapi/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/TTB-Network/python-openbmclapi/actions/workflows/github-code-scanning/codeql)
18+
[![Create tagged release](https://github.com/TTB-Network/python-openbmclapi/actions/workflows/build_and_publish.yml/badge.svg)](https://github.com/TTB-Network/python-openbmclapi/actions/workflows/build_and_publish.yml)
19+
20+
[赞助](https://afdian.net/a/atianxiua)
21+
22+
✨ 基于 [OpenBMCLAPI](https://github.com/bangbang93/openbmclapi) 的 Python 实现。
23+
24+
🎨 **跨系统****跨架构**。这得益于 Python 强大的语言功能。
25+
26+
**Docker** 支持。通过 Docker 更加**快捷地**部署 python-openbmclapi ~~(更支持一键跑路)~~
27+
28+
</div>
29+
30+
# 简介
31+
32+
本项目是 [OpenBMCLAPI](https://github.com/bangbang93/openbmclapi) 的 Python 版本,OpenBMCLAPI 是通过分布式集群帮助 [BMCLAPI](https://bmclapidoc.bangbang93.com/) 进行文件分发、加速中国大陆 Minecraft 下载的公益项目。
33+
34+
如果你想加入 OpenBMCLAPI,可以寻找 [bangbang93](https://github.com/bangbang93) 获取 `CLUSTER_ID``CLUSTER_SECRET`
35+
36+
# 贡献
37+
38+
如果你有能力,你可以向我们的仓库提交 Pull Request 或 Issue。
39+
40+
如果你想帮助我们进行多语言翻译,请前往 [Crowdin](https://translate.bugungu.top)
41+
42+
在贡献之前,请先阅读我们的[贡献准则](./CONTRIBUTING.md)
43+
44+
# 鸣谢
45+
46+
[LiterMC/go-openbmclapi](https://github.com/LiterMC/go-openbmclapi)
47+
48+
[bangbang93/openbmclapi](https://github.com/bangbang93/openbmclapi)
49+
50+
[SALTWOOD/CSharp-OpenBMCLAPI](https://github.com/SALTWOOD/CSharp-OpenBMCLAPI)
51+
52+
# 快速开始
53+
54+
1. 安装依赖
55+
56+
```bash
57+
pip install -r requirements.txt
58+
```
59+
60+
2. 首次运行脚本生成配置文件
61+
```yaml
62+
advanced:
63+
access_log: false
64+
debug: false
65+
host: ''
66+
locale: zh_cn
67+
cert:
68+
cert: null
69+
dir: .ssl
70+
key: null
71+
web:
72+
port: 6543
73+
proxy: false
74+
public_port: 6543
75+
```
76+
77+
3. 修改配置文件(例子)
78+
```yaml
79+
advanced:
80+
access_log: false
81+
debug: false
82+
host: ''
83+
locale: zh_cn
84+
cert:
85+
cert: null
86+
dir: .ssl
87+
key: null
88+
web:
89+
port: 6543
90+
proxy: false
91+
public_port: 6543
92+
clusters:
93+
- id: # 670...
94+
secret: # <你的节点密钥>
95+
# 需要增加多个节点如下
96+
# - id: # 670...
97+
# secret: # <你的节点密钥>
98+
storages:
99+
# local
100+
- name: bmclapi # 存储名字
101+
type: local
102+
path: /bmclapi
103+
weight: 1
104+
# alist
105+
- name: alist
106+
type: alist
107+
path: /path/to/your/alist
108+
endpoint: http://127.0.0.1:5244
109+
username: admin
110+
password: password
111+
weight: 1
112+
# alist 下的 WebDav
113+
- name: alist-webdav
114+
type: webdav
115+
path: /path/to/your/alist
116+
endpoint: http://127.0.0.1:5244/dav
117+
username: admin
118+
password: password
119+
weight: 1
120+
# s3
121+
- name: s3
122+
type: s3
123+
path: /path/to/your/s3
124+
endpoint: https://s3.amazonaws.com
125+
access_key: <你的access_key>
126+
secret_key: <你的secret_key>
127+
bucket: <你的bucket>
128+
weight: 1
129+
# 可选
130+
# 例子
131+
# custom_s3_host: bmclapi-files.ttb-network.top
132+
# public_endpoint: https://s3.ttb-network.top
133+
```
134+
135+
4. 开始 for Windows
136+
```bash
137+
python main.py
138+
```
139+
140+
4. 开始 for Docker
141+
```bash
142+
docker run -d --restart=always -p 6543:6543 -v /path/to/your/config.yaml:/app/config.yaml -v /path/to/your/bmclapi:/app/bmclapi --name python-openbmclapi atianxiua/python-openbmclapi:latest
143+
```
144+
145+
# TODO
146+
- [ ] 文档
147+
- [ ] 面板

0 commit comments

Comments
 (0)