Skip to content

v0.2.4

Choose a tag to compare

@ptonlix ptonlix released this 15 Oct 07:29
· 11 commits to main since this release
b0a53ab

v0.2.4

日期:2026-10-15

这是 v0.2.3 之后的店面源码打包修复。公开页面、设备码、授权范围、买家注册、买入开关、支付成功条件、店面缓存、文本压缩范围、Caddy 匹配和安装回滚都没有改。没有新的数据库迁移。compose.yaml 与 v0.2.3 相同。install.sh 与 v0.2.3 相同。

还没有接受过店面发布时,下载接口要打包镜像工作目录里的 storefront/。v0.2.3 的运行镜像只有 Next standalone、静态资源和数据库迁移,这个目录不在里面。打包抛错后返回 50301,正文是「店面下载暂时不可用。」首页仍是内置页,所以网站看起来正常。这一版把仓库里的 storefront/ 复制到 /app/storefront。已有发布仍下载该发布自己的源码包。

生产应用镜像是 docker.io/<用户名>/merclink:0.2.4。正式版同时推送 0.2.4 和 latest。只换应用镜像即可。不需要换 compose.yaml。

中文

这一版能做什么

  • 生产镜像的进程工作目录包含 storefront/accept.mjs、preview.mjs、render-slots.mjs 和 README.md。standalone 文件追踪不包括这个目录,所以 runner 在 /app 下单独复制它。
  • .dockerignore 不排除 storefront/。构建上下文里仍有这个目录。
  • 还没有 storefront_releases 记录时,带 storefront:write 的 GET /api/v1/storefront/source 从 /app/storefront 打包。压缩包里有上述验收和预览脚本,以及由当前默认公开页生成的起始 HTML 和样式。
  • 已经接受过发布时,下载的仍是该发布保存的源码包,不是这份起始目录。没有激活的发布时,公开页仍是内置页。

这一版不做

  • 不改公开页的店名、货架、二维码和执照尺寸、页脚或规格轴显示。
  • 不改设备码流程、scope、买家注册或支付成功条件。只有订单状态 paid 表示支付成功。
  • 不改店面 HTML 的 no-store,也不改 CSS、JS 的 10 分钟新鲜期和之后最多 24 小时的后台校验。
  • 不改公开图片按 id 缓存一年的规则。缺失图片仍是 404。
  • 不改 Caddy 的五行 Content-Type 匹配,也不改镜像标签。仍是 caddy:2.11.7-alpine。
  • 不改一键安装询问的字段,不安装系统包,也不默认打开买入。安装和升级未完成时的回滚与 v0.2.3 相同。
  • 不改 50301 的文案。目录以外的打包失败仍返回「店面下载暂时不可用。」已有发布的对象缺失时,文案仍是「店面源码暂时无法读取。」
  • 不激活店面,不补写历史发布,也不把 Docker Hub 用户名、令牌、域名或证书写进仓库。

升级注意

修复在应用镜像里。compose.yaml 和 install.sh 与 v0.2.3 相同。不要删 .env,也不要删 caddy_data。

一键安装过的机器,等这个正式版发布后执行:

curl -fsSL -o /tmp/merclink-install.sh https://github.com/ptonlix/MercLink/releases/latest/download/install.sh && bash /tmp/merclink-install.sh upgrade

upgrade 会下载这个 tag 的 compose.yaml,保留已有密钥和后来手工打开的买入配置,然后 pull。它不打印已保存的密码。这次 compose.yaml 没有变化。升级如果没有完成,部署文件和版本号会回到升级前;已经换上的容器要再执行 docker compose up -d 才和文件一致。

手工部署的机器不要再跑一键安装。把 MERCLINK_IMAGE 改为 docker.io/<用户名>/merclink:0.2.4,然后执行:

docker compose pull && docker compose up -d

不要加 --build。拉取完成后,用带 storefront:write 的商家令牌再请求 GET /api/v1/storefront/source。还没有发布记录时,压缩包里应有 accept.mjs。

