11 lines
432 B
Bash
11 lines
432 B
Bash
#!/bin/sh
|
|
set -eu
|
|
set -- redis
|
|
. "$(dirname "$0")/dependency-pki.sh"
|
|
password=$(openssl rand -hex 32)
|
|
hash=$(printf %s "$password" | openssl dgst -sha256 -r | cut -d' ' -f1)
|
|
printf 'rediss://api:%s@redis:6379/0\n' "$password" > "$tmp/api.url"
|
|
printf '%s\n' 'user default off' 'user health on nopass -@all +ping' \
|
|
"user api on #$hash ~session:* -@all +hello +ping +get +set +del +client|setinfo" > "$tmp/users.acl"
|
|
finish redis
|