Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
53fda23
fix(rdp): Windows 原生会话不再抢 OS 光标
paofu-cium Oct 14, 2026
81feacc
merge: 同步上游 dev(1a7be5a92)到修复分支
paofu-cium Oct 18, 2026
437cd8b
feat(ui): implement fixed three-column navigation shell
feigeCode Nov 19, 2026
1e18663
fix(home): 修复首页远端资源占用采集的 Tokio reactor 崩溃
feigeCode Nov 19, 2026
4ba7a6c
feat(extension): 扩展贡献的连接类型接入「新建连接」向导
feigeCode Nov 19, 2026
51cf300
feat(toolbox): 工具箱不再列出贡献面板的扩展 app
feigeCode Nov 19, 2026
28e148d
fix(clipboard): 粘贴图片统一转 PNG,临时文件统一 navop- 前缀
feigeCode Nov 19, 2026
b561e87
feat(home): 完善连接资源信息展示 (#279)
feigeCode Nov 19, 2026
9802a92
merge: 合并 pr420-review(RDP 光标归属改为每帧重算,避免 mstscax 原生会话光标跳动)
feigeCode Nov 19, 2026
42ccd84
Merge remote-tracking branch 'origin/dev' into dev
feigeCode Nov 19, 2026
d689e97
feat(ssh): 跳板机体系全面优化:错误链、堡垒机直连、映射收敛与共享传输
feigeCode Nov 19, 2026
ede94fb
feat(ci): CNB 镜像每次同步后只保留最新 5 个版本,控制对象存储用量
feigeCode Nov 20, 2026
308f454
fix(terminal): 堡垒机直连模式两处运行时缺陷修复
feigeCode Nov 20, 2026
fa90279
fix(home): 修复 CPU 采集并收紧资源布局
feigeCode Nov 19, 2026
d4e478f
revert(ui): 回滚固定三列导航壳
feigeCode Nov 20, 2026
468201f
feat(deep-link): 支持 jms:// 深链接唤起 Navop 直连 JumpServer 资产
feigeCode Nov 20, 2026
52e85a7
feat(deep-link): 支持 ssh:// 与 sftp:// 深链接(默认关闭,设置里启用)
feigeCode Nov 20, 2026
54db12f
feat(ssh_form): 连接方式改为基础信息单选,堡垒机直连不再重复填写
feigeCode Nov 20, 2026
bb0419d
fix(sftp): 目录枚举加超时并把堡垒机受限根目录讲清楚
feigeCode Nov 20, 2026
3ce6dd4
fix(terminal_view): 受限会话下不再反复因跟随终端目录报错
feigeCode Nov 20, 2026
4e38fc1
fix(sftp): 盘符形态的远程文件名不再让整目录读取失败
feigeCode Nov 20, 2026
3f63fbc
fix: 修复深链接 CI 与终端搜索
feigeCode Nov 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ Every run of `upload-r2.yml` also copies the channel manifests onto the GitHub R
- **稳定发布同时刷新 beta 清单**:a stable run also publishes the exact same stable manifests as `feed-<product>-beta.json` and overwrites the R2 beta keys (`updates/beta/latest.json`, `updates/navop-shell/shell/beta/latest.json`, `updates/navop-data/data/beta/latest.json`) with that same stable manifest. Beta clients only read the beta feed/assets; without this refresh they would stay pinned to the last beta forever and never receive a new stable release. A beta run still writes only the beta keys and beta asset names, so the stable feed and the un-suffixed asset names are never touched.
- **CNB 同步由 `upload-r2.yml` 最后派发**:`sync-cnb-release-assets.yml` must run after the `feed-*.json` assets exist. The dispatch used to live at the end of `release.yml`, which raced the concurrent `upload-r2.yml` run and could complete before the feed assets were uploaded. `release.yml` now dispatches only `upload-r2.yml` (with `-f channel`), and the CNB sync is dispatched by the last step of `upload-r2.yml`.
- **`feed-*.json` 不会被误当成安装包**:the installer download/upload globs are `navop-*` / `navop_*`, and the manifest's `packages` list keeps only names matching `/^navop[-_]/`, so feed assets never appear in `downloads`, `fallback_downloads` or `packages`, and never land under the R2 `releases/<tag>/` prefix.
- **CNB 只保留最新 5 个版本**:CNB 对象存储免费额度 100 GiB,统计「制品、LFS 对象、图片及附件」,而单版镜像(三个产品 × 多平台 × 多种包格式)已涨到约 3 GiB,历史 Release 会持续吃额度直到按 ¥1/GiB/月 计费。因此 `sync-cnb-release-assets.yml` 在每同步完一个 tag 后会调用 `.github/scripts/prune-cnb-releases.sh`,只保留版本号最大的 5 个 Release,并额外保底保留最新稳定版与最新 beta 各一个(两条通道的客户端都按「最新 tag」取 `feed-*.json`,保底保证任何情况下都拿得到清单)。清理**只删 CNB Release,不动 git tag** —— 更新器靠 git refs 广告发现新版本,tag 没了就永远收不到更新。脚本拒绝在「本次同步的 tag 不在 CNB 上」时清理,避免镜像没传成功反而把旧版本删光;令牌缺 `repo-release:rw` 时任务报错并提示更新 `CNB_TOKEN`。

## Changelog format

Expand Down
176 changes: 176 additions & 0 deletions .github/scripts/prune-cnb-releases.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
#!/usr/bin/env bash
# 清理 navop 在 CNB 上的 Release,只保留最新若干个版本。
#
# 背景:CNB 对象存储免费额度 100 GiB,统计「制品、LFS 对象、图片及附件」,
# 而 navop 每个版本在 CNB Release 上约有 27 个安装包(约 1.75 GiB)。发版节奏
# 一快就会顶满 100 GiB 并开始按 ¥1/GiB/月 计费。GitHub Release 才是分发主线,
# CNB 只是国内镜像,旧版本没有保留价值。
#
# 安全约束(见 crates/app_kit/src/update/mirror.rs):
# * 更新器先用 git refs 广告发现 tag,再取「最新 tag」Release 里的 feed-*.json,
# 所以最新版本必须留着,且只删 Release —— 不碰 git tag。
# * 保留集合固定包含:本次同步的 tag、版本号最大的稳定版、版本号最大的 beta,
# 再叠加版本号最大的 N 个版本。稳定版/beat 保底是为了让两个通道的客户端
# 永远拿得到最新清单,即使 N 个最新版本恰好全是 beta。
#
# 环境变量:
# CNB_REPOSITORY navop-dev/navop
# CNB_TOKEN 具备 repo-release:rw 的 CNB 访问令牌
# SYNCED_TAG 本次刚同步完的 tag(必须存在于 CNB,否则拒绝清理)
# CNB_RELEASE_RETENTION 保留的版本数,默认 5
# CNB_PRUNE_DRY_RUN true 时只打印计划,不实际删除
set -uo pipefail

: "${CNB_REPOSITORY:?CNB_REPOSITORY is required}"
: "${CNB_TOKEN:?CNB_TOKEN is required}"
: "${SYNCED_TAG:?SYNCED_TAG is required}"

RETENTION="${CNB_RELEASE_RETENTION:-5}"
DRY_RUN="${CNB_PRUNE_DRY_RUN:-false}"
API="https://api.cnb.cool/${CNB_REPOSITORY}"

work="$(mktemp -d)"
trap 'rm -rf "${work}"' EXIT

fail() { echo "::error::$*"; exit 1; }
warn() { echo "::warning::$*"; }

human_size() {
awk -v b="$1" 'BEGIN {
split("B KiB MiB GiB TiB", u, " "); i = 1
while (b >= 1024 && i < 5) { b /= 1024; i++ }
printf "%.2f %s", b, u[i]
}'
}

