diff --git a/wiki/README.md b/wiki/README.md index abd91464d..a2f5d3b58 100644 --- a/wiki/README.md +++ b/wiki/README.md @@ -15,13 +15,13 @@ from a fresh look at the code and the outstanding issues. So here we are 🎉 * [Setting up *uplinks*](uplinks.md) * [Packages Access](packages.md) * [Enable Notifications](notifications.md) +* [Installing Plugins](plugins.md) +* [Authorization and access](auth.md) ## Advanced Configurations @@ -42,7 +42,3 @@ from a fresh look at the code and the outstanding issues. So here we are 🎉 * [Ansible](ansible.md) * [Docker](docker.md) - -## Extends Verdaccio - -* [Plugins](plugins.md) diff --git a/wiki/auth.md b/wiki/auth.md new file mode 100644 index 000000000..642606210 --- /dev/null +++ b/wiki/auth.md @@ -0,0 +1,38 @@ +# Authentification + +The authentification is tied to the auth [plugin](plugins.md) you are using. The package restrictions also is handled by the [Package Access](packages.md). + +The client authentification is handled by `npm` client itself. Once you login to the application: + +```bash +npm adduser --registry http://localhost:4873 +``` + +A token is generated in the `npm` configuration file hosted in your user home folder. For more information about `.npmrc` read the [official documentation](https://docs.npmjs.com/files/npmrc). + +```bash +cat .npmrc +registry=http://localhost:5555/ +//localhost:5555/:_authToken="secretVerdaccioToken" +//registry.npmjs.org/:_authToken=secretNpmjsToken +``` + +## Default htpasswd + +In order to simplify the setup, `verdaccio` use a build-in plugin based on `htpasswd`. + +```yaml +auth: + htpasswd: + file: ./htpasswd + # Maximum amount of users allowed to register, defaults to "+inf". + # You can set this to -1 to disable registration. + #max_users: 1000 +``` + +Property | Type | Required | Example | Support | Description +--- | --- | --- | --- | --- | --- +file | string | Yes | ./htpasswd | all | file that host the encrypted credentials +max_users | number | No | 1000 | all | set limit of users + +In case to decide do not allow user to login, you can set `max_users: -1`. \ No newline at end of file diff --git a/wiki/plugins.md b/wiki/plugins.md index 8a5b568c2..aee112aba 100644 --- a/wiki/plugins.md +++ b/wiki/plugins.md @@ -1,4 +1,62 @@ -This is a pre release of plugins compatible with **Verdaccio**. +# Plugins + +Verdaccio is an plugabble aplication. Currently supports multiple plugins only for [Auhtentification](auth.md) but there are plans to [improve the plugin system](https://github.com/verdaccio/verdaccio/issues/169). If you are intested to develop your own plugin, read the [development](development.md) section. + +## Usage + +### Installation + +```bash +$> npm install --global verdaccio-activedirectory +``` +`verdaccio` as a sinopia fork it has backward compability with plugins that are compatible with `sinopia@1.4.0`. In such case the installation is the same. + +``` +&> npm install --global sinopia-memory +``` + +### Configuration + +Open the `config.yaml` file and update the `auth` section as follows: + +The default configuration looks like this, due we use a build-in `htpasswd` plugin by default that you can disable just commenting out the following lines. + +```yaml + htpasswd: + file: ./htpasswd + # Maximum amount of users allowed to register, defaults to "+inf". + # You can set this to -1 to disable registration. + #max_users: 1000 +``` + +and replacing them with (in case you decide to use a `ldap` plugin. + +```yaml +auth: + activedirectory: + url: "ldap://10.0.100.1" + baseDN: 'dc=sample,dc=local' + domainSuffix: 'sample.local' +``` + +### Multiple Auth plugins + +This is tecnically possible, the plugins order becames important, the the credentials will resolved in order. + +```yaml +auth: + htpasswd: + file: ./htpasswd + # Maximum amount of users allowed to register, defaults to "+inf". + # You can set this to -1 to disable registration. + #max_users: 1000 + activedirectory: + url: "ldap://10.0.100.1" + baseDN: 'dc=sample,dc=local' + domainSuffix: 'sample.local' +``` + +This is a list of plugins compatible with **Verdaccio**. ## Sinopia Legacy Plugins