# sinopia-leveldb

> a leveldb backed auth plugin for sinopia private npm

Latest version **0.0.9** (published 2016-06-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install sinopia-leveldb
pnpm add sinopia-leveldb
yarn add sinopia-leveldb
bun add sinopia-leveldb
```

Provides the command `sinopia-leveldb`.

## 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.0.9 |
| Published | 2016-06-26 |
| First published | 2016-06-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4.0.0 |
| Dependencies | 8 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | yaniv kessler |
| Maintainers | kessler |
| Keywords | auth, leveldb, npm, plugin, sinopia |

## Links

- npm: https://www.npmjs.com/package/sinopia-leveldb
- Repository: https://github.com/kessler/node-sinopia-leveldb
- Issues: https://github.com/kessler/node-sinopia-leveldb/issues
- npm.io page: https://npm.io/package/sinopia-leveldb

## Dependencies (8)

- [xn](https://npm.io/package/xn.md) 0.0.4
- [read](https://npm.io/package/read.md) ^1.0.7
- [rimraf](https://npm.io/package/rimraf.md) ^2.5.2
- [unirest](https://npm.io/package/unirest.md) ^0.5.0
- [commander](https://npm.io/package/commander.md) ^2.9.0
- [concat-stream](https://npm.io/package/concat-stream.md) ^1.5.1
- [json-over-tcp](https://npm.io/package/json-over-tcp.md) ^0.3.2
- [level-bytewise](https://npm.io/package/level-bytewise.md) ^1.0.0

## Alternatives

- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads
- [escher-request](https://npm.io/package/escher-request.md) — 545 weekly downloads

## Recent versions

- 0.0.9 (latest) — 2016-06-26
- 0.0.8 — 2016-06-26
- 0.0.7 — 2016-06-26
- 0.0.6 — 2016-06-26
- 0.0.5 — 2016-06-26
- 0.0.4 — 2016-06-26
- 0.0.3 — 2016-06-26
- 0.0.2 — 2016-06-25

## README

# sinopia-leveldb

**a leveldb backed auth plugin for sinopia private npm**

- This plugin saves only hashes of the password
- Plugin comes with an api tool to perform various operations (see below)
- Supports groups, groups can be used in sinopia's config.yaml to restrict access to packages

[![npm status](http://img.shields.io/npm/v/sinopia-leveldb.svg?style=flat-square)](https://www.npmjs.org/package/sinopia-leveldb) [![Dependency status](https://img.shields.io/david/kessler/node-sinopia-leveldb.svg?style=flat-square)](https://david-dm.org/kessler/node-sinopia-leveldb)

## set up

#### install sinopia and the plug in
```
npm install -g sinopia
npm install -g sinopia-leveldb
```

#### add this to config.yaml, in the auth section:
```yaml
auth:
  leveldb:
    file: ./userdb

    # replace the control port use to communicate 
    # between the cli and sinopia.
    # this configuration is optional
    # controlServerPort: 4874
```
The db path is relative to the location of sinopia's config.yaml
You should also remove ```htpasswd ``` plugin if it's there

#### fire up sinopia
```
sinopia
```
I usually use pm2 for this. 

#### use the cli tool to initialize the database
With a root user, pick any name
```
sinopia-leveldb init myuser
```

***The cli provide in itself is not secure and is designed to work on the machine that is running sinopia***

## other cli commands

#### set password
```
sinopia-leveldb set-password myuser
```

#### add user to groups
```
sinopia-leveldb add-group myuser somegroup
```

#### list user's groups
```
sinopia-leveldb list myuser
```

#### list all users with their groups
```
sinopia-leveldb list
```

## license

[MIT](http://opensource.org/licenses/MIT) © yaniv kessler

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