Feature Request: add CORS API indicating 'gitea' #7632

Closed
opened 2025-11-02 07:31:57 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @coolaj86 on GitHub (Jul 27, 2021).

TL;DR

I'd like there to be some way to indicate that the service is gitea, as opposed to gitlab.

Example

I'd like to be able to do something like this:

await fetch('https://try.gitea.io/api/v1/version', { mode: 'cors' }).toJSON()
// { "name": "gitea", "version": "1.15.0" }

Or similar to this:

await fetch('https://try.gitea.io/.well-known/openid-configuration', { mode: 'cors' }).toJSON()
// { "service_documentation": "https://docs.gitea.io" }

Just something that reveals "yes, this is gitea".

Rationalé

The reason is that I'm building a tool Bliss, which works with GitHub, GitLab, and Gitea and I'd like to be able to detect which system a user-supplied URL represents, since they have slightly different APIs.

Originally created by @coolaj86 on GitHub (Jul 27, 2021). # TL;DR I'd like there to be some way to indicate that the service is `gitea`, as opposed to `gitlab`. # Example I'd like to be able to do something like this: ```js await fetch('https://try.gitea.io/api/v1/version', { mode: 'cors' }).toJSON() // { "name": "gitea", "version": "1.15.0" } ``` Or similar to this: ```js await fetch('https://try.gitea.io/.well-known/openid-configuration', { mode: 'cors' }).toJSON() // { "service_documentation": "https://docs.gitea.io" } ``` Just something that reveals "yes, this is gitea". # Rationalé The reason is that I'm building a tool [Bliss](https://github.com/coolaj86/bliss), which works with **GitHub**, **GitLab**, and **Gitea** and I'd like to be able to detect which system a user-supplied URL represents, since they have slightly different APIs.
GiteaMirror added the type/proposalmodifies/api labels 2025-11-02 07:31:57 -06:00
Author
Owner

@techknowlogick commented on GitHub (Jul 28, 2021):

I wouldn't necessarily recommend the oidc wellknown endpoint for discovery of software type based on a docs URL (there must be a wellknown endpoint for what type of forge is in place), although regardless of purpose if a PR were to be made for the docs URL I'd recommend using https://docs.gitea.io/en-us/oauth2-provider/

I'd also hesitate to use the version endpoint, because users are able to mandate that endpoint require credentials.

@techknowlogick commented on GitHub (Jul 28, 2021): I wouldn't necessarily recommend the oidc wellknown endpoint for discovery of software type based on a docs URL (there must be a wellknown endpoint for what type of forge is in place), although regardless of purpose if a PR were to be made for the docs URL I'd recommend using https://docs.gitea.io/en-us/oauth2-provider/ I'd also hesitate to use the version endpoint, because users are able to mandate that endpoint require credentials.
Author
Owner

@techknowlogick commented on GitHub (Sep 7, 2021):

A PR for the wellknown nodeinfo endpoint can be found here: https://github.com/go-gitea/gitea/pull/16953

@techknowlogick commented on GitHub (Sep 7, 2021): A PR for the wellknown nodeinfo endpoint can be found here: https://github.com/go-gitea/gitea/pull/16953
Author
Owner

@techknowlogick commented on GitHub (Sep 28, 2021):

Closing per linked PR

@techknowlogick commented on GitHub (Sep 28, 2021): Closing per linked PR
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#7632