Add owner inbox UI with address release
Web: "My listings" (listings, requests of a listing, conversation) in three panes on wide screens and one at a time on phones, and a sheet or dialog to release the exact address. Sign-in uses a link printed by `node run` (token in the URL fragment, kept in sessionStorage only). API: GET /api/v1/mine (own listings with request counts and whether an address is saved); inbox rows gain last_dir, needs_reply, preview, effort and grant_until, and can be filtered by listing. Docs: PROTOCOL.md and README describe the owner UI and login. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
+20
-3
@@ -307,8 +307,24 @@ text rules below are enforced by endpoints.
|
||||
`#/c/<author>/<id>/<thread secret>` (the secret stays in the URL fragment,
|
||||
which is never sent to a server) that polls every 20 s, shows only verified
|
||||
owner replies and counts the rest as rejected; `#/messages` lists the
|
||||
conversations stored in this browser. There is **no owner UI yet**; the owner
|
||||
uses the admin API.
|
||||
conversations stored in this browser.
|
||||
- **Owner UI** (`#/mine`): your listings (requests needing a reply, whether an
|
||||
address is saved), the requests of one listing (status, preview, effort,
|
||||
filters), a conversation, and a sheet to **release the address** (prefilled
|
||||
from the saved one; address, phone, a free-text note, validity 1 to 30 days).
|
||||
Three panes side by side on a wide screen, one at a time on a phone. It uses
|
||||
the admin API above plus `GET /api/v1/mine` (own listings with request counts
|
||||
and `address_saved`) and `GET /api/v1/inbox?listing=<id>`, whose rows also
|
||||
carry `last_dir`, `needs_reply`, a text `preview` (empty for hidden messages),
|
||||
`effort` (proof-of-work bits of the first message) and `grant_until`.
|
||||
- **Owner login.** The page itself never contains the admin token (every node
|
||||
serves the same page, including public gateways). `node run` prints a link
|
||||
`http://127.0.0.1:8080/#/login/<token>` to the terminal, not to its log. The
|
||||
token is in the URL fragment, which a browser never sends to a server; the
|
||||
page moves it into `sessionStorage` (so closing the tab signs out), removes it
|
||||
from the address bar and sends it only to the node that served the page. A
|
||||
paste field is the fallback; a token the node refuses (for example after
|
||||
`recover`) is forgotten.
|
||||
|
||||
### Limits of this design
|
||||
|
||||
@@ -338,6 +354,7 @@ token written to `admin.token` at init, mode 0600).
|
||||
| `POST /api/v1/listings` | token | publish a draft; the node adds identity, time, PoW and signature |
|
||||
| `PUT /api/v1/listings/{id}` | token | replace own listing (`seq + 1`); the region cannot change |
|
||||
| `DELETE /api/v1/listings/{id}` | token | publish a tombstone |
|
||||
| `GET /api/v1/mine` | token | your live listings with request counts and whether an address is saved (messaging, see above) |
|
||||
|
||||
Reads send `Access-Control-Allow-Origin: *` (the data is public). Writes are
|
||||
not cross-origin. Images are not supported yet. `status` also reports the
|
||||
@@ -379,7 +396,7 @@ Proof-of-work per listing and per revocation, plus subscribable blocklists
|
||||
|
||||
## Open
|
||||
|
||||
An owner UI for the inbox, abuse reporting for messages, reciprocity rules, anti-
|
||||
Abuse reporting for messages, reciprocity rules, anti-
|
||||
discrimination (AGG) content rules, blocklists, peer scoring and rate limits,
|
||||
incremental sync and anti-entropy, DHT discovery, UI publishing, image hosting,
|
||||
recovering listings onto a fresh machine with an empty database, a helper to
|
||||
|
||||
Reference in New Issue
Block a user