• Stars
    star
    126
  • Rank 284,543 (Top 6 %)
  • Language
    Python
  • License
    MIT License
  • Created about 4 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Simple Python Script To Mirror Repository From Github To Gitea

Simple Python Script To Mirror Repository / Gist From Github To Gitea

Why ?

I am a data hoarder.

I 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.

✅ Requirements

  1. Python3 -- sudo apt-get install python3
  2. PyGithub -- pip install PyGithub

⚙️Installation

Github Clone

Just run the below cmd in your Gitea server

git clone https://github.com/varunsridharan/github-gitea-mirror

Or you can download the source code and install it where ever you need

🚀 Usage

Github Access Token Scopes

  • if you want to mirror private repos then select everything under Repo scope
  • if you want to mirror public repos then select repo.public_repo scope
  • if you want to mirror secret Gists then select gist scope

First make sure you have updated the config.json

Option Description
github.username Your Github Username
github.accesstoken Your Github Account's Personal Access Token
- -
gitea.host Selfhosted Gitea URL without / at the end
gitea.accesstoken Your Personal Access Token
gitea.username Account User Name
gitea.gist.prefix Custom Prefix For Repository When Mirroring Gists
gitea.gist.surfix Custom Prefix For Repository When Mirroring Gists
- -
repomap Remap A Repository To Diff User
blacklist A list of glob-expression on github full repository names to skip
gistsSource set to true to mirror all Gists Created By You
gistsStared set to true to mirror all Gists Stared By You
repositoryStared set to true to mirror all Repository Stared By You
repositorySource set to true to mirror all Repository Created By You
repositoryForked set to true to mirror all Repository Forked By You
- -
local_cache.enabled Set to true to store all repostiory slugs from gitea as json
local_cache.file_path Custom Path to store json file

Local Cache can come handly when running this script via cron which reduces api request your selfhosted gitea instance

Run cmd & Wait

$ python3 mirror.py

Cron Setup

  1. Run crontab -e
  2. mkdir $HOME/mirrorLogs -p
  3. /usr/bin/python3 $HOME/github-to-gitea-mirror/mirror.py > $HOME/mirrorLogs/date +%Y-%m-%d-%H-%M-%S.log 2>&1

📝 Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

Checkout CHANGELOG.md

🤝 Contributing

If you would like to help, please take a look at the list of issues.

💰 Sponsor

I fell in love with open-source in 2013 and there has been no looking back since! You can read more about me here. If 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.

  • ☕ How about we get to know each other over coffee? Buy me a cup for just $9.99
  • ☕️☕️ How about buying me just 2 cups of coffee each month? You can do that for as little as $9.99
  • 🔰 We love bettering open-source projects. Support 1-hour of open-source maintenance for $24.99 one-time?
  • 🚀 Love open-source tools? Me too! How about supporting one hour of open-source development for just $49.99 one-time ?

📜 License & Conduct

📣 Feedback

  • ⭐ This repository if this project helped you! 😉
  • Create An 🔧 Issue if you need help / found a bug

Connect & Say 👋


Built With ♥ By Varun Sridharan 🇮🇳


More Repositories

1

pi-hole-android-private-dns

Script to auto-install & configure Android Private DNS For Pi-Hole
Shell
87
star
2

action-github-workflow-sync

Github Action To Sync Github Action's Workflow Files Across Repositories
JavaScript
52
star
3

woocommerce-role-based-price

WooCommerce Role Based Price Plugin
PHP
47
star
4

dizzle

~ Simple Fast CSS Selector Engine ~
HTML
38
star
5

action-hashnode-blog

Fetch & Display Your Hashnode blog posts.
JavaScript
33
star
6

action-dynamic-readme

~ Dynamic ReadME Generator ~
PHP
33
star
7

action-gitea-mirror

Simple Python Script To Auto Trigger Gitea Mirror Using Github Action
Shell
26
star
8

action-repository-meta

Github Action exposes useful metadata as environment variable which can be called / used in a workflow
JavaScript
17
star
9

action-wp-org-deploy

Github Action To Publish WordPress.org Plugin's Update
Shell
12
star
10

action-wp-pot-generator

Generates POT Files for your wordpress Plugin / Theme based on the content inside Github Repo
Shell
10
star
11

wp-dependencies

Provides Function To Check if a plugin is active/inactive & function to compare versions.
PHP
10
star
12

emoji

Shows All Emoji Available In Github
HTML
10
star
13

vsp-framework

Simple & Lightweight WP Plugin Framework
PHP
8
star
14

woocommerce-quick-buy

Add Quick buy button to redirect user to checkout / cart immediately when he click quick buy button
PHP
8
star
15

woocommerce-quick-donation

Online Donation Using Woocoomerce. for woocommerce user's
PHP
7
star
16

addon-firefox-home-assistant

Simple & Quick Access Addon For Home Assistant
JavaScript
7
star
17

wp-endpoint

Simple Lib To Handle Creation of Custom Endpoints Or Rewrites in WordPress
PHP
7
star
18

addon-firefox-homer-dashboard

Simple & Quick Access Addon For Homer Dashboard
JavaScript
6
star
19

wp-review-me

This library provides developers to ask end user to review their product (theme / plugin)
PHP
6
star
20

cpanel-apache-proxy

Simple Script To Handle Apache Reverse Proxy In cPanel
Shell
5
star
21

wp-ajaxer

Simple Lightweight Ajax Handler For WP Theme/Plugin Developers
PHP
5
star
22

docker-linksnatch

This is a Dockerized version of the linksnatch tool, originally created by Amit Merchant
Dockerfile
5
star
23

wp-post

Simple WP Post Class With Advanced Options.
PHP
4
star
24

