Given two running Gitea instances, with this container you can accomplish the following:
- In the Gitea instance with access to the internet, you can mirror an external repository, like the ones hosted in GitHub.
- In the Gitea instance with access to the first instance, you can mirror the repository copy created in number 1.
We use this behaviour to provide secure access to external repositories to environments with limited internet connectivity.
These instructions will cover usage information and for the docker container
In order to run this container you'll need docker installed.
Install and run from the command line using:
docker run ghcr.io/alan-turing-institute/gitea-mirror-manager:main
-
MIRROR_SERVER_URL
- The URL of the Gitea server with access to an external Git repository via the Internet. -
MIRROR_SERVER_USERNAME
- The username of a user inMIRROR_SERVER_URL
. -
MIRROR_SERVER_PASSWORD
- The password of a user inMIRROR_SERVER_URL
with usernameMIRROR_SERVER_USERNAME
. -
WORKSPACE_SERVER_URL
- The URL of the Gitea server without access to an external Git repository. -
WORKSPACE_SERVER_USERNAME
- The username of a user inWORKSPACE_SERVER_URL
. -
WORKSPACE_SERVER_PASSWORD
- The password of a user inWORKSPACE_SERVER_URL
with usernameWORKSPACE_SERVER_URL
. -
REPOSITORY_DATA
- Information of the external repository to mirror in JSON format. It should contain:{ "repositories": [ { "repository_name": "An identifier for the Git repository to mirror.", "repository_url": "The URL of the GitHub repository to mirror, like https://github.com/alan-turing-institute/gitea-mirror-manager.", "repository_auth_token": "A read-only GitH personal access token, with access to the repository to mirror." } ] }
gitea_mirror_manager/mirrors.py
- The Python module that setups the mirrors in both Gitea servers, using REST API calls.
- Python v3.13
- Requests v2.32.5
We use SemVer for versioning. For the versions available, see the tags on this repository.
This project is licensed under the MIT License - see the LICENSE file for details.