docs(peer-sync): token now sent (gitignored docs/peer_sync_token.txt)
ci / smoke (push) Canceled after 0s
ci / smoke (push) Canceled after 0s
This commit is contained in:
1 parent
0dbd7b153c
commit
58b77419f5
2 files changed
+12
-6
No files matched your search
@@ -54,3 +54,6 @@ Thumbs.db
|
||||
|
||||
# Local AI tool config (contains API key)
|
||||
opencode.json
|
||||
|
||||
# Peer sync shared secret — copy with the handoff, never commit
|
||||
docs/peer_sync_token.txt
|
||||
@@ -37,12 +37,12 @@ Base URL from FCP `.env`:
|
||||
|
||||
```
|
||||
PEER_API_URL=http://192.168.192.209:7000 # zenai peer (empty => peer sync disabled)
|
||||
PEER_API_TOKEN=<shared secret> # optional -> X-API-Key header
|
||||
PEER_API_TOKEN=<shared secret> # -> X-API-Key header (value in docs/peer_sync_token.txt)
|
||||
PEER_API_TIMEOUT=5 # seconds, per request
|
||||
```
|
||||
|
||||
Requests are plain JSON POSTs. Headers: `Content-Type: application/json`,
|
||||
optional `X-API-Key`.
|
||||
`X-API-Key: <PEER_API_TOKEN>`.
|
||||
|
||||
### 1.1 Start — `POST {PEER_API_URL}/api/batch/start`
|
||||
|
||||
@@ -146,8 +146,11 @@ JSON FCP sends is dropped before it reaches `counter_control.py`.
|
||||
- Store the metadata on the zenai batch row (new columns or a JSON blob) so
|
||||
zenai history can be joined with FCP history by `source` + `fcp_batch_number`.
|
||||
|
||||
### 3.3 Optional API key (recommended)
|
||||
### 3.3 API key (now sent by FCP)
|
||||
|
||||
- FCP sends `X-API-Key: <PEER_API_TOKEN>` on every start/stop request.
|
||||
- The shared secret lives in `docs/peer_sync_token.txt` (**gitignored**) — copy
|
||||
that file together with this handoff. Same value is in the FCP `.env`.
|
||||
- Accept `X-API-Key` on `/api/batch/start` and `/api/batch/stop`.
|
||||
- Validate **only when the header is present**, so the zenai dashboard UI keeps
|
||||
working unchanged.
|
||||
@@ -242,9 +245,9 @@ mirror DB with plate `B9999TEST`, and the mirror batch mode left on `manual`.
|
||||
on zenai still shows batches 1–3 for 2026-11-13 — test batch #4 is missing
|
||||
from zenai history. `end_batch()` reports the DB write as failed. Must be
|
||||
fixed on zenai, otherwise every synced batch vanishes from zenai history.
|
||||
4. **No `X-API-Key` check.** `PEER_API_TOKEN` is empty on the mirror, so the
|
||||
header was not sent and zenai accepted the call. Untested behaviour for a
|
||||
wrong key. → §3.3.
|
||||
4. **No `X-API-Key` check.** FCP now always sends the header (random secret,
|
||||
see `docs/peer_sync_token.txt`), but zenai ignores it — no 401 path exists
|
||||
yet. → §3.3.
|
||||
|
||||
## 6. Where the FCP code lives
|
||||
|
||||
|
||||
Reference in new issue
Block a user