Skip to content

feat: support global credential configuration for external repo mirroring #38997

Description

@hiroa-ai

Feature Request

Description

Currently, when setting up pull/push mirrors for external repositories (e.g., GitHub private repos), each mirror requires its own credentials (username + token) to be entered individually. This becomes tedious when you have many repositories under the same owner/org that need mirroring.

Proposed Solution

Add a global credential configuration option in the Gitea admin settings or user settings where users can define credentials for external hosts (e.g., github.com, gitlab.com, etc.). These credentials would be used as defaults when creating new mirrors for repos on those hosts, so users don't have to fill in the token for every single mirror.

Example

  • Admin goes to Site Administration → "External Repository Credentials"
  • Adds an entry: Host = github.com, Username = myuser, Token = ghp_xxx
  • Later, when creating a pull mirror for a GitHub repo, the credential fields would be pre-filled

Use Case

This is especially useful for users who:

  • Self-host Gitea and mirror many repos from GitHub
  • Want to batch-migrate large numbers of private repos
  • Operate Gitea instances for teams where many repos share the same external credentials

Alternatives

  • Allow configuring credentials via environment variables or app.ini
  • Provide an API endpoint to set default per-host credentials

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions