[GH-ISSUE #314] Feature Request: API endpoint to add mirrors programmatically #5215

Open
opened 2026-06-18 18:08:21 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @ThomasMillochau on GitHub (Jun 7, 2026).
Original GitHub issue: https://github.com/RayLabsHQ/gitea-mirror/issues/314

Originally assigned to: @arunavo4 on GitHub.

Problem

There is currently no way to add a mirror to gitea-mirror without manually editing the configuration. This blocks automation use cases such as:

  • GitHub Actions / CI pipelines that auto-register new repos
  • Workflow tools (n8n, Make, etc.) reacting to external events
  • Infrastructure-as-code / GitOps setups

Proposed solution

Add a simple REST API (with API key auth) exposing at minimum:

POST /api/mirrors   – create a new mirror
GET  /api/mirrors   – list existing mirrors

Example payload:

{
  "source": "https://github.com/owner/repo",
  "destination": "https://gitea.example.com/owner/repo",
  "interval": "1h"
}

The API key could be set via an env variable and disabled by default.

Why this matters

This would make gitea-mirror viable in fully automated environments without any manual intervention, and would open the door to community integrations (n8n nodes, Actions, etc.).

Open to contributing or testing if there's interest. 🙏

Originally created by @ThomasMillochau on GitHub (Jun 7, 2026). Original GitHub issue: https://github.com/RayLabsHQ/gitea-mirror/issues/314 Originally assigned to: @arunavo4 on GitHub. ### Problem There is currently no way to add a mirror to `gitea-mirror` without manually editing the configuration. This blocks automation use cases such as: - GitHub Actions / CI pipelines that auto-register new repos - Workflow tools (n8n, Make, etc.) reacting to external events - Infrastructure-as-code / GitOps setups ### Proposed solution Add a simple REST API (with API key auth) exposing at minimum: ``` POST /api/mirrors – create a new mirror GET /api/mirrors – list existing mirrors ``` Example payload: ```json { "source": "https://github.com/owner/repo", "destination": "https://gitea.example.com/owner/repo", "interval": "1h" } ``` The API key could be set via an env variable and disabled by default. ### Why this matters This would make `gitea-mirror` viable in fully automated environments without any manual intervention, and would open the door to community integrations (n8n nodes, Actions, etc.). Open to contributing or testing if there's interest. 🙏
Author
Owner

@arunavo4 commented on GitHub (Jun 14, 2026):

@ThomasMillochau No dedicated mirrors API yet, but you can already automate it with the existing endpoints: sign in via POST /api/auth/sign-in/email to get a session cookie, then POST /api/sync/repository to add a repo and POST /api/job/mirror-repo to start the mirror. It's session-based rather than an API key, so the caveats are that it needs the account password and the schedule interval is global. A proper API-key setup with a /api/v1/mirrors namespace is the right long-term fix. Happy to take a PR if you want to tackle it.

<!-- gh-comment-id:4700710424 --> @arunavo4 commented on GitHub (Jun 14, 2026): @ThomasMillochau No dedicated mirrors API yet, but you can already automate it with the existing endpoints: sign in via `POST /api/auth/sign-in/email` to get a session cookie, then `POST /api/sync/repository` to add a repo and `POST /api/job/mirror-repo` to start the mirror. It's session-based rather than an API key, so the caveats are that it needs the account password and the schedule interval is global. A proper API-key setup with a `/api/v1/mirrors` namespace is the right long-term fix. Happy to take a PR if you want to tackle it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea-mirror#5215