47 lines
1.1 KiB
Markdown
47 lines
1.1 KiB
Markdown
|
|
# __PROJECT_NAME__
|
||
|
|
|
||
|
|
A Shade-enabled Bun + Hono server. Encrypted messages in/out via two HTTP endpoints.
|
||
|
|
|
||
|
|
## Prerequisites
|
||
|
|
|
||
|
|
A running Shade prekey server. The default is `__PREKEY_SERVER__`. You can either:
|
||
|
|
- Run one locally: `docker run -p 3900:3900 shade-prekey-server`
|
||
|
|
- Override with `SHADE_PREKEY_SERVER=...` in `.env`
|
||
|
|
|
||
|
|
## Run
|
||
|
|
|
||
|
|
```bash
|
||
|
|
bun install
|
||
|
|
bun run start
|
||
|
|
```
|
||
|
|
|
||
|
|
The server registers itself with the prekey server on startup.
|
||
|
|
|
||
|
|
## Endpoints
|
||
|
|
|
||
|
|
### Send an encrypted message
|
||
|
|
|
||
|
|
```bash
|
||
|
|
curl -X POST http://localhost:3000/send \
|
||
|
|
-H "Content-Type: application/json" \
|
||
|
|
-d '{"to": "peer-name", "message": "hello"}'
|
||
|
|
```
|
||
|
|
|
||
|
|
Returns a `ShadeEnvelope` you can forward to the peer via any transport.
|
||
|
|
|
||
|
|
### Receive an encrypted envelope
|
||
|
|
|
||
|
|
```bash
|
||
|
|
curl -X POST http://localhost:3000/receive \
|
||
|
|
-H "Content-Type: application/json" \
|
||
|
|
-d '{"from": "peer-name", "envelope": {...}}'
|
||
|
|
```
|
||
|
|
|
||
|
|
Returns the decrypted plaintext.
|
||
|
|
|
||
|
|
## Next steps
|
||
|
|
|
||
|
|
- Wire a real delivery layer (WebSocket, HTTP push, etc.)
|
||
|
|
- Run `shade dashboard` to watch live activity
|
||
|
|
- Compare fingerprints with peers out-of-band before trusting sessions
|