A python script fetches all your starred repositories from your GitHub account and clones them to your server so you will never lose important resources

Overview


This little python script fetches all your starred repositories from your GitHub account and clones them to your server so you will never lose important resources!

Usage

This script is designed to be used with cron. So, first of all, please install cron if it is not already installed.

You can configure the script either via environment variables (keys uppercase with SG_ as prefix) or via a configuration file located in the current work directory, in your home directory at .stargrab/config.* or at /etc/stargrab/config.*. Both yaml and json files are accepted as config file formats.

These are the available configurations.

Key Type Required Description
github_token string Yes The GitHub API token to authenticate you against the API. It can be obtained from here.
target string No (default: repositories) The target location where repository mirros should be stored.
user string No (default: viewer) The user to grab starred repositories from. Defaultly, this will be the user authenticated with the GitHub token.
ignore string No A regular expression applied on the lowercased username/reponame of each repository. When it matches, the repository is ignored.
depth number No Specify a maximum commit depth for repositories on initial clone.

Run barely

Of course, you need python3 and git to be installed on your system.

Now, clone the repository into your home directory.

git clone https://github.com/zekrotja/stargrab ~/stargrab

Then, you want to install the required dependencies of the script.

python3 -m pip install -r ~/stargrab/requirements.txt

After that, create a location to store the repository mirrors to.

mkdir ~/stargrab_repos

Following, create the config in your home directory and enter your configuration.

mkdir ~/.stargrab
vim ~/.stargrab/config.yml

Next, create a crontab entry to execute the script periodically.

crontab -e

The entry could look like following. This will execute the mirroring every day at 3am.

0 3 * * * python3 /home/
   
    /stargrab/stargrab/main.py >> /home/
    
     /stargrab/log 2>&1

    
   

Run with Docker

Therefore, you need Docker to be installed on your system, of course.

First, pull the image from GHCR.

docker pull ghcr.io/zekrotja/stargrab:latest

Optionally, you can now tag the image for simplicity.

docker tag ghcr.io/zekrotja/stargrab:latest stargrab:latest

Next, create a crontab entry to execute the Docker image periodically.

crontab -e

The entry could look like following. This will execute the mirroring every day at 3am.

-v /home/ /stargrab_repos:/var/repos stargrab">
0 3 * * * docker run --rm --env SG_GITHUB_TOKEN="
     
       -v /home/
      
       /stargrab_repos:/var/repos stargrab

      
     
Owner
Ringo Hoffmann
Full stack developer. SysAdmin / DevOps Enthusiast. I ♥ Go, React, C# and Docker. | he/him
Ringo Hoffmann
NoChannelBot - Bot bans users, that send messages like channels

No Channel Bot Say "STOP" to users who send messages as channels! Bot prevents u

Andrew 10 Oct 05, 2022
AuthGG is a Python library for dealing with Auth.gg apis

AuthGG AuthGG is a Python library for dealing with Auth.gg apis Installation Use the package manager pip to install requests Add the auth.py file in y

ExtremeDev 1 Dec 20, 2021
Asyncio SDK for Azure Cosmos DB

Asyncio SDK for Azure Cosmos DB. This library is intended to be a very thin asyncio wrapper around the Azure Comsos DB Rest API. It is not intended to have feature parity with the Microsoft Azure SDK

Grant McDonald 4 Dec 04, 2021
A python package for fetching informations from GitHub API

Py-GitHub A python package for fetching informations from GitHub API Made with Python3 (C) @FayasNoushad Copyright permission under MIT License Licens

Fayas Noushad 6 Nov 28, 2021
A slack bot that notifies you when a restaurant is available for orders

Slack Wolt Notifier A Slack bot that notifies you when a Wolt restaurant or venue is available for orders. How does it work? Slack supports bots that

Gil Matok 8 Oct 24, 2022
A simple message content sniping Discord bot which you can run yourself! Sniping API pulled from isobot and Arch bot

