robustness: split jetstream into own container, add cursor persistence
Jetstream was running backgrounded in the same container as the API server, so crashes went undetected and Docker never restarted it. Now each process runs as a separate docker-compose service with independent restart policies. Also adds cursor persistence to SQLite (saved every 5s) so restarts resume from where they left off, moves event destructuring inside try/catch blocks, and adds global unhandled error/rejection handlers for crash visibility.
This commit is contained in:
14
README.md
14
README.md
@@ -1,6 +1,8 @@
|
||||
# litenote-jetstream
|
||||
|
||||
Backend for [Remanso](https://remanso.space), a blogging platform on the AT Protocol. Listens to the Jetstream firehose for `space.remanso.note` records and serves them via a REST API.
|
||||
Backend for [Remanso](https://remanso.space), a blogging platform on the AT
|
||||
Protocol. Listens to the Jetstream firehose for `space.remanso.note` records and
|
||||
serves them via a REST API.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
@@ -39,13 +41,13 @@ docker run -p 8080:8080 -v litenote-data:/data litenote-jetstream
|
||||
|
||||
## API
|
||||
|
||||
| Endpoint | Description |
|
||||
|---|---|
|
||||
| `GET /notes?cursor=&limit=` | Paginated notes from all users |
|
||||
| Endpoint | Description |
|
||||
| -------------------------------- | ---------------------------------- |
|
||||
| `GET /notes?cursor=&limit=` | Paginated notes from all users |
|
||||
| `GET /:did/notes?cursor=&limit=` | Paginated notes for a specific DID |
|
||||
|
||||
## Environment Variables
|
||||
|
||||
| Variable | Default | Description |
|
||||
|---|---|---|
|
||||
| Variable | Default | Description |
|
||||
| ------------- | ---------- | -------------------------------- |
|
||||
| `SQLITE_PATH` | `notes.db` | Path to the SQLite database file |
|
||||
|
||||
Reference in New Issue
Block a user