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

      
     
You might also like...
GitHub Activity Generator - A script that helps you instantly generate a beautiful GitHub Contributions Graph for the last year.
GitHub Activity Generator - A script that helps you instantly generate a beautiful GitHub Contributions Graph for the last year.

GitHub Activity Generator A script that helps you instantly generate a beautiful GitHub Contributions Graph for the last year. Before ๐Ÿ˜ ๐Ÿ˜ถ ๐Ÿ˜’ After ?

A python package that fetches tweets and user information in a very pythonic manner.

Tweetsy Tweetsy uses Twitter's underlying API to fetch user information and tweets and present it in a human-friendly way. What makes Tweetsy special

Lumi-Bot - Discord bot that fetches cryptocurrency prices utilizing CoinGeko API
Lumi-Bot - Discord bot that fetches cryptocurrency prices utilizing CoinGeko API

Lumi-Bot Discord bot that fetches and monitors cryptocurrency prices utilizing C

A Python script that wraps the gitleaks tool to enable scanning of multiple repositories in parallel
A Python script that wraps the gitleaks tool to enable scanning of multiple repositories in parallel

mpgitleaks A Python script that wraps the gitleaks tool to enable scanning of multiple repositories in parallel. The motivation behind writing this sc

This Server Cloner can clone the server you want with all the perms of roles in every particular channel.

Server-Cloner-with-perms ๐Ÿš€ This Server Cloner can clone the server you want with all the perms of roles in every particular channel. Features Clone C

A discord Server Bot made with Python, This bot helps people feel better by inspiring them with motivational quotes or by responding with a great message, also the users of the server can create custom messages by telling the bot with Commands.
A discord Server Bot made with Python, This bot helps people feel better by inspiring them with motivational quotes or by responding with a great message, also the users of the server can create custom messages by telling the bot with Commands.

A discord Server Bot made with Python, This bot helps people feel better by inspiring them with motivational quotes or by responding with a great message, also the users of the server can create custom messages by telling the bot with Commands.

A Python Script to scan through an Instagram account to find all the followers and followings.

Instagram Followers Scan A Python Script to scan through an Instagram account to find all the followers and followings. You can also get filtered list

A simple Python script using Telethon to log all (or some) messages a user or bot account can see on Telegram.

telegram-logger A simple Python script using Telethon to log all (or some) messages a user or bot account can see on Telegram. Requirements Python 3.6

Unauthenticated enumeration of services, roles, and users in an AWS account or in every AWS account in existence.

Quiet Riot ๐ŸŽถ C'mon, Feel The Noise ๐ŸŽถ An enumeration tool for scalable, unauthenticated validation of AWS principals; including AWS Acccount IDs, roo

Owner
Ringo Hoffmann
Full stack developer. SysAdmin / DevOps Enthusiast. I โ™ฅ Go, React, C# and Docker. | he/him
Ringo Hoffmann
An simple python script for remove rockstar account for fivem, very useful for cheating or change account for unban from an server, remember change steam account.

This tool is used for be unbanned from servers, u need disconnect the discord, use other steam account and uninstall xbox for be unbanned 100%, it only work for unban in server, not global

MiguDEV 4 Oct 10, 2022
A github actions + python code to extract URLs to code repositories to put into standard form, starting with github

A github actions + python code to extract URLs to code repositories to put into standard form, starting with github ---- NOTE: JUS

Justin Gosses 2 Nov 15, 2021
You can share your Chegg account for answers using this bot with your friends without getting your account blocked/flagged

Chegg-Answer-Bot You can share your Chegg account for answers using this bot with your friends without getting your account blocked/flagged Reuirement

Ammey Saini 27 Dec 24, 2022
Cytotron - A unique discord bot like never before. Add it to your server to keep it active, motiviated, and amazing!!

Cytotron - Take your server to the next level Most of the details are in the website. Go to https://cytotron-bot.gq for more information. If that link

LeviathanProgramming 6 Jun 13, 2021
Project to list all resources in an AWS account with tags.

AWS-ListAll Project to list all resources in an AWS account with tags. This script works on any system Get started: Install python3 and pip3 along wit

Connor Shubham Verlekar 3 Jan 30, 2022
Check and write all account info + Check nitro on account

Discord-Token-Checker Check and write all account info + Check nitro on account Also check https://github.com/GuFFy12/Discord-Token-Parser (Parse disc

null 36 Jan 1, 2023
โ„๏ธ Don't waste your money paying for new tokens, once you have used your tokens, clean them up and resell them!

TokenCleaner Don't waste your money paying for new tokens, once you have used your tokens, clean them up and resell them! If you have a very large qua

0xVichy 59 Nov 14, 2022
An automated tool that fetches information about your crypto stake and generates historical data in time.

Introduction Yield explorer is a WIP! I needed a tool that would show me historical data and performance of my staked crypto but was unable to find a

Sedat Can Yalรงฤฑn 42 Nov 26, 2022