回滚时把应用镜像改回 docker.io/<用户名>/merclink:0.2.3,再 pull。不要把 latest 当作回滚点。latest 会在这个正式版发布时移到 0.2.4。退回 0.2.3 会再次缺少 /app/storefront,第一次下载又会返回 50301。

English

Date: 2026-10-15

This is the storefront source packaging fix after v0.2.3. The public pages, device-code flow, authorization scopes, buyer registration, purchase switch, the rule that only paid means payment success, storefront caching, the set of compressed types, the Caddy matchers, and install rollback are unchanged. There is no new database migration. compose.yaml is the same file as v0.2.3. install.sh is the same file as v0.2.3.

Before any storefront release is accepted, the download packs storefront/ from the image working directory. The v0.2.3 runner image contains the Next standalone output, static assets, and database migrations, and does not contain that directory. The pack error becomes 50301 with the message 店面下载暂时不可用。 The home page stays on the built-in page, so the site still looks healthy. This version copies the repository storefront/ directory to /app/storefront. A release that has already been accepted is still downloaded as that release's own source archive.

The production image is docker.io/<namespace>/merclink:0.2.4. The stable release also publishes latest. Replacing the application image is enough. compose.yaml does not need to change.

What this version does

  • The production image working directory contains storefront/accept.mjs, preview.mjs, render-slots.mjs, and README.md. Standalone file tracing does not include this directory, so the runner copies it into /app on its own.
  • .dockerignore does not exclude storefront/. The build context still contains the directory.
  • When storefront_releases has no row, GET /api/v1/storefront/source with storefront:write packs /app/storefront. The archive contains those acceptance and preview scripts, plus the starter HTML and stylesheet generated from the current default public pages.
  • After a release has been accepted, the download remains that release's stored source archive, not this starter directory. With no active release, public pages remain the built-in pages.

What this version does not do

  • It does not change the public store name, shelf, contact-QR or license size, footer, or variant-axis display.
  • It does not change the device-code flow, scopes, buyer registration, or the payment-success rule. Only order status paid means payment succeeded.
  • It does not change no-store on storefront HTML, or the 10-minute freshness window and later 24-hour background revalidation for CSS and JS.
  • It does not change the one-year cache for a public image id. A missing image is still 404.
  • It does not change Caddy's five Content-Type lines or the image tag. It remains caddy:2.11.7-alpine.
  • It does not change what one-click install asks for, it does not install system packages, and it does not turn purchase on by default. Rollback of an unfinished install or upgrade stays as it was in v0.2.3.
  • It does not change the 50301 wording. A pack failure outside this missing directory still returns 店面下载暂时不可用。 A missing object for an accepted release still returns 店面源码暂时无法读取。
  • It does not activate a storefront, backfill old releases, or store a Docker Hub username, token, domain, or certificate in the repository.

Upgrade note

The fix is in the application image. compose.yaml and install.sh match v0.2.3. Do not delete .env or caddy_data.

After this stable release is published, a host installed by the script should run:

curl -fsSL -o /tmp/merclink-install.sh https://github.com/ptonlix/MercLink/releases/latest/download/install.sh && bash /tmp/merclink-install.sh upgrade

upgrade downloads compose.yaml for this tag, keeps generated secrets and any later purchase settings, then pulls. It does not print stored passwords. This compose.yaml is unchanged. If this upgrade does not finish, the deploy files and version pin return to their previous values. Containers already recreated from the new image match those files only after another docker compose up -d.

Do not run a fresh one-click install over a deployment that was created by hand. Set MERCLINK_IMAGE to docker.io/<namespace>/merclink:0.2.4, then run:

docker compose pull && docker compose up -d

Do not add --build. After the pull, request GET /api/v1/storefront/source again with a merchant token that has storefront:write. When no release row exists, the archive contains accept.mjs.

To roll back, set the application image to docker.io/<namespace>/merclink:0.2.3 and pull again. Do not use latest as the rollback point. latest moves to 0.2.4 when this stable release is published. Returning to 0.2.3 removes /app/storefront again, and the first download returns 50301.