eget icon indicating copy to clipboard operation
eget copied to clipboard

Gitea support

Open jolheiser opened this issue 2 years ago • 4 comments

It would be neat to use this with releases on a Gitea instance as well.

jolheiser avatar Nov 15 '22 20:11 jolheiser

Could you point me to an example of some software hosted on Gitea so I can see what might be involved?

zyedidia avatar Nov 15 '22 22:11 zyedidia

Sure! https://gitea.com/gitea/tea

Our API should be fairly similar to GH, so theoretically shouldn't be too much different aside from endpoints.

Of course, gitea is primarily for self hosting, so support would likely need to involve a way to specify some specific instance.

jolheiser avatar Nov 15 '22 23:11 jolheiser

I would also be willing to assist or even contribute this feature if you're okay with a proposal. 🙂

jolheiser avatar Nov 15 '22 23:11 jolheiser

Cool. It would be great to have Gitea support. I think it's unlikely I will implement it myself, but feel free to open a PR for it if you want. Maybe downloading from Gitea would require prefixing the repo with gitea.com. So it would be eget gitea.com/gitea/tea, for your example, or eget gitea.your.host/user/repo for custom hosted repos.

Hopefully it won't be too difficult to adapt the current code. You'll probably need to make a new GiteaAssetFinder in find.go, and then add some more parsing to getFinder in eget.go that will use the GiteaAssetFinder if it detects gitea in the hostname of the url, or something like that. Maybe if the custom host doesn't have gitea in the name, it would have to accept something like eget gitea/your.host/user/repo?

zyedidia avatar Nov 15 '22 23:11 zyedidia