{"id":24525908,"url":"https://github.com/tanq16/backhub","last_synced_at":"2025-03-15T15:41:00.989Z","repository":{"id":271336946,"uuid":"913072558","full_name":"Tanq16/backhub","owner":"Tanq16","description":"Backhub helps maintain backups of multiple GitHub repos as full local mirrors.","archived":false,"fork":false,"pushed_at":"2025-02-17T04:09:16.000Z","size":2353,"stargazers_count":35,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-25T08:04:47.001Z","etag":null,"topics":["automation","backup","backup-utility","git","github","github-backup","go","golang","homelab","repository-backup","self-hosted","self-hosting"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Tanq16.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-07T01:22:52.000Z","updated_at":"2025-02-19T01:55:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"e45e3f34-9c90-4cc0-9e3c-f8867bf51167","html_url":"https://github.com/Tanq16/backhub","commit_stats":null,"previous_names":["tanq16/backhub"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tanq16%2Fbackhub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tanq16%2Fbackhub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tanq16%2Fbackhub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tanq16%2Fbackhub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tanq16","download_url":"https://codeload.github.com/Tanq16/backhub/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243753989,"owners_count":20342537,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","backup","backup-utility","git","github","github-backup","go","golang","homelab","repository-backup","self-hosted","self-hosting"],"created_at":"2025-01-22T05:29:14.223Z","updated_at":"2025-03-15T15:41:00.981Z","avatar_url":"https://github.com/Tanq16.png","language":"Go","readme":"\u003cp align=\"center\"\u003e\n\u003cimg src=\".github/assets/logo.png\" alt=\"BackHub Logo\" width=\"250\" height=\"250\" /\u003e\u003cbr\u003e\n\u003ch1 align=\"center\"\u003eBackHub\u003c/h1\u003e\u003cbr\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://github.com/tanq16/backhub/actions/workflows/release.yml\"\u003e\u003cimg src=\"https://github.com/tanq16/backhub/actions/workflows/release.yml/badge.svg\" alt=\"Release Build\"\u003e\u003c/a\u003e\u0026nbsp;\u003ca href=\"https://goreportcard.com/report/github.com/tanq16/backhub\"\u003e\u003cimg src=\"https://goreportcard.com/badge/github.com/tanq16/backhub\" alt=\"Go Report Card\"\u003e\u003c/a\u003e\u003cbr\u003e\n\u003ca href=\"https://github.com/Tanq16/backhub/releases\"\u003e\u003cimg alt=\"GitHub Release\" src=\"https://img.shields.io/github/v/release/tanq16/backhub\"\u003e\u003c/a\u003e\u0026nbsp;\u003ca href=\"https://hub.docker.com/r/tanq16/backhub\"\u003e\u003cimg alt=\"Docker Pulls\" src=\"https://img.shields.io/docker/pulls/tanq16/backhub\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003c/p\u003e\n\n`BackHub` is a simple GitHub repository backup tool that creates complete local mirrors of your repositories. It supports concurrent backup operations, automated scheduling (every 3 days when run in a container), offers a standalone binary or a Docker container, and is self-hostable.\n\n---\n\n# Features\n\n- Full repository mirroring including all branches, tags, and history\n- Concurrent backup processing for multiple repositories defined in a YAML config file\n- Automated backups and homelab-deployable with Docker deployment (every 3 days)\n- GitHub token-based authentication (to be used in an environment variable)\n- Easy restoration capability due to it being local mirror\n- Multi-arch and multi-OS binary for simple one-time usage\n\n# Installation\n\nThe easiest way to download it is from the [project releases](https://github.com/Tanq16/backhub/releases).\n\n### Go Install\n\n```bash\ngo install github.com/tanq16/backhub@latest\n```\n\n### Building from Source\n\n```bash\ngit clone https://github.com/tanq16/backhub.git \u0026\u0026 \\\ncd backhub \u0026\u0026 \\\ngo build\n```\n\n# Usage\n\n### Binary Mode\n\nRun `backhub` directly with default config path (`.backhub.yaml` in PWD) or specify a custom config like so:\n\n```bash\nbackhub -c /path/to/config.yaml\n```\n\nFor inline environment variable, use:\n\n```bash\nGH_TOKEN=pat_jsdhksjdskhjdhkajshkdjh backhub\n```\n\n### Docker Mode\n\nThe Docker container uses a script that automatically runs the tool every 3 days to provide scheduled backups. First, set up a persistence repository:\n\n```bash\nmkdir $HOME/backhub # this is where you put your .backhub.yaml file\n```\n\nThen run the container like so:\n\n```bash\ndocker run -d \\\n  --name backhub \\\n  -e GH_TOKEN=your_github_token \\\n  -v $HOME/backhub:/app \\\n  tanq16/backhub:latest\n```\n\nConversely, you can use the following compose file for Docker compose or a stack in Portainer, Dockge, etc.\n\n```yaml\nversion: \"3.8\"\nservices:\n  backhub:\n    image: tanq16/backhub:latest\n    restart: unless-stopped\n    environment:\n      - GH_TOKEN=your_github_token\n    volumes:\n      - /home/tanq/backhub:/app\n```\n\n# YAML Config File\n\nBackHub uses a simple YAML configuration file. Its default path is `.backhub.yaml` in the current working directory:\n\n```yaml\nrepos:\n  - github.com/username/repo1\n  - github.com/username/repo2\n  - github.com/org/repo3\n```\n\nLastly, use the `GH_TOKEN` environment variable as your GitHub personal access token to perform the backup of private repos.\n\n# Using the Local Mirrors\n\nTo use a local mirror as a Git repository source (like when you need to restore from the backup), the following can be done:\n\n1. Directly pull or clone from the mirror treating it as a `backup` remote in an existing repository:\n    ```bash\n    git remote add backup /path/to/your/mirror.git\n    git pull backup main # or any other branch\n    git clone /path/to/your/mirror.git new-repo\n    ```\n\n2. Serve the mirror via a local git server and use it :\n    ```bash\n    git daemon --base-path=/path/to/mirror --export-all\n    git clone git://localhost/mirror.git # in a different path\n    ```\n\n3. Use the mirror as a git server by refering to it through the file protocol:\n    ```bash\n    git clone file:///path/to/mirror.git\n    ```\n\nBeing a mirror, it contains all references (branches, tags, etc.), so cloning or pulling from it allows accessing everything as if it's the original. Use `git branch -a` to see all branches and `git tag -l` to see all tags in the mirror.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftanq16%2Fbackhub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftanq16%2Fbackhub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftanq16%2Fbackhub/lists"}