From 60c586001cf4d21ef1351be8c8ad7a269a6f005a Mon Sep 17 00:00:00 2001 From: Elvis Claros Castro Date: Sat, 3 Oct 2026 19:03:27 -0300 Subject: Share one session through a public link claude-logbook -s REF --share uploads a session to a share server and prints its link; --shares lists them, --unshare deletes them, --expire picks how long they live. Before uploading it shows what goes up and warns about anything that looks like a credential. server/ is that share server: Go, standard library only, a FROM scratch image. It serves /share/ as a page, .txt and .json, accepts only the JSON payload (never HTML), pins the template's scripts with a CSP, keeps secrets hashed and rate-limits per client IP. --- server/README.md | 115 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 server/README.md (limited to 'server/README.md') diff --git a/server/README.md b/server/README.md new file mode 100644 index 0000000..8e2de37 --- /dev/null +++ b/server/README.md @@ -0,0 +1,115 @@ +# claude-logbook share server + +Serves the sessions published with `claude-logbook -s REF --share`: + +| Route | | +| --- | --- | +| `GET /` | Home with the instructions. | +| `GET /share/` | The conversation as a page (the CLI's `template.html`). | +| `GET /share/.txt` | Plain text transcript. | +| `GET /share/.json` | The stored payload. | +| `POST /api/shares` | `{"payload": {...}, "expire": "30d"}` → `201 {id, url, secret, expires}` | +| `PUT /api/shares/` | `Authorization: Bearer `; replaces the payload. | +| `DELETE /api/shares/` | `Authorization: Bearer `. | +| `GET /healthz` | `ok`. | + +Anyone can create a share; only the holder of the secret returned on +creation can replace or delete it. The server keeps only the secret's SHA-256. + +## Security model + +- **No HTML is accepted.** The payload is the JSON of `claude-logbook --json -s`; + it is checked field by field, unknown keys are dropped, memories are refused, + and the page is built from the template embedded in the binary. +- The data goes inside `