1
0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-11-17 07:45:52 +01:00
verdaccio/website/translated_docs/zh-Hans/plugins.md
verdacciobot 18c0b5458a New Crowdin translations (#778)
* New translations ansible.md (Chinese Simplified)
docs(website): new translations

* New translations auth.md (Chinese Simplified)
docs(website): new translations

* New translations build.md (Chinese Simplified)
docs(website): new translations

* New translations contributing.md (Chinese Simplified)
docs(website): new translations

* New translations ci.md (Chinese Simplified)
docs(website): new translations

* New translations chef.md (Chinese Simplified)
docs(website): new translations

* New translations contributing.md (Chinese Simplified)
docs(website): new translations

* New translations packages.md (Chinese Simplified)
docs(website): new translations

* New translations packages.md (Chinese Simplified)
docs(website): new translations

* New translations packages.md (Chinese Simplified)
docs(website): new translations

* New translations packages.md (Chinese Simplified)
docs(website): new translations

* New translations packages.md (Chinese Simplified)
docs(website): new translations

* New translations ansible.md (Chinese Simplified)
docs(website): new translations

* New translations ci.md (Chinese Simplified)
docs(website): new translations

* New translations plugins.md (Spanish)
docs(website): new translations

* New translations notifications.md (Spanish)
docs(website): new translations

* New translations auth.md (Chinese Simplified)
docs(website): new translations

* New translations contributing.md (Chinese Simplified)
docs(website): new translations

* New translations build.md (Chinese Simplified)
docs(website): new translations

* New translations chef.md (Chinese Simplified)
docs(website): new translations

* New translations packages.md (Chinese Simplified)
docs(website): new translations

* New translations packages.md (Chinese Simplified)
docs(website): new translations

* New translations packages.md (Chinese Simplified)
docs(website): new translations

* New translations packages.md (Chinese Simplified)
docs(website): new translations

* New translations packages.md (Chinese Simplified)
docs(website): new translations

* New translations packages.md (Chinese Simplified)
docs(website): new translations

* New translations packages.md (Chinese Simplified)
docs(website): new translations

* New translations plugins.md (Chinese Simplified)
docs(website): new translations

* New translations plugins.md (Chinese Simplified)
docs(website): new translations

* New translations plugins.md (Chinese Simplified)
docs(website): new translations
2018-06-23 16:42:14 +02:00

137 lines
5.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
id: plugins
title: "插件"
---
Verdaccio是一个可插拔的应用程序。它可以通过多种方式进行扩展例如新的认证方法添加endpoints或者使用自定义存储。
> 如果你对开发自己的插件感兴趣,请阅读[开发](development.md)部分。
## 用法
### 安装
```bash
$> npm install --global verdaccio-activedirectory
```
`verdaccio`作为一个sinopia的分支它和兼容`sinopia@1.4.0`的插件具有向后兼容性。在这种情况下,安装方式相同。
$> npm install --global sinopia-memory
### 配置
打开`config.yaml`文件并按如下说明更新`auth`部分:
默认配置如下所示,由于在默认情况下我们使用一个内置的`htpasswd`插件,我们可以通过注释下面几行代码来禁用它:
### Auth插件配置
```yaml
htpasswd:
file: ./htpasswd
#max_users: 1000
```
如果你决定使用`ldap`插件,将上述部分进行替换。
```yaml
auth:
activedirectory:
url: "ldap://10.0.100.1"
baseDN: 'dc=sample,dc=local'
domainSuffix: 'sample.local'
```
#### 多个授权插件
这在技术上可行,插件的顺序变得非常重要,安全凭据将按顺序获取。
```yaml
auth:
htpasswd:
file: ./htpasswd
#max_users: 1000
activedirectory:
url: "ldap://10.0.100.1"
baseDN: 'dc=sample,dc=local'
domainSuffix: 'sample.local'
```
### 中间件插件配置
这是一个如何设置中间件插件的示例。所有的中间件插件必须被定义在**middlewares**命名空间。
```yaml
middlewares:
audit:
enabled: true
```
### 存储插件配置
这是一个如何设置存储插件的示例。所有的存储插件必须在**store**命名空间进行定义。
```yaml
store:
memory:
limit: 1000
```
> 如果你定义一个自定义存储,配置文件中的**storage**属性将会被忽略。
## 旧式插件
### Sinopia插件
(兼容所有版本)
* [sinopia-npm](https://www.npmjs.com/package/sinopia-npm)支持npm注册表的sinopia认证插件。
* [sinopia-memory](https://www.npmjs.com/package/sinopia-memory): auth plugin for sinopia that keeps users in memory.
* [sinopia-github-oauth-cli](https://www.npmjs.com/package/sinopia-github-oauth-cli).
* [sinopia-crowd](https://www.npmjs.com/package/sinopia-crowd): auth plugin for sinopia supporting atlassian crowd.
* [sinopia-activedirectory](https://www.npmjs.com/package/sinopia-activedirectory): Active Directory authentication plugin for sinopia.
* [sinopia-github-oauth](https://www.npmjs.com/package/sinopia-github-oauth): authentication plugin for sinopia2, supporting github oauth web flow.
* [sinopia-delegated-auth](https://www.npmjs.com/package/sinopia-delegated-auth): Sinopia authentication plugin that delegates authentication to another HTTP URL
* [sinopia-altldap](https://www.npmjs.com/package/sinopia-altldap): Alternate LDAP Auth plugin for Sinopia
* [sinopia-request](https://www.npmjs.com/package/sinopia-request): An easy and fully auth-plugin with configuration to use an external API.
* [sinopia-htaccess-gpg-email](https://www.npmjs.com/package/sinopia-htaccess-gpg-email): Generate password in htaccess format, encrypt with GPG and send via MailGun API to users.
* [sinopia-mongodb](https://www.npmjs.com/package/sinopia-mongodb): An easy and fully auth-plugin with configuration to use a mongodb database.
* [sinopia-htpasswd](https://www.npmjs.com/package/sinopia-htpasswd): auth plugin for sinopia supporting htpasswd format.
* [sinopia-leveldb](https://www.npmjs.com/package/sinopia-leveldb): a leveldb backed auth plugin for sinopia private npm.
* [sinopia-gitlabheres](https://www.npmjs.com/package/sinopia-gitlabheres): Gitlab authentication plugin for sinopia.
* [sinopia-gitlab](https://www.npmjs.com/package/sinopia-gitlab): Gitlab authentication plugin for sinopia
* [sinopia-ldap](https://www.npmjs.com/package/sinopia-ldap): LDAP auth plugin for sinopia.
* [sinopia-github-oauth-env](https://www.npmjs.com/package/sinopia-github-oauth-env) Sinopia authentication plugin with github oauth web flow.
> All sinopia plugins should be compatible with all future verdaccio versions. Anyhow, we encourage contributors to migrate them to the modern verdaccio API and using the prefix as *verdaccio-xx-name*.
## Verdaccio Plugins
(compatible since 2.1.x)
### Authorization Plugins
* [verdaccio-bitbucket](https://github.com/idangozlan/verdaccio-bitbucket): Bitbucket authentication plugin for verdaccio.
* [verdaccio-ldap](https://www.npmjs.com/package/verdaccio-ldap): LDAP auth plugin for verdaccio.
* [verdaccio-active-directory](https://github.com/nowhammies/verdaccio-activedirectory): Active Directory authentication plugin for verdaccio
* [verdaccio-gitlab](https://github.com/bufferoverflow/verdaccio-gitlab): use GitLab Personal Access Token to authenticate
* [verdaccio-htpasswd](https://github.com/verdaccio/verdaccio-htpasswd): Auth based on htpasswd file plugin (built-in) for verdaccio
### Middleware Plugins
* [verdaccio-audit](https://github.com/verdaccio/verdaccio-audit): verdaccio plugin for *npm audit* cli support (built-in) (compatible since 3.x)
* [verdaccio-profile-api](https://github.com/ahoracek/verdaccio-profile-api): verdacci plugin for *npm profile* cli support and *npm profile set password* for *verdaccio-htpasswd* based authentificaton
### Storage Plugins
(compatible since 3.x)
* [verdaccio-memory](https://github.com/verdaccio/verdaccio-memory) Storage plugin to host packages in Memory
* [verdaccio-s3-storage](https://github.com/remitly/verdaccio-s3-storage) Storage plugin to host packages **Amazon S3**
* [verdaccio-google-cloud](https://github.com/verdaccio/verdaccio-google-cloud) Storage plugin to host packages **Google Cloud Storage**
## Caveats
> Not all these plugins are been tested continuously, some of them might not work at all. Please if you found any issue feel free to notify the owner of each plugin.