{"id":13586119,"url":"https://github.com/varunsridharan/github-gitea-mirror","last_synced_at":"2025-04-09T20:10:24.744Z","repository":{"id":38273597,"uuid":"303305095","full_name":"varunsridharan/github-gitea-mirror","owner":"varunsridharan","description":"Simple Python Script To Mirror Repository From Github To Gitea","archived":false,"fork":false,"pushed_at":"2024-08-05T02:00:42.000Z","size":113,"stargazers_count":191,"open_issues_count":6,"forks_count":23,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-02T13:53:53.076Z","etag":null,"topics":["gist","gitea","gitea-mirror","gitea-mirrors","github","github-gitea-migration","github-gitea-mirror","github-mirror","github-mirrors","mirror"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/varunsridharan.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-12T06:59:48.000Z","updated_at":"2025-03-19T13:27:29.000Z","dependencies_parsed_at":"2024-10-23T01:59:47.618Z","dependency_job_id":null,"html_url":"https://github.com/varunsridharan/github-gitea-mirror","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/varunsridharan%2Fgithub-gitea-mirror","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/varunsridharan%2Fgithub-gitea-mirror/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/varunsridharan%2Fgithub-gitea-mirror/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/varunsridharan%2Fgithub-gitea-mirror/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/varunsridharan","download_url":"https://codeload.github.com/varunsridharan/github-gitea-mirror/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248103871,"owners_count":21048245,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gist","gitea","gitea-mirror","gitea-mirrors","github","github-gitea-migration","github-gitea-mirror","github-mirror","github-mirrors","mirror"],"created_at":"2024-08-01T15:05:20.330Z","updated_at":"2025-04-09T20:10:24.710Z","avatar_url":"https://github.com/varunsridharan.png","language":"Python","readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://cdn.svarun.dev/gh/varunsridharan/github-gitea-mirror/banner.jpg\"/\u003e\n\u003c/p\u003e\n\nSimple Python Script To Mirror Repository / Gist From Github To Gitea\n\n## Why ?\nI am a [data hoarder.](https://www.reddit.com/r/DataHoarder/)\n\nI am not migrating away from GitHub because I see no reason to: the platform is very useful to me, and I’d not like to lose it. What I’m trying to accomplish is a fail-safe in case something happens to GitHub which would make me lose access, be that voluntarily or involuntarily.\n\n## ✅  Requirements\n1. Python3 -- `sudo apt-get install python3`\n2. [PyGithub](https://github.com/PyGithub/PyGithub) -- `pip install PyGithub`\n\n## ⚙️Installation\n\n### Github Clone\nJust run the below cmd in your Gitea server\n\n    git clone https://github.com/varunsridharan/github-gitea-mirror\n\nOr you can download the source code and install it where ever you need\n\n## 🚀 Usage\n\n### Github Access Token Scopes\n* if you want to mirror private repos then select everything under **Repo** scope\n* if you want to mirror public repos then select **repo.public_repo** scope\n* if you want to mirror secret Gists then select **gist** scope\n\n### First make sure you have updated the `config.json`\n\n| Option | Description |\n| --- | --- |\n| `github.username` | Your Github Username |\n| `github.accesstoken` | Your Github Account's Personal Access Token |\n| - | - |\n| `gitea.host` | Selfhosted Gitea URL without `/` at the end |\n| `gitea.accesstoken` | Your Personal Access Token |\n| `gitea.username` | Account User Name |\n| `gitea.gist.prefix` | Custom Prefix For Repository When Mirroring Gists |\n| `gitea.gist.surfix` | Custom Prefix For Repository When Mirroring Gists |\n| - | - |\n| `repomap` | Remap A Repository To Diff User |\n| `blacklist` | A list of glob-expression on github full repository names to skip |\n| `gistsSource` | set to true to mirror all Gists Created By You|\n| `gistsStared` | set to true to mirror all Gists Stared By You|\n| `repositoryStared` | set to true to mirror all Repository Stared By You |\n| `repositorySource` | set to true to mirror all Repository Created By You |\n| `repositoryForked` | set to true to mirror all Repository Forked By You |\n| - | - |\n| `local_cache.enabled` | Set to **true** to store all repostiory slugs from gitea as json |\n| `local_cache.file_path` | Custom Path to store json file |\n\n\u003e Local Cache can come handly when running this script via cron\n\u003e which reduces api request your selfhosted gitea instance\n\n### Run cmd \u0026 Wait\n\n    $ python3 mirror.py\n\n\n## Cron Setup\n1. Run `crontab -e`\n2. `mkdir $HOME/mirrorLogs -p`\n3. `/usr/bin/python3 $HOME/github-to-gitea-mirror/mirror.py \u003e $HOME/mirrorLogs/`date +\\%Y-\\%m-\\%d-\\%H-\\%M-\\%S`.log 2\u003e\u00261`\n\n---\n\n## 📝 Changelog\nAll notable changes to this project will be documented in this file.\n\nThe format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),\nand this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n\n[Checkout CHANGELOG.md](/CHANGELOG.md)\n\n## 🤝 Contributing\nIf you would like to help, please take a look at the list of [issues](issues/).\n\n## 💰 Sponsor\n[I][twitter] fell in love with open-source in 2013 and there has been no looking back since! You can read more about me [here][website].\nIf you, or your company, use any of my projects or like what I’m doing, kindly consider backing me. I'm in this for the long run.\n\n- ☕ How about we get to know each other over coffee? Buy me a cup for just [**$9.99**][buymeacoffee]\n- ☕️☕️ How about buying me just 2 cups of coffee each month? You can do that for as little as [**$9.99**][buymeacoffee]\n- 🔰         We love bettering open-source projects. Support 1-hour of open-source maintenance for [**$24.99 one-time?**][paypal]\n- 🚀         Love open-source tools? Me too! How about supporting one hour of open-source development for just [**$49.99 one-time ?**][paypal]\n\n## 📜  License \u0026 Conduct\n- [**MIT**](LICENSE) © [Varun Sridharan](website)\n- [Code of Conduct](code-of-conduct.md)\n\n## 📣 Feedback\n- ⭐ This repository if this project helped you! :wink:\n- Create An [🔧 Issue](issues/) if you need help / found a bug\n\n## Connect \u0026 Say 👋\n- **Follow** me on [👨‍💻 Github][github] and stay updated on free and open-source software\n- **Follow** me on [🐦 Twitter][twitter] to get updates on my latest open source projects\n- **Message** me on [📠 Telegram][telegram]\n- **Follow** my pet on [Instagram][sofythelabrador] for some _dog-tastic_ updates!\n\n---\n\n\u003cp align=\"center\"\u003e\n\u003ci\u003eBuilt With ♥ By \u003ca href=\"https://sva.onl/twitter\"  target=\"_blank\" rel=\"noopener noreferrer\"\u003eVarun Sridharan\u003c/a\u003e 🇮🇳 \u003c/i\u003e\n\u003c/p\u003e\n\n---\n\n\u003c!-- Personl Links --\u003e\n[paypal]: https://sva.onl/paypal\n[buymeacoffee]: https://sva.onl/buymeacoffee\n[sofythelabrador]: https://www.instagram.com/sofythelabrador/\n[github]: https://sva.onl/github/\n[twitter]: https://sva.onl/twitter/\n[telegram]: https://sva.onl/telegram/\n[email]: https://sva.onl/email\n[website]: https://sva.onl/website/\n","funding_links":[],"categories":["Python","github"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvarunsridharan%2Fgithub-gitea-mirror","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvarunsridharan%2Fgithub-gitea-mirror","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvarunsridharan%2Fgithub-gitea-mirror/lists"}