Fix webhook configuration for automatic deployments
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 <noreply@anthropic.com>
This commit is contained in:
@@ -159,17 +159,8 @@ echo "✅ Traefik labels configured"
|
|||||||
# Configure webhook for automatic deployments
|
# Configure webhook for automatic deployments
|
||||||
echo "🪝 Setting up deployment webhook..."
|
echo "🪝 Setting up deployment webhook..."
|
||||||
|
|
||||||
# Generate webhook secret
|
# Coolify webhook URL uses the /deploy endpoint
|
||||||
WEBHOOK_SECRET=$(openssl rand -hex 16)
|
WEBHOOK_URL="${COOLIFY_API}/deploy?uuid=${APP_UUID}"
|
||||||
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
|
|
||||||
|
|
||||||
# Create webhook in Gitea
|
# Create webhook in Gitea
|
||||||
GITEA_API="https://git.startanaicompany.com/api/v1"
|
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 "{
|
-d "{
|
||||||
\"type\": \"gitea\",
|
\"type\": \"gitea\",
|
||||||
\"config\": {
|
\"config\": {
|
||||||
\"url\": \"${WEBHOOK_URL}?secret=${WEBHOOK_SECRET}\",
|
\"url\": \"${WEBHOOK_URL}\",
|
||||||
\"content_type\": \"json\",
|
\"content_type\": \"json\",
|
||||||
\"secret\": \"${WEBHOOK_SECRET}\"
|
\"http_method\": \"GET\"
|
||||||
},
|
},
|
||||||
\"events\": [\"push\"],
|
\"events\": [\"push\"],
|
||||||
|
\"authorization_header\": \"Bearer ${COOLIFY_API_TOKEN}\",
|
||||||
\"active\": true
|
\"active\": true
|
||||||
}")
|
}")
|
||||||
|
|
||||||
@@ -217,7 +209,6 @@ echo ""
|
|||||||
echo "📋 Deployment Details:"
|
echo "📋 Deployment Details:"
|
||||||
echo " Application UUID: $APP_UUID"
|
echo " Application UUID: $APP_UUID"
|
||||||
echo " Domain: https://$FULL_DOMAIN"
|
echo " Domain: https://$FULL_DOMAIN"
|
||||||
echo " Webhook Secret: $WEBHOOK_SECRET"
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "⏳ Your site will be available in 2-3 minutes at:"
|
echo "⏳ Your site will be available in 2-3 minutes at:"
|
||||||
echo " https://$FULL_DOMAIN"
|
echo " https://$FULL_DOMAIN"
|
||||||
@@ -245,7 +236,6 @@ Repository: $REPO_URL
|
|||||||
|
|
||||||
Database Password: $DB_PASSWORD
|
Database Password: $DB_PASSWORD
|
||||||
Session Secret: $SESSION_SECRET
|
Session Secret: $SESSION_SECRET
|
||||||
Webhook Secret: $WEBHOOK_SECRET
|
|
||||||
|
|
||||||
Coolify Dashboard: https://app.coolify.io/project/${COOLIFY_PROJECT_UUID}/${COOLIFY_SERVER_UUID}/application/${APP_UUID}
|
Coolify Dashboard: https://app.coolify.io/project/${COOLIFY_PROJECT_UUID}/${COOLIFY_SERVER_UUID}/application/${APP_UUID}
|
||||||
DEPLOYMENT_INFO
|
DEPLOYMENT_INFO
|
||||||
|
|||||||
Reference in New Issue
Block a user