feat: add one-command plugin deployment and removal
This commit is contained in:
@@ -16,6 +16,20 @@ HTTP API、管理员鉴权和 `custom_menu_items` 接入 Core;插件不导入
|
||||
两个插件都是独立 Go module,可以分别构建和发布。生产环境应使用独立的
|
||||
低权限服务账号、HTTPS 反向代理、签名包和稳定的 Core API 兼容基线。
|
||||
|
||||
## 推荐部署顺序
|
||||
|
||||
先单独部署官方 Sub2API Core,再部署本仓库的插件。官方 Core 的全新 Docker
|
||||
部署命令(官方仓库和官方镜像):
|
||||
|
||||
```sh
|
||||
mkdir -p /opt/sub2api-core && cd /opt/sub2api-core
|
||||
curl -fsSL https://raw.githubusercontent.com/Wei-Shaw/sub2api/main/deploy/docker-deploy.sh | bash
|
||||
docker compose -f docker-compose.local.yml up -d
|
||||
```
|
||||
|
||||
Core 和插件使用不同的目录、服务、端口及数据边界;不要把插件源码复制到
|
||||
Core 仓库,也不要让插件连接 Core PostgreSQL/Redis。
|
||||
|
||||
## 快速验证
|
||||
|
||||
```sh
|
||||
@@ -42,3 +56,22 @@ HTTP API、管理员鉴权和 `custom_menu_items` 接入 Core;插件不导入
|
||||
|
||||
Core 继续作为用户、余额、订阅、计费和用量账本的权威来源。插件浏览器端
|
||||
不持有 Core JWT、Admin Key 或其他服务密钥。
|
||||
|
||||
## 一键部署与卸载
|
||||
|
||||
Linux + systemd 环境可直接使用仓库内的安装脚本:
|
||||
|
||||
```sh
|
||||
curl -fsSL https://git.awaioi.com/awaioi/sub2api-add/raw/branch/main/deploy/install.sh \
|
||||
| sudo bash -s -- --plugin all
|
||||
```
|
||||
|
||||
默认卸载并保留配置/数据:
|
||||
|
||||
```sh
|
||||
curl -fsSL https://git.awaioi.com/awaioi/sub2api-add/raw/branch/main/deploy/uninstall.sh \
|
||||
| sudo bash -s -- --plugin all
|
||||
```
|
||||
|
||||
需要清除插件配置、数据和源码时,显式使用 `--purge --yes`。完整部署、反向
|
||||
代理、菜单应用和升级说明见 [`deploy/README.md`](deploy/README.md)。
|
||||
|
||||
Reference in New Issue
Block a user