0.0.9 • Published 9 years ago
sinopia-leveldb v0.0.9
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-leveldbadd 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: 4874The 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
sinopiaI usually use pm2 for this.
use the cli tool to initialize the database
With a root user, pick any name
sinopia-leveldb init myuserThe 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 myuseradd user to groups
sinopia-leveldb add-group myuser somegrouplist user's groups
sinopia-leveldb list myuserlist all users with their groups
sinopia-leveldb listlicense
MIT © yaniv kessler