AzBuilder / terrakube

Open source IaC Automation and Collaboration Software.
https://docs.terrakube.io
Apache License 2.0
502 stars 39 forks source link

Forgejo/Gitea VCS support #683

Open bencurio opened 8 months ago

bencurio commented 8 months ago

Feature description 💡

It might be worth considering supporting the Forgejo / Gitea VCS. The API is very similar to GitHub, which is what the project creators are aiming for.

OpenID configuration: https://code.forgejo.org/.well-known/openid-configuration OpenAPI Spec: https://code.forgejo.org/api/swagger

alfespa17 commented 8 months ago

As an alternative for now you could connect to those repositories using SSH

https://docs.terrakube.io/user-guide/vcs-providers/ssh

bencurio commented 8 months ago

Thank you, I found it in the meantime :-)

NegativeFeedback commented 6 months ago

is there a way to get the webhook information in the ui or api? I use gitea and the webhook/api should be the exact same as github so I was hoping to be able to manually add the hooks

alfespa17 commented 6 months ago

is there a way to get the webhook information in the ui or api? I use gitea and the webhook/api should be the exact same as github so I was hoping to be able to manually add the hooks

Not sure if I understand correctly, do you want to add manually the webhook?

NegativeFeedback commented 6 months ago

yes, I can fake it through github to get a payload url and copy that over to gitea but I cant find a way to get the secret. sorry if that was confusing!

alfespa17 commented 6 months ago

The secret to

yes, I can fake it through github to get a payload url and copy that over to gitea but I cant find a way to get the secret. sorry if that was confusing!

Not sure if this help, but you put the github secret when you create the VCS connection like the following for github enterprise:

image

Internally the webhook information is created in this part of the code.

https://github.com/AzBuilder/terrakube/blob/5fcf7610d9d4db3f4efafa40df30c5d64a7c59c1/api/src/main/java/org/terrakube/api/plugin/vcs/provider/github/GitHubWebhookService.java#L92

And there is one internal table called "webhook" with the information

https://github.com/AzBuilder/terrakube/blob/main/api/src/main/java/org/terrakube/api/rs/webhook/Webhook.java

I hope this can help.