This commit is contained in:
@@ -1,6 +1,42 @@
|
||||
# Zooid
|
||||
<p align="center">
|
||||
<img src="./zooid-wordmark.jpeg" alt="Zooid" width="280" />
|
||||
</p>
|
||||
|
||||
This is a multi-tenant relay based on [Khatru](https://gitworkshop.dev/fiatjaf.com/nostrlib/tree/master/khatru) which implements a range of access controls. It's designed to be used with [Flotilla](https://flotilla.social) as a community relay (complete with NIP 29 support), but it can also be used outside of a community context.
|
||||
<p align="center">
|
||||
<b>A multi-tenant Nostr relay for communities.</b>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="#quick-start">Quick start</a> ·
|
||||
<a href="#configuration">Configuration</a> ·
|
||||
<a href="#api">API</a> ·
|
||||
<a href="#deploying">Deploying</a>
|
||||
</p>
|
||||
|
||||
---
|
||||
|
||||
Zooid is a multi-tenant relay built on [Khatru](https://gitworkshop.dev/fiatjaf.com/nostrlib/tree/master/khatru) with a flexible set of access controls. It's designed to pair with [Flotilla](https://flotilla.social) as a community relay (with full NIP 29 support), but it works just fine outside of a community context too.
|
||||
|
||||
## Features
|
||||
|
||||
- **Multi-tenant** — run any number of virtual relays from a single instance, each with its own host, schema, and policy.
|
||||
- **Community-ready** — first-class support for [NIP 29](https://github.com/nostr-protocol/nips/blob/master/29.md) groups, invite codes, and role-based access.
|
||||
- **Batteries included** — optional [Blossom](https://github.com/hzrd149/blossom) media, [NIP 86](https://github.com/nostr-protocol/nips/blob/master/86.md) management, [NIP 9a](https://github.com/nostr-protocol/nips/pull/1079) push, and [LiveKit](https://livekit.io/) audio/video calls.
|
||||
- **Remotely manageable** — JSON REST API authenticated via [NIP 98](https://github.com/nostr-protocol/nips/blob/master/98.md).
|
||||
- **Operationally simple** — single binary, SQLite storage, OCI container, optional pprof.
|
||||
|
||||
## Quick start
|
||||
|
||||
```sh
|
||||
docker run -it \
|
||||
-p 3334:3334 \
|
||||
-v ./config:/app/config \
|
||||
-v ./media:/app/media \
|
||||
-v ./data:/app/data \
|
||||
ghcr.io/coracle-social/zooid
|
||||
```
|
||||
|
||||
Drop a TOML config file into `./config/` (see [Configuration](#configuration)) and the relay will be available at `ws://<host>:3334`.
|
||||
|
||||
## Architecture
|
||||
|
||||
@@ -13,7 +49,7 @@ Zooid supports a few environment variables, which configure shared resources lik
|
||||
- `PORT` - the port the server will listen on for all requests. Defaults to `3334`.
|
||||
- `CONFIG` - where to store relay configuration files. Defaults to `./config`.
|
||||
- `MEDIA` - where to store blossom media files. Defaults to `./media`.
|
||||
- `DATA` - where to store databse files. Defaults to `./data`.
|
||||
- `DATA` - where to store database files. Defaults to `./data`.
|
||||
- `API_HOST` - the hostname on which to expose the management API. If not set, the API is disabled.
|
||||
- `API_WHITELIST` - a comma-separated list of nostr hex pubkeys authorized to use the management API. Required when `API_HOST` is set.
|
||||
- `PPROF_ADDR` - an http host to serve pprof stats on.
|
||||
@@ -153,13 +189,16 @@ See `justfile` for defined commands.
|
||||
|
||||
## Deploying
|
||||
|
||||
Zooid can be run using an OCI container:
|
||||
Zooid is published as an OCI container at `ghcr.io/coracle-social/zooid`. See the [Quick start](#quick-start) above for a minimal `docker run` invocation. When running behind a reverse proxy, make sure the original `Host` header is forwarded unmodified — see the note on [`host`](#configuration) above.
|
||||
|
||||
```sh
|
||||
docker run -it \
|
||||
-p 3334:3334 \
|
||||
-v ./config:/app/config \
|
||||
-v ./media:/app/media \
|
||||
-v ./data:/app/data \
|
||||
ghcr.io/coracle-social/zooid
|
||||
```
|
||||
Zooid keeps state on disk (SQLite under `/app/data`, TOML configs under `/app/config`, Blossom blobs under `/app/media`) and serves long-lived WebSocket connections, so prefer platforms with **persistent volumes** and avoid scale-to-zero runtimes.
|
||||
|
||||
### One-click: Render
|
||||
|
||||
[](https://render.com/deploy)
|
||||
|
||||
The repo includes a [`render.yaml`](./render.yaml) blueprint that provisions a web service from the published image with a 10 GB persistent disk mounted at `/app` (covering `config/`, `data/`, and `media/`). After clicking the button and pointing Render at this repo, set any extra env vars from [Environment](#environment) and deploy.
|
||||
|
||||
## License
|
||||
|
||||
[MIT](./LICENSE)
|
||||
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
services:
|
||||
- type: web
|
||||
name: zooid
|
||||
runtime: image
|
||||
image:
|
||||
url: ghcr.io/coracle-social/zooid
|
||||
plan: starter
|
||||
region: oregon
|
||||
envVars:
|
||||
- key: PORT
|
||||
value: "3334"
|
||||
- key: CONFIG
|
||||
value: /app/config
|
||||
- key: DATA
|
||||
value: /app/data
|
||||
- key: MEDIA
|
||||
value: /app/media
|
||||
disk:
|
||||
name: zooid-data
|
||||
mountPath: /app
|
||||
sizeGB: 10
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 302 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 48 KiB |
Reference in New Issue
Block a user