Initial curated ITWorx_MCP_Hub source from 368fba691ea8d23403b4d56b53b5ec670d7c5020
This commit is contained in:
commit
cb5be898ea
663 files changed
+82674
No files matched your search
@@ -0,0 +1,29 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
fail() {
|
||||
echo "Redis secret-file validation failed" >&2
|
||||
exit 78
|
||||
}
|
||||
|
||||
if [ "${REDIS_AUTH_ENABLED:-false}" = "true" ]; then
|
||||
secret=/run/secrets/redis_password
|
||||
[ -f "$secret" ] && [ -r "$secret" ] || fail
|
||||
[ -s "$secret" ] || fail
|
||||
mode="$(stat -c '%a' "$secret" 2>/dev/null || true)"
|
||||
case "$mode" in 400|600) ;; *) fail ;; esac
|
||||
[ "$(stat -c '%u' "$secret" 2>/dev/null || true)" = "${SECRET_EXPECTED_UID:?}" ] || fail
|
||||
[ "$(stat -c '%g' "$secret" 2>/dev/null || true)" = "${SECRET_EXPECTED_GID:?}" ] || fail
|
||||
password="$(tr -d '\r\n' < "$secret")"
|
||||
[ -n "$password" ] || fail
|
||||
umask 077
|
||||
{
|
||||
printf 'save ""\nappendonly no\nmaxmemory-policy allkeys-lru\nrequirepass '
|
||||
printf '%s' "$password" | sed 's/\\/\\\\/g; s/"/\\"/g'
|
||||
printf '\n'
|
||||
} > /run/itworx/redis.conf
|
||||
unset password
|
||||
exec redis-server /run/itworx/redis.conf
|
||||
fi
|
||||
|
||||
exec redis-server --save "" --appendonly no --maxmemory-policy allkeys-lru
|
||||
Reference in new issue
Block a user