Repository navigation
refactor(server): group env vars by subsystem; relay cap default 1GB - #87
Merged
Merged
Conversation
polius
force-pushed
the
refactor/server-env-naming
branch
2 times, most recently
from
June 25, 2026 16:00
4d4fce8 to
a30d96c
Compare
…t to 1GB Rename the server's environment variables to a consistent FSEND_<DOMAIN>_<ATTRIBUTE> scheme so related knobs group together and each name says what it configures: FSEND_UDP_ADDR -> FSEND_RELAY_ADDR FSEND_ENABLE_RELAY -> FSEND_RELAY_ENABLED FSEND_MAX_RELAY_BYTES_PER_SESSION -> FSEND_RELAY_MAX_BYTES_PER_SESSION FSEND_HTTP_ADDR -> FSEND_PAIRING_ADDR FSEND_MAX_SESSIONS_PER_IP -> FSEND_PAIRING_MAX_SESSIONS_PER_IP FSEND_MAX_NEW_SESSIONS_PER_IP_PER_MIN -> FSEND_PAIRING_MAX_NEW_SESSIONS_PER_IP_PER_MIN FSEND_LOG_LEVEL and FSEND_SERVER_PASSWORD stay as-is: they're server-wide, not subsystem-specific, and SERVER_PASSWORD must not be confused with the client-side transfer password FSEND_PASS. --help and the docs now list the vars grouped General / Pairing / Relay. Also raise the per-session relay cap default from 100MB to 1GB. 100MB was too small to be a useful fallback: hole-punching fails most often on large transfers, which is exactly when the relay is needed. 1GB matches the value the compose stack already ran and stays abuse-bounded (the per-IP session limits cap concurrency). The shipped compose no longer restates defaults — it now sets only FSEND_DOMAIN and shows the common overrides as comments. This is a breaking change to released env var names (no compatibility shim); the release notes will call it out. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
polius
force-pushed
the
refactor/server-env-naming
branch
from
June 25, 2026 16:02
a30d96c to
a79f1c3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Renames the server's environment variables to a consistent
FSEND_<DOMAIN>_<ATTRIBUTE>scheme so related knobs group together and eachname says what it configures, and raises the per-session relay cap default
from 100MB to 1GB.
Renames
FSEND_UDP_ADDRFSEND_RELAY_ADDRFSEND_ENABLE_RELAYFSEND_RELAY_ENABLEDFSEND_MAX_RELAY_BYTES_PER_SESSIONFSEND_RELAY_MAX_BYTES_PER_SESSIONFSEND_HTTP_ADDRFSEND_PAIRING_ADDRFSEND_MAX_SESSIONS_PER_IPFSEND_PAIRING_MAX_SESSIONS_PER_IPFSEND_MAX_NEW_SESSIONS_PER_IP_PER_MINFSEND_PAIRING_MAX_NEW_SESSIONS_PER_IP_PER_MINFSEND_LOG_LEVELandFSEND_SERVER_PASSWORDstay unchanged — they'reserver-wide, not subsystem-specific, and
SERVER_PASSWORDmust not beconfused with the client-side transfer password
FSEND_PASS.--helpand the docs now list the vars grouped General / Pairing /Relay, with aligned columns.
Default change: relay cap 100MB → 1GB
100MB was too small to be a useful fallback: hole-punching fails most often
on large transfers, which is exactly when the relay is needed — a 100MB
cap fails the case the relay exists for. 1GB matches the value the compose
stack already ran and stays abuse-bounded (the per-IP session limits cap
concurrency). Applied to both the binary default and the relay package's
own
Default(), so there's a single source of truth.Compose cleanup
The shipped
docker-compose.ymlno longer restates defaults (thatduplication is what produced an earlier 1GB-vs-100MB doc bug). It now sets
only
FSEND_DOMAINand shows the one override most self-hosters want(
FSEND_SERVER_PASSWORD) as a comment, pointing to--helpfor the rest.Breaking change
These are released env var names and there is no compatibility shim (by
decision). An existing deployment's old vars are silently ignored after
upgrade and fall back to defaults. The release notes will carry a banner;
nothing in-code warns. The biggest blast radius is
FSEND_HTTP_ADDR(config + the Docker
--health-checkpath) — both updated here.Tests
Pure-rename mechanical change plus the one default bump:
TestServerLoadConfigDefaultsnow asserts the 1GB default.go build,go vet,gofmt -l, full suite incl.-raceand the e2e harness — all green.Not in scope (deliberate, discussed)
Rate-limit defaults (
5/30) stay as-is — they're the abuse bound, finefor individuals, and a documented tunable for shared-NAT orgs. Bare-metal
:443privilege and "set a password for a private server" are doc notes,not value changes.
infologging being near-silent is the upcomingobservability work, not a default.
🤖 Generated with Claude Code