forked from mtusi2026/mtusi2026lab2
feat: PostgreSQL, Bearer-сессии (Valkey/PostgreSQL), Argon2id, миграции, compose
- схема и миграции (migrations/0001_init.sql, python -m messenger.migrate); - регистрация с паролем (Argon2id), вход по Basic, opaque Bearer, logout, expiry; - сессии: SESSION_STORE=valkey (AOF, appendfsync always) или postgres; - пул соединений, statement/lock timeout и клиентский дедлайн: отказ БД = 503; - keyset-пагинация по индексу (chat_id, created_at, id), два запроса без OR; - compose.yaml с закреплёнными образами, secrets, restart.sh. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
893beaa79a
commit
01524165dd
@@ -0,0 +1,17 @@
|
||||
# Valkey is the single store of sessions (SESSION_STORE=valkey), so it must be durable.
|
||||
# AOF with fsync on every write: a confirmed login or logout survives a crash/restart,
|
||||
# a logout can never be lost and "resurrect" a token. Sessions are small and rare
|
||||
# writes, so the fsync cost is acceptable here (see REPORT.md).
|
||||
appendonly yes
|
||||
appendfsync always
|
||||
appenddirname "appendonlydir"
|
||||
# RDB snapshots are not needed on top of AOF.
|
||||
save ""
|
||||
dir /data
|
||||
port 6379
|
||||
protected-mode yes
|
||||
# Sessions are never evicted silently: if memory is full, writes fail and login returns 503.
|
||||
maxmemory 128mb
|
||||
maxmemory-policy noeviction
|
||||
# Password, generated by scripts/init_secrets.py and written here at container start.
|
||||
include /tmp/requirepass.conf
|
||||
Reference in New Issue
Block a user