From 5224c68bc71b899cf04ea468bd799edccc058a55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=AC=E6=98=8E?= <83812544+Ed1s0nZ@users.noreply.github.com> Date: Fri, 20 Mar 2026 02:02:39 +0800 Subject: [PATCH] Add files via upload --- README.md | 18 ++++++++++++++---- README_CN.md | 16 +++++++++++++--- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 73c7ea5b..b5cb505c 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/README_CN.md b/README_CN.md index 2d45b58c..5f75fff7 100644 --- a/README_CN.md +++ b/README_CN.md @@ -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`。 ⚠️ **注意:** 仅适用于无兼容性变更的版本更新。若版本存在兼容性调整,此方法不适用。