{"id":24999901,"url":"https://github.com/victor1890/github-backup","last_synced_at":"2026-05-08T10:36:01.792Z","repository":{"id":227523491,"uuid":"771183549","full_name":"Victor1890/github-backup","owner":"Victor1890","description":"A simple way to backup, synchronize and encrypt repositories for multiple users and organizations","archived":false,"fork":false,"pushed_at":"2024-03-13T20:11:16.000Z","size":46,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-17T11:09:42.330Z","etag":null,"topics":["backup-script","github","nodejs"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/Victor1890.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":"2024-03-12T20:52:28.000Z","updated_at":"2024-03-13T19:55:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"5637077b-e00f-4ee5-8281-22858ef5636c","html_url":"https://github.com/Victor1890/github-backup","commit_stats":null,"previous_names":["victor1890/github-backup"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Victor1890/github-backup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Victor1890%2Fgithub-backup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Victor1890%2Fgithub-backup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Victor1890%2Fgithub-backup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Victor1890%2Fgithub-backup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Victor1890","download_url":"https://codeload.github.com/Victor1890/github-backup/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Victor1890%2Fgithub-backup/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32776930,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["backup-script","github","nodejs"],"created_at":"2025-02-04T19:20:16.118Z","updated_at":"2026-05-08T10:36:01.784Z","avatar_url":"https://github.com/Victor1890.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Github Backup\n\nA simple way to backup, synchronize and encrypt repositories for multiple users and organizations\n\n### Features\n\n- Backup several organizations and users at the same time\n- Backup all kind of repositories (public, private..)\n- Update your backup by pulling latests changes (incremental backup)\n- Use the Github API to auto-update the list of repos in scope\n- Automatic encryption and decryption of the private repos during the sync process\n- Included CRON job in case you want to do periodical backups\n\n### How it works?\n\nMost of the governance is made by the use of environmental varaibles. The process can be based in a CRON job or direct execution (no cron).\n\n1. List all the repos from the organizations and users defined in the environmental varaibles by using Githup API.\n2. Decrypt previous data from private repos if exists\n3. Evaluate each repo in the list in order to clone as mirror (new) or pull for recent changes(incremental update)\n4. Encrypt private repos as a single file by using PGP symetrical passphrase and remove private repos folder\n5. Store a log with basic information about the processed Repos.\n\n### Requirements\n\nIn order to run this application you will need to provide a [valid personal github token with `repo` level access](https://docs.github.com/es/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)\n\n### Usage\n\n#### Configuration and secrets\n\nThis are the environmental secrets that you can use:\n\n- `GITHUB_TOKEN` (mandatory). This token is used to perform the API calls to Github and to clone/pull for private repos\n- `PASSPHRASE` (optional). Only is required if you want to backup private repositories. This is the passphare used to encrypt/decrypt the private repos. Highly recommended to use a STRONG, LONG and NON-REUSED password\n- `TARGET_ORGANIZATIONS` (optional) list of organizations splitted by comma in scope for backup (including private repos).\n- `TARGET_PUBLIC_ORGANIZATIONS` (optional) sames as `TARGET_ORGANIZATIONS` but with public repos only as scope\n- `TARGET_USERS` (optional) sames as `TARGET_ORGANIZATIONS` but for individual users\n- `CRON_TIME` (optional) this must be a [cron valid pattern](https://www.freeformatter.com/cron-expression-generator-quartz.html). If this is present the execution will be always a CRON jobs based\n- `CRON_TIMEZONE` (optional) this must be a valid [Timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones), by default is using `Atlantic Standard Time`\n\nThere are two main folders to manage as well:\n- `./repos` that stores all the clones of the repos (private and public)\n- `./logs` that stores all the relevant info of the last batch execution\n\n\n#### Example with docker compose\n\n```yml\nservices:\n  github-backup:\n    image: victor1890/github-backup:latest\n    restart: unless-stopped\n    environment:\n      GITHUB_TOKEN: 'github_personal_token'\n      PASSPHRASE: 'personal_passphrase'\n      TARGET_ORGANIZATIONS: 'one_org,other_org'\n      TARGET_PUBLIC_ORGANIZATIONS: 'different_org,aditional_org'\n      TARGET_USERS: 'my_user,another_user'\n      CRON_TIME: '* 18 * * * *'\n      CRON_TIMEZONE: 'Atlantic Standard Time'\n    volumes:\n      - \"./repos:/app/repos/\"\n      - \"./logs:/app/logs/\"\n```\n\n#### I don't want to use docker...\n\nYep, this project can be use as a regular NAtlantic Standard Timeodejs application, but remember to include the environmental secrets you need.\n#### How to restore a repo?\n\nYou will need to access the clone and push it to a new server, like:\n\n```bash\ncd repos/public_repos/USER/REPO.git\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvictor1890%2Fgithub-backup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvictor1890%2Fgithub-backup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvictor1890%2Fgithub-backup/lists"}