https://github.com/kessler/node-sinopia-leveldb
a leveldb backed auth plugin for sinopia private npm
https://github.com/kessler/node-sinopia-leveldb
Last synced: 22 days ago
JSON representation
a leveldb backed auth plugin for sinopia private npm
- Host: GitHub
- URL: https://github.com/kessler/node-sinopia-leveldb
- Owner: kessler
- License: mit
- Created: 2016-06-24T14:59:00.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-08-01T20:41:38.000Z (over 8 years ago)
- Last Synced: 2025-04-04T03:31:52.652Z (28 days ago)
- Language: JavaScript
- Size: 10.7 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# sinopia-leveldb
**a leveldb backed auth plugin for [sinopia private npm](https://github.com/rlidwka/sinopia)**
- 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[](https://www.npmjs.org/package/sinopia-leveldb) [](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