老板要求:软件里点「在线升级」校验版本号,直接在线覆盖安装、重启; 升级服务放在 https://md.wangjinding.com。 一、服务端(md.wangjinding.com) · 升级清单 GET /update/latest.json(nginx 单独 location,强制 no-store,带 CORS) { version, notes, pub_date, platforms.windows-x86_64: { signature, url, size, sha256 } } · 安装包走现有 /download/;另加稳定别名 latest-setup.exe / latest-portable.exe —— 官网页固定链到别名,以后发版不用改 HTML · tools/release/publish.py:一条命令完成「拷安装包 → 写清单 → 更新别名 → 打校验值」 · 官网页的版本号改成从 latest.json 拉(data-ver),发版后自动跟随 二、客户端(Tauri updater 官方插件,不是自己下 exe 硬跑) · 新增 tauri-plugin-updater + tauri-plugin-process · 命令 check_update() → { available, current, version, notes, date } install_update() → 下载 + 校验签名 + 静默覆盖安装 + restart · 签名用 minisign:私钥 /root/.tauri/xiaoyin-md-updater.key(600,**不在仓库里**), 公钥写进 tauri.conf.json;安装包被篡改会被客户端直接拒装 · 工具条新增升级按钮(仅 Tauri 版显示);点击 → 查版本 → 有新版弹窗(带更新说明) → 「立即升级」显示下载进度条 → 装完自动重启 · 版本号 2.6.1 → 2.6.2 三、已验证 · 构建出 XiaoyinMarkdown_2.6.2_x64-setup.exe(2.21 MB)+ .sig(448B) · 用 cryptography 按 minisign 规则**真验了一遍签名**:Ed25519 + BLAKE2b 预哈希 → 通过 · /update/latest.json 200 / application/json / no-store;sha256 与清单一致 · latest-setup.exe / latest-portable.exe 均 200 注意:2.6.1 是**没有升级器**的版本,老用户要手动装一次 2.6.2; 从 2.6.2 起才能在软件里一键升级。
34 lines
833 B
TOML
34 lines
833 B
TOML
[package]
|
||
name = "xiaoyin-markdown"
|
||
version = "2.6.2"
|
||
description = "小银 Markdown —— 轻量本地 Markdown 编辑器"
|
||
edition = "2021"
|
||
|
||
[build-dependencies]
|
||
tauri-build = { version = "2", features = [] }
|
||
|
||
[dependencies]
|
||
tauri = { version = "2", features = [] }
|
||
tauri-plugin-dialog = "2"
|
||
tauri-plugin-single-instance = "2"
|
||
# 在线升级:官方 updater(minisign 签名校验)+ process(升级后重启)
|
||
tauri-plugin-updater = "2"
|
||
tauri-plugin-process = "2"
|
||
serde = { version = "1", features = ["derive"] }
|
||
serde_json = "1"
|
||
clipboard-win = "5"
|
||
windows-sys = { version = "0.61", features = [
|
||
"Win32_Foundation",
|
||
"Win32_System_DataExchange",
|
||
"Win32_System_Memory",
|
||
"Win32_UI_Shell",
|
||
"Win32_UI_WindowsAndMessaging"
|
||
] }
|
||
|
||
[profile.release]
|
||
opt-level = "s"
|
||
lto = true
|
||
codegen-units = 1
|
||
strip = true
|
||
panic = "abort"
|