Renew the device certificate from the browser, with the recovery phrase

Within the last 30 days the owner page offers it. The node signs a new certificate for the same device key (peer ID and listings stay), saves it, and signs again own listings that would outlive the old certificate. The phrase is used for one request and not kept; another identity's phrase and no-phrase identities are refused. Device.Current gives the certificate to sign with while a renewal happens.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeFqV96dVeBX94inzcgZKw
This commit is contained in:
2026-11-18 23:19:30 +01:00
co-authored by Claude Sonnet 5.5
parent 210ba1b3e9
commit dfe35b422d
23 changed files with 1011 additions and 29 deletions
+2 -1
View File
@@ -449,7 +449,8 @@ token written to `admin.token` at init, mode 0600).
| method and path | auth | |
|---|---|---|
| `GET /api/v1/status` | no | peer ID, addresses, identity, regions, peer and listing counts |
| `GET /api/v1/status` | no | peer ID, addresses, identity, regions, peer and listing counts, `cert_expires_at` (unix seconds) and `can_renew` |
| `PUT /api/v1/certificate` | token | `{"phrase": "<12 words>"}`: renew the device certificate (see "Recovery" and renewal above); answers `{"cert_expires_at"}`. 400 malformed phrase, 409 another identity's phrase or an identity without a phrase |
| `GET /api/v1/listings` | no | filters: `geohash` (comma-separated prefixes), `kind`, `category`, `min_price`, `max_price`, `min_area`, `min_rooms`, `limit` (max 200), `offset` |
| `GET /api/v1/listings/{author}/{id}` | no | one listing |
| `POST /api/v1/listings` | token | publish a draft; the node adds identity, time, PoW and signature |