Update docs peer.paste

This commit is contained in:
Raven Scott
2026-05-27 23:58:04 -04:00
parent 345dbf2156
commit 60d17a7b91
+37 -14
View File
@@ -4,16 +4,16 @@ Temporary P2P text snippets for the P2NS network.
## Features
- Expiring pastes (default 24h, max 7 days)
- Optional burn-after-first-read
- Optional max read count
- Realtime websocket-driven UI updates
- Text + markdown formats with preview support
- Encryption by default (AES-GCM), optional public paste mode
- Text and markdown authoring with live preview
- Syntax highlighting support in preview and paste views
- Encryption by default (AES-GCM), optional public mode
- Optional passphrase-derived encryption mode
- Lightweight inline attachments (bounded)
- Expiring pastes (default 24h, max 7 days)
- Optional burn-after-first-read and max-read limits
- Lightweight inline attachments with total-size cap
- Public share links (`/p/:id`)
- Raw API access (`/api/pastes/:id/raw`)
- Raw consume API (`/api/pastes/:id/raw`)
- Metadata replication via HyperDB
## API
@@ -34,17 +34,40 @@ Temporary P2P text snippets for the P2NS network.
- `GET /api/openapi.json` machine-readable OpenAPI schema
- `GET /p/:id` human-readable paste page
## Notes
- Pasted content is stored in HyperDB and replicates with peers.
- A cleanup task runs hourly to purge expired/consumed entries.
- Burn-after-first-read pastes are intentionally excluded from recent active lists.
## Realtime WS Messages
## Realtime WebSocket Messages
- Client -> server: `request-pastes`, `create-paste`, `destroy-paste`
- Server -> client: `init`, `pastes-page`, `pastes-updated`, `paste-created`, `paste-destroyed`, `error`
## Payload Notes
- Create/Update fields used by plugin:
- `format`: `text` or `markdown`
- `public`: `true` for plaintext storage, otherwise encrypted payload expected
- `encrypted`: `{ iv, ciphertext, salt? }` for encrypted mode
- `encryptionMode`: e.g. `aes-gcm`, `passphrase-aes-gcm`, `none`
- `attachments`: inline list of `{ id, name, mime, size, data }`
## Limits and Behavior
- Content max length: `100000` chars
- Expiry max: `168` hours
- Max read count value: `1000000`
- Attachment cap:
- max attachments processed: `16`
- max total attachment bytes: `64MB`
- Burn-after-first-read pastes are intentionally excluded from recent active lists.
- Cleanup task runs hourly and removes expired/consumed entries.
- Paste data is replicated via HyperDB.
## Local Vendor Assets (No CDN)
`peer.paste` serves markdown/highlight dependencies locally via:
- `/api/vendor/marked.min.js`
- `/api/vendor/highlight.min.js`
- `/api/vendor/highlight-dark.css`
## Validation Script
- Run `node test-scripts/peer-paste-smoke.js https://peer.paste` to validate core API/OpenAPI availability.