Plugins
Verdaccio is a pluggable application. It can be extended in many ways, either new authentication methods, adding endpoints or using a custom storage.
There are 5 types of plugins:
- Authentication
- Middleware
- Stockage
- Custom Theme and filters
Si vous souhaitez développer votre plugin personnel, lisez la section development.
Utilisation
Installation
$> 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
Ouvrez le fichier >config.yaml
et mettez à jour la section auth
comme suit :
La configuration par défaut ressemble à ceci, car nous utilisons un plugin intégré htpasswd
qui peut être désactivé en commentant les lignes suivantes.
Authentication Configuration
htpasswd:
file: ./htpasswd
# max_users: 1000
et en les remplaçant par (si vous décidez d'utiliser un plugin ldap
.
auth:
activedirectory:
url: "ldap://10.0.100.1"
baseDN: 'dc=sample,dc=local'
domainSuffix: 'sample.local'
Multiple Authentication plugins
This is technically possible, making the plugin order important, as the credentials will be resolved in order.
auth:
htpasswd:
file: ./htpasswd
#max_users: 1000
activedirectory:
url: "ldap://10.0.100.1"
baseDN: 'dc=sample,dc=local'
domainSuffix: 'sample.local'
Middleware Configuration
This is an example how to set up a middleware plugin. All middleware plugins must be defined in the middlewares namespace.
middlewares:
audit:
enabled: true
Vous pouvez suivre le audit middle plugin comme exemple de base.
Storage Configuration
This is an example how to set up a storage plugin. All storage plugins must be defined in the store namespace.
store:
memory:
limit: 1000
Theme Configuration
Verdaccio allows to replace the User Interface with a custom one, we call it theme. By default, uses @verdaccio/ui-theme
that comes built-in, but, you can use something different installing your own plugin.
<br />$> npm install --global verdaccio-theme-dark
The plugin name prefix must start with
verdaccio-theme
, otherwise the plugin won't load.
You can load only one theme at a time and pass through options if you need it.
theme:
dark:
option1: foo
option2: bar
Plugins hérités
Sinopia Plugins
If you are relying on any sinopia plugin, remember are deprecated and might no work in the future.
- sinopia-npm: plugin d'authentification pour la prise en charge de sinopia avec un journal npm.
- sinopia-memory: plugin d'authentification pour sinopia qui se souvient des utilisateurs.
- sinopia-github-oauth-cli.
- sinopia-crowd : plugin d'authentification pour sinopia qui prend en charge le public atlassien.
- sinopia-activedirectory: plugin d'authentification Ative Directory pour sinopia.
- sinopia-github-oauth: plugin d'authentification pour sinopia2, prenant en charge le flux web github oauth.
- sinopia-delegated-auth: plugin d’authentification Sinopia qui délègue l’authentification vers une autre URL HTTP
- sinopia-altldap: plugin remplaçant LDAP Auth pour Sinopia
- sinopia-request: un facile auth-plugin, entier, avec configuration pour utiliser une API externe.
- sinopia-htaccess-gpg-mail: générer le mot de passe au format htaccess, chiffrer avec GPG et envoyer via l’API MailGun pour les utilisateurs.
- sinopia-mongodb: un facile auth-plugin, entier, avec configuration pour utiliser une base de données mongodb.
- sinopia-crowd : plugin d'authentification pour sinopia qui prend en charge le format htpasswd.
- sinopia-leveldb: plugin auth pris en charge par leveldb pour la synchronisation privée npm.
- sinopia-gitlabheres: plugin d'authentification Gitlab pour sinopia.
- sinopia-gitlab: plugin d'authentification Gitlab pour sinopia
- sinopia-ldap: plugin d'authentification LDAP pour sinopia.
- sinopia-github-oauth-env plugin d'authentification pour Sinopia avec une interface Web github oauth.
Tous les plugins de Sinopia devraient être compatibles avec toutes les futures versions de Verdaccio. Cependant, nous encourageons les contributeurs à les transférer vers l’API moderne de verdaccio et à utiliser le préfixe * verdaccio-xx-name *.