From 7220a304f183a65059bbca77fa51139de6bdb19a Mon Sep 17 00:00:00 2001 From: ZouYonghe <1259085392z@gmail.com> Date: Wed, 25 Nov 2026 07:17:49 +0900 Subject: [PATCH 1/2] docs: align desktop installation and maintainer guidance --- .github/workflows/build-desktop-tauri.yml | 5 ++--- README.md | 10 ++-------- README_zh.md | 10 ++-------- docs/architecture.md | 8 ++++---- docs/development.md | 8 +++++--- docs/repository-structure.md | 4 ++-- src-tauri/src/window/startup_loading.rs | 2 +- 7 files changed, 18 insertions(+), 29 deletions(-) diff --git a/.github/workflows/build-desktop-tauri.yml b/.github/workflows/build-desktop-tauri.yml index d34877c2..891a3fef 100644 --- a/.github/workflows/build-desktop-tauri.yml +++ b/.github/workflows/build-desktop-tauri.yml @@ -663,9 +663,8 @@ jobs: with: name: astrbot-desktop-tauri-${{ needs.resolve_build_context.outputs.astrbot_version }}-windows-${{ matrix.arch }} if-no-files-found: error - # Only upload Windows installer executables. - # Keep explicit globs here so we only publish the installer plus the - # portable zip, not bundled helper executables from the embedded runtime. + # Upload NSIS installers, their updater signatures, and portable ZIPs, + # not bundled helper executables from the embedded runtime. path: | ${{ env.WINDOWS_RELEASE_ASSET_GLOBS }} src-tauri/target/release/bundle/nsis/*.exe.sig diff --git a/README.md b/README.md index 3e84d027..1ef0d734 100644 --- a/README.md +++ b/README.md @@ -145,16 +145,10 @@ ASTRBOT_DASHBOARD_PORT=6185 Before enabling LAN access, make sure your system firewall allows port `6185`, and do not expose the port on untrusted networks or the public internet. - + ### macOS says the app is damaged or cannot be opened -If you downloaded the installer from the internet, macOS may attach a quarantine flag to the app. Run: - -```bash -xattr -dr com.apple.quarantine /Applications/AstrBot.app -``` - -Then restart the app. If the app is not located in `/Applications`, replace the path with the actual one. +Download a fresh copy of the `.dmg` for your Mac from the [official Releases page](https://github.com/AstrBotDevs/AstrBot-desktop/releases/latest) and reinstall AstrBot. If macOS still blocks the app, report the exact warning on the [issue tracker](https://github.com/AstrBotDevs/AstrBot-desktop/issues). ### Why do some MCP tools say `node`, `npx`, or `uvx` is missing? diff --git a/README_zh.md b/README_zh.md index 9e972aec..9a555869 100644 --- a/README_zh.md +++ b/README_zh.md @@ -145,16 +145,10 @@ ASTRBOT_DASHBOARD_PORT=6185 开启局域网访问前,请确认系统防火墙允许端口 `6185`,并不要在不可信网络或公网环境暴露该端口。 - + ### macOS 提示“应用已损坏”或无法打开 -如果你是从网络下载的安装包,macOS 可能会给应用打上 quarantine 标记。可执行: - -```bash -xattr -dr com.apple.quarantine /Applications/AstrBot.app -``` - -然后重新启动应用。如果应用不在 `/Applications`,请替换为实际路径。 +请从[官方发布页](https://github.com/AstrBotDevs/AstrBot-desktop/releases/latest)重新下载适合你的 Mac 的 `.dmg` 并安装。如果 macOS 仍阻止打开应用,请在[问题反馈页](https://github.com/AstrBotDevs/AstrBot-desktop/issues)附上完整的系统提示。 ### 为什么某些 MCP 工具提示缺少 `node`、`npx` 或 `uvx`? diff --git a/docs/architecture.md b/docs/architecture.md index 6c9af303..41fec853 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -116,7 +116,7 @@ backend 子系统对上提供统一的“后端可否管理、如何启动、何 - 路径优先级:`ASTRBOT_ROOT/data/desktop_state.json` -> 打包根目录下的 `data/desktop_state.json`。 - `shell_locale.rs` 维护 `locale` 字段。 - `update_channel.rs` 维护 `updateChannel` 字段,并保留其他 JSON 字段。 -- `desktop_settings.rs` 维护启动与窗口设置,以及插件界面扩展字段:`pluginUiExtensionsEnabled` 默认 `true`,`pluginUiExtensionGrants` 默认空数组;总开关只决定是否允许使用扩展,实际加载仍需逐个插件授权。 +- `desktop_settings.rs` 维护启动与窗口设置。`startupTheme` 记录 Dashboard 的浅色、深色或跟随系统偏好;未保存时启动页跟随系统。插件界面扩展字段中,`pluginUiExtensionsEnabled` 默认 `true`,`pluginUiExtensionGrants` 默认空数组;总开关只决定是否允许使用扩展,实际加载仍需逐个插件授权。 当前维护约定是:各模块共用同一个状态文件,但只管理自己的字段;共享锁覆盖完整的读改写,避免并发更新互相覆盖,读取和损坏文件修复也使用同一把锁。Desktop 设置缓存把持久化与缓存更新串行化;未知字段保留避免丢弃其他模块的配置。 @@ -149,11 +149,11 @@ backend 子系统对上提供统一的“后端可否管理、如何启动、何 ### 4.2 启动流程 -1. `app_runtime.rs` 初始化 Tauri 插件、窗口事件、页面加载事件和托盘。 -2. `startup_task.rs` 异步解析启动计划;打包态从 direct / `_up_/resources` 中选取与可执行文件绑定的完整资源根,开发态仍使用独立的 dev/custom 计划。 +1. `app_runtime.rs` 初始化 Tauri 插件、窗口事件、页面加载事件和托盘,并在显示主窗口前应用启动主题。 +2. 启动页加载完成或等待 2 秒后开始后端启动流程。`startup_task.rs` 异步解析启动计划;打包态从 direct / `_up_/resources` 中选取与可执行文件绑定的完整资源根,开发态仍使用独立的 dev/custom 计划。 3. backend readiness 在接受已运行或刚拉起的打包 backend 前,校验 `/api/v1/stats/versions`,并核对实际送出的 index 和 manifest 声明的入口摘要。 4. backend ready 后用 manifest 摘要生成的 `astrbot_bundle` 查询参数导航主窗口;失败时进入可见的 startup error 路径。 -5. 页面加载过程中按来源策略注入 desktop bridge,并在需要时注入 startup loading mode。 +5. 页面加载过程中按来源策略注入 desktop bridge,并在需要时注入 startup loading mode。Dashboard 未在 10 秒内报告加载完成时,桌面端用原生对话框提示。 ### 4.3 bridge 注入与桌面交互流程 diff --git a/docs/development.md b/docs/development.md index 9ea614e0..89bb951f 100644 --- a/docs/development.md +++ b/docs/development.md @@ -56,7 +56,7 @@ make prune - `make lint` - 执行 `cargo fmt --check` - - 执行 `cargo clippy -- -D warnings` + - 执行 `cargo clippy --locked --all-targets -- -D warnings` - `make test` - 执行 Rust 全量单元测试(`cargo test --locked`) - 若本机有 `pnpm`,执行资源准备脚本行为测试(`pnpm run test:prepare-resources`) @@ -76,6 +76,7 @@ make prune - `package.json` - `src-tauri/Cargo.toml` +- `src-tauri/Cargo.lock`(桌面 crate 的版本条目) - `src-tauri/tauri.conf.json` ## 5. 常用环境变量 @@ -135,12 +136,13 @@ beforeBuildCommand = pnpm run prepare:resources - stable(`tag-poll`)只选择 `vMAJOR.MINOR.PATCH` 格式的正式版本标签,忽略 beta、alpha、rc、dev、nightly 等预发布标签及其他非正式标签;没有正式标签时任务明确失败,不回退到预发布版本。 - 手动 `tag-poll` 的 `source_git_ref` 也只接受正式版本标签。需要打包预发布标签、分支或 commit 时使用 `custom`,不会更新 stable 通道。 -- 定时构建(`schedule`)检测到上游新 tag 时,会先自动同步版本文件并提交,再继续构建。 -- 手动触发(`workflow_dispatch`)默认只构建,不自动回写版本文件。 +- 定时 `tag-poll` 检测到未发布的上游正式标签时,会先尝试同步版本文件并提交,再继续构建。 +- 手动触发(`workflow_dispatch`)不会回写版本文件,默认运行 `nightly` 并在构建通过后更新 GitHub Nightly Release。Nightly 模式始终发布;`publish_release` 只控制手动 `tag-poll` 和 `custom` 是否发布。 - Desktop 使用独立 updater manifest,不复用 AstrBot Core 的 `api.soulter.top/releases` 更新索引。 - stable/nightly 的更新入口分别为 `https://releases.astrbot.app/desktop/channels/stable/latest.json` 和 `https://github.com/AstrBotDevs/AstrBot-desktop/releases/download/nightly/latest-nightly.json`。 - GitHub Actions 会把完整安装包继续发布到 GitHub Releases,仅 stable(`tag-poll`)将 updater 产物上传到 Cloudflare R2:先上传并校验不可变的版本目录,再更新 GitHub Release,最后原子提升通道 manifest。 - nightly 的更新清单与更新包仅发布到 GitHub Releases,不上传 R2。 +- macOS 发布产物包括手动安装用的 `.dmg`,以及应用内更新用的 `.app.tar.gz` 和对应签名文件。Stable 和 Nightly 使用同一套 macOS 签名与公证流程。 - R2 bucket、repository variables/secrets 和对象目录约定见 [`docs/environment-variables.md`](./environment-variables.md#4-发布ci-github-actions)。 - 发布与 updater 相关行为依赖 `src-tauri/tauri.conf.json`、GitHub Actions workflow 以及 `scripts/ci/generate_tauri_latest_json.py`、`scripts/ci/publish_r2_release.py` 共同完成。 diff --git a/docs/repository-structure.md b/docs/repository-structure.md index dec8e1d7..4eead643 100644 --- a/docs/repository-structure.md +++ b/docs/repository-structure.md @@ -40,7 +40,7 @@ - `window/actions.rs` - 主窗口动作与 tray 文案刷新联动封装。 - `window/startup_loading.rs` - - 启动页 loading mode 判定与注入逻辑。 + - 启动主题与原生背景配置,以及 loading mode 判定与注入。 - `lifecycle/` - 生命周期子系统目录。 - `lifecycle/cleanup.rs` @@ -117,7 +117,7 @@ - `launch_plan.rs` - custom/packaged/dev 启动计划构建;打包态完整资源候选选择、manifest 绑定和 WebUI 摘要校验。 - `startup_task.rs` - - 启动阶段后端就绪等待与主线程导航分发。 + - 后端就绪等待、主线程导航分发及 Dashboard 加载超时处理。 - `app_runtime.rs` - Tauri builder/run 编排与窗口/页面事件挂载。 - `app_types.rs` diff --git a/src-tauri/src/window/startup_loading.rs b/src-tauri/src/window/startup_loading.rs index 7b06935b..93d52f83 100644 --- a/src-tauri/src/window/startup_loading.rs +++ b/src-tauri/src/window/startup_loading.rs @@ -26,7 +26,7 @@ fn startup_background(theme: Theme) -> Color { pub(crate) fn apply_system_startup_background(app: &AppHandle) -> tauri::Result<()> { if let Some(window) = app.get_webview_window("main") { - // The window starts hidden, so set both layers before setup shows it. + // Set both background layers while the startup window is still hidden. window.set_background_color(Some(startup_background(window.theme()?)))?; } Ok(()) From 1239137ca036c29d5121eb2367ddcd0d123a4b9c Mon Sep 17 00:00:00 2001 From: ZouYonghe <1259085392z@gmail.com> Date: Wed, 25 Nov 2026 08:25:29 +0900 Subject: [PATCH 2/2] docs: preserve macOS release channel during reinstall --- README.md | 2 +- README_zh.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1ef0d734..39823a0f 100644 --- a/README.md +++ b/README.md @@ -148,7 +148,7 @@ Before enabling LAN access, make sure your system firewall allows port `6185`, a ### macOS says the app is damaged or cannot be opened -Download a fresh copy of the `.dmg` for your Mac from the [official Releases page](https://github.com/AstrBotDevs/AstrBot-desktop/releases/latest) and reinstall AstrBot. If macOS still blocks the app, report the exact warning on the [issue tracker](https://github.com/AstrBotDevs/AstrBot-desktop/issues). +Download a fresh copy of the `.dmg` for your Mac from the same channel you already use: [Stable](https://github.com/AstrBotDevs/AstrBot-desktop/releases/latest) or [Nightly](https://github.com/AstrBotDevs/AstrBot-desktop/releases/tag/nightly). Reinstall AstrBot. If macOS still blocks the app, report the exact warning on the [issue tracker](https://github.com/AstrBotDevs/AstrBot-desktop/issues). ### Why do some MCP tools say `node`, `npx`, or `uvx` is missing? diff --git a/README_zh.md b/README_zh.md index 9a555869..e6262541 100644 --- a/README_zh.md +++ b/README_zh.md @@ -148,7 +148,7 @@ ASTRBOT_DASHBOARD_PORT=6185 ### macOS 提示“应用已损坏”或无法打开 -请从[官方发布页](https://github.com/AstrBotDevs/AstrBot-desktop/releases/latest)重新下载适合你的 Mac 的 `.dmg` 并安装。如果 macOS 仍阻止打开应用,请在[问题反馈页](https://github.com/AstrBotDevs/AstrBot-desktop/issues)附上完整的系统提示。 +请从当前安装版本所属的通道([Stable](https://github.com/AstrBotDevs/AstrBot-desktop/releases/latest) 或 [Nightly](https://github.com/AstrBotDevs/AstrBot-desktop/releases/tag/nightly))重新下载适合你的 Mac 的 `.dmg` 并安装。如果 macOS 仍阻止打开应用,请在[问题反馈页](https://github.com/AstrBotDevs/AstrBot-desktop/issues)附上完整的系统提示。 ### 为什么某些 MCP 工具提示缺少 `node`、`npx` 或 `uvx`?