-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bfb2e22
commit 2f5cc24
Showing
6 changed files
with
318 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
open_collective: python-openbmclapi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: "🐛 报告漏洞" | ||
description: 上报在使用 python-openbmclapi 时遇到的那些恼人的漏洞。 | ||
labels: ["改进", "漏洞"] | ||
assignees: tianxiu2b2t, SilianZ | ||
body: | ||
- type: markdown | ||
attributes: | ||
value: | | ||
你是一位 python-openbmclapi 的长期使用者。在一个阳光明媚的早晨 ☀️,你打开了 OpenBMCLAPI 仪表盘,你发现你的一个正在使用 python-openbmclapi 的节点的信用值掉到了 -1800,一怒之下,你打开 GitHub 来到了本仓库,来提交这个问候 python-openbmclapi 的那些开发者全家人的友好 Issue。 | ||
- type: checkboxes | ||
attributes: | ||
label: 在开始之前…… | ||
description: 请确认你已做好以下准备。 | ||
options: | ||
- label: 我已在 [Issue](https://github.com/TTB-Network/python-openbmclapi/issues) 中搜索过我的要上报的漏洞,确定没有人提出过此漏洞。 | ||
required: true | ||
- label: 我是用的是最新的 [Release 版本](https://github.com/TTB-Network/python-openbmclapi/releases/latest)而不是最新的 [master 分支](https://github.com/TTB-Network/python-openbmclapi/tree/master)。 | ||
required: true | ||
- type: textarea | ||
attributes: | ||
label: 问题描述 | ||
description: 对遇到的漏洞进行清晰的描述。 | ||
placeholder: 我的 trust 被你们干到了 -1800。 | ||
validations: | ||
required: true | ||
- type: textarea | ||
attributes: | ||
label: 问题重现 | ||
description: 重现问题的步骤。 | ||
placeholder: | | ||
1. 我打开了程序。 | ||
2. 程序开始疯狂报错。 | ||
- type: textarea | ||
attributes: | ||
label: 运行环境 | ||
description: 向我们提供你运行时的环境有助于更快地解决问题。 | ||
placeholder: | | ||
Python 版本:3.12.3。 | ||
运行系统:Windows 10。 | ||
分片大小:30G。 | ||
- type: dropdown | ||
attributes: | ||
label: 节点类型 | ||
options: | ||
- 全量 | ||
- 分片 | ||
default: 0 | ||
- type: textarea | ||
attributes: | ||
label: 运行日志或截图 | ||
description: | | ||
“在没有错误日志的情况下诊断任何问题无异于闭眼开车。” —— Apache 文档《Getting Started》 | ||
placeholder: | | ||
你可以上传错误日志文件,亦可以在这里粘贴你的错误日志信息。 | ||
render: shell | ||
- type: textarea | ||
attributes: | ||
label: 备注 | ||
description: 任何其他的内容。 | ||
- type: checkboxes | ||
attributes: | ||
label: 如果…… | ||
options: | ||
- label: 如果可以的话,我可以帮助或自行修复这个漏洞。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: "✨ 功能请求" | ||
description: 为 python-openbmclapi 提出新的功能。 | ||
labels: ["改进"] | ||
assignees: SilianZ, tianxiu2b2t, unify-z | ||
body: | ||
- type: markdown | ||
attributes: | ||
value: | | ||
你是一位 python-openbmclapi 的使用者,但是有些功能的缺失使你困扰,你打算提交一个功能请求。 | ||
- type: checkboxes | ||
attributes: | ||
label: 在开始之前…… | ||
description: 请确认你已做好以下准备。 | ||
options: | ||
- label: 我已在 [Issue](https://github.com/TTB-Network/python-openbmclapi/issues) 中搜索过我的建议,确定没有人提出过此建议。 | ||
required: true | ||
- type: textarea | ||
attributes: | ||
label: 建议描述 | ||
description: 请描述你的建议。 | ||
placeholder: 使用 QQ 远程控制 python-openbmclapi 的行为。 | ||
validations: | ||
required: true | ||
- type: textarea | ||
attributes: | ||
label: 实现方法 | ||
description: 你认为可以实现的方法。 | ||
placeholder: 使用 aiohttp 对接 nonebot。 | ||
- type: textarea | ||
attributes: | ||
label: 备注 | ||
description: 任何其他的内容。 | ||
- type: checkboxes | ||
attributes: | ||
label: 如果…… | ||
options: | ||
- label: 如果可以的话,我可以帮助或自行实现这个功能。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
|
||
name: Create tagged release | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set env | ||
run: | | ||
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
- name: Create release | ||
run: npx changelogithub-chinese | ||
env: | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set env | ||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{secrets.HUB_USERNAME}} | ||
password: ${{secrets.HUB_PASSWORD}} | ||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: true | ||
tags: | | ||
atianxiua/python-openbmclapi:latest | ||
atianxiua/python-openbmclapi:${{env.RELEASE_VERSION}} | ||
platforms: linux/amd64, linux/arm64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 TTB-Network | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
<div align="center"> | ||
|
||
# OpenBMCLAPI for Python v4 | ||
|
||
Python-OpenBMCLAPI v4 的发布! | ||
|
||
简体中文 | [English](/i18n/README_en.md) | ||
|
||
 | ||
 | ||
 | ||
 | ||
 | ||
 | ||
[](https://crowdin.com/project/python-openbmclapi-site) | ||
 | ||
[](https://github.com/TTB-Network/python-openbmclapi/actions/workflows/github-code-scanning/codeql) | ||
[](https://github.com/TTB-Network/python-openbmclapi/actions/workflows/build_and_publish.yml) | ||
|
||
[赞助](https://afdian.net/a/atianxiua) | ||
|
||
✨ 基于 [OpenBMCLAPI](https://github.com/bangbang93/openbmclapi) 的 Python 实现。 | ||
|
||
🎨 **跨系统**、**跨架构**。这得益于 Python 强大的语言功能。 | ||
|
||
✨ **Docker** 支持。通过 Docker 更加**快捷地**部署 python-openbmclapi ~~(更支持一键跑路)~~。 | ||
|
||
</div> | ||
|
||
# 简介 | ||
|
||
本项目是 [OpenBMCLAPI](https://github.com/bangbang93/openbmclapi) 的 Python 版本,OpenBMCLAPI 是通过分布式集群帮助 [BMCLAPI](https://bmclapidoc.bangbang93.com/) 进行文件分发、加速中国大陆 Minecraft 下载的公益项目。 | ||
|
||
如果你想加入 OpenBMCLAPI,可以寻找 [bangbang93](https://github.com/bangbang93) 获取 `CLUSTER_ID` 和 `CLUSTER_SECRET`。 | ||
|
||
# 贡献 | ||
|
||
如果你有能力,你可以向我们的仓库提交 Pull Request 或 Issue。 | ||
|
||
如果你想帮助我们进行多语言翻译,请前往 [Crowdin](https://translate.bugungu.top)。 | ||
|
||
在贡献之前,请先阅读我们的[贡献准则](./CONTRIBUTING.md)。 | ||
|
||
# 鸣谢 | ||
|
||
[LiterMC/go-openbmclapi](https://github.com/LiterMC/go-openbmclapi) | ||
|
||
[bangbang93/openbmclapi](https://github.com/bangbang93/openbmclapi) | ||
|
||
[SALTWOOD/CSharp-OpenBMCLAPI](https://github.com/SALTWOOD/CSharp-OpenBMCLAPI) | ||
|
||
# 快速开始 | ||
|
||
1. 安装依赖 | ||
|
||
```bash | ||
pip install -r requirements.txt | ||
``` | ||
|
||
2. 首次运行脚本生成配置文件 | ||
```yaml | ||
advanced: | ||
access_log: false | ||
debug: false | ||
host: '' | ||
locale: zh_cn | ||
cert: | ||
cert: null | ||
dir: .ssl | ||
key: null | ||
web: | ||
port: 6543 | ||
proxy: false | ||
public_port: 6543 | ||
``` | ||
3. 修改配置文件(例子) | ||
```yaml | ||
advanced: | ||
access_log: false | ||
debug: false | ||
host: '' | ||
locale: zh_cn | ||
cert: | ||
cert: null | ||
dir: .ssl | ||
key: null | ||
web: | ||
port: 6543 | ||
proxy: false | ||
public_port: 6543 | ||
clusters: | ||
- id: # 670... | ||
secret: # <你的节点密钥> | ||
# 需要增加多个节点如下 | ||
# - id: # 670... | ||
# secret: # <你的节点密钥> | ||
storages: | ||
# local | ||
- name: bmclapi # 存储名字 | ||
type: local | ||
path: /bmclapi | ||
weight: 1 | ||
# alist | ||
- name: alist | ||
type: alist | ||
path: /path/to/your/alist | ||
endpoint: http://127.0.0.1:5244 | ||
username: admin | ||
password: password | ||
weight: 1 | ||
# alist 下的 WebDav | ||
- name: alist-webdav | ||
type: webdav | ||
path: /path/to/your/alist | ||
endpoint: http://127.0.0.1:5244/dav | ||
username: admin | ||
password: password | ||
weight: 1 | ||
# s3 | ||
- name: s3 | ||
type: s3 | ||
path: /path/to/your/s3 | ||
endpoint: https://s3.amazonaws.com | ||
access_key: <你的access_key> | ||
secret_key: <你的secret_key> | ||
bucket: <你的bucket> | ||
weight: 1 | ||
# 可选 | ||
# 例子 | ||
# custom_s3_host: bmclapi-files.ttb-network.top | ||
# public_endpoint: https://s3.ttb-network.top | ||
``` | ||
|
||
4. 开始 for Windows | ||
```bash | ||
python main.py | ||
``` | ||
|
||
4. 开始 for Docker | ||
```bash | ||
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 | ||
``` | ||
|
||
# TODO | ||
- [ ] 文档 | ||
- [ ] 面板 |