Navigation Menu

Skip to content

Commit

Permalink
Add optional hooks (#187)
Browse files Browse the repository at this point in the history
  • Loading branch information
zacanger authored and ceejbot committed Jun 10, 2019
1 parent 44285dc commit 40b9155
Show file tree
Hide file tree
Showing 7 changed files with 2,664 additions and 43 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -8,3 +8,5 @@ allowed-list
*~
*.swp
services/data/entropic-cache
.opt-in
.opt-out
4 changes: 4 additions & 0 deletions README.md
@@ -1,4 +1,5 @@
# Entropic: a federated package registry for anything

[![All Contributors](https://img.shields.io/badge/all_contributors-19-orange.svg?style=flat-square)](#contributors) [![Code of Conduct](https://img.shields.io/badge/%E2%9D%A4-code%20of%20conduct-blue.svg?style=flat-square)](CODE_OF_CONDUCT.md)

A new package registry with a new CLI, designed to be easy to stand up inside your network. Entropic features an entirely new file-centric API and a content-addressable storage system that attempts to minimize the amount of data you must retrieve over a network. This file-centric approach also applies to the publication API. See the [API section of the manifesto](https://github.com/entropic-dev/entropic/tree/master/docs#apis) for more details about the API offered.
Expand Down Expand Up @@ -79,11 +80,14 @@ Entropic is, at the moment of this writing, the work of two people: [Chris Dicki

## Contributors

<!-- markdownlint-disable MD033 -->
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore -->
<table><tr><td align="center"><a href="https://github.com/nschonni"><img src="https://avatars2.githubusercontent.com/u/1297909?v=4" width="100px;" alt="Nick Schonning"/><br /><sub><b>Nick Schonning</b></sub></a><br /><a href="https://github.com/entropic-dev/entropic/commits?author=nschonni" title="Documentation">馃摉</a></td><td align="center"><a href="https://github.com/gribnoysup"><img src="https://avatars2.githubusercontent.com/u/5036933?v=4" width="100px;" alt="Sergey"/><br /><sub><b>Sergey</b></sub></a><br /><a href="https://github.com/entropic-dev/entropic/commits?author=gribnoysup" title="Code">馃捇</a></td><td align="center"><a href="https://jmes.tech"><img src="https://avatars0.githubusercontent.com/u/542140?v=4" width="100px;" alt="James"/><br /><sub><b>James</b></sub></a><br /><a href="https://github.com/entropic-dev/entropic/commits?author=varjmes" title="Documentation">馃摉</a> <a href="https://github.com/entropic-dev/entropic/commits?author=varjmes" title="Code">馃捇</a></td><td align="center"><a href="https://zacanger.com"><img src="https://avatars3.githubusercontent.com/u/12520493?v=4" width="100px;" alt="Zac Anger"/><br /><sub><b>Zac Anger</b></sub></a><br /><a href="https://github.com/entropic-dev/entropic/commits?author=zacanger" title="Code">馃捇</a></td><td align="center"><a href="https://tck.io"><img src="https://avatars3.githubusercontent.com/u/193412?v=4" width="100px;" alt="Todd Kennedy"/><br /><sub><b>Todd Kennedy</b></sub></a><br /><a href="https://github.com/entropic-dev/entropic/commits?author=toddself" title="Code">馃捇</a></td><td align="center"><a href="http://bytes.inso.cc/"><img src="https://avatars2.githubusercontent.com/u/36964?v=4" width="100px;" alt="S茅bastien Cevey"/><br /><sub><b>S茅bastien Cevey</b></sub></a><br /><a href="https://github.com/entropic-dev/entropic/commits?author=theefer" title="Code">馃捇</a></td><td align="center"><a href="http://www.linkedin.com/in/niklabh"><img src="https://avatars2.githubusercontent.com/u/874046?v=4" width="100px;" alt="Nikhil Ranjan"/><br /><sub><b>Nikhil Ranjan</b></sub></a><br /><a href="https://github.com/entropic-dev/entropic/commits?author=niklabh" title="Code">馃捇</a></td></tr><tr><td align="center"><a href="http://twitter.com/olingern"><img src="https://avatars1.githubusercontent.com/u/1470297?v=4" width="100px;" alt="Nick Olinger"/><br /><sub><b>Nick Olinger</b></sub></a><br /><a href="https://github.com/entropic-dev/entropic/commits?author=olingern" title="Code">馃捇</a></td><td align="center"><a href="https://linkedin.com/in/jonathanfweiss"><img src="https://avatars2.githubusercontent.com/u/39352?v=4" width="100px;" alt="Jonathan Weiss"/><br /><sub><b>Jonathan Weiss</b></sub></a><br /><a href="https://github.com/entropic-dev/entropic/commits?author=jonathanweiss" title="Code">馃捇</a></td><td align="center"><a href="http://nesbitt.io"><img src="https://avatars2.githubusercontent.com/u/1060?v=4" width="100px;" alt="Andrew Nesbitt"/><br /><sub><b>Andrew Nesbitt</b></sub></a><br /><a href="https://github.com/entropic-dev/entropic/commits?author=andrew" title="Documentation">馃摉</a></td><td align="center"><a href="http://brennx0r.com"><img src="https://avatars0.githubusercontent.com/u/3596466?v=4" width="100px;" alt="Brenna Flood"/><br /><sub><b>Brenna Flood</b></sub></a><br /><a href="https://github.com/entropic-dev/entropic/commits?author=brennx0r" title="Documentation">馃摉</a></td><td align="center"><a href="https://aaronross.tech"><img src="https://avatars1.githubusercontent.com/u/18172185?v=4" width="100px;" alt="Aaron Ross"/><br /><sub><b>Aaron Ross</b></sub></a><br /><a href="https://github.com/entropic-dev/entropic/commits?author=superhawk610" title="Documentation">馃摉</a></td><td align="center"><a href="http://ceejbot.github.io/"><img src="https://avatars3.githubusercontent.com/u/757502?v=4" width="100px;" alt="C J Silverio"/><br /><sub><b>C J Silverio</b></sub></a><br /><a href="https://github.com/entropic-dev/entropic/commits?author=ceejbot" title="Code">馃捇</a> <a href="https://github.com/entropic-dev/entropic/commits?author=ceejbot" title="Documentation">馃摉</a></td><td align="center"><a href="https://www.neversaw.us"><img src="https://avatars3.githubusercontent.com/u/37303?v=4" width="100px;" alt="Chris Dickinson"/><br /><sub><b>Chris Dickinson</b></sub></a><br /><a href="https://github.com/entropic-dev/entropic/commits?author=chrisdickinson" title="Code">馃捇</a> <a href="https://github.com/entropic-dev/entropic/commits?author=chrisdickinson" title="Documentation">馃摉</a></td></tr><tr><td align="center"><a href="http://dinhe.net/~aredridel/"><img src="https://avatars3.githubusercontent.com/u/2876?v=4" width="100px;" alt="Aria Stewart"/><br /><sub><b>Aria Stewart</b></sub></a><br /><a href="https://github.com/entropic-dev/entropic/commits?author=aredridel" title="Code">馃捇</a></td><td align="center"><a href="https://pranshuchittora.github.io"><img src="https://avatars2.githubusercontent.com/u/32242596?v=4" width="100px;" alt="Pranshu Chittora"/><br /><sub><b>Pranshu Chittora</b></sub></a><br /><a href="https://github.com/entropic-dev/entropic/commits?author=pranshuchittora" title="Documentation">馃摉</a></td><td align="center"><a href="http://katebeard.co"><img src="https://avatars2.githubusercontent.com/u/37520401?v=4" width="100px;" alt="Kate Beard"/><br /><sub><b>Kate Beard</b></sub></a><br /><a href="https://github.com/entropic-dev/entropic/commits?author=sbinlondon" title="Documentation">馃摉</a></td><td align="center"><a href="http://zeke.sikelianos.com"><img src="https://avatars1.githubusercontent.com/u/2289?v=4" width="100px;" alt="Zeke Sikelianos"/><br /><sub><b>Zeke Sikelianos</b></sub></a><br /><a href="https://github.com/entropic-dev/entropic/commits?author=zeke" title="Code">馃捇</a></td><td align="center"><a href="https://github.com/samccone"><img src="https://avatars3.githubusercontent.com/u/883126?v=4" width="100px;" alt="Sam Saccone"/><br /><sub><b>Sam Saccone</b></sub></a><br /><a href="https://github.com/entropic-dev/entropic/commits?author=samccone" title="Documentation">馃摉</a></td></tr></table>

<!-- ALL-CONTRIBUTORS-LIST:END -->
<!-- markdownlint enable MD033 -->

## LICENSE

This project is released under the Apache 2.0 license.
29 changes: 15 additions & 14 deletions cli/lib/fetch.js
@@ -1,4 +1,4 @@
"use strict";
'use strict';

module.exports = fetchWithAgent;

Expand All @@ -9,22 +9,23 @@ const fetch = require('node-fetch');
const https = require('https');

const httpAgent = new http.Agent({
family: 6, hints: dns.ADDRCONFIG | dns.V4MAPPED
})
family: 6,
hints: dns.ADDRCONFIG | dns.V4MAPPED
});
const httpsAgent = new https.Agent({
family: 6, hints: dns.ADDRCONFIG | dns.V4MAPPED
})
family: 6,
hints: dns.ADDRCONFIG | dns.V4MAPPED
});

function fetchWithAgent(resource, init) {
if (!init) init = {};
if (!init) init = {};

const url = new URL(resource);
if (url.protocol == 'https:') {
init.agent = httpsAgent;
} else {
init.agent = httpAgent;
}
const url = new URL(resource);
if (url.protocol == 'https:') {
init.agent = httpsAgent;
} else {
init.agent = httpAgent;
}

return fetch(resource, init);
return fetch(resource, init);
}

18 changes: 18 additions & 0 deletions docs/HACKING.md
@@ -0,0 +1,18 @@
# Hacking

## Running Services

* [Get Docker](https://docs.docker.com/install/)
* [Get Docker Compose](https://docs.docker.com/compose/install/)
* [Get Node](https://nodejs.org/en/download/)

Once you have Node, Docker, and Docker Compose,
`cp services/registry/.env-example services/registry/.env`
(and make any adjustments you like), `npm i`, and `npm start` (or `docker-compose up`).

Then go to <http://localhost:3000>.

## Hooks

To run linting and formatting pre-commit, add a file in the project root called
`.opt-in` with the content `pre-commit`.

0 comments on commit 40b9155

Please sign in to comment.