Commit graph

62 commits

Author SHA1 Message Date
peaklabs-dev
54a834e042
fix(git): trigger deployments when watch_paths is empty 2026-01-07 19:15:16 +01:00
Andras Bacsai
7a305fd2cd fix: prevent timing attack in GitLab webhook token validation
Replace insecure !== operator with hash_equals() for constant-time
string comparison when validating GitLab webhook tokens.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 15:23:48 +01:00
Andras Bacsai
162eaa9f0d feat(github): implement processing for GitHub pull request webhooks and add helper functions for commit and PR file retrieval 2026-01-05 11:13:18 +01:00
Andras Bacsai
0e47de81d1 Fix: Prevent double deployments when multiple GitHub Apps access same repository (#2315)
Filter webhook-triggered deployments by source_id to ensure only applications
associated with the GitHub App that sent the webhook are deployed, preventing
duplicate deployments when the same repository is configured in multiple teams.
2025-12-12 11:35:00 +01:00
Andras Bacsai
700550b26f
Fix: Concurrent builds ignored & add deployment queue limit (#7488) 2025-12-11 11:03:02 +01:00
Andras Bacsai
d019553809 Add Retry-After header to 429 rate limit responses
Adds Retry-After: 60 header to all deployment queue full responses,
helping webhook clients know when to retry their requests.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-11 11:02:29 +01:00
Andras Bacsai
d27070b215 fix: Add comprehensive PR cleanup to GitLab, Bitbucket, and Gitea webhooks
Create a shared CleanupPreviewDeployment action that unifies PR cleanup logic across all Git providers. Previously, GitHub had comprehensive cleanup (cancels active deployments, kills helper containers, removes all PR containers), while GitLab, Bitbucket, and Gitea only did basic cleanup (delete preview record and remove one container by name).

This fix ensures all providers properly clean up orphaned PR containers when a PR is closed/merged, preventing security issues and resource waste. Also fixes early return bug in GitLab webhook handler.

Fixes #2610

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-08 17:10:39 +01:00
Andras Bacsai
6d16f52143 Add deployment queue limit to prevent queue bombing
- Add configurable deployment_queue_limit server setting (default: 25)
- Check queue size before accepting new deployments
- Return 429 status for webhooks/API when queue is full (allows retry)
- Show error toast in UI when queue limit reached
- Add UI control in Server Advanced settings

Fixes #6708

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 13:52:27 +01:00
Andras Bacsai
158d54712f Remove webhook maintenance mode replay feature
This feature stored incoming webhooks during maintenance mode and replayed them
when maintenance ended. The behavior adds unnecessary complexity without clear
value. Standard approach is to let webhooks fail during maintenance and let
senders retry.

Removes:
- Listener classes that handled maintenance mode events and webhook replay
- Maintenance mode checks from all webhook controllers (Github, Gitea, Gitlab, Bitbucket, Stripe)
- webhooks-during-maintenance filesystem disk configuration
- Feature mention from CHANGELOG

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 13:36:32 +01:00
Andras Bacsai
0b8d3d395e fix: remove redundant process termination logic from deployment methods 2025-11-10 14:46:02 +01:00
Andras Bacsai
67605d50fc fix(deployment): prevent base deployments from being killed when PRs close (#7113)
- Fix container filtering to properly distinguish base deployments (pullRequestId=0) from PR deployments
- Add deployment cancellation when PR closes via webhook to prevent race conditions
- Prevent CleanupHelperContainersJob from killing active deployment containers
- Enhance error messages with exit codes and actual errors instead of vague "Oops" messages
- Protect status transitions in finally blocks to ensure proper job failure handling
2025-11-09 14:41:35 +01:00
Andras Bacsai
d9ebf3b142 refactor(webhook): remove Webhook model and related logic; add migrations to drop webhooks and kubernetes tables 2025-09-10 19:35:53 +02:00
Andras Bacsai
52312e9de6 refactor(github-webhook): restructure application processing by grouping applications by server for improved deployment handling 2025-09-10 09:30:43 +02:00
Andras Bacsai
8c5c249c6a refactor(webhook): replace direct forceDelete calls with DeleteResourceJob dispatch for application previews 2025-09-05 19:27:59 +02:00
Andras Bacsai
a10e51b2c4 fix(webhook): replace delete with forceDelete for application previews to ensure immediate removal 2025-09-05 17:50:33 +02:00
Andras Bacsai
339118558c feat(settings): add option to restrict PR deployments to repository members and contributors 2025-09-05 14:30:51 +02:00
Andras Bacsai
5bdf2e8481 refactor(previews): move preview domain generation logic to ApplicationPreview model for better encapsulation and consistency across webhook handlers 2025-07-14 19:12:57 +02:00
Andras Bacsai
d075241289 feat(Deployment): enhance queue_application_deployment to handle existing deployments and return appropriate status messages 2025-04-11 15:27:56 +02:00
Andras Bacsai
337e12f5c6
Merge pull request #5245 from janwiebe-jump/fix-gitea
Gitea webhook sends action synchronized
2025-03-11 10:21:56 +01:00
janwiebe-jump
37553e79b7
Gitea webhook sends action synchronized 2025-02-27 17:25:33 +01:00
Andras Bacsai
27e4882d57 feat(core): You can validate compose files with docker compose config
fix(core): labels are now accepted with both compose styles
refactor: remove lots of ray's
2025-02-27 11:29:04 +01:00
Islam Adel
672a5d0bc5
fix: Handle pullrequest:updated for reliable preview deployments
The repo:push payload lacks the destination branch name, using push.changes.0.new.name instead. While sufficient for updates, this causes failures in preview deployments when a PR receives new commits—Coolify looks for git_branch in the applications table but finds the source branch instead.

By also processing pullrequest:updated, we ensure preview deployments remain in sync. However, this event triggers on various actions (e.g., PR title changes, reviewer updates), causing extra redeploys. Since Coolify doesn’t store commit hashes for preview deployments, handling these extra redeploys is our best workaround for Bitbucket.
2025-02-01 12:24:23 +02:00
peaklabs-dev
d9248508b4
chore: remove unused waitlist stuff 2024-12-09 12:00:54 +01:00
peaklabs-dev
5f985426ab
feat: update private key nam with new slug as well 2024-12-03 15:27:20 +01:00
Andras Bacsai
377758edcd fix stripe webhooks 2024-11-22 14:42:10 +01:00
Andras Bacsai
8e4060375d remove ray 2024-11-12 10:23:00 +01:00
Andras Bacsai
da9c8eed16
Merge pull request #4194 from quarkcore/fix/gitlab-empty-webhook-secret
Fix: Gitlab webhooks can be triggered without secret
2024-11-12 10:22:36 +01:00
Andras Bacsai
1faa8be615 fix: cloud + stripe related 2024-11-11 22:18:15 +01:00
quarkcore
8ddc5d6ef7
Merge branch 'next' into fix/gitlab-empty-webhook-secret 2024-11-08 15:19:45 +01:00
Kolja Völker
88e6c04b73 Fixes: https://github.com/coollabsio/coolify/issues/4186 2024-11-08 15:15:58 +01:00
Andras Bacsai
4fa533aae8 Refactor webhook event handling logic 2024-11-01 00:07:01 +01:00
Andras Bacsai
5ce2422b90 fix: stripe webhooks
fix: add custome created webhook
2024-10-31 23:26:40 +01:00
Lucas Michot
8e1444eaa7 Get rid of many useless blank lines 2024-10-31 17:44:01 +01:00
Lucas Michot
d557a22b91 Remove all ray() calls 2024-10-28 13:51:23 +01:00
andrasbacsai
96c4f5b8da Fix styling 2024-07-25 11:31:59 +00:00
Andras Bacsai
6a4aa492c0 fix: random generated uuid will be full length (not 7 characters) 2024-07-25 13:31:01 +02:00
Andras Bacsai
a3a1ff69e1 fix: preview deployments should be stopped properly via gh webhook 2024-07-22 13:06:03 +02:00
Andras Bacsai
38d9999814 refactor: Simplify code for retrieving subscription in Stripe webhook 2024-07-06 13:47:43 +02:00
Andras Bacsai
920305432b feat: Improve internal notification message for early fraud warning webhook 2024-07-05 20:31:19 +02:00
Andras Bacsai
42fb8ab379 feat: early fraud warning webhook 2024-07-05 20:25:53 +02:00
Andras Bacsai
613e980267 fix: cleanup subs in cloud 2024-06-27 12:48:37 +02:00
Andras Bacsai
73692a0c73 fix: remove cloud stripe notifications 2024-06-24 11:52:12 +02:00
andrasbacsai
2e01665340 Fix styling 2024-06-12 10:21:47 +00:00
Andras Bacsai
019cdd2b3a fix: compose generator 2024-06-12 12:20:58 +02:00
Thijmen
d86274cc37 Fix styling 2024-06-10 20:43:34 +00:00
Andras Bacsai
c80434141d fix: gitlab merge request should close PR 2024-06-10 10:42:52 +02:00
Andras Bacsai
7f052163e3 fix: comment id should be string
fix: do not wait for GH response, stop preview before
2024-06-06 12:50:38 +02:00
Andras Bacsai
2f621279c2 chore: Add null checks for team in Stripe webhook 2024-05-27 14:14:31 +02:00
Andras Bacsai
c30185c6ae feat: Handle incomplete expired subscriptions in Stripe webhook 2024-05-27 12:03:48 +02:00
Andras Bacsai
bdbd4b57b7 refactor 2024-05-23 11:30:39 +02:00