# ---------------------------------------------------------------- 拉取 Release
# page_size 默认只有 10,必须显式传;逐页拉到取空为止。
fetch_releases() {
local page=1 count status
: >"${work}/releases.ndjson"
while [ "${page}" -le 20 ]; do
status="$(curl -sS -o "${work}/page.json" -w '%{http_code}' \
-H "Authorization: Bearer ${CNB_TOKEN}" \
-H "Accept: application/json" \
"${API}/-/releases?page=${page}&page_size=100")" || {
warn "Cannot list CNB releases (network error on page ${page})"
return 1
}
case "${status}" in
200) ;;
401 | 403)
echo "::error::CNB token cannot list releases (HTTP ${status}): $(head -c 300 "${work}/page.json")"
return 2
;;
*)
warn "Cannot list CNB releases (HTTP ${status} on page ${page}): $(head -c 300 "${work}/page.json")"
return 1
;;
esac
count="$(jq 'length' "${work}/page.json" 2>/dev/null || echo 0)"
if [ "${count}" -eq 0 ]; then
break
fi
jq -c '.[] | {id: .id, tag: .tag_name, size: ([.assets[]?.size] | add // 0)}' \
"${work}/page.json" >>"${work}/releases.ndjson"
if [ "${count}" -lt 100 ]; then
break
fi
page=$((page + 1))
done
[ -s "${work}/releases.ndjson" ] || {
warn "CNB returned no releases; nothing to prune."
return 1
}
}

