kom-relay fit for public use #85

Merged
littlefox merged 2 commits from issue-67-relay into main 2026-10-17 23:13:39 +00:00
Owner

Closes #67

Limits per address/total (503), upload pacing, idle timeout, allowed origins (403), X-Forwarded-For behind a trusted proxy; NEOKOM_RELAY_* env. Relay split into lib + main; 5 in-process integration tests. docs/RELAY.md: threat model, Caddy/nginx.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XJW2ocwLunyaLiUwCBHEP8

Closes #67 Limits per address/total (503), upload pacing, idle timeout, allowed origins (403), X-Forwarded-For behind a trusted proxy; NEOKOM_RELAY_* env. Relay split into lib + main; 5 in-process integration tests. docs/RELAY.md: threat model, Caddy/nginx. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01XJW2ocwLunyaLiUwCBHEP8
kom-relay fit for public use: limits, origins, quiet logs
Some checks failed
ci / check (push) Successful in 9m16s
ci / desktop (push) Successful in 10m0s
ci / e2e (push) Failing after 23m51s
d66d9086ae
An installable web app needs HTTPS, so the relay will face the public
(#71). It now limits connections per client address (8) and in total
(256), paces each connection's upload (64 KiB/s after a 512 KiB burst,
so an image post still goes at once), closes connections idle for an
hour, and can allow only listed web origins. Behind a TLS proxy it can
take the client address from X-Forwarded-For. All via NEOKOM_RELAY_*.
Logs keep to addresses and why a connection ended.

The relay is now a library with serve() and a thin main, so
crates/relay/tests/limits.rs runs it in-process in front of an echo
server: forwarding, the per-address limit (503), origins (403), the
idle timeout and upload pacing. docs/RELAY.md has the threat model
and Caddy/nginx examples.

Refs #67

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XJW2ocwLunyaLiUwCBHEP8
Merge remote-tracking branch 'origin/main' into issue-67-relay
All checks were successful
ci / check (push) Successful in 9m52s
ci / desktop (push) Successful in 10m20s
ci / e2e (push) Successful in 15m30s
d74ed51b4f
littlefox referenced this pull request from a commit 2026-10-18 14:33:48 +00:00
Sign in to join this conversation.
No description provided.