6.2 KiB
id | title |
---|---|
plugins | Plugins |
Verdaccio је апликација која подржава плугине. Може се проширивати на много начина, додавањем нових метода за аутентификацију, додавањем endpoints-а или коришћењем custom storage-а.
There are 5 types of plugins:
- Authentication
- Middleware
- Меморија за складиштење
- Custom Theme and filters
Ако сте заинтересовани да развијете сопствени plugin, прочитајте development секцију.
Коришћење
Инсталација
$> 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
Конфигурисање
Отворите config.yaml
фајл и урадите update auth
секције према следећим упутствима:
Подразумевана конфигурација изгледа овако, јер користимо уграђени htpasswd
plugin као подразумеван, а који можете зауставити (disable) тако што ћете следеће линије претворити у коментар.
Authentication Configuration
htpasswd:
file: ./htpasswd
# max_users: 1000
и заменити их са датим (ако се одлучите да користите ldap
plugin).
auth:
activedirectory:
url: "ldap://10.0.100.1"
baseDN: 'dc=sample,dc=local'
domainSuffix: 'sample.local'
Multiple Authentication plugins
Технички је изводиво, ако поставите да је редослед плугина важан, услед чега ће се credentials извршити по том поретку.
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
Можете пратити audit middle plugin као базични пример.
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 the time and pass through options if is need it.
theme:
dark:
option1: foo
option2: bar
Традиционални плугини (Legacy plugins)
Sinopia Plugins
If you are relying on any sinopia plugin, remember are deprecated and might no work in the future.
- sinopia-npm: auth plugin за sinopia који подржава npm registry.
- sinopia-memory: auth plugin за sinopia који чува кориснике у меморији.
- sinopia-github-oauth-cli.
- sinopia-crowd: auth plugin за sinopia који подржава atlassian crowd.
- sinopia-activedirectory: Active Directory authentication plugin за sinopia.
- sinopia-github-oauth: authentication plugin за sinopia2, подржава github oauth web flow.
- sinopia-delegated-auth: Sinopia authentication plugin који delegira authentifikaciju за други HTTP URL
- sinopia-altldap: Алтернативни LDAP Auth plugin за Sinopia
- sinopia-request: Једноставан и целовит auth-plugin са конфигурацијом за коришћењем екстерних API.
- sinopia-htaccess-gpg-email: Генерише password у htaccess формату, encrypt са GPG и шаље преко MailGun API до корисника.
- sinopia-mongodb: Једноставан и целовит auth-plugin са конфигурацијом за коришћење mongodb database.
- sinopia-htpasswd: auth plugin за sinopia који подржава htpasswd формат.
- sinopia-leveldb: a leveldb подржан auth plugin за sinopia private npm.
- sinopia-gitlabheres: Gitlab authentication plugin за sinopia.
- sinopia-gitlab: Gitlab authentication plugin за sinopia
- sinopia-ldap: LDAP auth plugin за sinopia.
- sinopia-github-oauth-env Sinopia authentication plugin са github oauth web flow.
Сви sinopia plugins-и, требало би да буду компатибилни са свим будућим верзијама verdaccio-а. Било како било, охрабрујемо наше сараднике да пређу на модерни verdaccio API и да користе префикс као verdaccio-xx-name.