fetch_releases
case $? in
0) ;;
2) exit 1 ;;
*) exit 0 ;; # 瞬时故障不该让发版流程变红,下次构建会再清一次
esac

total="$(jq -r '.tag' "${work}/releases.ndjson" | wc -l | tr -d ' ')"
echo "CNB has ${total} release(s); retention policy keeps the newest ${RETENTION} plus the newest stable/beta entry point."

# 本次同步的 tag 不在 CNB 上就什么都不删:宁可留下旧版本,也不能在「新版本
# 其实没同步成功」时把镜像清空。
if ! jq -r '.tag' "${work}/releases.ndjson" | grep -Fxq "${SYNCED_TAG}"; then
fail "Refusing to prune: ${SYNCED_TAG} is not present on CNB"
fi

# ---------------------------------------------------------------- 计算保留集合
tags_sorted="$(jq -r '.tag' "${work}/releases.ndjson" | sort -V)"

keep=" ${SYNCED_TAG} "

newest="$(printf '%s\n' "${tags_sorted}" | tail -n "${RETENTION}")"
for t in ${newest}; do
keep="${keep}${t} "
done

# 稳定版与 beta 各保底一个:两条通道的客户端都按「最新 tag」取 feed-*.json。
stable_tag="$(printf '%s\n' "${tags_sorted}" | grep -v -- '-' | tail -n 1 || true)"
beta_tag="$(printf '%s\n' "${tags_sorted}" | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+-' | tail -n 1 || true)"
[ -n "${stable_tag}" ] && keep="${keep}${stable_tag} "
[ -n "${beta_tag}" ] && keep="${keep}${beta_tag} "

# 去重并排序,便于阅读日志。
keep_list="$(printf '%s\n' ${keep} | sort -uV | tr '\n' ' ')"
echo "Keeping releases: ${keep_list}"
echo " ${SYNCED_TAG} = just synced; ${stable_tag:-none} = newest stable; ${beta_tag:-none} = newest beta; newest ${RETENTION} by version"

if [ "$(printf '%s\n' ${keep} | sort -u | wc -l | tr -d ' ')" -ge "${total}" ]; then
echo "Nothing to prune."
exit 0
fi

