2020-08-19 20:27:35 +02:00
|
|
|
[](https://www.npmjs.com/package/verdaccio-htpasswd)
|
|
|
|
[](https://snyk.io/test/github/verdaccio/verdaccio-htpasswd?targetFile=package.json)
|
|
|
|
[](https://circleci.com/gh/ayusharma/verdaccio-htpasswd) [](https://codecov.io/gh/ayusharma/verdaccio-htpasswd)
|
|
|
|
[](https://app.fossa.io/projects/git%2Bgithub.com%2Fverdaccio%2Fverdaccio-htpasswd?ref=badge_shield)
|
|
|
|
[](https://opencollective.com/verdaccio)
|
|
|
|
[](http://chat.verdaccio.org/)
|
|
|
|

|
|
|
|
[](https://www.npmjs.com/package/verdaccio-htpasswd)
|
|
|
|
|
|
|
|
# Verdaccio Module For User Auth Via Htpasswd
|
|
|
|
|
|
|
|
`verdaccio-htpasswd` is a default authentication plugin for the [Verdaccio](https://github.com/verdaccio/verdaccio).
|
|
|
|
|
|
|
|
> This plugin is being used as dependency after `v3.0.0-beta.x`. The `v2.x` still contains this plugin built-in.
|
|
|
|
|
|
|
|
## Install
|
|
|
|
|
|
|
|
As simple as running:
|
|
|
|
|
|
|
|
$ npm install -g verdaccio-htpasswd
|
|
|
|
|
|
|
|
## Configure
|
|
|
|
|
|
|
|
auth:
|
|
|
|
htpasswd:
|
|
|
|
file: ./htpasswd
|
|
|
|
# Maximum amount of users allowed to register, defaults to "+infinity".
|
|
|
|
# You can set this to -1 to disable registration.
|
|
|
|
#max_users: 1000
|
2021-01-30 23:41:33 +01:00
|
|
|
# Hash algorithm, possible options are: "bcrypt", "md5", "sha1", "crypt".
|
|
|
|
#algorithm: bcrypt
|
|
|
|
# Rounds number for "bcrypt", will be ignored for other algorithms.
|
|
|
|
#rounds: 10
|
2020-08-19 20:27:35 +02:00
|
|
|
|
|
|
|
## Logging In
|
|
|
|
|
|
|
|
To log in using NPM, run:
|
|
|
|
|
|
|
|
```
|
|
|
|
npm adduser --registry https://your.registry.local
|
|
|
|
```
|
|
|
|
|
|
|
|
## Generate htpasswd username/password combination
|
|
|
|
|
2020-09-03 21:15:29 +02:00
|
|
|
If you wish to handle access control using htpasswd file, you can generate
|
|
|
|
username/password combination form
|
2020-08-19 20:27:35 +02:00
|
|
|
[here](http://www.htaccesstools.com/htpasswd-generator/) and add it to htpasswd
|
|
|
|
file.
|
|
|
|
|
|
|
|
## How does it work?
|
|
|
|
|
|
|
|
The htpasswd file contains rows corresponding to a pair of username and password
|
|
|
|
separated with a colon character. The password is encrypted using the UNIX system's
|
|
|
|
crypt method and may use MD5 or SHA1.
|
|
|
|
|
|
|
|
## Plugin Development in Verdaccio
|
|
|
|
|
|
|
|
There are many ways to extend [Verdaccio](https://github.com/verdaccio/verdaccio),
|
2020-09-03 21:15:29 +02:00
|
|
|
currently it support authentication plugins, middleware plugins (since v2.7.0)
|
|
|
|
and storage plugins since (v3.x).
|
|
|
|
|
2020-08-19 20:27:35 +02:00
|
|
|
#### Useful Links
|
2020-09-03 21:15:29 +02:00
|
|
|
|
2020-08-19 20:27:35 +02:00
|
|
|
- [Plugin Development](http://www.verdaccio.org/docs/en/dev-plugins.html)
|
|
|
|
- [List of Plugins](http://www.verdaccio.org/docs/en/plugins.html)
|
|
|
|
|
|
|
|
## License
|
2020-09-03 21:15:29 +02:00
|
|
|
|
2020-08-19 20:27:35 +02:00
|
|
|
[](https://app.fossa.io/projects/git%2Bgithub.com%2Fverdaccio%2Fverdaccio-htpasswd?ref=badge_large)
|