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
Develop and deploy applications with the Ionburst Cloud Python SDK.

Ionburst SDK for Python The Ionburst SDK for Python enables developers to easily integrate with Ionburst Cloud, building in ultra-secure and private o

Ionburst Cloud 3 Mar 06, 2022
Token-gate Notion pages

This is a Next.js project bootstrapped with create-next-app. Getting Started First, run the development server: npm run dev # or yarn dev Open http://

John 8 Oct 13, 2022
Provide fine-grained push access to GitHub from a JupyterHub

github-app-user-auth Provide fine-grained push access to GitHub from a JupyterHub. Goals Allow users on a JupyterHub to grant push access to only spec

Yuvi Panda 20 Sep 13, 2022
A Chip-8 emulator written using Python's default libraries

Chippure A Chip-8 emulator written using Python's default libraries. Instructions: Simply launch the .py file and type the name of the Chip8 ROM you w

5 Sep 27, 2022
Faux is a chatbot bridge between urbit and discord.

Faux Faux is a chatbot bridge between urbit and discord. Whenever a member posts in your discord group, a bot will echo their message in your urbit gr

10 Dec 27, 2022
Simple PoC script that allows you to exploit telegram's "send with timer" feature by saving any media sent with this functionality.

Simple PoC script that allows you to exploit telegram's "send with timer" feature by saving any media sent with this functionality.

Matteo 52 Nov 29, 2022
Clubhouse API written in Python. Standalone client included. For reference and education purposes only.

clubhouse-py is originally developed for the sake of interoperability. Standalone client is also created with very basic features, including but not limited to the audio-chat

1.7k Jan 05, 2023
A discord bot can stress ip addresses with python tool

Python-ddos-bot Coded by Lamp#1442 A discord bot can stress ip addresses with python tool. Warning! DOS or DDOS is illegal, i shared for educational p

IrgyGANS 1 Nov 16, 2021
Python client library for Google Maps API Web Services

Python Client for Google Maps Services Description Use Python? Want to geocode something? Looking for directions? Maybe matrices of directions? This l

Google Maps 3.8k Jan 01, 2023
An API wrapper for Discord written in Python.

HCord A fork of discord.py project. HCord is a modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python. Key Featu

HCord 0 Jul 30, 2022
An Open-Source Discord bot created to provide basic functionality which should be in every discord guild. We use this same bot with additional configurations for our guilds.

A Discord bot completely written to be taken from the source and built according to your own custom needs. This bot supports some core features and is

Tesseract Coding 14 Jan 11, 2022
A multi exploit instagram exploitation framework

Instagram Exploitation Framework About IEF Is an open source Instagram Exploitation Framework with various Exploits that could be used to mod your pro

Instagram Exploitation Framework - BirdSecurity 1 May 23, 2022
Experiment to find the best time to look for an appointment at the Berlin Bürgeramt

Bürgeramt appointment experiment Checks Berlin.de for free Anmeldung appointments every X minutes, then analyses the results. How to use Run get-page.

Nicolas Bouliane 42 Jan 02, 2023
A bot can play all variants, but standard are abit weak, so if you need strongest you can change fsf instead of stockfish_14_Dev

MAINTAINERS Drdisrespect1 and drrespectable lichess-bot Engine communication code taken from https://github.com/ShailChoksi/lichess-bot by ShailChoksi

RPNS Nimsilu 1 Dec 12, 2021
Python client for the Socrata Open Data API

sodapy sodapy is a python client for the Socrata Open Data API. Installation You can install with pip install sodapy. If you want to install from sour

Cristina 368 Dec 09, 2022
A secure and customizable bot for controlling cross-server announcements and interactions within Discord

DiscordBot A secure and customizable bot for controlling cross-server announcements and interactions within Discord. Within the code of the bot, you c

Jacob Dorfmeister 1 Jan 22, 2022
Python library to connect to Firebots API

This is a firebot library to connect to Firebots API. https://firebot.app/ From Firebots Website: "Firebot is a fully featured open-source bot that c

1 Jan 08, 2022
a translator bot for discord

TranslatorBOT it is a simple and powerful discord bot, it been used for translating includes more than 100 language, it has a lot of integrated comman

Mear. 2 Feb 03, 2022
OMDB-and-TasteDive-Mashup - Mashing up data from two different APIs to make movie recommendations.

OMDB-and-TasteDive-Mashup This hadns-on project is in the Python 3 Programming Specialization offered by University of Michigan via Coursera. Mashing

Eszter Pai 1 Jan 05, 2022
Celestial - a Python regex Discord chatbot who can talk with you.

Celestial a Python regex Discord chat bot who can talk with you. Invite url: https://discord.com/api/oauth2/authorize?client_id=927573556961869825&per

Jirayu Kaewsing 3 Jan 01, 2023