fix: warn that a specified password may not be as secure as the autogenerated one
This commit is contained in:
@@ -26,7 +26,10 @@ service_create() {
|
|||||||
mkdir -p "$SERVICE_ROOT/config" || dokku_log_fail "Unable to create service config directory"
|
mkdir -p "$SERVICE_ROOT/config" || dokku_log_fail "Unable to create service config directory"
|
||||||
curl -sSL "https://raw.githubusercontent.com/antirez/redis/${PLUGIN_IMAGE_VERSION:0:3}/redis.conf" > "$SERVICE_ROOT/config/redis.conf" || dokku_log_fail "Unable to download the default redis.conf to the config directory"
|
curl -sSL "https://raw.githubusercontent.com/antirez/redis/${PLUGIN_IMAGE_VERSION:0:3}/redis.conf" > "$SERVICE_ROOT/config/redis.conf" || dokku_log_fail "Unable to download the default redis.conf to the config directory"
|
||||||
PASSWORD=$(openssl rand -hex 32)
|
PASSWORD=$(openssl rand -hex 32)
|
||||||
[[ -n "$SERVICE_PASSWORD" ]] && PASSWORD="$SERVICE_PASSWORD"
|
if [[ -n "$SERVICE_PASSWORD" ]]; then
|
||||||
|
PASSWORD="$SERVICE_PASSWORD"
|
||||||
|
dokku_log_warn "Specified password may not be as secure as the auto-generated password"
|
||||||
|
fi
|
||||||
echo "$PASSWORD" > "$SERVICE_ROOT/PASSWORD"
|
echo "$PASSWORD" > "$SERVICE_ROOT/PASSWORD"
|
||||||
chmod 640 "$SERVICE_ROOT/PASSWORD"
|
chmod 640 "$SERVICE_ROOT/PASSWORD"
|
||||||
sed -i.bak "s/# requirepass.*/requirepass ${PASSWORD}/" "$SERVICE_ROOT/config/redis.conf" && rm "$SERVICE_ROOT/config/redis.conf.bak"
|
sed -i.bak "s/# requirepass.*/requirepass ${PASSWORD}/" "$SERVICE_ROOT/config/redis.conf" && rm "$SERVICE_ROOT/config/redis.conf.bak"
|
||||||
|
|||||||
Reference in New Issue
Block a user