feat(redis): add shared Redis 8.10.3 to platform
This commit is contained in:
1 parent
eb96f56349
commit
67356b1489
13 files changed
+671
No files matched your search
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
# Restrict usernames to a single ACL token; never interpolate raw passwords
|
||||
# into Redis configuration syntax or command-line arguments.
|
||||
case "${REDIS_USERNAME:-}" in
|
||||
""|default|*[!a-zA-Z0-9_.-]*)
|
||||
echo "REDIS_USERNAME must contain only letters, digits, _, . or - and must not be default." >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
if [ -z "${REDISCLI_AUTH:-}" ]; then
|
||||
echo "REDIS_PASSWORD must not be empty." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
umask 077
|
||||
password_hash="$(printf '%s' "$REDISCLI_AUTH" | sha256sum)"
|
||||
password_hash="${password_hash%% *}"
|
||||
printf 'user default off\nuser %s on #%s ~* &* +@all\n' \
|
||||
"$REDIS_USERNAME" "$password_hash" > /run/redis-acl/users.acl
|
||||
unset password_hash
|
||||
|
||||
exec redis-server /etc/redis/redis.conf
|
||||
Reference in new issue
Block a user