{"id":21305889,"url":"https://github.com/haskell-hvr/hackage-mirror-tool","last_synced_at":"2025-07-23T04:33:41.455Z","repository":{"id":66248818,"uuid":"59695172","full_name":"haskell-hvr/hackage-mirror-tool","owner":"haskell-hvr","description":"Hackage mirroring tool","archived":false,"fork":false,"pushed_at":"2024-04-11T12:51:27.000Z","size":3753,"stargazers_count":6,"open_issues_count":1,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-07-11T21:35:55.527Z","etag":null,"topics":["cabal","hackage","haskell","mirroring","s3"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/haskell-hvr.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","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":"2016-05-25T20:25:36.000Z","updated_at":"2019-12-05T06:34:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"d817a912-b9c1-46a2-9620-80db2ac92ec1","html_url":"https://github.com/haskell-hvr/hackage-mirror-tool","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/haskell-hvr/hackage-mirror-tool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haskell-hvr%2Fhackage-mirror-tool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haskell-hvr%2Fhackage-mirror-tool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haskell-hvr%2Fhackage-mirror-tool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haskell-hvr%2Fhackage-mirror-tool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/haskell-hvr","download_url":"https://codeload.github.com/haskell-hvr/hackage-mirror-tool/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haskell-hvr%2Fhackage-mirror-tool/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266618798,"owners_count":23957273,"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":["cabal","hackage","haskell","mirroring","s3"],"created_at":"2024-11-21T16:19:50.482Z","updated_at":"2025-07-23T04:33:41.433Z","avatar_url":"https://github.com/haskell-hvr.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"Hackage mirroring tool  [![Build Status](https://travis-ci.org/haskell-hvr/hackage-mirror-tool.svg?branch=master)](https://travis-ci.org/haskell-hvr/hackage-mirror-tool)\n======================\n\n\nThis is a simple tool for mirroring to S3-compatible object stores\n(e.g. Dreamhost or AWS).\n\nSee also `hackage-mirror-tool --help`.\n\n\n## Resource requirements\n\nCurrently, using this tool to operate a http://hackage.haskell.org\nmirror has the following requirements:\n\n - ~1 GiB local filesystem storage (used for by local 01-index.tar cache)\n - ~10 GiB of storage in S3 bucket (at time of writing ~7.1 GiB were needed, this size increases monotonoically over time)\n - A single-threaded `hackage-mirror-tool` run needs (less than) ~256 MiB RAM; IOW, a small 512 MiB RAM VM configuration suffices.\n\n## Example usages\n\n### `cronjob`-based\n\nThis is a simple example for how to set up a cronjob-based mirror job,\nwhich is triggered every 3 minutes.\n\nCreate the following `cronjob(5)` entry:\n\n\n```\n*/3 * * * *  ${HOME}/bin/run_mirror_job.sh\n```\n\nThe `${HOME}/bin/run_mirror_job.sh` script contains:\n\n```bash\n#!/bin/bash\n\nmkdir -p ${HOME}/workdir/logs\ncd ${HOME}/workdir/\n\nS3_ACCESS_KEY=\"ASJKDS...\" \\\nS3_SECRET_KEY=\"asdjhakjsdhadhadjhaljkdh...\" \\\ntimeout -k5 170 ${HOME}/bin/hackage-mirror-tool +RTS -t -A2M -M256M -RTS \\\n  --hackage-url      http://hackage.haskell.org \\\n  --hackage-pkg-url  http://hackage.haskell.org/package/ \\\n  --s3-base-url      https://s3.amazonaws.com \\\n  --s3-bucket-id     my-hackage-mirror \\\n   \u0026\u003e\u003e ${HOME}/workdir/logs/$(date -I).log\n```\n\nThe `timeout -k5 170` arguments are defined that way in order to\nensure that the current job is killed before the next cronjob gets\nstarted.\n\n## Sample AWS access policy\n\n```\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"bucketlevel\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": [\n                \"arn:aws:s3:::hackage-mirror-tool\"\n            ]\n        },\n        {\n            \"Sid\": \"objectlevel\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:GetObject\",\n                \"s3:PutObject\",\n                \"s3:PutObjectAcl\"\n            ],\n            \"Resource\": [\n                \"arn:aws:s3:::hackage-mirror-tool/*\"\n            ]\n        }\n    ]\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaskell-hvr%2Fhackage-mirror-tool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhaskell-hvr%2Fhackage-mirror-tool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaskell-hvr%2Fhackage-mirror-tool/lists"}