From e6f047e45f2b88922c476811b5dbb8b555c2ee8d Mon Sep 17 00:00:00 2001 From: hermes Date: Mon, 7 Sep 2026 12:09:06 +0200 Subject: [PATCH] fix(wordpress): generate distinct MYSQL_PASSWORD and MYSQL_ROOT_PASSWORD (sed -g overwrote both) --- wordpress/deploy.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/wordpress/deploy.sh b/wordpress/deploy.sh index 4f9befc..db15769 100755 --- a/wordpress/deploy.sh +++ b/wordpress/deploy.sh @@ -64,9 +64,8 @@ if [ ! -f "$SCRIPT_DIR/.env" ]; then # Generate random passwords for local dev ROOT_PASS=$(openssl rand -hex 16 2>/dev/null || cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n1) WP_PASS=$(openssl rand -hex 16 2>/dev/null || cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n1) - sed -i "s/change-me-to-a-strong-password/${ROOT_PASS}/g" "$SCRIPT_DIR/.env" - # Second occurrence is MYSQL_PASSWORD - sed -i "0,/change-me-to-a-strong-password/{s/change-me-to-a-strong-password/${WP_PASS}/}" "$SCRIPT_DIR/.env" + sed -i "0,/change-me-to-a-strong-password/{s/change-me-to-a-strong-password/${ROOT_PASS}/}" "$SCRIPT_DIR/.env" + sed -i "s/change-me-to-a-strong-password/${WP_PASS}/" "$SCRIPT_DIR/.env" echo -e "${GREEN}✓${NC} Contraseñas generadas en ${SCRIPT_DIR}/.env" fi