{"id":20945170,"url":"https://github.com/tbxark/github-backup","last_synced_at":"2025-07-23T18:32:46.750Z","repository":{"id":77774049,"uuid":"465140002","full_name":"TBXark/github-backup","owner":"TBXark","description":"A simple tool to backup github repository to gitea or other provider.","archived":false,"fork":false,"pushed_at":"2025-01-25T04:51:08.000Z","size":171,"stargazers_count":21,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T10:39:25.775Z","etag":null,"topics":["backup","backup-script","gitea","gitea-mirror","github","golang"],"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/TBXark.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":"2022-03-02T03:15:25.000Z","updated_at":"2025-02-26T09:40:34.000Z","dependencies_parsed_at":"2025-01-23T08:32:22.595Z","dependency_job_id":null,"html_url":"https://github.com/TBXark/github-backup","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/TBXark/github-backup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TBXark%2Fgithub-backup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TBXark%2Fgithub-backup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TBXark%2Fgithub-backup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TBXark%2Fgithub-backup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TBXark","download_url":"https://codeload.github.com/TBXark/github-backup/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TBXark%2Fgithub-backup/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266732101,"owners_count":23975963,"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","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"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","backup-script","gitea","gitea-mirror","github","golang"],"created_at":"2024-11-18T23:47:01.605Z","updated_at":"2025-07-23T18:32:46.701Z","avatar_url":"https://github.com/TBXark.png","language":"Go","readme":"# GitHub Backup\n\nA simple tool to back up GitHub repository to gitea or other provider.\n\n\u003e Legacy javascript version you can find in [legacy](./legacy/)\n\n### Installation\n\n#### Build from source\n```bash\ngo install github.com/TBXark/github-backup@latest\n````\n\n### Usage\n```\nUsage of github-backup:\n  -config string\n        config file (default \"config.json\")\n  -help\n        show help\n  -version\n        show version\n\n```\n\n```bash\ngithub-backup -config config.json\n```\n\n\n### Configuration\n\n\u003e The configuration file is a json file, the default configuration is as follows, You need to replace the placeholder with your own configuration, And delete the comments\n```json5\n{\n  // Target configuration, will be used to backup the repository\n  \"targets\": [\n    {\n      // The user or organization to be backed up\n      \"owner\": \"GITHUB_OWNER\",\n      // The token of the repository to be backed up\n      \"token\": \"GITHUB_TOKEN\",\n      // The backup target owner\n      \"repo_owner\": \"BACKUP_TARGET_REPO_OWNER\",\n      \"backup\": {\n        // The backup target type, currently only supports gitea and file\n        \"type\": \"file\",\n        // File configuration, only used when the backup target is file\n        \"config\": {\n          // The directory where the backup file is stored\n          \"dir\": \"SAVE_DIR\",\n          // The history json file path\n          \"history\": \"FILE_HISTORY_JSON_PATH\",\n          // When debug is true, files will not be downloaded\n          \"debug\": false\n        }\n      },\n      // Filter rules\n      \"filter\": {\n        // When the repository is not matched, the action to be taken, currently only supports delete and ignore\n        \"unmatched_repo_action\": \"ignore\",\n        // Allow rules, only repositories that match the rules will be backed up\n        // The rule is a regular expression, the format is :owner/:repo/:private/:fork/:archived\n        // For example, the rule [a-zA-Z0-9._-]+/[a-zA-Z0-9._-]+/0/[01]/[01] means that only public repositories will be backed up\n        \"allow_rule\": [\"[a-zA-Z0-9._-]+/[a-zA-Z0-9._-]+/0/[01]/[01]\"],\n        // Deny rules, repositories that match the rules will not be backed up\n        \"deny_rule\": [\"[a-zA-Z0-9._-]+/[a-zA-Z0-9._-]+/1/[01]/[01]\"]\n      },\n        // The specific token configuration, the key is the rule, and the value is the token\n      \"specific_github_token\": {\n        \"[a-zA-Z0-9._-]+/[a-zA-Z0-9._-]+/0/[01]/[01]\": \"PUBLIC_GITHUB_TOKEN\", \n        \"[a-zA-Z0-9._-]+/[a-zA-Z0-9._-]+/1/[01]/[01]\": \"PRIVATE_GITHUB_TOKEN\"\n      }\n    },\n    {\n      // The organization to be backed up\n      \"owner\": \"GITHUB_ORG\",\n      // Set is_owner_org to true when the owner is an organization\n      \"is_owner_org\": true,\n      // The backup target organization \n      \"repo_owner\": \"BACKUP_TARGET_REPO_ORG\",\n      // Set is_repo_owner_org to true when the backup target is an organization\n      \"is_repo_owner_org\": true,\n    }\n  ],\n  // Default configuration, will be used if the target configuration is not sets\n  \"default_conf\": {\n    \"github_token\": \"YOUR_GITHUB_TOKEN\",\n    \"repo_owner\": \"BACKUP_TARGET_REPO_OWNER\",\n    \"backup\": {\n      \"type\": \"gitea\",\n      // Gitea configuration, only used when the backup target is gitea\n      \"config\": {\n        // Gitea host, You can use your own gitea server\n        \"host\": \"GITEA_HOST\",\n        // Gitea token, You can create a new token in the gitea settings\n        \"token\": \"GITEA_TOKEN\",\n        // Gitea username, You can use your own gitea username\n        \"auth_username\": \"GITEA_USERNAME\"\n      }\n    },\n    \"filter\": {\n      \"unmatched_repo_action\": \"delete\",\n      \"allow_rule\": [],\n      \"deny_rule\": []\n    }\n  }\n}\n```\n\n### License\n\n**github-backup** is released under the MIT license. See [LICENSE](LICENSE) for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftbxark%2Fgithub-backup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftbxark%2Fgithub-backup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftbxark%2Fgithub-backup/lists"}