Local convex

From joelhooks/joelclaw · View interactive version

Local convex is an AI agent skill from the GitHub repository joelhooks/joelclaw. Operate Joel's local self-hosted Convex setup with Central Postgres and NAS-backed Garage/S3-compatible object storage. Use when: 'local convex', 'self-hosted convex', 'Convex S3', 'Convex Garage', 'Garage', 'Convex MinIO', 'Convex buckets', 'run Convex locally', or any task wiring/debugging the loc

How to use this skill

Skill file

Local Convex

For private addresses, accounts, ports, and host roles, see .brain/resources/operator-network-context.svx in the private dark-wizard repo and the tailnet-topology skill. Replace angle-bracket placeholders with the configured values before running commands.

Operate Joel's local self-hosted Convex setup. This is not generic Convex advice. It is the local joelclaw path: Central Postgres for database state and Garage on <nas> for S3-compatible object storage. The custom MinIO install is now a rollback/reference path. ASUSTOR MinIO CE is only a temporary smoke-test reference.

Canonical Sources

Read these before mutating the setup:

If those disagree, prefer the brain project note for current truth, then verify live state with non-secret health checks.

Current Local Topology

Custom MinIO is a rollback/reference path, not canonical:

ASUSTOR MinIO CE is not canonical:

Convex Buckets

Garage should have these Convex buckets:

Convex Env Shape

Use the generated secret values from the NAS env file. Do not print them in chat.

AWS_REGION=usw2
S3_ENDPOINT_URL=http://<tailnet-ip>:<service-port>
AWS_S3_FORCE_PATH_STYLE=true
AWS_ACCESS_KEY_ID=<from <nas-hdd-export>/s3/garage-compose/convex-s3.env>
AWS_SECRET_ACCESS_KEY=<from <nas-hdd-export>/s3/garage-compose/convex-s3.env>
S3_STORAGE_EXPORTS_BUCKET=joelclaw-local-usw2-convex-exports
S3_STORAGE_SNAPSHOT_IMPORTS_BUCKET=joelclaw-local-usw2-convex-snapshot-imports
S3_STORAGE_MODULES_BUCKET=joelclaw-local-usw2-convex-modules
S3_STORAGE_FILES_BUCKET=joelclaw-local-usw2-convex-files
S3_STORAGE_SEARCH_BUCKET=joelclaw-local-usw2-convex-search

Health Checks

Prefer checks that do not reveal secrets:

tailscale ping --timeout=5s --c 2 <nas>
nc -vz -w 5 <tailnet-ip> <object-api-port>
curl -sS -m 5 -o /tmp/garage-root.out -w '%{http_code}\n' http://<tailnet-ip>:<service-port>/

Garage does not allow anonymous S3 access; a 403 AccessDenied response from / proves the API is reachable.

For MinIO rollback/reference only:

curl -fsS -m 5 http://<tailnet-ip>:<service-port>/minio/health/ready
nc -vz -w 5 <tailnet-ip> <s3-api-port>
nc -vz -w 5 <tailnet-ip> <object-console-port>

For CE reference only:

curl -fsS -m 5 http://<tailnet-ip>:<service-port>/minio/health/ready

NAS Access Rules

Central Postgres Rules

sudo -u joelclaw psql -h /Users/Shared/joelclaw/run -p 5432 -d postgres

Garage Operations

The Garage installer has already completed successfully. Re-run it only to reconcile the service after intentional edits:

ssh -t <ssh-user>@<nas> 'sudo sh <nas-export>/s3/install-three-body-convex-garage.sh'

The installer:

Do not expose Garage to the public internet. LAN/tailnet only.

Local Convex Runner

The current projectless setup staged a local runner at:

/Users/joel/Documents/Codex/2026-06-17/we-re-setting-up-durable-self/work/local-convex

Important files:

Selective Exposure

Convex is intentionally exposed by named interfaces and ports only. Do not change this to a wildcard 0.0.0.0 bind.

Current verified URLs:

# Local
http://127.0.0.1:3210
http://127.0.0.1:3211
http://127.0.0.1:6791

# Tailnet (through the Origin proxy)
http://<host-tailnet-ip>:3210
http://<host-tailnet-ip>:3211
http://<host-tailnet-ip>:6791

The LAN listener is retired (sec-20261103-003, 2026-11-03): the old

com.joelclaw.local-convex.lan-forwarder LaunchDaemon is booted out and

disabled. Do not bring it back; LAN clients use the tailnet address.

Implementation:

Known Docker Desktop gotcha:

Manage the proxy:

cd /Users/joel/Code/joelhooks/joelclaw
CONVEX_PROXY_ALARM_AS=<sender name> CONVEX_PROXY_ALARM_TO=<desk> ./infra/central/native/install-convex-origin-proxy.sh
launchctl print gui/$(id -u)/com.joelclaw.convex-origin-proxy
node --test infra/central/native/test-convex-origin-proxy.mjs

Manage tailnet forwards without disturbing unrelated Tailscale Serve config:

tailscale serve --bg --yes --tcp 3210 tcp://127.0.0.1:13210
tailscale serve --bg --yes --tcp 3211 tcp://127.0.0.1:13211
tailscale serve --bg --yes --tcp 6791 127.0.0.1:6792
tailscale serve status --json

# Disable only the Convex forwards if needed.
tailscale serve --tcp=3210 off
tailscale serve --tcp=3211 off
tailscale serve --tcp=6791 off

Do not run tailscale serve reset casually; there may be unrelated Serve routes on this node.

Exposure checks:

curl -fsS -m 5 http://127.0.0.1:3210/version
curl -fsS -m 5 http://<host-tailnet-ip>:3210/version
curl -fsSI -m 5 http://127.0.0.1:13210/version | grep -i x-convex-origin-proxy   # proxy answers

# A foreign Origin must get 403; no Origin must reach Convex.
curl -s -o /dev/null -w '%{http_code}\n' -X POST -H 'Origin: https://evil.example' \
  -H 'content-type: application/json' -d '{"path":"x:y","args":{}}' http://<host-tailnet-ip>:3210/api/mutation

# The LAN address must refuse connections (listener retired).
curl -fsS -m 5 http://<host-lan-ip>:3210/version || echo "refused, as intended"

curl -fsSI -m 5 http://127.0.0.1:6791
curl -fsSI -m 5 http://<host-tailnet-ip>:6791

lsof -nP -iTCP:3210 -iTCP:3211 -iTCP:6791 -iTCP:6792 -iTCP:13210 -iTCP:13211 -sTCP:LISTEN

The healthy self-hosted backend /version response is currently unknown.

Secret Handling

Operating Sequence

When asked to wire or debug local Convex:

  1. Read the brain project note.
  2. Verify Garage S3 API reachability on <object-api-port>.
  3. Verify whether Convex env is pointing at Garage by IP, not MinIO CE and not the tailnet alias.
  4. Confirm Central Postgres is the DB target; do not move Postgres state to NAS.
  5. Run a Convex-level export/import or file upload smoke test.
  6. If exposing Convex beyond localhost, keep Docker bound to localhost and use the selective LAN/Tailscale forwarding model above.
  7. Capture any durable change back into the brain project note.
  8. Leave custom MinIO and MinIO CE alone until the Garage-backed Convex path is proven and Joel explicitly wants cleanup.

Gotchas

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.