Override redis creds with addon provided vars

This commit is contained in:
Codex
2025-11-12 11:38:27 -06:00
parent 294a84a414
commit b8d38f52a2
2 changed files with 15 additions and 1 deletions

View File

@@ -5,7 +5,7 @@
"description": "Next-gen knowledge base that blends docs, whiteboards, and databases for self-hosted teams.",
"website": "https://affine.pro",
"contactEmail": "support@affine.pro",
"version": "0.1.12",
"version": "0.1.13",
"changelog": "Initial Cloudron packaging",
"manifestVersion": 2,
"minBoxVersion": "7.0.0",

View File

@@ -99,6 +99,20 @@ print(f"{host}\n{port}\n{password}\n{db}\n{username}")
PY
)
IFS=$'\n' read -r host port password db username <<<"$redis_info"
if [ -n "${CLOUDRON_REDIS_HOST:-}" ]; then
host="$CLOUDRON_REDIS_HOST"
fi
if [ -n "${CLOUDRON_REDIS_PORT:-}" ]; then
port="$CLOUDRON_REDIS_PORT"
fi
if [ -n "${CLOUDRON_REDIS_PASSWORD:-}" ]; then
password="$CLOUDRON_REDIS_PASSWORD"
fi
if [ -n "${CLOUDRON_REDIS_USERNAME:-}" ]; then
username="$CLOUDRON_REDIS_USERNAME"
elif [ -z "$username" ]; then
username="default"
fi
export REDIS_SERVER_HOST="$host"
export REDIS_SERVER_PORT="$port"
export REDIS_SERVER_PASSWORD="$password"