Giter Club home page Giter Club logo

docker-gitstalker's Introduction

GitStalker

This is a small Docker image to automatically clone / pull GIT and backup GitHub repos.

  • Clone and pull specific GIT repositories every 15 minutes
  • Backup all your GitHub repos (including private ones) daily
  • Automatically remove old backups (default is 7 days)

I originally wrote this to run on my QNAP NAS drive, but it can be used on any system that suits you.

Sample usage

$ docker run --name gitstalker \
             -e GITHUB_USERNAME=igoramadas \
             -e GITHUB_TOKEN=my_personal_token \
             -e BACKUP_DAYS=30 \
             -e REPO_strautomator=https://another_user:[email protected]/strautomator/web.git \
             -e REPO_pandagainz=https://github.com/igoramadas/pandagainz.git \
             -v /share/backup:/backup \
             -v /share/GIT/repos:/repos \
             igoramadas/gitstalker:latest

Environment variables

GITHUB_USERNAME

Your GitHub username. If not provided then the backup feature will not run.

GITHUB_TOKEN

Your personal GitHub access token. To get one, follow these instructions.

BACKUP_DAYS

For how many days should backups be kept? Default value is 7.

INCLUDE_ARCHIVED

If 1 or true, archived repos will also be backed up. Default is false.

USER_AGENT

Allows you to change the User-Agent header connecting to GitHub. Default is GitStalker.

REPO_id

Any environment variable starting with REPO_ will be considered a repository to be cloned / pulled.

Folders

  • /backup - where backups should be saved
  • /repos - where individual repos should be cloned to

Limitations

  • Backup only compatible with GitHub for now. BitBucket and others might be added in the future (no promises!).
  • At the moment you can only clone via https://, trying to clone using SSH will fail.
  • Credentials need to be passed directly on the URL when needed.
    • For GitHub repos, if no credentials were passed and you have set the GITHUB_USERNAME and GITHUB_TOKEN, these will be added automatically.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.