Add files via upload

This commit is contained in:
公明
2026-03-20 02:02:39 +08:00
committed by GitHub
parent b504f405a8
commit 5224c68bc7
2 changed files with 27 additions and 7 deletions

View File

@@ -174,10 +174,20 @@ go build -o cyberstrike-ai cmd/server/main.go
### Version Update (No Breaking Changes)
**CyberStrikeAI version update (when there are no compatibility changes):**
1. Download the latest source code.
2. Copy the old project's `/data` folder and `config.yaml` file into the new source directory.
3. Restart with: `chmod +x run.sh && ./run.sh`
**CyberStrikeAI one-click upgrade (recommended):**
1. (First time) enable the script: `chmod +x upgrade.sh`
2. Upgrade with: `./upgrade.sh` (optional flags: `--tag vX.Y.Z`, `--no-venv`, `--preserve-custom`, `--yes`)
3. The script will back up your `config.yaml` and `data/`, upgrade the code from GitHub Release, update `config.yaml`'s `version`, then restart the server.
Recommended one-liner:
`chmod +x upgrade.sh && ./upgrade.sh --yes`
If something goes wrong, you can restore from `.upgrade-backup/` (or manually copy `/data` and `config.yaml` back) and run `./run.sh` again.
Requirements / tips:
* You need `curl` or `wget` for downloading Release packages.
* `rsync` is recommended/required for the safe code sync.
* If GitHub API rate-limits you, set `export GITHUB_TOKEN="..."` before running `./upgrade.sh`.
⚠️ **Note:** This procedure only applies to version updates without compatibility or breaking changes. If a release includes compatibility changes, this method may not apply.

View File

@@ -173,9 +173,19 @@ go build -o cyberstrike-ai cmd/server/main.go
### CyberStrikeAI 版本更新(无兼容性问题)
1. 下载最新源代码;
2. 将旧项目的 `/data` 文件夹、`config.yaml` 文件复制至新版源代码目录;
3. 执行命令重启:`chmod +x run.sh && ./run.sh`
1. (首次使用)启用脚本:`chmod +x upgrade.sh`
2. 一键升级:`./upgrade.sh`(可选参数:`--tag vX.Y.Z`、`--no-venv`、`--preserve-custom`、`--yes`
3. 脚本会备份你的 `config.yaml` 和 `data/`,从 GitHub Release 升级代码,更新 `config.yaml` 的 `version` 字段后重启服务。
推荐的一键指令:
`chmod +x upgrade.sh && ./upgrade.sh --yes`
如果升级失败,可以从 `.upgrade-backup/` 恢复,或按旧方式手动拷贝 `/data` 和 `config.yaml` 后再运行 `./run.sh`。
依赖/提示:
* 需要 `curl` 或 `wget` 用于下载 GitHub Release 包。
* 建议/需要 `rsync` 用于安全同步代码。
* 如果遇到 GitHub API 限流,运行前设置 `export GITHUB_TOKEN="..."` 再执行 `./upgrade.sh`。
⚠️ **注意:** 仅适用于无兼容性变更的版本更新。若版本存在兼容性调整,此方法不适用。