# hobs-registry

> The Hobs registry

Latest version **0.3.1** (published 2016-10-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install hobs-registry
pnpm add hobs-registry
yarn add hobs-registry
bun add hobs-registry
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.1 |
| Published | 2016-10-05 |
| First published | 2016-10-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 25 |
| Known vulnerabilities | 0 (+45 in 7 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Eric Lafleur |
| Maintainers | elafleur |

## Links

- npm: https://www.npmjs.com/package/hobs-registry
- Repository: https://github.com/crambit/hobs-registry
- Homepage: https://github.com/crambit/hobs-registry#readme
- Issues: https://github.com/crambit/hobs-registry/issues
- npm.io page: https://npm.io/package/hobs-registry

## Dependencies (25)

- [tar](https://npm.io/package/tar.md) ^2.2.1
- [cors](https://npm.io/package/cors.md) ^2.8.0
- [jade](https://npm.io/package/jade.md) ^1.11.0
- [async](https://npm.io/package/async.md) ^2.0.1
- [memjs](https://npm.io/package/memjs.md) ^0.10.0
- [config](https://npm.io/package/config.md) ^1.21.0
- [morgan](https://npm.io/package/morgan.md) ^1.7.0
- [rimraf](https://npm.io/package/rimraf.md) ^2.5.4
- [express](https://npm.io/package/express.md) ^4.14.0
- [fstream](https://npm.io/package/fstream.md) ^1.0.10
- [ssh-url](https://npm.io/package/ssh-url.md) ^0.1.5
- [bcryptjs](https://npm.io/package/bcryptjs.md) ^2.3.0
- [mongoose](https://npm.io/package/mongoose.md) ^4.6.0
- [node-uuid](https://npm.io/package/node-uuid.md) ^1.4.7
- [validator](https://npm.io/package/validator.md) ^5.6.0
- [basic-auth](https://npm.io/package/basic-auth.md) ^1.0.4
- [nodemailer](https://npm.io/package/nodemailer.md) ^2.6.0
- [body-parser](https://npm.io/package/body-parser.md) ^1.15.2
- [compression](https://npm.io/package/compression.md) ^1.6.2
- [express-jwt](https://npm.io/package/express-jwt.md) ^3.4.0
- [jsonwebtoken](https://npm.io/package/jsonwebtoken.md) ^7.1.9
- [cookie-session](https://npm.io/package/cookie-session.md) ^2.0.0-alpha.1
- [express-rate-limit](https://npm.io/package/express-rate-limit.md) ^2.4.0
- [express-jwt-blacklist](https://npm.io/package/express-jwt-blacklist.md) ^1.1.0
- [nodemailer-sparkpost-transport](https://npm.io/package/nodemailer-sparkpost-transport.md) ^1.0.0

## Recent versions

- 0.3.1 (latest) — 2016-10-05

## README

# Hobs Registry

![status-stable](https://img.shields.io/badge/status-stable-green.svg)
[![Build Status](https://travis-ci.org/crambit/hobs-registry.svg?branch=master)](https://travis-ci.org/crambit/hobs-registry)

Quarry is [Hobs](https://github.com/crambit/hobs)' community repository for
packages, currently hosted at [quarry.crambit.com](https://quarry.crambit.com).
The registry can also be used internally in your organization, behind the firewall.

## Requirements

- Node.js 0.10+
- MongoDB 2.6+
- Memcached 1.4.0+

## Installation

```
$ npm install hobs-registry
```

## API function list

### Find packages

```
$ curl https://quarry.crambit.com/api/packages?q=zeta-server
```

### List packages

```
$ curl https://quarry.crambit.com/api/packages?direction=desc&sort=downloads
```

Response

```json
[
  {
    "_id": "56d4c6b4a8a954b4210ff930",
    "name": "zeta-server",
    "description": "Zeta server monitoring",
    "tags": [ "#zeta" ],
    "owner": {
      "_id": "56cc29c42b445817e010c45b",
      "name": "bob",
      "email": "bob@example.com"
    },
    "latest_version": "0.1.0",
    "url": "https://github.com/elafleur/zeta-server",
    "created_at": "2015-12-02T13:28:38.108Z",
    "updated_at": "2015-12-02T13:28:38.108Z",
    "downloads": 23
  },
]
```

### Download package

```
$ curl https://quarry.crambit.com/api/packages/zeta-server/download?version=latest \
     -o zeta-server.tar.gz
```

### Publish package

```
$ curl -X POST https://quarry.crambit.com/api/packages \
     -H "Authorization: Bearer <JSON_Web_Token>" \
     --data-binary "@horuspack.tar.gz"
```

or

```
$ curl -X POST https://quarry.crambit.com/api/packages \
     -H "Authorization: Bearer <JSON_Web_Token>" \
     -d url=https://github.com/elafleur/zeta-server
```

### Unpublish package

```
$ curl -X DELETE https://quarry.crambit.com/api/packages \
     -H "Authorization: Bearer <JSON_Web_Token>" \
     -d name=zeta-server
```

It is generally considered bad behavior to remove a package that others are depending on!

### Register

```
$ curl -X POST https://quarry.crambit.com/api/users \
     -d name=jack \
     -d email=jack@example.net \
     -d password=secret_password
```

### Login

```
$ curl -X POST https://quarry.crambit.com/api/users \
     -u username:password
```

Response

```json
  {
    "name": "jack",
    "registry": "quarry.crambit.com",
    "token": "<JSON_Web_Token>"
  }
```

### Logout

```
$ curl -X POST https://quarry.crambit.com/api/users/logout \
     -H "Authorization: Bearer <JSON_Web_Token>"
```

This will invalidate the current token associated to your user on the registry.

## Configuration

| Key                  | Description                 | Default Value                       |
| -------------------- | --------------------------- | ----------------------------------- |
| `port`               | Listening port              | 3000                                |
| `bind`               | Bind address                | '0.0.0.0'                           |
| `host`               | External host address       | 'localhost:3000'                    |
| `secure`             | Secure protocol (https)     | false                               |
| `skipValidation`     | Skip checking repo via git  | false                               |
| `skipNormalization`  | Leave ssh URLs as is        | false                               |
| `tmpDir`             | Temp directory              | '/tmp'                              |
| `maxSize`            | Package size limit in bytes | 1000000                             |
| `token.secret`       | Secret to sign JWTs         | 'secret_token'                      |
| `token.expiresIn`    | JWTs TTL                    | '30d'                               |
| `database.url`       | MongoDB address             | 'mongodb://127.0.0.1:27017/reg_dev' |
| `memcached.servers`  | Memcached server addresses  | ['127.0.0.1:11211']                 |
| `memcached.username` | Memcached username          | null                                |
| `memcached.password` | Memcached password          | null                                |
| `mailer.transport`   | Transport configuration     | 'smtp'                              |
| `mailer.options.url` | Transporter options         | null                                |

## Testing

Make sure you installed MongoDB and Memcached and properly configured `config/test.js`, and then:

```
$ NODE_ENV=test npm test
```

## License

[MIT](LICENSE)

---
_Source: https://npm.io/package/hobs-registry · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
