Covert mirrored repo to regular repo using API #14770

Open
opened 2025-11-02 11:22:35 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @simonjpickering on GitHub (Jul 17, 2025).

Feature Description

Currently mirrored repositories can be setup using the API. However, if you want to convert the repository to a standard one this can only be achieved via the Web UI. When looking at the web UI it makes a post request as follows:

URL: https://giteaurl.com/repository_owner/repository_name/settings

The body of the request is as follows:
{
_csrf: "dPHwrmh0SKDK6HFN2FVTmTy6Wpo6MTc1Mjc0MTgzOTEwNzA5MTg3Ng",
action: "convert",
repo_name: "repository_name"
}

If you attempt to send this using curl then you always get a message 'Invalid CSRF token'. There is no way to obtain this token through the API, so while it would appear that an existing API method is available to convert repositories you are restricted to doing this through the Web UI.

Can this be added as public API call please.

Screenshots

No response

Originally created by @simonjpickering on GitHub (Jul 17, 2025). ### Feature Description Currently mirrored repositories can be setup using the API. However, if you want to convert the repository to a standard one this can only be achieved via the Web UI. When looking at the web UI it makes a post request as follows: URL: https://giteaurl.com/repository_owner/repository_name/settings The body of the request is as follows: { _csrf: "dPHwrmh0SKDK6HFN2FVTmTy6Wpo6MTc1Mjc0MTgzOTEwNzA5MTg3Ng", action: "convert", repo_name: "repository_name" } If you attempt to send this using curl then you always get a message 'Invalid CSRF token'. There is no way to obtain this token through the API, so while it would appear that an existing API method is available to convert repositories you are restricted to doing this through the Web UI. Can this be added as public API call please. ### Screenshots _No response_
GiteaMirror added the topic/apitype/proposal labels 2025-11-02 11:22:35 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#14770