lightweight proxy for GTS comments #3

Merged
james merged 2 commits from feat/comments-proxy into main 2026-05-26 03:44:47 +00:00
Owner
No description provided.
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>
docs: add CLAUDE.md project guide
All checks were successful
CI / build (pull_request) Successful in 29s
Proxy / test (pull_request) Successful in 58s
a21912f008
Capture architecture (Hugo module + proxy), commands (hvm-managed Hugo,
proxy tests), conventions, release process, and the non-obvious gotchas
(Go strips vendor/ dirs; nested proxy go.mod; drafts needed to render
the partial; GoToSocial vs Mastodon auth).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
james merged commit 7edde48d1e into main 2026-05-26 03:44:47 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
james/hugo-ap-comments!3
No description provided.