Skip to content

Server: commit the VDS stability hardening already in production - #2

Merged
ProAnima merged 3 commits into
mainfrom
port/vds-hardening
Oct 14, 2026
Merged

ProAnima merged 3 commits into
mainfrom
port/vds-hardening

Conversation

@ProAnima

Copy link
Copy Markdown
Owner

The VDS has been running these changes since the 2026-08-21 stability rollout, but they were never committed. A deploy from main would silently revert them and bring back the rejection of blobs above roughly 12 MiB. This PR ports them onto the refactored main (the old routes.rs change now lives in routes/mod.rs); all other files are byte-identical to the deployed version.

Server

  • Startup rejects zero or oversized FOCUSNOOK_MAX_* values.
  • New FOCUSNOOK_MAX_REQUEST_BODY_BYTES (default 32 MiB), validated to cover the Base64-encoded blob limit plus JSON overhead. The body limit used to be blob size + 1 MiB, so valid blobs above ~12 MiB were rejected after Base64 expansion.
  • Graceful shutdown on SIGTERM as well as Ctrl+C.

Deploy

  • Docker: log rotation, health-check start periods, stop grace periods.
  • nginx: 32 MiB body limit aligned with the server; rate limiting on login and registration only.
  • backup-vds-local.py: rejects unknown host keys (was a warning) and supports an OpenSSH host alias with keys.
  • smoke-test.sh, .env.example, generate-env.sh, README updated for the new limit.

Checks

  • scripts/check.ps1 -Only server: fmt, Clippy, 24 tests (new: request_limit_accounts_for_base64_blob_expansion).
  • docker compose config valid; shell scripts pass bash -n; the backup script compiles.
  • nginx config is the one live on the VDS; it was not re-validated with nginx -t here.

The original uncommitted snapshot is kept in wip/2026-08-21-sync-hardening. The desktop part of that work (account-bound sync) follows in a separate PR.

🤖 Generated with Claude Code

Feargin and others added 2 commits October 14, 2026 16:48
…p on SIGTERM

- Reject zero or oversized FOCUSNOOK_MAX_* values at startup instead of accepting any number.
- Add FOCUSNOOK_MAX_REQUEST_BODY_BYTES (default 32 MiB) and require it to cover the Base64-encoded blob limit plus JSON overhead; the body limit was blob size + 1 MiB, which rejected valid blobs above roughly 12 MiB.
- Shut down gracefully on SIGTERM as well as Ctrl+C, so a container stop lets in-flight exchanges finish.

Ported from the 2026-08-21 work that is already running on the VDS (wip/2026-08-21-sync-hardening) onto the split routes/ module.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ackups

- Docker: JSON log rotation, health-check start periods and stop grace periods for postgres and the server.
- nginx: 32 MiB body limit aligned with the server, rate limiting on login and registration only.
- backup-vds-local.py: reject unknown host keys and support an OpenSSH host alias with key-based access.
- smoke-test.sh, .env.example, generate-env.sh and README cover the new request limit.

Matches the configuration deployed to the VDS on 2026-08-21.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ProAnima
ProAnima merged commit 4e6559b into main Oct 14, 2026
3 checks passed
@ProAnima
ProAnima deleted the port/vds-hardening branch October 14, 2026 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants