#!/bin/sh # Valkey (lab7): TLS-only (plaintext port 0), ACL users rendered at start into the tmpfs from a Docker secret. # default disabled # api session cache + login rate limit keys only, a minimal command set (no FLUSH*, CONFIG, KEYS, SCAN, EVAL) # health PING only (container healthcheck) # Cache only: no persistence; PostgreSQL stays the source of truth for sessions. set -eu umask 077 { echo "user default off" echo "user api on >$(cat /run/secrets/valkey_api_password) resetkeys ~session:* ~ratelimit:* resetchannels -@all +get +set +del +incr +incrby +expire +ttl +ping +hello +client|setinfo +client|setname +select" echo "user health on >health resetkeys -@all +ping" } > /tmp/users.acl exec valkey-server \ --port 0 \ --tls-port 6379 \ --tls-cert-file /run/secrets/server.crt \ --tls-key-file /run/secrets/server.key \ --tls-ca-cert-file /run/secrets/ca.crt \ --tls-auth-clients no \ --aclfile /tmp/users.acl \ --save "" --appendonly no \ --maxmemory 64mb --maxmemory-policy allkeys-lru \ --dir /data