fix(release): move the release mirror out of the website dist - #2150
Merged
Conversation
The release mirror lived in BitFun-Website/dist/release. `npm run build` empties dist/, so every website deploy deleted the mirrored installers and manifests — downloads and the updater fallback 404'd until the next cron sync re-downloaded ~2.3 GB from GitHub. Point WEBSITE_RELEASE_DIR at /srv/bitfun-release instead, outside any build output, and let the environment override it. nginx serves that directory through a `location ^~ /release/` alias, so the public URLs are unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
发布镜像目录原本是
BitFun-Website/dist/release。npm run build会清空dist/,所以每次网站部署都会删掉整个镜像——2.3 GB 的安装包和latest.json/downloads.json/linux-binaries.json/relay-image.json全部消失。后果:
今天更新官网时踩到了,已在生产环境验证复现。
改动
WEBSITE_RELEASE_DIR改为/srv/bitfun-release(构建产物之外),并允许环境变量覆盖。nginx 通过location ^~ /release/alias 指向该目录,公开 URL 完全不变。^~前缀用于阻止下方~* \.(js|css|png|...)$那条 immutable 缓存 regex 抢匹配。生产环境已完成的操作
mv到/srv/bitfun-release(同文件系统,瞬时;迁移前后文件列表+大小逐项比对一致)location ^~ /release/,nginx -t通过后 reloadAlready exists(无丢失、无重新下载)diff一致/srv/bitfun-release完好,/release/*全部 200/206验证
node --test scripts/linux-binaries-manifest.test.mjs→ 9/9 通过/release/latest.json/release/downloads.json/release/linux-binaries.json/release/relay-image.json.sig均 200,/release/0.2.16/bitfun-installer.exerange 请求 206,目录遍历 403遗留
nginx 站点配置
/etc/nginx/sites-available/openbit.fun目前只存在于服务器上,未纳入任何仓库版本管理(本次改动只能靠这条 PR 描述留痕)。是否要像deploy/miniapp-market/那样把它收进仓库,另议。