From 530e4c07d6917fc4de1999e885639eb80da1ca76 Mon Sep 17 00:00:00 2001 From: kat Date: Sun, 4 Oct 2026 21:37:00 -0400 Subject: [PATCH] Add constellation --- .env.example | 3 +++ Caddyfile | 8 +++++++- README.md | 39 ++++++++++++++++++++++++--------------- compose.local.yaml | 12 ++++++++++++ compose.yaml | 27 +++++++++++++++++++++++++++ 5 files changed, 73 insertions(+), 16 deletions(-) diff --git a/.env.example b/.env.example index 0fddc85..e128c4a 100644 --- a/.env.example +++ b/.env.example @@ -23,6 +23,9 @@ PLC_POSTGRES_PASSWORD= # Jetstream DEPLOY_JETSTREAM=1 +# Constellation +DEPLOY_CONSTELLATION=1 + # Relay DEPLOY_RELAY=1 RELAY_ADMIN_PASSWORD= diff --git a/Caddyfile b/Caddyfile index 0e71c23..880e877 100644 --- a/Caddyfile +++ b/Caddyfile @@ -14,12 +14,18 @@ reverse_proxy plc:{$PLC_PORT} } - # Jetstream (read API) + # Jetstream @jetstream host jetstream.{$DOMAIN} handle @jetstream { reverse_proxy jetstream:{$JETSTREAM_PORT} } + # Constellation + @constellation host constellation.{$DOMAIN} + handle @constellation { + reverse_proxy constellation:{$CONSTELLATION_PORT} + } + # Relay @relay host relay.{$DOMAIN} handle @relay { diff --git a/README.md b/README.md index 880ee74..40dbd7e 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,12 @@ Self-contained [AT Protocol](https://atproto.com) development environment. +- PDS +- PLC +- Relay +- Jetstream +- Constellation + ## setup ```sh @@ -14,18 +20,19 @@ Fill out `.env`. Set `DEPLOY_*` to `0` to disable a service. ## remote -| Service | Address | -| --------- | --------------------------- | -| PDS | `https://pds.$DOMAIN` | -| PLC | `https://plc.$DOMAIN` | -| Relay | `https://relay.$DOMAIN` | -| Jetstream | `https://jetstream.$DOMAIN` | +| Service | Address | +| ------------- | ------------------------------- | +| PDS | `https://pds.$DOMAIN` | +| PLC | `https://plc.$DOMAIN` | +| Relay | `https://relay.$DOMAIN` | +| Jetstream | `https://jetstream.$DOMAIN` | +| Constellation | `https://constellation.$DOMAIN` | Caddy sits in front as a reverse proxy. 1. Set `DOMAIN` and fill in every blank secret in `.env`. -2. Point `pds`, `plc`, `relay`, and `jetstream` DNS records at this host and - terminate TLS in front of Caddy (it listens on `CADDY_PORT`). +2. Point `pds`, `plc`, `relay`, `jetstream`, and `constellation` DNS records + at this host and terminate TLS in front of Caddy (it listens on `CADDY_PORT`). 3. `docker compose up -d`. Request crawl: @@ -39,12 +46,13 @@ docker compose restart relay ## localhost -| Service | Address | -| --------- | ----------------------- | -| PDS | `http://localhost:3000` | -| PLC | `http://localhost:4000` | -| Relay | `http://localhost:2470` | -| Jetstream | `http://localhost:8080` | +| Service | Address | +| ------------- | ----------------------- | +| PDS | `http://localhost:3000` | +| PLC | `http://localhost:4000` | +| Relay | `http://localhost:2470` | +| Jetstream | `http://localhost:8080` | +| Constellation | `http://localhost:6789` | ```sh docker compose -f compose.yaml -f compose.local.yaml up -d @@ -61,4 +69,5 @@ docker compose restart relay ## notes -Handles use `.test` by default, e.g. `alice.test`. +- Handles use `.test` by default, e.g. `alice.test`. +- Constellation duplicates indexed records every every 4 seconds 🤷‍♀️. diff --git a/compose.local.yaml b/compose.local.yaml index d6707f4..0adf811 100644 --- a/compose.local.yaml +++ b/compose.local.yaml @@ -31,3 +31,15 @@ services: environment: - JETSTREAM_RELAY_URL=http://localhost:2470 - JETSTREAM_PLC_URL=http://localhost:4000 + + constellation: + network_mode: host + command: + - "--jetstream" + - "ws://localhost:8080/subscribe" + - "--backend" + - "rocks" + - "--data" + - "/data" + - "--bind" + - "0.0.0.0:6789" diff --git a/compose.yaml b/compose.yaml index 2178021..ac543a9 100644 --- a/compose.yaml +++ b/compose.yaml @@ -14,11 +14,13 @@ services: - PLC_PORT=4000 - JETSTREAM_PORT=8080 - RELAY_PORT=2470 + - CONSTELLATION_PORT=6789 depends_on: - pds - plc - jetstream - relay + - constellation restart: unless-stopped deploy: replicas: ${DEPLOY_CADDY:-1} @@ -109,6 +111,30 @@ services: deploy: replicas: ${DEPLOY_JETSTREAM:-1} + constellation: + container_name: constellation + build: + context: https://tangled.org/microcosm.blue/microcosm-rs.git + dockerfile: constellation/Dockerfile + volumes: + - constellation_data:/data + command: + - "--jetstream" + - "ws://jetstream:8080/subscribe" + - "--backend" + - "rocks" + - "--data" + - "/data" + - "--bind" + - "0.0.0.0:6789" + - "--did-web-domain" + - "constellation.${DOMAIN}" + depends_on: + - jetstream + restart: unless-stopped + deploy: + replicas: ${DEPLOY_CONSTELLATION:-1} + relay: container_name: relay build: @@ -159,6 +185,7 @@ volumes: pds_data: plc_data: jetstream_data: + constellation_data: relay_data: relay_db_data: caddy_data: -- knotmirror 0.0.1