mbecker20 / komodo

🦎 a tool to build and deploy software on many servers 🦎
https://komo.do
GNU General Public License v3.0
1.85k stars 35 forks source link

[Feature] Have redeploy webhook respond with an error when the secret is missing #85

Open parnic opened 1 month ago

parnic commented 1 month ago

I have some stacks created backed by a Gitea git repo. I've got a webhook setup for the Auto Redeploy endpoint (ending in /deploy) for any push to the repo, and I can see in Gitea that it's being called and returning a 200 success code. The stack's compose contents aren't being updated and the container is not automatically redeployed, however.

The repo is a self-hosted repo with authentication setup, and the only file committed to the repo is docker-compose.yml (which is configured in Komodo under "File Paths"). Manual updates and redeploys work fine after pushing a new file to the repo, it's just the auto-redeploy that's not working.

Komodo version: v1.14.2, self-hosted, deployed through Docker using image image: ghcr.io/mbecker20/komodo:latest and ghcr.io/ferretdb/ferretdb for PostgreSQL backing. Please let me know what other debugging information I can provide!

mbecker20 commented 1 month ago

This seems like a configuration issue.

mbecker20 commented 1 month ago

Another note, currently the webhook will return 200: OK to Gitea even if the webhook secret is misconfigured. I can improve this to give error response to Gitea for easier debugging.

parnic commented 1 month ago

Having it return non-200 would be wonderful and help users understand that things aren't working. If the response body could explain the problem, that would be even better.

I am a bit unclear on the whole webhook secret thing, I suppose. The configuration says

Provide a custom webhook secret for this resource, or use the global default.

The docs on this https://komo.do/docs/setup/advanced seem to suggest that the default is an empty string, so I believed if nothing was specified, none would be needed. It sounds like that's not the case?

Apologies for the noise, it does sound like a configuration error on my end. Perhaps I should have read the docs more clearly!

parnic commented 1 month ago

Ah, I see what I did now, the .env file I grabbed has the sample string set in the environment variable. Alright, I will update my webhooks and it sounds like that should do it!

Consider this a request to change the response when the webhook fails, then! Thank you!