lightweight proxy for GTS comments #3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/comments-proxy"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds proxy/, a tiny stdlib-only HTTP service so the static comments widget can load replies from an auth-required instance (GoToSocial returns 401 to anonymous /api/v1 requests). It holds the bearer token server-side, attaches it upstream, and returns CORS-enabled JSON. - single configured upstream; forwards ONLY GET /api/v1/statuses/{id}/context (validated id) so it can't be an open proxy or make other authenticated calls - CORS allowlist, OPTIONS preflight, in-memory TTL cache, /healthz - config via env (UPSTREAM_HOST, ACCESS_TOKEN, ALLOWED_ORIGINS, LISTEN_ADDR, CACHE_TTL, UPSTREAM_TIMEOUT) - Dockerfile (distroless static, nonroot), docker-compose example - unit tests + e2e tests that build & run the real binary over HTTP - .forgejo/workflows/proxy.yml runs vet + unit + e2e + build on proxy/ changes - own go.mod so it's excluded from the Hugo module shipped to consumers Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>