Only for a few routes, that consumes postgresql CPU
Re-implement sequelize connection routing mechanism, to support:
* Replica lag monitoring (to not select replicas that are too far
behind the primary)
* Be opt-in instead of opt-out (primary is used by default, a context
must be marked to use replicas)
* Handle "read-you-writes" mechanism (ensure that reads after writes
see the latest data, using the user ID to track recent writes)
* OAuth tokens LRU cache broadcasts its invalidations in Redis
* socket.io uses the Redis adapter, so a notification is delivered to a
user connected to any process
* rate limit counters are stored in Redis instead of in memory
Security sensitive limiters fail the request when Redis is unavailable
This commit is part of bigger work to add horizontal scaling support to
PeerTube.
We don't use chokidar because it re-lists the *entire* watched directory and
stats every one of its entries on each filesystem event: a live directory with a
long DVR window holds thousands of segments, so watching it costs a lot of CPU
for every segment the transcoding process generates
* Add opt-in email notification for successful logins with new-device and location detection
* default email notif on + correction
* ci tests fix update
* Prune user login devices table
* Don't send a notification for the first login
---------
Co-authored-by: Chocobozzz <[email protected]>
Uses the .yaml files to generate a JSON-Schema
describing the possible configuration options,
and add CI checks to keep this from going stale
and validate the YAML files against the schema.
Assisted-by: claude-code: claude-opus-4-7 (planning) + claude-sonnet-4-7 (execution)
Signed-off-by: cinereal <[email protected]>