bulk-git-clone

Simple PHP Application That Can Clone All Github Repo in your local
PHP
4
star
25

wp-cli-textdomain

Cli Version of Add Txt Domain
PHP
4
star
26

action-envato-uploader

Github Action Which Uploads Files Onto Envato FTP
Shell
4
star
27

laragon-tool

Simple Local Laragon Toolkit
JavaScript
4
star
28

wp-conditional-logic

Simple WordPress Library To Evaluate / Handle Conditional Logic.
PHP
4
star
29

sweetalert2-php

Sweetalert2 Code Builder In PHP
PHP
3
star
30

css-spinners

Collections of CSS Loading Indicators / Spinners
HTML
3
star
31

action-apigen

Github Action To Generate Code Docs Website For PHP Using ApiGen
Shell
3
star
32

product-brands-for-woocommerce

product-brands-for-woocommerce
PHP
3
star
33

woocommerce-attributes-menu-manager

Show Woocommerce Custom Attributes in Wordpress Menu Page
PHP
3
star
34

action-wp-textdomain

Add Text Domain To Your WordPress Plugin / Themes On The Fly
PHP
3
star
35

varunsridharan

Github Profile README
Mustache
3
star
36

wp-plugin-version-management

Simple WordPress Plugin Library To Handle Version Management To Provide Easy Upgrade Handling.
PHP
3
star
37

tamil-fonts

Quick View Of All Usable Tamil Fonts In Premier Pro / Photoshop
2
star
38

gulp-boilerplate

JavaScript
2
star
39

live-admin-customzier

Create Customized theme for wordpress admin panel http://technofreaky.github.io/Live-Admin-Customizer/
PHP
2
star
40

action-repository-roster

Shout-out supporters in your GitHub README file.
PHP
2
star
41

wordpress-woocommerce-plugin-boiler-plate

Plugin Boiler Plate With WooCommerce & Wordpress
PHP
2
star
42

wp-transient-api

Provides Option to store Transient / options with version management.
PHP
2
star
43

demo-action-dynamic-readme

This is a demo repository for Dynamic Readme GitHub Action
PHP
2
star
44

sofy

A bundler for modular and extensible web projects.
JavaScript
2
star
45

wc-user-role-based-coupon

Sell product in different coupon for different user role based on your settings.
PHP
2
star
46

wc-product-subtitle

Create Custom Product Subtitle For WooCommerce Products.
PHP
2
star
47

actions-toolkit

Github Actions Toolkit For Shell Script & PHP
PHP
2
star
48

action-wp-org-assets-update

Update your plugin readme and assets in the WordPress.org repository outside of new releases
Shell
2
star
49

blog-demos

Demo Code Related To My Blog Posts.
HTML
2
star
50

php-sniff

Collection of PHP Coding Standards & Compatibility Rules Set for My Projects
2
star
51

wp-db-table

A base WordPress database table class with query builder
PHP
2
star
52

demo-action-hashnode-blog

This repository is a demo for Hashnode Blog Github Action
2
star
53

woocommerce-dumpper

A sample product generator for WooCommerce.
PHP
1
star
54

woocommerce-bulk-attribute-manager

woocommerce-bulk-attribute-manager
PHP
1
star
55

wp-localizer

Simple & Usefull WP Localizer Library
PHP
1
star
56

wordpress-js-ports

Simple WordPress URL Handler Ported To Javascript (add_query_arg,remove_query_arg)
JavaScript
1
star
57

gist-box-pinned

📌 All my pinned gist actions
1
star
58

php-autoloader

Lightweight PSR-4 PHP Autoloader Class.
PHP
1
star
59

wol

Script To Wake & Shutdown Remote System Using WOL (WakeOnLAN) and SSH for shutdown. with E-Mail Notification
Shell
1
star
60

wc-paytm-gateway

PHP
1
star
61

action-gh-latest-repo

Github Action That Provides Latest Public GitHub Repos From A User
JavaScript
1
star
62

.template

1
star
63

action-envato-publisher

Push Source Code To Envato FTP By packing contents into a zipfile
Shell
1
star
64

wc-better-grouped-products

Enrich your visitor with best grouped products view
PHP
1
star
65

responsive_image_auto_resizer

Auto Image Resize And Cache For Responsive
PHP
1
star
66

php-classmap-generator

Generates PHP Class-maps and works with PHP-Autoloader
PHP
1
star
67

demo-action-repository-roster

this repository is a demo for Repository Roster Github Action
1
star
68

wc-role-based-addtocart-price-hide

Hide Product Add To Cart / Price Based on User Role
PHP
1
star
69

probot-envato-purchase-verification

JavaScript
1
star
70

phpstan-issue

issue with phpstan will be replicated
PHP
1
star
71

Loaders.CSS-Android-App

Android App For Loaders.css https://github.com/ConnorAtherton/loaders.css
JavaScript
1
star
72

composer-dashboard

This is a simple Github Actions App Which provides a detailed stats on my projects
PHP
1
star
73

wordpress-plugin-activation-welcome-page

A Welcome Screen For Your WordPress Plugin
PHP
1
star
74

personal-docker-images

This repository contains all personal docker images.
Shell
1
star
75

docker-mirror

Personal Docker Hub Mirror System
PHP
1
star
76

home-assistant-config

🏠 My Home Assistant configuration, a bit different that others :) Be sure to 🌟 this repository for updates!
Shell
1
star
77

wc-sample-data

Custom WooCommerce Development & Testing Database With WP Uploads
1
star
78

easy-gulp-tasker

This Better Gulp Tasker is mainly focused on simplifying on creating gulp config / task to speed up the development process.
JavaScript
1
star