Skip to content

Repository files navigation

gh-backup

Description

gh-backup is a Spring Boot tool for backing up public GitHub repositories for specified users or organizations. It is available as a command-line tool, a web application, and a daemon that runs scheduled backups automatically (with Docker support).

Installation

First Time Installation

  1. Ensure Java 17+ and Maven 3.6+ are installed.
  2. Clone the repository:
    git clone https://github.com/dmccoystephenson/gh-backup.git
    cd gh-backup
  3. Build the project:
    mvn clean package
  4. The executable JAR will be created at target/gh-backup-1.0.0.jar.

Usage

Documentation

Support

You can find the support Discord server here.

Experiencing a bug?

Please fill out a bug report here.

Contributing

Testing

Unit Tests

Linux / macOS:

mvn clean test

Windows:

mvn clean test

If you see BUILD SUCCESS, the tests have passed.

Development

Building and Running Locally

  1. Clone the repository and build:
    mvn clean package
  2. Run in CLI mode:
    java -jar target/gh-backup-1.0.0.jar octocat
  3. Run in web mode:
    java -Dspring.profiles.active=web -jar target/gh-backup-1.0.0.jar
    Then open http://localhost:8080 in your browser.
  4. Run in daemon mode (automatic scheduled backups):
    java -Dspring.profiles.active=daemon -Dbackup.scheduled.users=octocat,github -jar target/gh-backup-1.0.0.jar
    See Docker Deployment below for a containerized setup, and COMMANDS.md for all daemon options.

Docker Deployment (Daemon Mode)

The repository includes a Dockerfile and docker-compose.yml for running gh-backup as a background service that backs up configured users/organizations every 24 hours by default.

  1. Create a .env file from the example and configure it:
    cp .env.example .env
  2. Start the daemon:
    docker-compose up -d
  3. View logs:
    docker-compose logs -f
  4. Stop the daemon:
    docker-compose down

See CONFIG.md for the full list of daemon configuration options.

Authors and Acknowledgement

Developers

Name Main Contributions
dmccoystephenson Initial development and maintenance

License

This project is licensed under the MIT License.

You are free to use, modify, and distribute this software under the terms of the MIT License.

See the LICENSE file for the full license text.

Project Status

This project is in active development.

Changelog

See CHANGELOG.md for a release-by-release summary of changes.

About

Backup public GitHub repositories for specified users or organizations.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages