-
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce self-hosted Gitea & Codeberg API endpoints #2
Conversation
FWIW, there's a Gitea forge at gitea.com, but it isn't advertised much, as far as I can tell, so I did not make |
I like this approach. I'll try to review this tomorrow after I've gotten some sleep. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codewise, I just have some nitpicks on formatting of log outputs.
I tested codeberg on
nix flake show 'http://localhost:3000/v1/codeberg/firefish/firefish.tar.gz'
(which did have an error, but not on rime's part, so that endpoint seems functional)
I like how we get to use the get_repo_refs endpoint for version, branch, and
tag, very neat (might see if I can get this to work for github).
I couldn't find any gitea instances with nix flakes that had releases. If you
know any we could use to test against that would be useful (specially since I
should probably write some tests sooner or later). Another option might be that
I make a trivial flake repo with a release on codeberg and some self hosted
instance to test against.
Another more general question: codeberg runs on forgejo right, not gitea, and
they seem to be compatible... But I wonder if we should name this endpoint
forgejo, and then have a gitea endpoint redirect to it? If for no other reason
than the fact that forgejo seems the more FOSS adjacent option, and between the
two, I personally lean more towards supporting their project. I wonder how you feel about this?
Thanks, will correct them a bit and force-push!
https://git.madhouse-project.org/algernon/riemann-c-client - that has a flake on the 2.1.1 release, so
They are, indeed. Forgejo is pretty much Codeberg's soft-fork of Gitea, and thus, they are compatible.
I... considered this too, but ultimately, Gitea is the upstream project, so having that as the main endpoint felt more correct, even if Forgejo is more open. I'm happy to rename the endpoint nevertheless, because showing support for the more open variant is also the right thing to do. You know what? I'll do that. As for the redirect: what if we didn't need a redirect, and would just use the same routes for both |
This introduces the `/v1/forgejo/:host/:user/:repo/` routes, where `:host` is any forgejo (or gitea, or any other compatible forge) instance. Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
The `/v1/codeberg` API endpoint supports `codeberg.org`, which runs Forgejo (a Gitea soft-fork), so it simply redirects all requests to `/v1/forgejo/codeberg.org`. Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
Updated the log messages, and renamed the endpoint from gitea to forgejo - new version of the PR force pushed. |
I think that sounds very cool, and yea, I think it's good to do this in a separate PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing current and added endpoints indicate this is working without regressions, LGTM 👍 merging
This PR has two parts: the first commit introduces the
/v1/gitea/:host/:user/:repo/
family of routes, supporting any self-hosted Gitea or Gitea-compatible forge. The second commit introduces/v1/codeberg
, a simple redirect to/v1/gitea/codeberg.org
,