Skip to content

Dev - #110

Open
NicolasKieffer wants to merge 5 commits into
mainfrom
dev
Open

Dev#110
NicolasKieffer wants to merge 5 commits into
mainfrom
dev

Conversation

@NicolasKieffer

Copy link
Copy Markdown
Collaborator

No description provided.

NicolasKieffer and others added 5 commits September 1, 2026 18:53
A user configured with `rateLimit.max: 0` was never blocked: the requests
kept returning 200. Two independent causes:

- `user.rateLimit.max || 100` evaluated 0 to the default of 100, so the
  user silently kept a quota of 100 requests per window;
- express-rate-limit v5 skips its own check when max is falsy
  (`if (max && current > max)`), so even a correctly resolved 0 would let
  every request through instead of answering 429.

Resolve the max with Number.isFinite() so 0 is distinguished from "not
configured", and answer the 429 from a guard placed before the limiter,
since the limiter itself can never do it. The guard mirrors the headers
the limiter sets and honours the per-user message.

Also stop calling getUserById() unguarded: a valid temporary token whose
user was removed from users.json produced a 500 instead of falling back
to the default limits.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
While snapshot-reports was unavailable, createReport() failed and the
error was deliberately swallowed — a report failure must never fail the
request itself. Those requests ended up with no report URL at all.

Add a maintenance script to create the missing URLs after the fact, for
a single request, for every request of one user, or for all of them. It
only ever adds a missing report URL: an existing one is never replaced
and the analysis is never re-run. Dry run is the default.

This is a recovery patch, not part of the normal flow — whether a given
request deserves a report (cached? demo?) stays the operator's call.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
On the EC2 instances the container is managed by systemd, not by the
docker run snippets in this file, and the units carry no Restart=
directive — a container that loses the boot race against dockerd stays
down until someone notices. Document how the service is actually run,
the Restart=always drop-in, and why systemctl must be used instead of
docker stop.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…rt-urls

Fix/rate limit and missing report urls
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.

1 participant