2026-08-09 18:35:00 +08:00
2026-08-09 02:42:45 +08:00
2026-08-09 02:42:45 +08:00
2026-08-09 18:35:00 +08:00
2026-08-09 02:42:45 +08:00
2026-08-08 05:00:54 +08:00
2026-08-08 04:33:05 +08:00
2026-08-08 04:33:05 +08:00

Coruna Lab Web

独立的渠道静态资源构建与分发服务,与 coruna-lab(Laravel C2 / Admin)同级部署。

coruna-lab-web/
├── frontend/
│   ├── source/          # 只读模板 / 明文输入(勿直接 --apply)
│   ├── tools/           # new_project / patch_*
│   ├── doc/             # Stage JS / sync / C2 链路文档
│   └── tests/           # native path patch 等工具测试
├── build_api/           # 同步 Build / Delete HTTP API(FastAPI)
├── docs/BUILD_API.md
├── tests/               # build_api 单元测试
└── artifacts/           # 本地默认产物根(gitignore)
    └── channel/<id>/{web,sync,out,manifest.json}

兄弟项目:

ios-fetch/
├── coruna-lab/          # Laravel:渠道元数据、C2、Admin
└── coruna-lab-web/      # 本仓库:构建 + 静态产物站

Laravel 通过 CORUNA_BUILD_SERVICE_* 调用本服务的:

  • POST /v1/channels/{id}/build
  • DELETE /v1/channels/{id}

公开静态路径:

/channel/<id>/web/support.html
/channel/<id>/sync/daily.html

Setup

cd coruna-lab-web
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

export BUILD_API_TOKEN="$(python3 -c 'import secrets; print(secrets.token_urlsafe(48))')"
export BUILD_API_ARTIFACT_ROOT="$PWD/artifacts"
python3 -m build_api

手动构建(不经 API):

python3 frontend/tools/new_project.py \
  --channel-id 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' \
  --deployment-domains 'www.dep.example' \
  --reporting-domains 'www.rep.example' \
  --support-template test   # test | blank

Tests

python3 -m unittest discover -s tests -p 'test_*.py'
python3 -m unittest discover -s frontend/tests -p 'test_*.py'
python3 -m unittest discover -s frontend/tools/tests -p 'test_*.py'

Deploy

见 docs/BUILD_API.md。可用宝塔等面板托管进程与反向代理,仓库内不维护 Nginx / systemd 样例。

S
Description
No description provided
Readme 21 MiB
Languages
HTML 93.3%
Python 6.7%