{"id":14985353,"url":"https://github.com/composer/mirror","last_synced_at":"2025-10-08T02:59:22.658Z","repository":{"id":49697859,"uuid":"258228114","full_name":"composer/mirror","owner":"composer","description":"Mirroring script for packagist.org and composer repositories metadata in general","archived":false,"fork":false,"pushed_at":"2024-11-21T08:34:27.000Z","size":144,"stargazers_count":34,"open_issues_count":2,"forks_count":9,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-05T11:41:19.404Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","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/composer.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":"2020-04-23T14:14:15.000Z","updated_at":"2025-03-27T05:43:11.000Z","dependencies_parsed_at":"2024-09-24T15:34:21.155Z","dependency_job_id":"f940e878-b6e2-4e38-9caa-63424b2cc23a","html_url":"https://github.com/composer/mirror","commit_stats":{"total_commits":30,"total_committers":4,"mean_commits":7.5,"dds":0.1333333333333333,"last_synced_commit":"6f3c8ea5fe77e1681942d9eddda4d4948390db37"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/composer/mirror","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/composer%2Fmirror","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/composer%2Fmirror/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/composer%2Fmirror/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/composer%2Fmirror/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/composer","download_url":"https://codeload.github.com/composer/mirror/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/composer%2Fmirror/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267205997,"owners_count":24052762,"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-26T02:00:08.937Z","response_time":62,"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":[],"created_at":"2024-09-24T14:10:47.423Z","updated_at":"2025-10-08T02:59:17.621Z","avatar_url":"https://github.com/composer.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Composer Repository Mirror\r\n\r\n## Setup\r\n\r\n### Scripted Setup\r\n\r\n- See https://github.com/peter279k/mirror-kickstarter if you are looking for automated scripts dealing with the setup of mirrors.\r\n\r\n### Manual Setup\r\n\r\n- `git clone https://github.com/composer/mirror mirror`\r\n- `cd mirror`\r\n- `composer install`\r\n- `cp mirror.config.php.dist mirror.config.php`\r\n- Edit `mirror.config.php` to fit your needs, and mind the TODO entries which MUST be filled-in.\r\n- Run it using supervisord or similar, it is made to shutdown regularly to avoid leaks or getting stuck for any reason. There are 3 scripts you should run:\r\n    - `./mirror.php --v1` should be run permanently to sync Composer 1 metadata (if you do not need Composer 1 metadata, you don't have to run this, but then you must set `has_v1_mirror` to `false` in the config)\r\n    - `./mirror.php --v2` should be run permanently to sync Composer 2 metadata\r\n    - `./mirror.php --gc` should be run once an hour or so with a cron job to clean up old v1 files (if you do not need Composer 1 metadata, you don't need to run this)\r\n\r\n## Debugging and force-resync of v2 metadata\r\n\r\nIn case the v2 metadata gets very outdated because you did not update the mirror for a while, this will be detected\r\nand a resync will happen automatically.\r\n\r\nHowever, if you want to run a resync manually to see what is going on you can use:\r\n\r\n`./mirror.php --resync -v`\r\n\r\nThis will make sure the v2 metadata is in sync again (wait for the script to complete which may take a while) and\r\nthen running `./mirror.php --v2` regularly again should get you back on regular updates.\r\n\r\n## Requirements\r\n\r\n- PHP 7.3+\r\n- A web server configured:\r\n  - to send Last-Modified headers, and respond correctly to `If-Modified-Since` requests with `304 Not Modified`\r\n  - to allow HTTP/2 if possible as HTTP/1 performance will be much reduced\r\n  - to respond correctly with 404s for missing files\r\n\r\n## Update\r\n\r\nIn your mirror dir:\r\n\r\n- `git pull origin master`\r\n- `composer install`\r\n\r\nThen restart the workers\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomposer%2Fmirror","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcomposer%2Fmirror","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomposer%2Fmirror/lists"}