添加上游同步自动化工具
Some checks failed
CI / test (push) Has been cancelled
CI / golangci-lint (push) Has been cancelled
Security Scan / backend-security (push) Has been cancelled
Security Scan / frontend-security (push) Has been cancelled

新增工具脚本:
- scripts/sync-upstream.sh: 主同步脚本,自动从上游拉取并应用配置
- scripts/apply-branding.sh: 自动应用StarFireAPI品牌化修改
- scripts/apply-deploy-config.sh: 自动应用部署配置
- scripts/README.md: 工具使用说明

功能特性:
 自动备份当前分支
 从上游仓库拉取最新代码
 自动应用品牌化修改(Sub2API → StarFireAPI)
 自动应用部署配置(端口、Redis、镜像等)
 智能提示和确认
 支持回滚操作

使用方法:
chmod +x scripts/*.sh
./scripts/sync-upstream.sh

修改 .gitignore 以允许追踪自定义同步工具

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
huangzhenpc
2026-01-30 01:42:21 +08:00
parent e2c325505a
commit d46653b2c2
8 changed files with 711 additions and 1 deletions

27
scripts/README.md Normal file
View File

@@ -0,0 +1,27 @@
# StarFireAPI 上游同步工具
自动从上游拉取最新代码并重新应用自定义配置的工具集。
## 快速使用
```bash
# 1. 赋予执行权限
chmod +x scripts/*.sh
# 2. 执行同步
./scripts/sync-upstream.sh
```
## 工具说明
- **sync-upstream.sh**: 主同步脚本,自动完成整个流程
- **apply-branding.sh**: 品牌化修改StarFireAPI
- **apply-deploy-config.sh**: 部署配置端口、Redis等
## 回滚
```bash
git reset --hard backup-YYYYMMDD-HHMMSS
```
详细说明见脚本内注释。