forked from mtusi2026/mtusi2026lab7
28 lines
1.2 KiB
Plaintext
28 lines
1.2 KiB
Plaintext
# 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
|
|
protected-mode yes
|
|
# Lab 7: TLS only. The plaintext port is closed (port 0); clients verify the server certificate
|
|
# (internal CA, SAN valkey). No client certificates at grade 3 (tls-auth-clients no): the client
|
|
# identity is the ACL user + password below.
|
|
port 0
|
|
tls-port 6379
|
|
tls-cert-file /run/secrets/valkey.crt
|
|
tls-key-file /run/secrets/valkey.key
|
|
tls-ca-cert-file /run/secrets/internal-ca.crt
|
|
tls-auth-clients no
|
|
tls-protocols "TLSv1.2 TLSv1.3"
|
|
# Sessions are never evicted silently: if memory is full, writes fail and login returns 503.
|
|
maxmemory 128mb
|
|
maxmemory-policy noeviction
|
|
# Lab 7: ACL users instead of one shared password (file written by infra/valkey/start.sh at start):
|
|
# `default` is off, `api` may touch only session:* / ratelimit:* keys with the commands it uses.
|
|
aclfile /tmp/valkey/users.acl
|