Gittree is a Rust-based NIP-34 Git service built on Nostr transport with GRASP-compatible repository metadata and a relay-backed state model.
Gittree ships as a set of Rust services plus supporting infrastructure:
Rust services:
relay: Nostr relay with NIP-11/42/43 support and GRASP metadata.admission: admission policy hook for event validation.state: state lookup service for hooks and coordinators.coordinator: repo provisioning and Forgejo integration.sync: reconciliation of git refs into state.git-http: Git HTTP gateway to Forgejo.webhook: Forgejo webhook ingestion.control: control plane (NIP-98 authenticated).auth: signup and profile API (NIP-98 authenticated).ui: legacy UI service.app: static app UI host (Leptos build output).
Infra services:
postgresforgejomailpitnginx
Host ports from docker-compose.yml:
- relay: 8080
- admission: 8081
- state: 8082
- coordinator: 8083
- sync: 8084
- git-http: 8085
- ui: 8086
- webhook: 8087
- control: 8088
- auth: 8089
- app: 8090
- postgres: 5432
- mailpit: 1025 / 8025
- nginx: 80
- forgejo: internal 3000 / 22 (not published to host)
Relay tenancy is host-based. The relay resolves a tenant by the Host header,
and returns 404 for unknown hosts. Create tenants via the control plane
before serving relay traffic.
Per-tenant policy:
public_read=falserequires NIP-42 auth plus membership for reads.public_write=falserequires NIP-42 auth plus membership for writes.
Membership is managed with NIP-43 join/leave semantics. Invites are exposed via membership list and claim events.
The control service exposes NIP-98 authenticated endpoints:
POST /v1/relay/tenants: create a tenant, generate relay signer material, and seed owner membership.POST /v1/repos: create a repo from a signed NIP-34 announcement.
Tenant creation payload (JSON):
{
"host": "relay.example",
"name": "Example Relay",
"description": "...",
"public_read": false,
"public_write": false,
"auth_required": true
}
The auth service provides:
POST /v1/signup: create or reuse an account bound to a Nostr pubkey.GET /v1/profileandPATCH /v1/profile: manage profile data.
All services read from .env. Key operator variables include:
GITTREE_RELAY_URLSGITTREE_CONTROL_TOKENGITTREE_CONTROL_ADMIN_KEYSGITTREE_FORGEJO_API_TOKENGITTREE_FORGEJO_OWNERGITTREE_FORGEJO_WEBHOOK_SECRETGITTREE_STORAGE_READ_URLGITTREE_STORAGE_WRITE_URL
See .env.example for the full set.
Logs are written under ./logs/ by default, with per-service subdirectories
and Docker service output.
Contributions are welcome. Feel free to open issues or pull requests.
Gittree is released into the public domain under the Unlicense. See LICENSE.