Discord Snipe Bot This is a bot made with the same message content sniping API from isobot and Arch bot. It's default prefix is -, however you can als

notsniped 5 Aug 11, 2022
A mass account list editor for python

Account-List-Editor This is an mass account list editor Usage Run the editor.py file with python (python3 ./editor.py) Press a button (1/2) and drag &

ExtremeDev 1 Dec 20, 2021
trading strategy for freqtrade crypto bot it base on CDC-ActionZone

ft-action-zone trading strategy for freqtrade crypto bot it base on CDC-ActionZone Indicator by piriya33 Clone The Repository if you just clone this r

Miwtoo 17 Aug 13, 2022
A Python library for PagerDuty.

Pygerduty Python Library for PagerDuty's REST API and Events API. This library was originally written to support v1 and is currently being updated to

Dropbox 164 Dec 20, 2022
First Party data integration solution built for marketing teams to enable audience and conversion onboarding into Google Marketing products (Google Ads, Campaign Manager, Google Analytics).

Megalista Sample integration code for onboarding offline/CRM data from BigQuery as custom audiences or offline conversions in Google Ads, Google Analy

Google 76 Dec 29, 2022
Telegram Bot to save Posts or Files that can be Accessed via Special Links

OKAERI-FILE Bot Telegram untuk menyimpan Posting atau File yang dapat Diakses melalui Link Khusus. Jika Anda memerlukan tambahan module lagi dalam rep

Wahyusaputra 5 Aug 04, 2022
A lightweight Python wrapper for the IG Markets API

trading_ig A lightweight Python wrapper for the IG Markets API. Simplifies access to the IG REST and Streaming APIs with a live or demo account. What

IG Python 247 Dec 08, 2022
multi-purpose discord bot

virus multi-purpose discord bot ⚠️ WARNING This project is incomplete and may not work as expected. Download & Run Install Python =3.10 Clone the sou

miten 2 Jan 17, 2022
This is a DCA crypto trading bot built for Binance written in Python

This is a DCA crypto trading bot built for Binance written in Python. It works by allowing you to DCA at an interval of your choosing and reports back on your average buy price as well as a chart con

Andrei 55 Oct 17, 2022
A file-based quote bot written in Python

Let's Write a Python Quote Bot! This repository will get you started with building a quote bot in Python. It's meant to be used along with the Learnin

1 Oct 28, 2021
Indian Space Research Organisation API With Python

ISRO Indian Space Research Organisation API Installation pip install ISRO Usage import isro isro.spacecrafts() # returns spacecrafts data isro.lau

Fayas Noushad 5 Aug 11, 2022
对hermit 的API进行简单的封装,做成了这个python moudle

hermit-py 对hermit 的API进行简单的封装,做成了这个Python Moudle,推荐通过wheel的方式安装。 目前对点击、滑动、模拟输入、找组件、等支持较好,支持查看页面的实时布局信息,再通过布局信息进行点击滑动等操作。 支持剪贴板相关的操作,支持设置剪贴的任意语言内容。

LookCos 40 Jun 25, 2022
Source code of BobuxAdmin bot from Bobux Bot Development server.

BobuxAdmin Source code of BobuxAdmin bot from Bobux Bot Development server. The bot is written with usage of disnake and SQLite database. Functionalit

Bobux Bot Developers 3 Dec 29, 2022
A simple google translator telegram bot

Translator-Bot A simple google translator telegram bot Please fork this repository don't import code Made with Python3 (C) @FayasNoushad Copyright per

Fayas Noushad 14 Nov 12, 2022
A Telegram Music Bot written in Python using Pyrogram and Py-Tgcalls

A Telegram Music Bot written in Python using Pyrogram and Py-Tgcalls. This is Also The Source Code of The UserBot Which is Playing Music in @S1-BOTS Support Group ❤️

SAF ONE 224 Dec 28, 2022