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
Talon accessibility - Experimental Talon integrations using macOS accessibility APIs

talon_accessibility Experimental Talon integrations using macOS accessibility AP

Phil Cohen 11 Dec 23, 2022
Just another Shiny and Greninja-ash killing preventor for Myuu

Myuu-Anti-Shiny-Discord-Bot Why I made it? Since, I was legit fed up of NebbyBot's lag (not criticising it), I decided to make my own but in python an

5 Nov 12, 2022
Python library for RetroMMO related stuff, including API wrapper

python library for RetroMMO related stuff, including API wrapper.

1 Nov 25, 2021
How to add reaction on message discord.py

BA / HR / RS: Python (discord.py) skripta pomocu koje dodajete reakciju na vasu poruku putem komande !v ili da se dodaje samo u nekoj odredjenoj sobi.

Seekii 3 Dec 23, 2021
Nft-maker - Create your own NFT!

nft-maker How to If you're going to use this program, change the pictures in the "images" folder. All images must be of the same resolution and size.

Georgii Arakelian 4 Mar 13, 2022
A simple and easy to use musicbot in python and it uses lavalink.

Lavalink-MusicBot A simple and easy to use musicbot in python and it uses lavalink. ✨ Features plays music in your discord server well thats it i gues

Afnan 1 Nov 29, 2021
A simple way to create a request to the coinpayment API with a valid HMAC using your private key and command

Coinpayments Verify TXID Created for Astral Discord bot A simple way to create a request to the coinpayment API with a valid HMAC using your private k

HellSec 1 Nov 07, 2022
The Python client library for the Tuneup Technology App.

Tuneup Technology App Python Client Library The Python client library for the Tuneup Technology App. This library allows you to interact with the cust

Tuneup Technology 0 Jun 29, 2022
A repo-watcher to watch for commits on a repo an trigger GitHub action by sending a `repository_dispatch` event to destinantion repo

repo-watcher-dispatch-sender This app is used to send a repository_dispatch event to the destination repo set in config.py or Environmental Variables

Divide Projects™ 2 Feb 06, 2022
Available slots checker for Spanish Passport

Bot that checks for available slots to make an appointment to issue the Spanish passport at the Uruguayan consulate page

1 Nov 30, 2021
Send Informative, Concise Slack Notifications With Minimal Effort

slack-templates Send Informative, Concise Slack Notifications With Minimal Effort slack-templates Slack Integration Available Templates Usage Report t

9 Nov 03, 2022
Process your transactions from etherscan (and other forks) into excel file for easier manipulation.

DEGEN TRACKER Read first This is my first Python open source project and it is very likely full of bad practices and security issues. You should not u

1 Oct 13, 2022
A Discord bot to play bluffing games like Dobbins or Bobbins

Usage: pip install -r requirements.txt python3 bot.py DISCORD_BOT_TOKEN Gameplay: All commands are case-insensitive, with trailing punctuation and spa

4 May 27, 2022
Terraform Cloud CLI for Managing Workspace Terraform Versions

Terraform Cloud Version Manager This tiny script makes it easy to update the Terraform Version on all of the Workspaces inside Terraform Cloud. It wil

Robert Hafner 1 Jan 07, 2022
Simple Discord bot for the Collectez community.

Harvey - Discord Bot Simple Discord bot for the Collectez community. Features Ping the current status of Collectez's Teztools node. Steal emojis from

delintkhaum 1 Dec 26, 2021
Python tool to Check running WebClient services on multiple targets based on @leechristensen

WebClient Service Scanner Python tool to Check running WebClient services on multiple targets based on @tifkin_ idea. This tool uses impacket project.

Pixis 153 Dec 28, 2022
SpotPlay2YouPlay - Converts new additions to a Spotify playlist to a matching Youtube playlist

SpotPlay2YouPlay - Converts new additions to a Spotify playlist to a matching Youtube playlist, can also be configured to converting whole playlists with the refresh fun

9 Mar 06, 2022
Discord Panel is an AIO panel for Discord that aims to have all the needed tools related to user token interactions, as in nuking and also everything you could possibly need for raids

Discord Panel Discord Panel is an AIO panel for Discord that aims to have all the needed tools related to user token interactions, as in nuking and al

11 Mar 30, 2022
A Discord Bot - has a few commands. Built using python - Discord.py - RIP.

Discord_Bot A Discord Bot has been built here. It is capable of running a few commands. The below present screenshot should suffice in terms of explai

Manab Kumar Biswas 1 May 22, 2022