From fc0309787a9f89e48594b9a1b9529c91c89d7524 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikael=20West=C3=B6=C3=B6?= Date: Fri, 23 Jan 2026 23:37:53 +0100 Subject: [PATCH] Fix webhook configuration for automatic deployments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated webhook to use correct Coolify API endpoint: - Changed from /webhooks/source/gitea/events/manual/{uuid} to /api/v1/deploy?uuid={uuid} - Added Bearer token authorization header to webhook - Removed unnecessary webhook secret generation - Uses GET request to /deploy endpoint as per Coolify API docs This fix enables automatic deployments when pushing to repository. Reference: https://coolify.io/docs/api-reference/api/operations/deploy-by-tag-or-uuid 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- deploy-to-coolify.example.sh | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/deploy-to-coolify.example.sh b/deploy-to-coolify.example.sh index df40913..c8dd7f5 100755 --- a/deploy-to-coolify.example.sh +++ b/deploy-to-coolify.example.sh @@ -159,17 +159,8 @@ echo "✅ Traefik labels configured" # Configure webhook for automatic deployments echo "🪝 Setting up deployment webhook..." -# Generate webhook secret -WEBHOOK_SECRET=$(openssl rand -hex 16) -WEBHOOK_URL="https://app.coolify.io/webhooks/source/gitea/events/manual/${APP_UUID}" - -# Configure webhook in Coolify -curl -s -X PATCH "${COOLIFY_API}/applications/${APP_UUID}" \ - -H "Authorization: Bearer ${COOLIFY_API_TOKEN}" \ - -H "Content-Type: application/json" \ - -d "{ - \"manual_webhook_secret_gitea\": \"${WEBHOOK_SECRET}\" - }" > /dev/null +# Coolify webhook URL uses the /deploy endpoint +WEBHOOK_URL="${COOLIFY_API}/deploy?uuid=${APP_UUID}" # Create webhook in Gitea GITEA_API="https://git.startanaicompany.com/api/v1" @@ -179,11 +170,12 @@ WEBHOOK_RESPONSE=$(curl -s -X POST "${GITEA_API}/repos/${GITEA_USERNAME}/${GITEA -d "{ \"type\": \"gitea\", \"config\": { - \"url\": \"${WEBHOOK_URL}?secret=${WEBHOOK_SECRET}\", + \"url\": \"${WEBHOOK_URL}\", \"content_type\": \"json\", - \"secret\": \"${WEBHOOK_SECRET}\" + \"http_method\": \"GET\" }, \"events\": [\"push\"], + \"authorization_header\": \"Bearer ${COOLIFY_API_TOKEN}\", \"active\": true }") @@ -217,7 +209,6 @@ echo "" echo "📋 Deployment Details:" echo " Application UUID: $APP_UUID" echo " Domain: https://$FULL_DOMAIN" -echo " Webhook Secret: $WEBHOOK_SECRET" echo "" echo "⏳ Your site will be available in 2-3 minutes at:" echo " https://$FULL_DOMAIN" @@ -245,7 +236,6 @@ Repository: $REPO_URL Database Password: $DB_PASSWORD Session Secret: $SESSION_SECRET -Webhook Secret: $WEBHOOK_SECRET Coolify Dashboard: https://app.coolify.io/project/${COOLIFY_PROJECT_UUID}/${COOLIFY_SERVER_UUID}/application/${APP_UUID} DEPLOYMENT_INFO