Dokploy / Dokploy/dokploy

Add Github Webhook Secret support

Open
#2,672 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
37.4k
Forks
3k
Avg merge
1d 3h
Merged PRs (30d)
73

Description

What problem will this feature address?

Currently, any deploy URL can be triggered by any client, as soon as they get access to the webhook url.

Since the refreshToken is stored in the URL, it makes it possible to intercept this url, then a bad actor could re-use this token to spam deployments, causing potential server overload.

Describe the solution you'd like

Adding support for handling GitHub's Webhooks Secret :

Image

Would make this public url for deployment more secure, as the secret will need to match what Dokploy would provide.

The steps to implement such validation is described here : https://docs.github.com/en/webhooks/using-webhooks/validating-webhook-deliveries

I guess such logic would live next to this : https://github.com/Dokploy/dokploy/blob/569d43ae7fcd307a477983f17fcfbb33a656d204/apps/dokploy/pages/api/deploy/%5BrefreshToken%5D.ts#L25

Describe alternatives you've considered

Currently, I guess the only alternative to provide such level of validation would be to have a custom url doing this same logic, which would then call the dokploy cli to deploy the application.

Obviously, this seems way over the top, and I would rather risk having a public webhook url rather than creating such workaround.

Additional context

While unrelated (I should maybe create another issue for that), it doesn't help that GitHub Webhook support is basically unusable for the workflow of the Registry package events (screenshot below), as it create superfluous events with payloads that Dokploy does not support

Image
Will you send a PR to implement it?

Maybe, need help

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with apps/dokploy/pages/api/deploy/[refreshToken].ts at the linked line, then read GitHub's webhook delivery validation guidance. Determine how the endpoint can validate the configured webhook secret before deployment requests are accepted. Done means requests with a matching secret are supported while invalid or absent signatures are rejected.

Written by the indexing model from the issue text.

Assessment

Tech stack
github, typescript
Domain
api, backend, devops, security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.