# ---------------------------------------------------------------- 删除旧 Release
deleted=0
freed=0
failed=0
while IFS=$'\t' read -r id tag size; do
case " ${keep} " in
*" ${tag} "*)
echo "keep ${tag} ($(human_size "${size}"))"
continue
;;
esac
if [ "${DRY_RUN}" = "true" ]; then
echo "delete ${tag} ($(human_size "${size}"), id=${id}) [dry-run]"
deleted=$((deleted + 1))
freed=$((freed + size))
continue
fi
status="$(curl -sS -o "${work}/del.json" -w '%{http_code}' -X DELETE \
-H "Authorization: Bearer ${CNB_TOKEN}" \
-H "Accept: application/json" \
"${API}/-/releases/${id}")" || status="000"
case "${status}" in
200 | 202 | 204)
echo "delete ${tag} ($(human_size "${size}"), id=${id})"
deleted=$((deleted + 1))
freed=$((freed + size))
;;
404)
echo "delete ${tag} (already gone)"
deleted=$((deleted + 1))
freed=$((freed + size))
;;
401 | 403)
echo "::error::CNB token lacks release write scope (HTTP ${status}) when deleting ${tag}: $(head -c 300 "${work}/del.json")"
echo "::error::Create a CNB access token with repo-release:rw at https://cnb.cool/profile/token and update the CNB_TOKEN secret."
exit 1
;;
*)
warn "Failed to delete ${tag} (HTTP ${status}): $(head -c 200 "${work}/del.json")"
failed=$((failed + 1))
;;
esac
done < <(jq -r '[.id, .tag, .size] | @tsv' "${work}/releases.ndjson")

echo "Pruned ${deleted} release(s), freed $(human_size "${freed}") of CNB object storage (kept ${keep_list})."
if [ "${failed}" -gt 0 ]; then
warn "${failed} release(s) could not be deleted; the next build will retry."
fi
23 changes: 23 additions & 0 deletions .github/workflows/sync-cnb-release-assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ permissions:

env:
CNB_REPOSITORY: "navop-dev/navop"
# CNB 只当国内镜像,旧版本没有保留价值:每次同步新版本后清掉更旧的 Release。
CNB_RELEASE_RETENTION: "5"

concurrency:
group: navop-cnb-release
Expand Down Expand Up @@ -111,3 +113,24 @@ jobs:
echo "::error::mpgrm release sync failed after 3 attempts for ${TAG_NAME}"
exit 1
fi

# 对象存储免费额度只有 100 GiB(统计制品、LFS、图片与附件),而单版镜像
# 已涨到约 3 GiB,历史 Release 会持续吃额度直到开始计费。这里只删 Release,
# 不动 git tag —— 更新器靠 refs 广告发现 tag,tag 必须留着(已实测:删
# Release 不会连带删 tag)。
# 脚本从「本次 workflow 的 ref」取,而不是上面按 tag 检出的工作区:手工
# 重跑旧 tag 时,那个 tag 的树里还没有这个脚本。
# 清理失败不让整个同步 job 变红(镜像本身已经同步成功),但令牌缺
# repo-release:rw 时报错,因为那是必须人工修一次的问题。
- name: Checkout maintenance scripts
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
sparse-checkout: .github/scripts
path: .maintenance

- name: Prune old CNB releases
env:
CNB_TOKEN: ${{ secrets.CNB_TOKEN }}
SYNCED_TAG: ${{ inputs.tag }}
run: bash .maintenance/.github/scripts/prune-cnb-releases.sh
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions crates/app_kit/resources/linux/navop.desktop
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[Desktop Entry]
Name=Navop
Comment=Navop - Database, SSH, Terminal, AI Tools
Exec=navop %F
Exec=navop %U
Icon=navop
Type=Application
Categories=Development;Utility;Database;
Terminal=false
StartupWMClass=navop
MimeType=application/vnd.sqlite3;application/x-sqlite3;application/x-duckdb;application/vnd.duckdb;text/markdown;application/x-asciicast;
MimeType=application/vnd.sqlite3;application/x-sqlite3;application/x-duckdb;application/vnd.duckdb;text/markdown;application/x-asciicast;x-scheme-handler/jms;
Keywords=database;ssh;sftp;terminal;redis;mongodb;postgresql;mysql;
Loading
Loading