You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
2.1 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. # Mirror your github repositories to your gitea server
  2. ## Badges
  3. [![image pulls](https://img.shields.io/docker/pulls/jaedle/mirror-to-gitea.svg)](https://cloud.docker.com/repository/docker/jaedle/mirror-to-gitea)
  4. [![microbadger analysis](https://images.microbadger.com/badges/image/jaedle/mirror-to-gitea.svg)](https://microbadger.com/images/jaedle/mirror-to-gitea "Get your own image badge on microbadger.com")
  5. ## Description
  6. This script mirrors automatically the public repositories from a github-user or github-organization to your gitea server.
  7. It will - once started - create a mirrored repository under a given token for a gitea user fully automatically.
  8. Example:
  9. A github user `github-user` has public repositories `dotfiles` and `zsh-config`.
  10. Starting the script with a gitea token for the account `gitea-user` will create the following mirror repositories:
  11. - github.com/github-user/dotfiles ← some-gitea.url/gitea-user/dotfiles
  12. - github.com/github-user/zsh-config ← some-gitea.url/zsh-config/dotfiles
  13. The mirror settings are default by your gitea instance.
  14. ## Prerequisites
  15. - Something to mirror (a github user or organization with public repos)
  16. - Gitea instance up and running
  17. - User for Gitea with generated token
  18. - Docker
  19. ## Run it
  20. ```sh
  21. docker container run \
  22. -d \
  23. --restart always \
  24. -e GITHUB_USERNAME=github-user \
  25. -e GITEA_URL=https://some-gitea.url \
  26. -e GITEA_TOKEN=please-exchange-with-token \
  27. jaedle/mirror-to-gitea:latest
  28. ```
  29. This will a spin up a docker container running infinite which will try to mirror all your repositories once every hour to your gitea server.
  30. ### Parameters
  31. - `GITHUB_USERNAME` name of user or organization which public repos should be mirrored
  32. - `GITHUB_TOKEN` [GitHub personal access token](https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token) (optional)
  33. - `GITEA_URL` url of your gitea server
  34. - `GITEA_TOKEN` token for your gitea user
  35. ## Things to do
  36. - refactoring
  37. - think about how to test
  38. - configurable interval
  39. - better logging
  40. - use github token to solve problems with rate limits
  41. - add gitlab support
  42. - and so on..