{"id":20850446,"url":"https://github.com/noteed/nginx-hackage","last_synced_at":"2026-04-01T20:28:44.979Z","repository":{"id":19371625,"uuid":"22611917","full_name":"noteed/nginx-hackage","owner":"noteed","description":"Hackage mirror as static files. The deployment at hackage.reesd.com was retired 2022-09-04.","archived":false,"fork":false,"pushed_at":"2017-07-04T21:40:17.000Z","size":580,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-26T21:53:11.234Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/noteed.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-04T16:41:41.000Z","updated_at":"2022-09-05T08:59:17.000Z","dependencies_parsed_at":"2022-09-13T14:51:35.589Z","dependency_job_id":null,"html_url":"https://github.com/noteed/nginx-hackage","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/noteed/nginx-hackage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noteed%2Fnginx-hackage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noteed%2Fnginx-hackage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noteed%2Fnginx-hackage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noteed%2Fnginx-hackage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/noteed","download_url":"https://codeload.github.com/noteed/nginx-hackage/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noteed%2Fnginx-hackage/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31291632,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T13:12:26.723Z","status":"ssl_error","status_checked_at":"2026-04-01T13:12:25.102Z","response_time":53,"last_error":"SSL_read: 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":[],"created_at":"2024-11-18T03:09:31.889Z","updated_at":"2026-04-01T20:28:44.953Z","avatar_url":"https://github.com/noteed.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hackage mirror as static files\n\nThis repository contains a few scripts to generate a static web site acting as\na local Hackage server. The offered packages can be a subset of the real\nHackage, managed by a manually edited file.\n\nThe result (with all packages) is visible at http://hackage.reesd.com/.\n\n\n## Index\n\nOn the real Hackage, all .cabal files of all packages are available at two\nlocations:\n\n    https://hackage.haskell.org/packages/index.tar.gz\n    https://hackage.haskell.org/packages/archive/00-index.tar.gz\n\nThe second location is a redirect to the first one. I guess it is necessary for\nolder cabal-install versions. Note that HTTP is available too and is actually a\nnecessity for `cabal-install`.\n\nThat file is roughly 7.1 M. The structure of the index is as follow:\n\n    \u003e tar tf index.tar.gz\n    ...\n    snap-server/0.9.4.5/snap-server.cabal\n    ...\n\nThe corresponding package actually lives at (note the missing \"s\" to\n\"package\"):\n\n    https://hackage.haskell.org/package/snap-server-0.9.4.5/snap-server-0.9.4.5.tar.gz\n    https://hackage.haskell.org/packages/archive/snap-server/0.9.4.5/snap-server-0.9.4.5.tar.gz\n\nOn Hackage, the cabal file is also available at:\n\n    https://hackage.haskell.org/package/snap-server-0.9.4.5/snap-server.cabal\n    https://hackage.haskell.org/packages/archive/snap-server/0.9.4.5/snap-server.cabal\n\nNote: currently we don't download the `.cabal` file or serve it separately.\n\n\n## Generating the content\n\nWe don't necessarily download everything from Hackage. The whole Hackage is\nabout 9G. Instead we download only what is listed in `package-names.txt`. The\nformat looks like:\n\n    ...\n    snap-server/0.9.4.5\n    ...\n\nI.e. what `tar tf index.tar.gz` outputs, minus the cabal file component. An\nexample file `reesd-package-names.txt` (actually used to develop Reesd) is\nprovided.\n\nThus running\n\n    \u003e ./download.sh\n\nwill download the individual tarballs, put them in the correct places within\nthe `static` directory (using the first URI layout described above; the second\nlayout is provided by an Nginx rewrite rule).\n\nTODO The index that we serve ourselves should be regenerated to only list the\nfile that we actually have.\n\nA full mirror can be created and updated with the `sync.sh` script.\n\n\n## Serving the index and packages\n\nWith the Docker image from https://github.com/noteed/docker-nginx, it is\nstraightforward to serve the `static` directory (built in the previous\nsection):\n\n    \u003e docker run -d \\\n        -p 80:80 \\\n        -v `pwd`/static:/usr/share/nginx/www \\\n        -v `pwd`/sites-enabled:/etc/nginx/sites-enabled \\\n        noteed/nginx\n\nNote that the Nginx configuration's server name is `hackage.reesd.com`. Please\nadapat it to your needs.\n\n\n## Note for automatic downloads / mirroring\n\nSupport for both If-None-Match and If-Modified-Since headers is broken on the\nofficial Hackage. (See\nhttp://www.haskell.org/pipermail/cabal-devel/2014-June/009807.html)\n\nUsage of `noteed/nginx` as showned above supports If-Modified-Since.\n\nThis means that providing the value of Last-modified (as-is) allows one to not\ndownload the new index if not necessary. Instead, a 304 Not Modified is\nreturned:\n\n    \u003e curl -I -H 'If-Modified-Since: Thu, 07 Aug 2014 05:26:11 GMT' \\\n        http://xxx.xxx.xxx.xxx/packages/index.tar.gz\n    HTTP/1.1 304 Not Modified\n    Server: nginx/1.1.19\n    Date: Thu, 07 Aug 2014 11:29:31 GMT\n    Last-Modified: Thu, 07 Aug 2014 05:26:11 GMT\n    Connection: keep-alive\n\nIf you want to setup a mirror, downloading all Hackage's packages is time\nconsuming and probably an increase in transfer that it would be happy to avoid.\n\nA better way is to use rsync. See https://github.com/noteed/rsync-hackage.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoteed%2Fnginx-hackage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnoteed%2Fnginx-hackage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoteed%2Fnginx-hackage/lists"}