fix: properly escape psql commands, use -c instead of heredoc
PR Checks / hadolint (pull_request) Successful in 8s
PR Checks / build-test (pull_request) Failing after 23s

This commit is contained in:
opencodecabilloteu
2026-06-15 17:27:57 -04:00
parent 581d2f1fac
commit 36b5282c41
+1 -1
View File
@@ -77,7 +77,7 @@ if [ "$READY" = false ]; then
fi
# Ensure www-data role exists for Unix socket connection
docker exec -e PGPASSWORD=*** "$DB_CONTAINER" psql -U ttrss -d ttrss <<<"CREATE ROLE "www-data" WITH LOGIN;" 2>/dev/null; docker exec -e PGPASSWORD=*** "$DB_CONTAINER" psql -U ttrss -d ttrss <<<"GRANT ALL ON DATABASE ttrss TO "www-data";" 2>/dev/null || true
docker exec -e PGPASSWORD=ttrss "$DB_CONTAINER" psql -U ttrss -d ttrss -c "CREATE ROLE www-data WITH LOGIN;" 2>/dev/null; docker exec -e PGPASSWORD=ttrss "$DB_CONTAINER" psql -U ttrss -d ttrss -c "GRANT ALL ON DATABASE ttrss TO www-data;" 2>/dev/null || true
echo "Updating TT-RSS database schema..."
echo yes | docker exec -i -u www-data -e DB_HOST=db -e DB_PORT=5432 "$CONTAINER_NAME" php /var/www/ttrss/update.php --update-schema 2>&1 || true