Free, open-source screen sharing for private live streams with friends. Watch together in a browser or self-host Piik. 免费开源的私密屏幕共享,支持游戏直播、一起看电影与自部署。
chore(release): move the domestic mirror to AtomGit (#516)
TNTcraft4a4703622ae3
diff --git a/.github/workflows/gitee-mirror.yml b/.github/workflows/atomgit-mirror.ymlsimilarity index 96%rename from .github/workflows/gitee-mirror.ymlrename to .github/workflows/atomgit-mirror.ymlindex 92deb641..37ca4cc0 100644--- a/.github/workflows/gitee-mirror.yml+++ b/.github/workflows/atomgit-mirror.yml@@ -1,4 +1,4 @@-name: Gitee mirror+name: AtomGit mirroron:workflow_run:@@ -17,7 +17,7 @@ permissions:actions: readconcurrency:- group: gitee-mirror+ group: atomgit-mirrorcancel-in-progress: falsequeue: max@@ -72,7 +72,7 @@ jobs:"$RUNNER_TEMP/mirror-release" "$PIIK_RELEASE_VERSION" "$PIIK_RELEASE_REVISION"env:GH_TOKEN: ${{ github.token }}- GITEE_TOKEN: ${{ secrets.GITEE_TOKEN }}+ ATOMGIT_TOKEN: ${{ secrets.ATOMGIT_TOKEN }}PIIK_RELEASE_VERSION: ${{ steps.source.outputs.version }}PIIK_RELEASE_REVISION: ${{ steps.source.outputs.revision }}- name: Explain recoverydiff --git a/README.md b/README.mdindex 9f0fbace..e952c289 100644--- a/README.md+++ b/README.md@@ -4,7 +4,7 @@<p align="center"><a href="https://piik.tv">Website</a> ·<a href="https://github.com/TNTcraftHIM/Piik/releases">Download</a> ·- <a href="https://gitee.com/TNTcraftHIM/Piik/releases">Gitee mirror</a> ·+ <a href="https://atomgit.com/TNTcraftHIM/Piik/releases">AtomGit mirror</a> ·<a href="https://demo.piik.tv">Use online</a> ·<a href="https://piik.tv/docs/?lang=en">Documentation</a></p>diff --git a/README.zh-CN.md b/README.zh-CN.mdindex b8f93247..0ccb6868 100644--- a/README.zh-CN.md+++ b/README.zh-CN.md@@ -4,7 +4,7 @@<p align="center"><a href="https://piik.tv/?lang=zh-CN">官网</a> ·<a href="https://github.com/TNTcraftHIM/Piik/releases">下载</a> ·- <a href="https://gitee.com/TNTcraftHIM/Piik/releases">Gitee 镜像</a> ·+ <a href="https://atomgit.com/TNTcraftHIM/Piik/releases">AtomGit 镜像</a> ·<a href="https://demo.piik.tv">在线版</a> ·<a href="https://piik.tv/docs/zh/">文档中心</a></p>diff --git a/cmd/piik-app/README.md b/cmd/piik-app/README.mdindex e345c0dd..42ad2928 100644--- a/cmd/piik-app/README.md+++ b/cmd/piik-app/README.md@@ -34,7 +34,8 @@ service. To supply capture to an existing site, leave the launcher open andApp remembers the last confirmed room mode. On first use, **Public invite** isselected and waits for confirmation. A starred site opens on startup instead.-The launcher checks releases through GitHub, with Gitee as an alternative.+The launcher checks releases through GitHub. Published binaries retain their+Gitee fallback; use AtomGit for current manual mirror downloads.Its update button downloads your platform's ZIP, or opens Releases if no packagematches. **Release notes** opens the changes; major upgrades show a warning.Follow the [upgrade steps](#upgrading) to replace App.@@ -129,14 +130,14 @@ Different 2.x versions preserve established sharing and viewing. New featuresrequire support from the relevant App and site.1. Read the release notes on [GitHub](https://github.com/TNTcraftHIM/Piik/releases/latest)- or [Gitee](https://gitee.com/TNTcraftHIM/Piik/releases).+ or [AtomGit](https://atomgit.com/TNTcraftHIM/Piik/releases).2. For Local room or Public invite, stop sharing, close App and extract thecomplete new package. Start it and send a fresh invitation.3. For a group's site, the administrator [updates Server](../../docs/operations/service-management.md)first. Then update connected Apps and refresh all sharing/viewing pages.-The launcher update button downloads the package; **Gitee mirror** is an-alternative source. Restarting App or Server interrupts active shares.+The launcher update button downloads the package; the+[AtomGit mirror](https://atomgit.com/TNTcraftHIM/Piik/releases) is an alternative source. Restarting App or Server interrupts active shares.## Terminal And Shutdowndiff --git a/cmd/piik-app/README.zh-CN.md b/cmd/piik-app/README.zh-CN.mdindex 855f618b..2582492c 100644--- a/cmd/piik-app/README.zh-CN.md+++ b/cmd/piik-app/README.zh-CN.md@@ -30,7 +30,7 @@ macOS 原生采集需要 macOS 13 或更新版本。目前主要测试 Windows AApp 会记住上次确认的房间模式。首次使用默认选中 **公网邀请**,确认后才启动;有收藏站点时,启动后直接打开该站点。-启动页通过 GitHub 检查更新,Gitee 作为备用来源。更新按钮下载对应平台的 ZIP;+启动页通过 GitHub 检查更新;已发布客户端仍内置 Gitee 备用来源,当前手动备用下载请使用 AtomGit。没有匹配包时打开发布页。**版本说明** 可查看改动,大版本升级会另行提示。替换 App 的操作见[升级步骤](#升级)。@@ -111,12 +111,12 @@ App 与站点需要使用同一大版本,**2.x 与 1.x 不能混用**。不同 2.x 版本保留已有的分享和观看功能,新功能需要相关 App 与站点支持。1. 查看 [GitHub](https://github.com/TNTcraftHIM/Piik/releases/latest) 或- [Gitee](https://gitee.com/TNTcraftHIM/Piik/releases) 上的版本说明。+ [AtomGit](https://atomgit.com/TNTcraftHIM/Piik/releases) 上的版本说明。2. 使用本地房间或公网邀请时,停止分享并关闭 App,完整解压新版程序包,重新启动后发送新邀请。3. 使用已有站点时,由管理员先[更新 Server](../../docs/operations/service-management.zh-CN.md),再更新连接的 App,并刷新所有分享与观看页面。-启动页的更新按钮可下载程序包,**Gitee 备用下载** 提供备用来源。+启动页的更新按钮可下载程序包;[AtomGit 镜像](https://atomgit.com/TNTcraftHIM/Piik/releases)提供当前备用下载。重启 App 或 Server 会中断当前分享。## 终端与关闭diff --git a/docs/deployment.md b/docs/deployment.mdindex 8e1cc45d..56533e2f 100644--- a/docs/deployment.md+++ b/docs/deployment.md@@ -145,7 +145,8 @@ the same pair and artifact hashes. The [version policy](./standards/versioning.mowns ordering and first-public-release readiness.The default App launcher starts immediately, then checks GitHub Releases in the-background, falling back to the Gitee mirror if GitHub is unavailable. The+background. Published binaries still fall back to Gitee if GitHub is unavailable;+current manual downloads use AtomGit. The[release-source policy](./standards/versioning.md#release-sources) owns selectionand provenance checks. It shows a link only whenthe latest stable release is newer, the same version has a known different sourcediff --git a/docs/guide/getting-started.md b/docs/guide/getting-started.mdindex 95b3336c..1ec2b5a0 100644--- a/docs/guide/getting-started.md+++ b/docs/guide/getting-started.md@@ -47,8 +47,8 @@ restrictive networks may load the page but block video.1. Download **Piik App** for your platform from[GitHub Releases](https://github.com/TNTcraftHIM/Piik/releases) or the- [Gitee mirror](https://gitee.com/TNTcraftHIM/Piik/releases). On phones and tablets,- install the app; extract the APK first if you use the Gitee ZIP. On a computer,+ [AtomGit mirror](https://atomgit.com/TNTcraftHIM/Piik/releases). On phones and tablets,+ install the APK directly. On a computer,extract the whole archive and keep its directory structure intact.2. Open `piik-app.exe` on Windows, `Piik App.app` on macOS, or `./piik-app` on Linux.On phones and tablets, open Piik after installation. The launcher opens in your system browser.diff --git a/docs/guide/getting-started.zh-CN.md b/docs/guide/getting-started.zh-CN.mdindex b3152082..e06ee554 100644--- a/docs/guide/getting-started.zh-CN.md+++ b/docs/guide/getting-started.zh-CN.md@@ -42,8 +42,8 @@ Piik 支持一位房主分享屏幕,最多 20 位受邀观众观看。先选## 用 Piik App 分享1. 从 [GitHub Releases](https://github.com/TNTcraftHIM/Piik/releases) 或- [Gitee 镜像](https://gitee.com/TNTcraftHIM/Piik/releases)下载以 **`piik-app`** 开头、- 对应平台的程序包。手机或平板安装 App;Gitee ZIP 需先解压,再安装其中的 APK。+ [AtomGit 镜像](https://atomgit.com/TNTcraftHIM/Piik/releases)下载以 **`piik-app`** 开头、+ 对应平台的程序包。手机或平板安装 App;直接安装 APK。桌面端完整解压并保留目录结构。2. Windows 打开 `piik-app.exe`,macOS 打开 `Piik App.app`,Linux 运行 `./piik-app`。手机或平板安装后打开 Piik。启动页会在系统浏览器里打开。diff --git a/docs/operations/github.md b/docs/operations/github.mdindex f49ffb5c..ac9b77ce 100644--- a/docs/operations/github.md+++ b/docs/operations/github.md@@ -88,75 +88,55 @@ the Docker download. Keep repository Actions access enabled for later releases.Image checks, version identity and retries follow[container distribution](../standards/versioning.md#container-distribution).-## Gitee Download Mirror--[TNTcraftHIM/Piik](https://gitee.com/TNTcraftHIM/Piik) is a public README/Release-mirror. Source, documentation and issues stay on GitHub. The **Gitee mirror**-workflow uses the repository Actions secret `GITEE_TOKEN`, which is configured; rotate it there-when needed. Never put it in source, a remote URL or a distributed package.-GitHub publication continues to use the workflow's scoped token.--After a successful main-push CI run, **Gitee mirror** downloads that run's original-artifacts and runs `scripts/mirror-release.mjs`. It skips runs that did not publish-the current GitHub release. GitHub publication and **Website** do not depend on-mirror success. A mirror failure stays visible in its own failed workflow; an-unfinished Gitee release remains a preview.--Rerun **Gitee mirror** to verify existing files and upload only missing ones.-Read retries cover the complete JSON or attachment body, not just response-headers. A partial attachment is discarded and its checksum starts again on-the next bounded attempt. Uploads and other mutations are not blindly retried-after an ambiguous timeout; rerunning inventories existing attachments first.-Operation and package progress identify which transfer failed without recording-tokens. A successful retry does not by itself identify the earlier network cause.-For a separate retry, dispatch it on `main` with the **original CI run ID**:+## AtomGit Download Mirror++[AtomGit TNTcraftHIM/Piik](https://atomgit.com/TNTcraftHIM/Piik) is the public+source and Release mirror. GitHub owns development, issues and original packages.+AtomGit's configured repository synchronization handles branches, tags and commits;+the **AtomGit mirror** GitHub workflow separately copies published binary assets.+Its repository Actions secret is `ATOMGIT_TOKEN`. Never put this token in source,+a remote URL or a distributed package. GitHub publication keeps its scoped token.++After a successful main-push CI run, the workflow downloads that run's complete+original Server and App artifacts and invokes `scripts/mirror-release.mjs`.+It skips runs that did not publish the current GitHub release. GitHub publication+and **Website** do not depend on mirror success. An unfinished mirror remains a+prerelease until every package passes anonymous full-download SHA-256 validation.+This includes the original signed APK and its already-built ZIP wrapper.++For recovery, rerun **AtomGit mirror** with the original publishing CI run ID:```sh-gh workflow run gitee-mirror.yml --repo TNTcraftHIM/Piik --ref main -f run_id=RUN_ID+gh workflow run atomgit-mirror.yml --repo TNTcraftHIM/Piik --ref main -f run_id=RUN_ID```-The source must be a completed main-push run of this repository's CI workflow,-matching the latest published GitHub release. Manual recovery also accepts a-legacy CI run that failed after GitHub publication. The workflow executes trusted-main tooling and treats downloaded artifacts only as data. Old retries cannot-complete a mirror for a superseded release. Both publishers reject changing a-published package; use a corrected new version if its bytes are wrong.+The source must be a completed main-push CI run matching the latest published+GitHub release. The workflow runs trusted main tooling and treats artifacts only+as data. A superseded release cannot complete a new mirror. Both publishers reject+changing published bytes; a corrected package needs a corrected new version.-For a local retry, first let any active mirror workflow finish. Use the release-revision's scripts and original complete build output retained outside the-checkout. Earlier versions can have a different-package set. While the publishing run's artifacts are available, download all packages-into one directory (replace `RUN_ID`, `FULL_SOURCE_SHA` and `VERSION`):+For a local retry, let any active workflow finish and recover the complete original+build output, including descriptors, manifests and checksum sidecars, in one fresh+directory. Use `gh run download` for each `piik-server*` and `piik-app-*` artifact+from that publishing run, or use the retained operator output after CI expiry.+Public Release archives alone do not include all validation sidecars. Never rebuild+a published version to recover metadata. See [artifact retention](../deployment.md#build-host).```sh-for artifact in piik-server piik-server-linux-arm64 piik-server-windows-amd64 piik-app-windows-amd64 piik-app-linux-amd64 piik-app-linux-arm64 piik-app-darwin-arm64 piik-app-darwin-amd64 piik-app-android-universal; do- gh run download RUN_ID --repo TNTcraftHIM/Piik \- --name "$artifact-FULL_SOURCE_SHA" --dir /tmp/piik-mirror-done-node scripts/mirror-release.mjs /tmp/piik-mirror VERSION FULL_SOURCE_SHA+node scripts/mirror-release.mjs /path/to/original-artifacts VERSION FULL_SOURCE_SHA --dry-run+node scripts/mirror-release.mjs /path/to/original-artifacts VERSION FULL_SOURCE_SHA```-Use a fresh directory. Public Release downloads contain only runtime archives;-mirror verification also needs the original descriptors, manifest and checksum-files. If CI artifacts have expired, recover that complete output from the-operator's retained copy. Rebuilding a published version is not a metadata-recovery procedure. See [artifact retention](../deployment.md#build-host).--Use the release's actual version and full `target_commitish` SHA, with-`GITEE_TOKEN` supplied through the publisher environment. `--dry-run` after the-three arguments checks local identity, checksums and attachment sizes without-publishing. The [release-source policy](../standards/versioning.md#release-sources)-owns provenance, selection and quota limits. The first public release passed-complete matching mirror download acceptance for every Server and App package.--Release postflight applies the [two-version mirror retention policy](../standards/versioning.md#release-sources).-After verifying the latest mirror and its fallback against GitHub, inventory-older releases with `/releases/{id}/attach_files`, verify their GitHub originals,-then remove only the reviewed attachments through-`DELETE /releases/{id}/attach_files/{attachment_id}`. Recheck both retained-versions and the anonymous `download/latest` links afterward. Keep deletion-inventories and verification results with operator release records, not source-history. The upload script does not itself delete older attachments.+Supply `ATOMGIT_TOKEN` only through the publisher environment. Reads retry within+a bounded deadline, including complete response bodies. Mutations are not blindly+retried: rerunning inventories existing files before uploading missing ones. Signed+upload URLs and callback headers are credentials and are never logged. A failed+upload leaves a visible failed workflow and pending prerelease.++No automatic attachment cleanup runs. Do not apply Gitee's former size/quota or+retention rules to AtomGit. This migration does not delete the old Gitee repository+or its packages. Already published software keeps its embedded old fallback until+a later software release replaces it.## Platform Referencesdiff --git a/docs/operations/self-hosting.md b/docs/operations/self-hosting.mdindex 994bb055..4ab2c560 100644--- a/docs/operations/self-hosting.md+++ b/docs/operations/self-hosting.md@@ -18,7 +18,7 @@ Server packages are available for Linux x64/ARM64 and Windows x64.Download the Server archive matching your machinefrom [GitHub Releases](https://github.com/TNTcraftHIM/Piik/releases)-or the [Gitee mirror](https://gitee.com/TNTcraftHIM/Piik/releases).+or the [AtomGit mirror](https://atomgit.com/TNTcraftHIM/Piik/releases).On Linux, use `uname -m` to check the architecture:| Platform | Archive |diff --git a/docs/operations/self-hosting.zh-CN.md b/docs/operations/self-hosting.zh-CN.mdindex 0484fdbe..7345a810 100644--- a/docs/operations/self-hosting.zh-CN.md+++ b/docs/operations/self-hosting.zh-CN.md@@ -15,7 +15,7 @@ Piik Server 将网页、房间管理和可选的媒体转发打包在**一个服服务端提供 Linux x64/ARM64 和 Windows x64 程序包。从 [GitHub Releases](https://github.com/TNTcraftHIM/Piik/releases) 或-[Gitee 镜像](https://gitee.com/TNTcraftHIM/Piik/releases)下载对应架构的服务端程序包。+[AtomGit 镜像](https://atomgit.com/TNTcraftHIM/Piik/releases)下载对应架构的服务端程序包。Linux 可运行 `uname -m` 查看架构:| 平台 | 程序包 |diff --git a/docs/operations/website.md b/docs/operations/website.mdindex 0e58b505..19868b2e 100644--- a/docs/operations/website.md+++ b/docs/operations/website.md@@ -10,7 +10,7 @@ The static website source is `site/`. Its content and design follow the| Website | [piik.tv](https://piik.tv) || P2P-only demo on the separate US server | [demo.piik.tv](https://demo.piik.tv) || App downloads and release notes | [GitHub Releases](https://github.com/TNTcraftHIM/Piik/releases) |-| Download mirror for domestic access | [Gitee Releases](https://gitee.com/TNTcraftHIM/Piik/releases) |+| Download mirror for domestic access | [AtomGit Releases](https://atomgit.com/TNTcraftHIM/Piik/releases) || Documentation source | [Reader guides](../guide/README.md), with a separate [developer map](../README.md) |GitHub Pages serves `piik.tv` behind@@ -240,12 +240,12 @@ each provider's native latest-attachment route:- GitHub: `releases/latest/download/asset-name.zip`([documentation](https://docs.github.com/en/repositories/releasing-projects-on-github/linking-to-releases)).-- Gitee: `releases/download/latest/asset-name.zip`- ([Windows download](https://gitee.com/TNTcraftHIM/Piik/releases/download/latest/piik-app-windows-amd64.zip)).+- AtomGit: `releases/download/latest/asset-name.zip`+ ([Windows download](https://atomgit.com/TNTcraftHIM/Piik/releases/download/latest/piik-app-windows-amd64.zip)).Both links follow provider publication without a website rebuild. Supported Apparchitecture choices stay visible; one selection updates both providers' links.-Android uses one universal APK for ARM64 and x64. The iOS entry opens the online+Both providers distribute the same universal Android APK for ARM64 and x64. The iOS entry opens the onlineversion without promising an App release date. An optional GitHub metadata request supplies the latest version/date and itsauthored editorial title and one-line explanation;failure does not disable architecture selection. Without JavaScript, the default@@ -253,11 +253,11 @@ links remain Windows x64, Apple silicon, Linux x64 and Android universal. Publispackage before deploying its website option. ARM64 Server packages alone do notenable an ARM64 App choice.Platform buttons say “Download from GitHub” /-“GitHub 下载”; the secondary link says “Download from Gitee” /-“Gitee 国内镜像下载”. Keep versions and archive formats out of these labels.+“GitHub 下载”; the secondary link says “Download from AtomGit” /+“AtomGit 国内镜像下载”. Keep versions and archive formats out of these labels.[Versioning](../standards/versioning.md#release-sources) owns package verificationand completion of mirror publication. GitHub remains the primary source; the-Gitee download can temporarily lag while a mirror publication completes.+AtomGit download can temporarily lag while a mirror publication completes.Verify the latest redirects and package checksums after releases.## Publish@@ -273,7 +273,7 @@ Verify the latest redirects and package checksums after releases.4. Accepted main pushes run CI first; success triggers **Website**, which checksout that CI run's exact commit. Manual dispatch uses its selected `main` commit.Before publishing, both paths skip a build that is no longer current main;- dispatch again for the latest commit when needed. The separate Gitee mirror+ dispatch again for the latest commit when needed. The separate AtomGit mirrorworkflow does not gate Website deployment. Download links resolve through each provider, sopublishing a package or retrying its mirror needs no link refresh.Only `build/site/` is uploaded; website work does not package App/Server.diff --git a/docs/standards/versioning.md b/docs/standards/versioning.mdindex ef8fe2d3..47bad5e5 100644--- a/docs/standards/versioning.md+++ b/docs/standards/versioning.md@@ -123,12 +123,12 @@ Desktop App archive names are fixed per target: `piik-app-{target}.zip`. Each putag owns its archive bytes; the full source SHA remains in `REVISION` and therelease descriptor. Fixed names allow GitHub's native latest-asset links;[website operations](../operations/website.md#preview) owns download presentation-and verification of the matching Gitee mirror.+and verification of the matching AtomGit mirror.Android uses the installable `piik-app-android-universal.apk` for both ARM64 andx64. The same build also produces `piik-app-android-universal.zip`, containing-only that unchanged signed APK. GitHub keeps both originals; Gitee distributes-the ZIP, and its download links explain extraction before installation.+only that unchanged signed APK. GitHub and AtomGit keep both originals;+current Android download links use the installable APK directly.Both follow the same release identity, checksum and complete-target rules.[Android build instructions](../../mobile/README.md#signed-release-apk)own signing input and installation details.@@ -137,7 +137,7 @@ Public Release attachments contain the App ZIPs/APK and Server runtime archivesfor the registered package targets. Package descriptors (`.release.json`), file manifests (`.manifest.tsv`)and standalone `.sha256` files remain build/deployment inputs in the local outputand CI artifacts; publishers validate them but do not upload them to GitHub or-Gitee Releases. The release body includes a collapsed full source SHA and+AtomGit Releases. The release body includes a collapsed full source SHA andSHA-256 listing generated from the verified packages. GitHub's automatic sourcearchives are separate from Piik's uploaded packages. Retain original buildmetadata with operator deployment records as described in [deployment](../deployment.md).@@ -159,15 +159,16 @@ identity separately. Stable update notices ignore prereleases.### Major-Upgrade GuidanceThe App update notice keeps direct download as its primary action, with a small-Gitee mirror link below it. A newer major adds a short, visible breaking-change-notice linking to the selected provider's exact release page; ordinary updates+mirror link below it. Published binaries retain Gitee until their next release;+the current manual mirror is AtomGit. A newer major adds a short, visible breaking-change+notice linking to the selected provider's release page; ordinary updatesdo not add a separate release-notes control. The Server logs the same distinctionwhile preserving its checker JSON and exit codes. This is release guidance,not a replacement for actual wire checks.-Updates remain a manual action. Release prose stays on GitHub/Gitee; the App+Updates remain a manual action. Release prose stays on GitHub/AtomGit; the Appdoes not fetch or render remote Markdown or add a second changelog store.Keep the major warning inline, without a confirmation dialog or mandatory-website detour. The mirror link opens Gitee releases without depending on the+website detour. The mirror link opens provider releases without depending on thewebsite. API response time does not measure package-download throughput;do not add speed probes or automaticprovider switching to an otherwise valid update check.@@ -215,7 +216,7 @@ after all required artifacts and checks pass. The publisher verifies matchingversion, source SHA and checksums, then creates/uploads/publishes one GitHub draft.When there are no unpublished product changes, CI validates a development buildand skips packaging and publication; it never assigns an old release version to-a new source SHA. The separate Website and Gitee mirror workflows follow successful+a new source SHA. The separate Website and AtomGit mirror workflows follow successfulmain CI independently. Mirror failure must remain visible without blocking GitHubpublication or Website deployment; retries use the original publishing artifacts.Failed draft uploads can resume; published artifacts are never overwritten.@@ -284,7 +285,7 @@ rewriting main.The publisher appends generated build identity and package checksums to thereviewed text, passes it through a temporary notes file to GitHub, then removes-that file. Gitee copies the GitHub description. Retrying the same+that file. AtomGit copies the GitHub description. Retrying the samerelease preserves its reviewed prose; draft retries refresh only the markedgenerated build/checksum section to match the uploaded bytes. Published releasesremain unchanged. An exact tag does not move@@ -309,7 +310,7 @@ explanation to one authored line, using plain text inside `**...**` and thedescription. The website reads these same pairs fromthe published Release body and displays the current language; it does not keepanother copy, interpret arbitrary Markdown or guess a headline from older-releases. Gitee retains the same body. Do not add a campaign registry or automatic+releases. AtomGit retains the same body. Do not add a campaign registry or automaticversion-based inheritance; review any reused headline when preparing the PR.Then introduce **this update** in each language with one or two factual sentences:@@ -343,62 +344,37 @@ presentation, not Piik's version selection or feature claims.## Release Sources-GitHub Releases is the primary publication; Gitee is an optional official mirror-for domestic access, with a minimal README pointing development and documentation-back to GitHub. The Gitee repository need not copy the source tree. Its README/tag-commit is not the Piik source revision; release metadata retains the original-GitHub SHA. Build each target once and copy the selected original archives,-notices, version, full source SHA and artifact hashes to both. Android's ZIP-wrapper is a build artifact, not a mirror-side rebuild. Gitee's-[official response](https://gitee.com/oschina/git-osc/issues/IB93ZJ) states that it-cannot distribute APK downloads; do not work around its response type in the Browser.-A Git repository mirror-alone does not synchronize Release attachments. Keep one release description.-Update detection reads each provider's API metadata; it does not parse the public-changelog or download build descriptors. The existing pipeline owns local-machine-readable build metadata.--The two providers only adapt API fields and download locations into the same-release model. Share version comparison, channel filtering and package validation.-The normal background check tries GitHub, then Gitee if the primary is unavailable;-download links may expose both verified locations. A lagging mirror must not-cause a downgrade or a version/hash disagreement to be silently accepted.-Gitee's documented latest endpoint means last updated, so provider normalization-must select stable release precedence explicitly, not equate provider ordering.--Synchronize only an explicitly published release; branch pushes stay quiet.-Retrying a failed mirror upload reuses the original package. Advertise a mirrored-package as available only after its required attachments and matching metadata-are present. Tokens belong only to publishing, never the distributed Browser/App.-The public mirror is [TNTcraftHIM/Piik](https://gitee.com/TNTcraftHIM/Piik).-The publisher reuses the shared artifact validator, checks every public package-against GitHub's published asset digest, then uploads and verifies anonymous-Gitee downloads. Gitee has no draft API: an incomplete mirror remains a preview-release, and becomes stable only after every file passes. A source marker in-the release body (`<!-- piik-source: <full-SHA> -->`) preserves the GitHub revision;-the mirror's `target_commitish` identifies only its own README commit.-App notices and the operator check share their existing version comparison-across providers. Each provider has its own deadline; the mirror checks at most-ten pages of 100 releases and rejects an incomplete listing. An explicit operator-`--api-url` override checks that endpoint alone. A valid primary result, including-an up-to-date result, does not consult the mirror.--Gitee currently documents 100 MB per attachment and 1 GB total repository-attachments for ordinary projects. The mirror rejects files above 100,000,000-bytes before writing. GitHub retains published history; Gitee retains package-attachments for the latest stable version and one preceding verified stable-version. Order by semantic version, not update time; a preview cannot displace-the fallback. Verify the new mirror completely before retiring older attachments,-and verify that the fallback's packages remain downloadable and match GitHub.-Delete only older mirror attachments with verified GitHub originals; retain-release descriptions and tags. Unknown files or provenance require review.-Check capacity before upload. Cleanup may reclaim versions outside the two-retained stable versions; never delete either retained version to make an-unverified replacement fit. Exhausted storage leaves a pending preview.-Target authentication, uploads, anonymous metadata/CORS and the complete matching-Server/three-platform App downloads and SHA-256 checks passed for the public release.-Use API metadata in the Browser; ordinary asset-link redirects are not guaranteed-to permit cross-origin fetch, even when a normal download works.+GitHub Releases is the primary publication. The public+[AtomGit project](https://atomgit.com/TNTcraftHIM/Piik) mirrors source branches,+tags and commits through its configured repository synchronization. Release+metadata and binary attachments are published separately; Git synchronization+alone does not make packages available.++Build each target once. The mirror publisher reuses the shared artifact validator,+compares every original package with GitHub's published SHA-256 digest, and copies+the existing release description plus its original source marker+(`<!-- piik-source: <full-SHA> -->`). It publishes all original packages,+including the signed Android APK and the existing ZIP wrapper. Neither package+is rebuilt at the mirror. Tokens belong only to publishing.++Create an AtomGit prerelease, obtain each missing attachment's signed upload+location, and upload its bytes. Signed locations and callback headers are temporary+credentials and must not appear in logs. Before marking the release stable,+anonymously download every package and verify its complete size and SHA-256.+A rerun inventories the existing release and attachments first; never blindly+retry a timed-out mutation or replace a published package. An incomplete release+remains a prerelease. GitHub and website publication remain independent of mirror+success. No automatic deletion or Gitee-specific quota policy applies to AtomGit.++GitHub remains the first update source. Already published App and Server binaries+retain their embedded Gitee fallback until a subsequent software release changes+that consumer. The website and current download guides use AtomGit. Update+consumers must normalize provider fields into the existing release model, retain+source provenance and semantic version comparison, and reject incomplete listings.+They must not treat provider update ordering as stable version precedence. A valid+primary result, including an up-to-date result, does not consult a fallback.+Use anonymous API metadata in the Browser; a normal attachment download does not+establish cross-origin fetch support.## Public Release Baseline@@ -426,7 +402,7 @@ limits stay in [verification status](../verification-status.md).- Apple's [bundle build version](https://developer.apple.com/documentation/bundleresources/information-property-list/cfbundleversion)and [release version](https://developer.apple.com/documentation/bundleresources/information-property-list/cfbundleshortversionstring)are numeric; package generation derives both from the release and keeps SHA separately.-- [GitHub Releases API](https://docs.github.com/en/rest/releases/releases) and- [Gitee's official API SDK reference](https://gitee.com/sdk/gitee5j/blob/main/docs/RepositoriesApi.md):- provider endpoints and metadata. [Gitee Release documentation](https://help.gitee.com/repository/release/intro)- owns its current attachment limits. Provider checks were made on 2026-09-12.+- [GitHub Releases API](https://docs.github.com/en/rest/releases/releases),+ [AtomGit API](https://docs.atomgit.com/docs/apis/) and+ [AtomGit Release uploads](https://atomgit-api-doc.atomgit.com/14.release/219.get_the_upload_address_of_the_release_attachment.html)+ own provider endpoints, authentication and attachment upload contracts.diff --git a/docs/status.md b/docs/status.mdindex 84750c70..a237ffe3 100644--- a/docs/status.md+++ b/docs/status.md@@ -99,7 +99,7 @@ identity and postflight evidence. `piik.tv` runs on GitHub Pages behindCloudflare; website delivery includes a bilingual documentation center builtfrom repository guides.-GitHub owns original Server and App packages; Gitee mirrors them without+GitHub owns original Server and App packages; AtomGit mirrors them withoutrebuilding and verifies anonymous downloads against their checksums. Serverpackages cover Linux x64/ARM64 and Windows x64; Docker images are Linux-only.App packages cover Windows x64 and macOS/Linux x64/ARM64.diff --git a/docs/todo.md b/docs/todo.mdindex bc8e8683..8dc4537d 100644--- a/docs/todo.md+++ b/docs/todo.md@@ -107,8 +107,6 @@ own behavior; research and Git/PRs own evidence and completed history.reports first-launch blocking; the troubleshooting guide provides a scopedopening procedure, not a signing fix. Verify downloaded bundles on a Mac whensigning becomes available.-- **Gitee download-source warning.** Paused by the owner. Keep GitHub primary- and retain Gitee; do not add a self-hosted mirror. Reopen for new provider evidence.- **Automatic local chat history.** Manual TXT export already exists. Automaticstorage needs a stable room-incarnation identity, bounded retention and deletion;reusable room codes must not combine conversations.diff --git a/mobile/README.md b/mobile/README.mdindex 2b9a125a..18da536d 100644--- a/mobile/README.md+++ b/mobile/README.md@@ -85,8 +85,8 @@ and verify that the same clean source revision still owns the final output.The universal `piik-app-android-universal.apk` contains arm64 and x86-64.The build verifies its signature, package identity, version and ABIs, then writesthe existing schema-2 release descriptor and SHA-256 sidecars. It also wraps-the unchanged signed APK in `piik-app-android-universal.zip` for Gitee; extract-that ZIP before installation. GitHub publishes both distributions.+the unchanged signed APK in `piik-app-android-universal.zip`. GitHub and AtomGit+publish both distributions; use the APK directly for installation.The existing CI App matrix publishes them with the matching desktop/Serverartifacts. Publication requires four repository secrets:`PIIK_ANDROID_KEYSTORE_BASE64` (the keystore bytes in Base64),diff --git a/scripts/mirror-release.mjs b/scripts/mirror-release.mjsindex b33e21eb..95133b32 100644--- a/scripts/mirror-release.mjs+++ b/scripts/mirror-release.mjs@@ -8,19 +8,18 @@ const [directory, version, revision, option] = process.argv.slice(2);if (option && option !== "--dry-run") {throw new Error("Use mirror-release.mjs <artifacts> <version> <full-SHA> [--dry-run]");}-const { mirrorFiles: files } = readReleaseArtifacts(directory, version, revision);-if (files.some((file) => file.size > 100_000_000)) throw new Error("Gitee's 100 MB attachment limit is exceeded");+const { files } = readReleaseArtifacts(directory, version, revision);const repository = "TNTcraftHIM/Piik";-const api = `https://gitee.com/api/v5/repos/${repository}`;+const api = `https://api.atomgit.com/api/v5/repos/${repository}`;const marker = `<!-- piik-source: ${revision} -->`;-const token = process.env.GITEE_TOKEN?.trim();+const token = process.env.ATOMGIT_TOKEN?.trim();function requireLatestSource() {const latest = JSON.parse(execFileSync("gh", ["api", `repos/${repository}/releases/latest`],{ encoding: "utf8", stdio: ["ignore", "pipe", "pipe"], timeout: 30_000 }));if (latest.tag_name !== version || latest.target_commitish !== revision ||latest.draft !== false || latest.prerelease !== false) {- throw new Error("Only the latest GitHub release may create or complete a Gitee mirror");+ throw new Error("Only the latest GitHub release may create or complete an AtomGit mirror");}}@@ -38,27 +37,26 @@ async function fetchResponse(url, options, timeout, consume) {}} catch (error) {if (attempt === attempts || !(signal.aborted || error instanceof TypeError || error?.name === "TimeoutError")) {- throw new Error(`Gitee ${options.method ?? "GET"} ${new URL(url).pathname}: ${error.message}`);+ throw new Error(`AtomGit ${options.method ?? "GET"} ${new URL(url).pathname}: ${error.message}`);}} finally {if (response?.body && !response.bodyUsed) await response.body.cancel().catch(() => {});}- console.log(`Retry Gitee read ${new URL(url).pathname}: ${attempt + 1}/${attempts}`);+ console.log(`Retry AtomGit read ${new URL(url).pathname}: ${attempt + 1}/${attempts}`);await delay(attempt * 1_000);}}async function request(path, method = "GET", body) {- const multipart = body instanceof FormData;- console.log(`Gitee ${method} ${path}`);+ console.log(`AtomGit ${method} ${path}`);// A timed-out upload may already exist. Retry only reads; a script rerun// reconciles attachment identities before any subsequent write.return fetchResponse(api + path, {method, redirect: "error",- headers: { Accept: "application/json", Authorization: `Bearer ${token}`,- ...(!body || multipart ? {} : { "Content-Type": "application/json" }) },- body: body ? multipart ? body : JSON.stringify(body) : undefined,- }, multipart ? 180_000 : 20_000, async response => {+ headers: { Accept: "application/json", "PRIVATE-TOKEN": token,+ ...(!body ? {} : { "Content-Type": "application/json" }) },+ body: body ? JSON.stringify(body) : undefined,+ }, 20_000, async response => {if (response.status === 404 && method === "GET") return null;if (!response.ok) throw new Error(`HTTP ${response.status}`);return response.json();@@ -67,11 +65,11 @@ async function request(path, method = "GET", body) {// Verify anonymously: credentials are never forwarded to attachment redirects.async function verifyDownload(uploaded, file) {- const expectedURL = `https://gitee.com/${repository}/releases/download/${version}/${file.name}`;- if (uploaded?.size !== file.size || uploaded.browser_download_url !== expectedURL) {+ const expectedURL = `https://atomgit.com/${repository}/releases/download/${version}/${file.name}`;+ if (uploaded?.name !== file.name || uploaded.browser_download_url !== expectedURL) {throw new Error(`Mirror attachment metadata mismatch: ${file.name}`);}- console.log(`Verify Gitee package: ${file.name} (${file.size} bytes)`);+ console.log(`Verify AtomGit package: ${file.name} (${file.size} bytes)`);await fetchResponse(expectedURL, {}, 180_000, async response => {if (!response.ok || !response.body) throw new Error(`Mirror attachment is not anonymously downloadable: ${file.name}`);const hash = createHash("sha256");@@ -90,7 +88,7 @@ async function verifyDownload(uploaded, file) {if (option === "--dry-run") {console.log(JSON.stringify({ version, revision, files: files.length, bytes: files.reduce((sum, file) => sum + file.size, 0) }));} else {- if (!token) throw new Error("GITEE_TOKEN must be supplied by the publisher's environment");+ if (!token) throw new Error("ATOMGIT_TOKEN must be supplied by the publisher's environment");const source = JSON.parse(execFileSync("gh", ["api", `repos/${repository}/releases/tags/${version}`],{ encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] }));if (source.draft !== false || source.prerelease !== false || source.tag_name !== version || source.target_commitish !== revision ||@@ -114,36 +112,51 @@ if (option === "--dry-run") {if (!release || release.prerelease) requireLatestSource();if (!release) {const repo = await request("");- if (!repo || repo.private || !repo.default_branch) throw new Error("A public initialized Gitee mirror is required");+ if (!repo || repo.private || !repo.default_branch) throw new Error("A public initialized AtomGit mirror is required");release = await request("/releases", "POST", {- tag_name: version, name: source.name || `Piik ${version}`, body, prerelease: true,- target_commitish: repo.default_branch,+ tag_name: version, name: source.name || `Piik ${version}`, body, release_status: "pre",+ target_commitish: revision,});}- if (!Number.isSafeInteger(release.id) || release.id <= 0) throw new Error("Invalid Gitee release identity");- const attachments = await request(`/releases/${release.id}/attach_files?per_page=100`);- if (!Array.isArray(attachments) || attachments.length >= 100) throw new Error("Unexpected mirror attachment list");+ const attachments = release.assets;+ if (!Array.isArray(attachments)) throw new Error("Unexpected mirror attachment list");for (const file of files) {- let uploaded = attachments.find((asset) => asset.name === file.name);+ const matches = attachments.filter((asset) => asset.name === file.name);+ if (matches.length > 1) throw new Error("Duplicate mirror attachment: " + file.name);+ let uploaded = matches[0];if (!uploaded) {if (!release.prerelease) throw new Error("Published mirror is incomplete; publish a corrected new version");- console.log(`Upload Gitee package: ${file.name} (${file.size} bytes)`);- const form = new FormData();- form.append("file", await openAsBlob(file.path), file.name);- uploaded = await request(`/releases/${release.id}/attach_files`, "POST", form);+ console.log("Upload AtomGit package: " + file.name + " (" + file.size + " bytes)");+ const upload = await request("/releases/" + version + "/upload_url?file_name=" + encodeURIComponent(file.name));+ if (!upload || typeof upload.url !== "string" || new URL(upload.url).protocol !== "https:" ||+ !upload.headers || typeof upload.headers !== "object") throw new Error("Invalid attachment upload response");+ // Signed locations and callback headers are credentials; never log them.+ let response;+ try {+ response = await fetch(upload.url, { method: "PUT", redirect: "error", headers: upload.headers,+ body: await openAsBlob(file.path), signal: AbortSignal.timeout(180_000) });+ if (!response.ok) throw new Error("HTTP " + response.status);+ await response.arrayBuffer();+ } catch (error) {+ const reason = response && !response.ok ? "HTTP " + response.status :+ error?.name === "TimeoutError" ? "timeout" : "network or response failure";+ throw new Error("AtomGit attachment upload failed: " + file.name + " (" + reason + "); rerun to inventory before retry");+ }+ release = await request("/releases/tags/" + version);+ uploaded = release?.assets?.find((asset) => asset.name === file.name);}await verifyDownload(uploaded, file);}- // Gitee has no draft API. Its preview flag fences incomplete uploads from checks.+ // Keep incomplete attachment sets out of stable update checks.if (release.prerelease) {// Uploads may take minutes; a newer GitHub release must not be displaced.requireLatestSource();- const completed = await request(`/releases/${release.id}`, "PATCH", {- tag_name: version, name: source.name || `Piik ${version}`, body, prerelease: false,+ const completed = await request(`/releases/${version}`, "PATCH", {+ tag_name: version, name: source.name || `Piik ${version}`, body, release_status: "latest",});if (completed.prerelease !== false || completed.tag_name !== version) {- throw new Error("Gitee did not confirm the completed stable mirror");+ throw new Error("AtomGit did not confirm the completed stable mirror");}}- console.log(`Verified Gitee mirror ${version} from ${revision} (${files.length} attachments).`);+ console.log(`Verified AtomGit mirror ${version} from ${revision} (${files.length} attachments).`);}diff --git a/scripts/release-version.mjs b/scripts/release-version.mjsindex 7c1e61f1..cfae2812 100644--- a/scripts/release-version.mjs+++ b/scripts/release-version.mjs@@ -17,9 +17,11 @@ export function stableTags(root, ...filter) {const nonProductPaths = ["site/**", "docs/**", "tests/**", ".agents/**", ".codex/**", ".githooks/**","*.md", ".gitignore", ".env.example", "vitest.config.ts",- "cmd/**/*.md", "internal/**/*.md", "native/**/*.md", "src/**/*.md",+ "cmd/**/*.md", "internal/**/*.md", "native/**/*.md", "src/**/*.md", "mobile/**/*.md",".github/ISSUE_TEMPLATE/**", ".github/pull_request_template.md",- ".github/workflows/website.yml", ".github/workflows/gitee-mirror.yml",+ ".github/workflows/website.yml", ".github/workflows/atomgit-mirror.yml",+ // Retired workflow deletions remain outside historical product diffs.+ ".github/workflows/gitee-mirror.yml","scripts/build-website.mjs", "scripts/update-website-hero.mjs", "scripts/build-film-controls.mjs","scripts/update-guide-images.mjs", "scripts/update-guide-diagrams.tsx","scripts/check-docs.mjs", "scripts/check-container.mjs", "scripts/markdown-slug.mjs", "scripts/check-project-state.*", "scripts/install-hooks.*",diff --git a/site/index.html b/site/index.htmlindex 4c77daf7..9492be25 100644--- a/site/index.html+++ b/site/index.html@@ -805,8 +805,8 @@href="https://github.com/TNTcraftHIM/Piik/releases/latest/download/piik-app-windows-amd64.zip"><svg aria-hidden="true"><use href="#download-mark" /></svg><span lang="en">Download from GitHub</span><span lang="zh-CN">GitHub 下载</span></a- ><a href="https://gitee.com/TNTcraftHIM/Piik/releases/download/latest/piik-app-windows-amd64.zip"- ><span lang="en">Download from Gitee</span><span lang="zh-CN">Gitee 国内镜像下载</span></a+ ><a href="https://atomgit.com/TNTcraftHIM/Piik/releases/download/latest/piik-app-windows-amd64.zip"+ ><span lang="en">Download from AtomGit</span><span lang="zh-CN">AtomGit 国内镜像下载</span></a></article><article class="download-card" aria-labelledby="download-macos">@@ -833,8 +833,8 @@href="https://github.com/TNTcraftHIM/Piik/releases/latest/download/piik-app-darwin-arm64.zip"><svg aria-hidden="true"><use href="#download-mark" /></svg><span lang="en">Download from GitHub</span><span lang="zh-CN">GitHub 下载</span></a- ><a href="https://gitee.com/TNTcraftHIM/Piik/releases/download/latest/piik-app-darwin-arm64.zip"- ><span lang="en">Download from Gitee</span><span lang="zh-CN">Gitee 国内镜像下载</span></a+ ><a href="https://atomgit.com/TNTcraftHIM/Piik/releases/download/latest/piik-app-darwin-arm64.zip"+ ><span lang="en">Download from AtomGit</span><span lang="zh-CN">AtomGit 国内镜像下载</span></a><p><span lang="en">Native capture requires macOS 13+.</span><span lang="zh-CN">原生采集需 macOS 13 及以上。</span></p></article>@@ -863,8 +863,8 @@href="https://github.com/TNTcraftHIM/Piik/releases/latest/download/piik-app-linux-amd64.zip"><svg aria-hidden="true"><use href="#download-mark" /></svg><span lang="en">Download from GitHub</span><span lang="zh-CN">GitHub 下载</span></a- ><a href="https://gitee.com/TNTcraftHIM/Piik/releases/download/latest/piik-app-linux-amd64.zip"- ><span lang="en">Download from Gitee</span><span lang="zh-CN">Gitee 国内镜像下载</span></a+ ><a href="https://atomgit.com/TNTcraftHIM/Piik/releases/download/latest/piik-app-linux-amd64.zip"+ ><span lang="en">Download from AtomGit</span><span lang="zh-CN">AtomGit 国内镜像下载</span></a></article></div>@@ -891,8 +891,8 @@<p class="download-variant">ARM64 / x64</p><a class="lr-btn button download-button" href="https://github.com/TNTcraftHIM/Piik/releases/latest/download/piik-app-android-universal.apk"><svg aria-hidden="true"><use href="#download-mark" /></svg><span lang="en">Download from GitHub</span><span lang="zh-CN">GitHub 下载</span></a- ><a href="https://gitee.com/TNTcraftHIM/Piik/releases/download/latest/piik-app-android-universal.zip"- ><span lang="en">Gitee ZIP (extract to install)</span><span lang="zh-CN">Gitee 国内镜像(ZIP,解压安装)</span></a>+ ><a href="https://atomgit.com/TNTcraftHIM/Piik/releases/download/latest/piik-app-android-universal.apk"+ ><span lang="en">Download from AtomGit</span><span lang="zh-CN">AtomGit 国内镜像下载</span></a><p class="download-note"><span lang="en">Android 10 or later.</span><span lang="zh-CN">Android 10 及以上。</span></p></article><article class="download-card" aria-labelledby="download-ios">@@ -911,6 +911,7 @@</section><div class="download-help"><a class="lr-btn button" href="https://github.com/TNTcraftHIM/Piik"><span lang="en">View on GitHub</span><span lang="zh-CN">GitHub 项目</span><span aria-hidden="true"> ↗</span></a>+ <a class="lr-btn button" href="https://atomgit.com/TNTcraftHIM/Piik"><span lang="en">View on AtomGit</span><span lang="zh-CN">AtomGit 项目</span><span aria-hidden="true"> ↗</span></a><p><span lang="en">Found a problem? <a href="https://github.com/TNTcraftHIM/Piik/issues">Let us know</a>.</span><span lang="zh-CN">遇到问题?欢迎<a href="https://github.com/TNTcraftHIM/Piik/issues">反馈</a>。</span></p></div></section>diff --git a/tests/publish-release.test.ts b/tests/publish-release.test.tsindex ac5a0bc9..e336dff6 100644--- a/tests/publish-release.test.ts+++ b/tests/publish-release.test.ts@@ -43,16 +43,16 @@ const release = (draft: boolean): Release => ({tag_name: version, target_commitish: revision, draft, prerelease: false, assets: completeAssets,});-describe("Gitee mirror publication", () => {+describe("AtomGit mirror publication", () => {const marker = `<!-- piik-source: ${revision} -->`;- const api = "https://gitee.com/api/v5/repos/TNTcraftHIM/Piik";- const download = `https://gitee.com/TNTcraftHIM/Piik/releases/download/${version}/`;+ const api = "https://api.atomgit.com/api/v5/repos/TNTcraftHIM/Piik";+ const download = `https://atomgit.com/TNTcraftHIM/Piik/releases/download/${version}/`;const sourceAssets = packageNames.map((name) => {const bytes = readFileSync(join(directory, name));return { name, size: bytes.length, digest: `sha256:${hash(bytes)}`, state: "uploaded" };});async function mirror(options: { existing?: "pending" | "published" | "unknown"; corrupt?: boolean;- wrongSource?: boolean; wrongDigest?: boolean; missing?: boolean;+ wrongSource?: boolean; wrongDigest?: boolean; missing?: boolean; uploadFailure?: boolean | number;stale?: boolean; supersededDuringUpload?: boolean;downloadFault?: { remaining: number; name: "TimeoutError" | "TypeError" };fault?: { method: string; remaining: number; status: number | "timeout" | "body-timeout" } } = {}) {@@ -64,9 +64,10 @@ describe("Gitee mirror publication", () => {} }));};const mutations: string[] = [];- const attachments = sourceAssets.filter(asset => !asset.name.endsWith(".apk"))+ const attachments = sourceAssets.map(({ name, size }) => ({ name, size, browser_download_url: download + name }));- const present = options.existing === "pending" ? attachments.slice(0, 1) : options.missing ? [] : attachments;+ const present = options.existing === "pending" ? attachments.slice(0, 1) : options.existing && !options.missing ? [...attachments] : [];+ let pending = options.existing !== "published";const source = {...release(false), html_url: `https://github.com/TNTcraftHIM/Piik/releases/tag/${version}`,target_commitish: options.wrongSource ? "b".repeat(40) : revision,@@ -82,11 +83,11 @@ describe("Gitee mirror publication", () => {} else expect(args[1]).toBe(`repos/TNTcraftHIM/Piik/releases/tags/${version}`);return JSON.stringify(source);});- vi.stubEnv("GITEE_TOKEN", "fixture-mirror-token");+ vi.stubEnv("ATOMGIT_TOKEN", "fixture-mirror-token");vi.stubGlobal("fetch", vi.fn<typeof fetch>(async (input, init) => {const url = String(input);if (url.startsWith(download)) {- expect(url).not.toMatch(/\.apk$/);+expect(init?.headers).toBeUndefined();const file = url.slice(download.length);if (options.downloadFault && options.downloadFault.remaining > 0) {@@ -96,7 +97,21 @@ describe("Gitee mirror publication", () => {}return new Response(options.corrupt ? "corrupt" : readFileSync(join(directory, file)));}- expect(init?.headers).toHaveProperty("Authorization", "Bearer fixture-mirror-token");+ if (url.startsWith("https://upload.example/")) {+ const name = url.slice("https://upload.example/".length);+ expect(init?.method).toBe("PUT");+ expect(init?.headers).not.toHaveProperty("PRIVATE-TOKEN");+ if (options.uploadFailure) {+ mutations.push("PUT " + name);+ if (typeof options.uploadFailure === "number") return new Response("secret signed upload URL", { status: options.uploadFailure });+ throw new Error("secret signed upload URL");+ }+ expect(hash(Buffer.from(await (init?.body as Blob).arrayBuffer()))).toBe(hash(readFileSync(join(directory, name))));+ mutations.push("PUT " + name);+ present.push(attachments.find(asset => asset.name === name)!);+ return new Response(null);+ }+ expect(init?.headers).toHaveProperty("PRIVATE-TOKEN", "fixture-mirror-token");expect(init?.redirect).toBe("error");const path = url.slice(api.length);const method = init?.method ?? "GET";@@ -109,26 +124,25 @@ describe("Gitee mirror publication", () => {}return new Response(null, { status: options.fault.status });}- if (path.startsWith("/releases/tags/")) return options.existing+ if (path.startsWith("/releases/tags/")) return options.existing || mutations.length? Response.json({ id: 42, tag_name: version, body: options.existing === "unknown" ? "unknown" : marker,- prerelease: options.existing !== "published" }) : new Response(null, { status: 404 });+ prerelease: pending, assets: [...present] }) : new Response(null, { status: 404 });if (path === "") return Response.json({ private: false, default_branch: "master" });if (path === "/releases" && method === "POST") {const body = JSON.parse(String(init?.body));- expect(body.prerelease).toBe(true);+ expect(body.release_status).toBe("pre");expect(body.body).toContain(marker);- return Response.json({ ...body, id: 42 });+ return Response.json({ ...body, prerelease: true, assets: [] });}- if (path.includes("/attach_files?") && method === "GET") return Response.json(options.existing ? present : []);- if (path.endsWith("/attach_files") && method === "POST") {- const file = (init?.body as FormData).get("file") as File;- expect(hash(Buffer.from(await file.arrayBuffer()))).toBe(hash(readFileSync(join(directory, file.name))));- return Response.json(attachments.find((asset) => asset.name === file.name));+ if (path.includes("/upload_url?") && method === "GET") {+ const name = new URL(url).searchParams.get("file_name")!;+ return Response.json({ url: "https://upload.example/" + name, headers: { "Content-Type": "application/octet-stream" } });}- if (path === "/releases/42" && method === "PATCH") {+ if (path === `/releases/${version}` && method === "PATCH") {const body = JSON.parse(String(init?.body));- expect(body.prerelease).toBe(false);- return Response.json({ ...body, id: 42 });+ expect(body.release_status).toBe("latest");+ pending = false;+ return Response.json({ ...body, prerelease: false, assets: present });}throw new Error(`Unexpected mirror request: ${method} ${path}`);}));@@ -155,14 +169,14 @@ describe("Gitee mirror publication", () => {const result = await mirror();expect(result.failure).toBeUndefined();expect(result.mutations[0]).toBe("POST /releases");- expect(result.mutations.at(-1)).toBe("PATCH /releases/42");- expect(result.mutations.filter((value) => value.endsWith("/attach_files"))).toHaveLength(sourceAssets.length - 1);+ expect(result.mutations.at(-1)).toBe(`PATCH /releases/${version}`);+ expect(result.mutations.filter((value) => value.startsWith("PUT "))).toHaveLength(sourceAssets.length);});it("resumes pending uploads and leaves complete stable releases unchanged", async () => {const pending = await mirror({ existing: "pending" });expect(pending.failure).toBeUndefined();- expect(pending.mutations.filter((value) => value.endsWith("/attach_files"))).toHaveLength(sourceAssets.length - 2);+ expect(pending.mutations.filter((value) => value.startsWith("PUT "))).toHaveLength(sourceAssets.length - 1);expect(await mirror({ existing: "published" })).toEqual({ mutations: [], failure: undefined });});@@ -174,7 +188,7 @@ describe("Gitee mirror publication", () => {}const superseded = await mirror({ existing: "pending", supersededDuringUpload: true });expect(superseded.failure).toContain("Only the latest GitHub release");- expect(superseded.mutations).not.toContain("PATCH /releases/42");+ expect(superseded.mutations).not.toContain(`PATCH /releases/${version}`);expect(await mirror({ existing: "published", stale: true })).toEqual({ mutations: [], failure: undefined });});@@ -194,7 +208,7 @@ describe("Gitee mirror publication", () => {const failed = await mirror({ downloadFault });expect(failed.failure).toBeDefined();expect(downloadFault.remaining).toBe(1);- expect(failed.mutations).not.toContain("PATCH /releases/42");+ expect(failed.mutations).not.toContain(`PATCH /releases/${version}`);});it("does not repeat forbidden reads or ambiguous writes", async () => {@@ -217,10 +231,19 @@ describe("Gitee mirror publication", () => {expect(result.mutations).toEqual([]);});+ it.each([true, 403, 413, 503])("reports safe upload diagnostics without retrying PUT (%s)", async (uploadFailure) => {+ const result = await mirror({ uploadFailure });+ expect(result.failure).toContain(typeof uploadFailure === "number" ? "HTTP " + uploadFailure : "network or response failure");+ expect(result.mutations.filter(value => value.startsWith("PUT "))).toHaveLength(1);+ expect(result.failure).toContain("rerun to inventory before retry");+ expect(result.failure).not.toContain("secret signed");+ expect(result.mutations).not.toContain(`PATCH /releases/${version}`);+ });+it("does not publish a corrupt upload or repair a published missing file", async () => {const corrupt = await mirror({ corrupt: true });expect(corrupt.failure).toMatch(/mismatch/);- expect(corrupt.mutations).not.toContain("PATCH /releases/42");+ expect(corrupt.mutations).not.toContain(`PATCH /releases/${version}`);const incomplete = await mirror({ existing: "published", missing: true });expect(incomplete.failure).toContain("corrected new version");expect(incomplete.mutations).toEqual([]);diff --git a/tests/release-automation.test.ts b/tests/release-automation.test.tsindex 352af9c2..20b5320b 100644--- a/tests/release-automation.test.ts+++ b/tests/release-automation.test.ts@@ -176,13 +176,16 @@ describe("release automation", () => {"scripts/app-gate-endpoint.ts", "scripts/client-gate-endpoint.ts","scripts/network-lab.ts", "scripts/network-lab/endpoint.ts", "scripts/network-lab/stun/main.go","tests/room.test.ts", ".agents/skills/ponytail/SKILL.md", ".github/workflows/website.yml",- ".github/workflows/gitee-mirror.yml", "scripts/release-mirror-source.mjs"]) {+ ".github/workflows/atomgit-mirror.yml", ".github/workflows/gitee-mirror.yml", "mobile/README.md", "scripts/release-mirror-source.mjs"]) {mkdirSync(dirname(join(root, path)), { recursive: true });writeFileSync(join(root, path), "Peripheral content");}git("add", ".");git("commit", "-m", "feat(site)!: redesign the website\n\nBREAKING CHANGE: website layout only");expect(plan()).toMatchObject({ version: "development", publish: false });+ git("rm", ".github/workflows/gitee-mirror.yml");+ git("commit", "-m", "chore(mirror): remove retired workflow");+ expect(plan()).toMatchObject({ version: "development", publish: false });commit("fix: repair playback\n\nExample text:\nfeat: is not this commit's type");expect(plan().version).toBe("v1.0.1");commit("feat(site)!: refresh the film", "site/film/art.js");