From f8bbe6efc33ea153d6c5228de23d543a3cf9ee3d Mon Sep 17 00:00:00 2001 From: npub1qyvc0c5kl4gqv2fd97fsk46tu378sqgy35vc83rvgfwne90sel7s0ed67d <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@sprout-oss.stage.blox.sqprod.co> Date: Sat, 27 Jun 2026 11:57:17 -0400 Subject: [PATCH] chore(compose,scripts): drop Typesense from local dev/test stacks Search is Postgres FTS; the relay no longer reads TYPESENSE_URL/_API_KEY, so the local stacks no longer provision or wait on a Typesense container: - docker-compose.yml: removed the typesense service + typesense-data volume. - deploy/compose/compose.yml: removed the typesense service, its volume, the relay's TYPESENSE_URL env, and the relay depends_on: typesense health gate; compose.dev.yml: removed the typesense port/CORS override. - scripts/start-relay-for-tests.sh: stopped bringing up + health-waiting on the typesense container and stopped exporting TYPESENSE_* to the relay. - scripts/{dev-setup,run-tests}.sh: removed TYPESENSE_* env export/printout. - scripts/dev-reset.sh, e2e-*.sh, compose READMEs/run.sh: doc-string cleanup. Verified: docker compose config renders cleanly for docker-compose.yml and for deploy/compose (compose.yml + compose.dev.yml), zero typesense in the rendered output; all touched shell scripts pass bash -n. Co-authored-by: Tyler Longwell Signed-off-by: Tyler Longwell --- deploy/compose/README.md | 4 ++-- deploy/compose/compose.dev.yml | 6 ------ deploy/compose/compose.yml | 28 ---------------------------- deploy/compose/run.sh | 2 +- docker-compose.yml | 32 -------------------------------- scripts/dev-reset.sh | 2 +- scripts/dev-setup.sh | 6 +----- scripts/e2e-git-perms.sh | 2 +- scripts/e2e-relay-membership.sh | 2 +- scripts/run-tests.sh | 2 -- scripts/start-relay-for-tests.sh | 5 +---- 11 files changed, 8 insertions(+), 83 deletions(-) diff --git a/deploy/compose/README.md b/deploy/compose/README.md index 217ced7ef..0de524fb5 100644 --- a/deploy/compose/README.md +++ b/deploy/compose/README.md @@ -29,14 +29,14 @@ keypair. `!reset` tag to remove the direct relay port when Caddy terminates HTTPS. - Default `BUZZ_IMAGE` tracks `ghcr.io/block/buzz:main` for early testing. Pin it to `ghcr.io/block/buzz:sha-<7>` or a semver release tag for production once available. - Keep `BUZZ_RELAY_PRIVATE_KEY`, `BUZZ_GIT_HOOK_HMAC_SECRET`, database/Redis, - Typesense, and S3 secrets stable across restarts. + and S3 secrets stable across restarts. - `RELAY_OWNER_PUBKEY` is intentionally not prefixed with `BUZZ_`; it must be a 64-character hex Nostr pubkey when closed relay mode is enabled. - `BUZZ_AUTO_MIGRATE` is opt-in. Set `BUZZ_AUTO_MIGRATE=true` or run `buzz-admin migrate` before starting the relay when bootstrapping a fresh database. Auto-migration requires an image that includes embedded SQLx migrations. -- The stack uses Postgres, Redis, Typesense, MinIO, and a git data volume because +- The stack uses Postgres, Redis, MinIO, and a git data volume because those are real Buzz dependencies today. Minimal mode can simplify this later. Run `./run.sh backup-hint` for the backup checklist. diff --git a/deploy/compose/compose.dev.yml b/deploy/compose/compose.dev.yml index 258553a72..00ce14c1f 100644 --- a/deploy/compose/compose.dev.yml +++ b/deploy/compose/compose.dev.yml @@ -7,12 +7,6 @@ services: ports: - "${REDIS_PORT:-6379}:6379" - typesense: - environment: - TYPESENSE_ENABLE_CORS: "true" - ports: - - "${TYPESENSE_PORT:-8108}:8108" - minio: ports: - "${MINIO_API_PORT:-9000}:9000" diff --git a/deploy/compose/compose.yml b/deploy/compose/compose.yml index 2f2dc0abe..bc3c27501 100644 --- a/deploy/compose/compose.yml +++ b/deploy/compose/compose.yml @@ -11,7 +11,6 @@ services: BUZZ_METRICS_PORT: "9102" DATABASE_URL: postgres://${POSTGRES_USER:-buzz}:${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-buzz} REDIS_URL: redis://:${REDIS_PASSWORD:?set REDIS_PASSWORD}@redis:6379 - TYPESENSE_URL: http://typesense:8108 BUZZ_S3_ENDPOINT: http://minio:9000 BUZZ_S3_ACCESS_KEY: ${BUZZ_S3_ACCESS_KEY:?set BUZZ_S3_ACCESS_KEY} BUZZ_S3_SECRET_KEY: ${BUZZ_S3_SECRET_KEY:?set BUZZ_S3_SECRET_KEY} @@ -28,8 +27,6 @@ services: condition: service_healthy redis: condition: service_healthy - typesense: - condition: service_healthy minio: condition: service_healthy minio-init: @@ -85,28 +82,6 @@ services: networks: - buzz-net - typesense: - image: typesense/typesense:30.2 - environment: - TYPESENSE_DATA_DIR: /data - TYPESENSE_API_KEY: ${TYPESENSE_API_KEY:?set TYPESENSE_API_KEY} - TYPESENSE_ENABLE_CORS: "false" - volumes: - - buzz-typesense-data:/data - healthcheck: - test: - [ - "CMD-SHELL", - "bash -c 'exec 3<>/dev/tcp/127.0.0.1/8108; printf \"GET /health HTTP/1.1\\r\\nHost: 127.0.0.1\\r\\nConnection: close\\r\\n\\r\\n\" >&3; cat <&3 | grep -q ok'", - ] - interval: 10s - timeout: 5s - retries: 12 - start_period: 15s - restart: unless-stopped - networks: - - buzz-net - minio: image: minio/minio:RELEASE.2025-09-07T16-13-09Z command: server /data --console-address ":9001" @@ -151,9 +126,6 @@ volumes: buzz-redis-data: labels: com.buzz.volume: redis - buzz-typesense-data: - labels: - com.buzz.volume: typesense buzz-minio-data: labels: com.buzz.volume: minio diff --git a/deploy/compose/run.sh b/deploy/compose/run.sh index 9138cd546..d5465ea1f 100755 --- a/deploy/compose/run.sh +++ b/deploy/compose/run.sh @@ -39,7 +39,7 @@ backup_hint() { cat <<'MSG' Back up these before upgrades and on a regular schedule: -- deploy/compose/.env, especially BUZZ_RELAY_PRIVATE_KEY, DB/Redis/Typesense/S3 secrets, and BUZZ_GIT_HOOK_HMAC_SECRET +- deploy/compose/.env, especially BUZZ_RELAY_PRIVATE_KEY, DB/Redis/S3 secrets, and BUZZ_GIT_HOOK_HMAC_SECRET - The owner private key if bootstrap generated one for RELAY_OWNER_PUBKEY - Postgres data (prefer pg_dump or a quiesced volume snapshot) - MinIO/S3 bucket contents for media and git objects diff --git a/docker-compose.yml b/docker-compose.yml index 19ff5c387..0056ea6a4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -52,34 +52,6 @@ services: com.buzz.env: "dev" restart: unless-stopped - typesense: - image: typesense/typesense:30.2 - container_name: buzz-typesense - environment: - TYPESENSE_DATA_DIR: /data - TYPESENSE_API_KEY: buzz_dev_key - TYPESENSE_ENABLE_CORS: "true" - ports: - - "8108:8108" - volumes: - - typesense-data:/data - networks: - - buzz-net - healthcheck: - test: ["CMD-SHELL", "ls /proc/1/exe > /dev/null 2>&1 && kill -0 1 2>/dev/null || exit 1"] - interval: 10s - timeout: 5s - retries: 12 - start_period: 15s - deploy: - resources: - limits: - memory: 256m - labels: - com.buzz.service: "typesense" - com.buzz.env: "dev" - restart: unless-stopped - adminer: image: adminer:latest container_name: buzz-adminer @@ -202,10 +174,6 @@ volumes: name: buzz-postgres-data labels: com.buzz.volume: "postgres" - typesense-data: - name: buzz-typesense-data - labels: - com.buzz.volume: "typesense" minio-data: name: buzz-minio-data labels: diff --git a/scripts/dev-reset.sh b/scripts/dev-reset.sh index aea180d96..4d40ebb4e 100755 --- a/scripts/dev-reset.sh +++ b/scripts/dev-reset.sh @@ -29,7 +29,7 @@ cd "${REPO_ROOT}" # ---- Confirm ---------------------------------------------------------------- if [[ "${1:-}" != "--yes" ]]; then - echo -e "${YELLOW}WARNING: This will DELETE all local data (postgres, typesense volumes).${NC}" + echo -e "${YELLOW}WARNING: This will DELETE all local data (postgres, minio volumes).${NC}" echo -e " Redis data is ephemeral and always wiped on restart." echo "" read -r -p "Are you sure? [y/N] " confirm diff --git a/scripts/dev-setup.sh b/scripts/dev-setup.sh index 41c09fe44..0815d48b4 100755 --- a/scripts/dev-setup.sh +++ b/scripts/dev-setup.sh @@ -59,7 +59,6 @@ load_env() { if [[ "${PGUSER:-}" == "sprout" ]]; then PGUSER="buzz"; fi if [[ "${PGPASSWORD:-}" == "sprout_dev" ]]; then PGPASSWORD="buzz_dev"; fi if [[ "${PGDATABASE:-}" == "sprout" ]]; then PGDATABASE="buzz"; fi - if [[ "${TYPESENSE_API_KEY:-}" == "sprout_dev_key" ]]; then TYPESENSE_API_KEY="buzz_dev_key"; fi export DATABASE_URL="${DATABASE_URL:-postgres://buzz:buzz_dev@localhost:5432/buzz}" export PGHOST="${PGHOST:-localhost}" @@ -68,13 +67,11 @@ load_env() { export PGPASSWORD="${PGPASSWORD:-buzz_dev}" export PGDATABASE="${PGDATABASE:-buzz}" export REDIS_URL="${REDIS_URL:-redis://localhost:6379}" - export TYPESENSE_API_KEY="${TYPESENSE_API_KEY:-buzz_dev_key}" - export TYPESENSE_URL="${TYPESENSE_URL:-http://localhost:8108}" } cleanup_legacy_sprout_containers() { local legacy_containers - legacy_containers=$(docker ps -a --format '{{.Names}}' | grep -E '^sprout-(postgres|redis|typesense|adminer|keycloak|minio|minio-init|prometheus)$' || true) + legacy_containers=$(docker ps -a --format '{{.Names}}' | grep -E '^sprout-(postgres|redis|adminer|keycloak|minio|minio-init|prometheus)$' || true) if [[ -z "${legacy_containers}" ]]; then return fi @@ -184,7 +181,6 @@ echo -e "${GREEN}=======================================================${NC}" echo "" echo -e " ${BLUE}Postgres${NC} ${DATABASE_URL}" echo -e " ${BLUE}Redis${NC} ${REDIS_URL}" -echo -e " ${BLUE}Typesense${NC} ${TYPESENSE_URL} (key: ${TYPESENSE_API_KEY})" echo -e " ${BLUE}Adminer${NC} http://localhost:8082 (DB browser)" echo -e " ${BLUE}Keycloak${NC} http://localhost:8180 (admin / admin — local OAuth testing)" echo "" diff --git a/scripts/e2e-git-perms.sh b/scripts/e2e-git-perms.sh index a086183a3..105c1d547 100755 --- a/scripts/e2e-git-perms.sh +++ b/scripts/e2e-git-perms.sh @@ -5,7 +5,7 @@ # Two bots collaborate on a simple web page via the Buzz relay's git server. # # Prerequisites: -# - Docker services running (postgres, redis, typesense) +# - Docker services running (postgres, redis, minio) # - Relay built: cargo build --release --bin buzz-relay # - Credential helper built: cargo build --release --bin git-credential-nostr # - Signing program built: cargo build --release --bin git-sign-nostr diff --git a/scripts/e2e-relay-membership.sh b/scripts/e2e-relay-membership.sh index 6830af919..bea7332ad 100755 --- a/scripts/e2e-relay-membership.sh +++ b/scripts/e2e-relay-membership.sh @@ -5,7 +5,7 @@ # Tests relay-level membership enforcement and admin commands. # # Prerequisites: -# - Docker services running (postgres, redis, typesense) +# - Docker services running (postgres, redis, minio) # - Relay built: cargo build --release --bin buzz-relay # - nak available on PATH (for event signing) # diff --git a/scripts/run-tests.sh b/scripts/run-tests.sh index 3405410e8..db27c42d6 100755 --- a/scripts/run-tests.sh +++ b/scripts/run-tests.sh @@ -47,8 +47,6 @@ else export PGPASSWORD=buzz_dev export PGDATABASE=buzz export REDIS_URL="redis://localhost:6379" - export TYPESENSE_API_KEY="buzz_dev_key" - export TYPESENSE_URL="http://localhost:8108" fi # ---- Track results ---------------------------------------------------------- diff --git a/scripts/start-relay-for-tests.sh b/scripts/start-relay-for-tests.sh index 482d6a315..7dfb1b6da 100755 --- a/scripts/start-relay-for-tests.sh +++ b/scripts/start-relay-for-tests.sh @@ -55,7 +55,7 @@ err() { echo -e "${RED}[relay-test]${NC} $*" >&2; } cd "${REPO_ROOT}" log "Starting docker compose services..." -docker compose up -d postgres redis typesense minio minio-init +docker compose up -d postgres redis minio minio-init # ── Wait for services to be healthy ────────────────────────────────────────── @@ -78,7 +78,6 @@ wait_healthy() { wait_healthy "Postgres" "buzz-postgres" wait_healthy "Redis" "buzz-redis" -wait_healthy "Typesense" "buzz-typesense" wait_healthy "MinIO" "buzz-minio" # ── Apply database schema ──────────────────────────────────────────────────── @@ -129,8 +128,6 @@ log "Starting relay..." nohup env \ DATABASE_URL=postgres://buzz:buzz_dev@localhost:5432/buzz \ REDIS_URL=redis://localhost:6379 \ - TYPESENSE_URL=http://localhost:8108 \ - TYPESENSE_API_KEY=buzz_dev_key \ RELAY_URL=ws://localhost:3000 \ BUZZ_BIND_ADDR=0.0.0.0:3000 \ BUZZ_REQUIRE_AUTH_TOKEN=false \