diff --git a/testing/acl.conf b/testing/acl.conf new file mode 100644 index 0000000..4574b89 --- /dev/null +++ b/testing/acl.conf @@ -0,0 +1,24 @@ +# acl.conf + +# 1. Disable the default user (recommended for production) +# This user is created by default with full access if no password is set. +user default off + +# 2. Define a "root" or "admin" user with full access +user admin on >test +@all ~* + +# 4. Define a "cache" user +# This user can read and write to keys starting with "cache:". +# This is great for application-specific keys. +user cache on >your_strong_webapp_password +@all ~cache:* + +# 5. Define a "session" user +# This user can only get/set/del/expire keys related to caching. +user session on >your_strong_cache_password +GET +SET +SETEX +DEL +EXPIRE ~session:* + +# 6. Define a "cache" user +# This user can read and write to keys starting with "cache:". +# This is great for application-specific keys. +user limiter on >your_strong_limiter_password +@all ~LIMITS:* + +user pubsubuser on >strongpassword &printer:* +PUBLISH +SUBSCRIBE +PSUBSCRIBE +UNSUBSCRIBE +PUNSUBSCRIBE diff --git a/testing/docker-compose.yaml b/testing/docker-compose.yaml new file mode 100644 index 0000000..0fe2b9a --- /dev/null +++ b/testing/docker-compose.yaml @@ -0,0 +1,18 @@ +services: + valkey: + image: valkey/valkey:latest + ports: + - 6379:6379 + volumes: + - ./valkey_data:/data + - ./acl.conf:/usr/local/etc/valkey/acl.conf + command: valkey-server /usr/local/etc/valkey/acl.conf + user: "${UID}" + + redisinsight: + image: redis/redisinsight:latest + ports: + - 5540:5540 + volumes: + - ./redisinsight:/data + user: "${UID}" diff --git a/testing/run_localserver.sh b/testing/run_localserver.sh new file mode 100755 index 0000000..99bf518 --- /dev/null +++ b/testing/run_localserver.sh @@ -0,0 +1,6 @@ +echo "UID=${UID}" > .env +docker-compose up -d + +cd .. +WEB_DEBUG=true \ + ./run.py