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
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:
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 © yaniv kessler