{"id":23141623,"url":"https://github.com/zekrotja/stargrab","last_synced_at":"2025-08-17T13:31:51.748Z","repository":{"id":44802284,"uuid":"450035018","full_name":"zekroTJA/stargrab","owner":"zekroTJA","description":"Securely mirror your starred repositories.","archived":false,"fork":false,"pushed_at":"2023-02-13T09:21:30.000Z","size":3239,"stargazers_count":32,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-17T11:44:05.207Z","etag":null,"topics":["github","hacktoberfest","python","starred-repositories","stars"],"latest_commit_sha":null,"homepage":"","language":"Python","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/zekroTJA.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-01-20T09:37:08.000Z","updated_at":"2024-05-11T14:59:37.000Z","dependencies_parsed_at":"2024-05-29T16:12:49.683Z","dependency_job_id":"264c3f41-d2f7-4629-bb95-21a980badcb2","html_url":"https://github.com/zekroTJA/stargrab","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zekroTJA/stargrab","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zekroTJA%2Fstargrab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zekroTJA%2Fstargrab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zekroTJA%2Fstargrab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zekroTJA%2Fstargrab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zekroTJA","download_url":"https://codeload.github.com/zekroTJA/stargrab/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zekroTJA%2Fstargrab/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270856561,"owners_count":24657688,"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-08-17T02:00:09.016Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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":["github","hacktoberfest","python","starred-repositories","stars"],"created_at":"2024-12-17T14:14:03.034Z","updated_at":"2025-08-17T13:31:51.303Z","avatar_url":"https://github.com/zekroTJA.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\".github/media/banner.png\" width=\"100%\"/\u003e\n\n---\n\nThis little python script fetches all your starred repositories from your GitHub account and clones them to your server so you will never lose important resources!\n\n# Usage\n\nThis script is designed to be used with cron. So, first of all, please install cron if it is not already installed.\n\nYou can configure the script either via environment variables (keys uppercase with `SG_` as prefix) or via a configuration file located in the current work directory, in your home directory at `.stargrab/config.*` or at `/etc/stargrab/config.*`. Both `yaml` and `json` files are accepted as config file formats.\n\nThese are the available configurations.\n| Key | Type | Required | Description |\n|-----|------|----------|-------------|\n| `github_token` | `string` | Yes | The GitHub API token to authenticate you against the API. It can be obtained from [here](https://github.com/settings/tokens). |\n| `target` | `string` | No (default: `repositories`) | The target location where repository mirros should be stored. |\n| `user` | `string` | No (default: `viewer`) | The user to grab starred repositories from. Defaultly, this will be the user authenticated with the GitHub token. |\n| `ignore` | `string` | No | A regular expression applied on the lowercased `username/reponame` of each repository. When it matches, the repository is ignored. |\n| `depth` | `number` | No | Specify a maximum commit depth for repositories on initial clone. |\n| `max_size` | `string` or `number` | No | Filter repositories for maximum disk size. Only repos that are smaller than this value will be stored. |\n\n## Run barely\n\nOf course, you need python3 and git to be installed on your system.\n\nNow, clone the repository into your home directory.\n```\ngit clone https://github.com/zekrotja/stargrab ~/stargrab\n```\n\nThen, you want to install the required dependencies of the script.\n```\npython3 -m pip install -r ~/stargrab/requirements.txt\n```\n\nAfter that, create a location to store the repository mirrors to.\n```\nmkdir ~/stargrab_repos\n```\n\nFollowing, create the config in your home directory and enter your configuration.\n```\nmkdir ~/.stargrab\nvim ~/.stargrab/config.yml\n```\n\nNext, create a crontab entry to execute the script periodically.\n```\ncrontab -e\n```\n\nThe entry could look like following. This will execute the mirroring every day at 3am.\n```\n0 3 * * * python3 /home/\u003cyourUserName\u003e/stargrab/stargrab/main.py \u003e\u003e /home/\u003cyourUserName\u003e/stargrab/log 2\u003e\u00261\n```\n\n## Run with Docker\n\nTherefore, you need Docker to be installed on your system, of course.\n\nFirst, pull the image from GHCR.\n```\ndocker pull ghcr.io/zekrotja/stargrab:latest\n```\n\nOptionally, you can now tag the image for simplicity.\n```\ndocker tag ghcr.io/zekrotja/stargrab:latest stargrab:latest\n```\n\nNext, create a crontab entry to execute the Docker image periodically.\n```\ncrontab -e\n```\n\nThe entry could look like following. This will execute the mirroring every day at 3am.\n```\n0 3 * * * docker run --rm --env SG_GITHUB_TOKEN=\"\u003cyourGitHubToken\u003e\" -v /home/\u003cyourUserName\u003e/stargrab_repos:/var/repos stargrab\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzekrotja%2Fstargrab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzekrotja%2Fstargrab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzekrotja%2Fstargrab/lists"}