diff --git a/website/i18n/es-ES.json b/website/i18n/es-ES.json index 4d4c6955d..66480c1c4 100644 --- a/website/i18n/es-ES.json +++ b/website/i18n/es-ES.json @@ -3,8 +3,8 @@ "localized-strings": { "next": "Siguiente", "previous": "Anterior", - "tagline": "Un repositorio y proxy de npm privado", - "ansible": "Instalar con Ansible", + "tagline": "Verdaccio · A lightweight private npm proxy registry", + "ansible": "Ansible", "authentification": "Autentificación", "build": "Construir el código fuente", "chef": "Libro de cocina de chef", @@ -31,7 +31,7 @@ "unit-testing": "Tests Unitario", "uplinks": "Uplinks", "use-cases": "Casos de Uso", - "webui": "Interfaz de Usuario Web", + "webui": "Web User Interface2", "what-is-verdaccio": "Qué es Verdaccio?", "windows": "Instalando como Servicio en Windows", "Docs": "Documentación", @@ -57,9 +57,8 @@ "This project is maintained by a dedicated group of people.|statement made to reader": "Este proyecto es mantenido por un grupo de personas dedicadas.", "Learn more about Verdaccio using the [documentation on this site.](/docs/en/installation.html)|no description given": "Aprenda mucho mas sobre Verdaccio usando la [documentación en este sitio.](/docs/en/installation.html)", "You can follow and contact us on|no description given": "Puedes seguirnos o contactarnos en", - "If the documentation is not enough help, you can try browsing into our|no description given": "Si la documentación no ofrece demasiada ayuda, puedes tratar de navegar en nuestra", "and also you can chat with the Verdaccio community at|no description given": "y también puedes hablar con nuestra comunidad en", - "More Help?|no description given": "Mas Ayuda?", + "If the documentation is not enough help, you can try browsing into our|no description given": "Si la documentación no ofrece demasiada ayuda, puedes tratar de navegar en nuestra", "This project is maintained by the Verdaccio community.|no description given": "Este proyecto es mantenido por la comunidad de Verdaccio.", "Get Started|no description given": "Empezar", "Contribute|no description given": "Contribuye", @@ -81,12 +80,6 @@ "Add your company|no description given": "Agrega tu compañia", "Help Translate|recruit community translators for your project": "Ayuda con traducciones", "Edit this Doc|recruitment message asking to edit the doc source": "Editar", - "Translate this Doc|recruitment message asking to translate the docs": "Traducir", - "Many great developers are already enjoying Verdaccio, join the club!|no description given": "Muchos grandes desarrolladores ya están disfrutando de Verdaccio, ¡Únete al club!", - "Easy to Install|no description given": "Fácil de Instalar", - "Easy to Set Up|no description given": "Fácil de Configurar", - "Easy to Use|no description given": "Fácil de Usar", - "What developers are saying|no description given": "Lo que dicen los desarrolladores", - "Many great developers are already enjoying Verdaccio, join the community!": "Many great developers are already enjoying Verdaccio, ¡Únete a la comunidad!" + "Translate this Doc|recruitment message asking to translate the docs": "Traducir" } } \ No newline at end of file diff --git a/website/i18n/pt-BR.json b/website/i18n/pt-BR.json index 364bd469d..b987ff0ff 100644 --- a/website/i18n/pt-BR.json +++ b/website/i18n/pt-BR.json @@ -3,8 +3,8 @@ "localized-strings": { "next": "Próximo", "previous": "Anterior", - "tagline": "Um simples e eficiente registro privado para npm", - "ansible": "Instalação com Ansible", + "tagline": "Verdaccio · A lightweight private npm proxy registry", + "ansible": "Ansible", "authentification": "Autenticação", "build": "Usando a partir do codigo fonte", "chef": "Chef Cookbook", @@ -31,7 +31,7 @@ "unit-testing": "Unit Testing", "uplinks": "Uplinks", "use-cases": "Casos de uso", - "webui": "Interface Web", + "webui": "Web User Interface2", "what-is-verdaccio": "O que é o Verdaccio?", "windows": "Instalando como um Serviço no Windows", "Docs": "Docs", @@ -57,9 +57,8 @@ "This project is maintained by a dedicated group of people.|statement made to reader": "Este projeto é mantido por um grupo dedicado de pessoas.", "Learn more about Verdaccio using the [documentation on this site.](/docs/en/installation.html)|no description given": "Saiba mais sobre o projeto acessando a [documentação](/docs/en/installation.html)", "You can follow and contact us on|no description given": "You can follow and contact us on", - "If the documentation is not enough help, you can try browsing into our|no description given": "If the documentation is not enough help, you can try browsing into our", "and also you can chat with the Verdaccio community at|no description given": "and also you can chat with the Verdaccio community at", - "More Help?|no description given": "Precisa de Ajuda?", + "If the documentation is not enough help, you can try browsing into our|no description given": "If the documentation is not enough help, you can try browsing into our", "This project is maintained by the Verdaccio community.|no description given": "Este projeto é mantido pela Comunidade Verdaccio.", "Get Started|no description given": "Get Started", "Contribute|no description given": "Contribuir", @@ -81,12 +80,6 @@ "Add your company|no description given": "Add your company", "Help Translate|recruit community translators for your project": "Ajude-nos a Traduzir", "Edit this Doc|recruitment message asking to edit the doc source": "Editar", - "Translate this Doc|recruitment message asking to translate the docs": "Traduzir", - "Many great developers are already enjoying Verdaccio, join the club!|no description given": "Many great developers are already enjoying Verdaccio, join the club!", - "Easy to Install|no description given": "Fácil de Instalar", - "Easy to Set Up|no description given": "Fácil de Configurar", - "Easy to Use|no description given": "Fácil de Usar", - "What developers are saying|no description given": "What developers are saying", - "Many great developers are already enjoying Verdaccio, join the community!": "Many great developers are already enjoying Verdaccio, join the community!" + "Translate this Doc|recruitment message asking to translate the docs": "Traduzir" } } \ No newline at end of file diff --git a/website/i18n/zh-CN.json b/website/i18n/zh-CN.json index 1b5a9c365..92c74f22e 100644 --- a/website/i18n/zh-CN.json +++ b/website/i18n/zh-CN.json @@ -3,8 +3,8 @@ "localized-strings": { "next": "下一个", "previous": "上一个", - "tagline": "一个轻量级的私有 npm 代理仓库", - "ansible": "使用 Ansible 安装", + "tagline": "Verdaccio · A lightweight private npm proxy registry", + "ansible": "Ansible", "authentification": "认证", "build": "编译源代码", "chef": "Chef Cookbook", @@ -31,7 +31,7 @@ "unit-testing": "单元测试", "uplinks": "Uplinks", "use-cases": "使用场景", - "webui": "Web 界面", + "webui": "Web User Interface2", "what-is-verdaccio": "什么是 Verdaccio?", "windows": "作为 Windows 服务安装", "Docs": "文档", @@ -57,9 +57,8 @@ "This project is maintained by a dedicated group of people.|statement made to reader": "This project is maintained by a dedicated group of people.", "Learn more about Verdaccio using the [documentation on this site.](/docs/en/installation.html)|no description given": "通过 [站内文档](/docs/en/installation.html) 了解更多信息", "You can follow and contact us on|no description given": "您可在这里以关注并联系我们", - "If the documentation is not enough help, you can try browsing into our|no description given": "If the documentation is not enough help, you can try browsing into our", "and also you can chat with the Verdaccio community at|no description given": "你也可以在这里与 Verdaccio 社区交流", - "More Help?|no description given": "需要更多帮助?", + "If the documentation is not enough help, you can try browsing into our|no description given": "If the documentation is not enough help, you can try browsing into our", "This project is maintained by the Verdaccio community.|no description given": "这个项目由 Verdaccio 社区维护。", "Get Started|no description given": "Get Started", "Contribute|no description given": "贡献", @@ -81,12 +80,6 @@ "Add your company|no description given": "添加你的公司", "Help Translate|recruit community translators for your project": "帮助翻译", "Edit this Doc|recruitment message asking to edit the doc source": "编辑", - "Translate this Doc|recruitment message asking to translate the docs": "翻译", - "Many great developers are already enjoying Verdaccio, join the club!|no description given": "Many great developers are already enjoying Verdaccio, join the club!", - "Easy to Install|no description given": "易于安装", - "Easy to Set Up|no description given": "易于设置", - "Easy to Use|no description given": "易于使用", - "What developers are saying|no description given": "What developers are saying", - "Many great developers are already enjoying Verdaccio, join the community!": "Many great developers are already enjoying Verdaccio, join the community!" + "Translate this Doc|recruitment message asking to translate the docs": "翻译" } } \ No newline at end of file diff --git a/website/translated_docs/es-ES/dev-plugins.md b/website/translated_docs/es-ES/dev-plugins.md index 39e6f0f8b..ef25853dc 100644 --- a/website/translated_docs/es-ES/dev-plugins.md +++ b/website/translated_docs/es-ES/dev-plugins.md @@ -2,32 +2,49 @@ id: dev-plugins title: "Extensiones en Desarrollo" --- -Hay muchas maneras de extender `verdaccio`, actualmente apoyamos `authentication plugins`, `middleware plugins` (desde `v2.7.0`) y `storage plugins` desde (`v3.x`). +There are many ways to extend `verdaccio`, the kind of plugins supported are: + +* Authentication plugins +* Middleware plugins (since `v2.7.0`) +* Storage plugins since (`v3.x`) + +> We recommend developing plugins using our [flow type definitions](https://github.com/verdaccio/flow-types). ## Extensión de Autenticación -Esta sección describe cómo se ve una extensión de Verdaccio de manera ES5. Básicamente tenemos que devolver un objeto con un único método llamado `authenticate` que recibirá 3 argumentos (`user, password, callback`). Una vez que la autenticación haya sido ejecutada habrán 2 opciones con las que se podrá dar una respuesta a `verdaccio`. +Basically we have to return an object with a single method called `authenticate` that will recieve 3 arguments (`user, password, callback`). ### API -```js -function authenticate (user, password, callback) { - ...more stuff +```flow +interface IPluginAuth extends IPlugin { + login_url?: string; + authenticate(user: string, password: string, cb: Callback): void; + adduser(user: string, password: string, cb: Callback): void; + allow_access(user: RemoteUser, pkg: $Subtype, cb: Callback): void; + allow_publish(user: RemoteUser, pkg: $Subtype, cb: Callback): void; } ``` -##### OnError +> Only `adduser`, `allow_access` and `allow_publish` are optional, verdaccio provide a fallback in all those cases. -Algo malo sucedió o la autenticación no tuvo éxito. +#### Callback - callback(null, false) - +Once the authentication has been executed there is 2 options to give a response to `verdaccio`. -##### OnSuccess +###### OnError -La autenticación tuvo éxito. +Either something bad happened or auth was unsuccessful. -`groups` es una matriz de cadenas de caracteres donde el usuario participa. +```flow +callback(null, false) +``` + +###### OnSuccess + +The auth was successful. + +`groups` is an array of strings where the user is part of. callback(null, groups); @@ -65,7 +82,7 @@ Auth.prototype.authenticate = function (user, password, callback) { module.exports = Auth; ``` -Y la configuración +And the configuration will looks like: ```yaml auth: @@ -73,13 +90,23 @@ auth: file: ./htpasswd ``` -Donde `htpasswd` es el sufijo del nombre de la extensión. Por ejemplo: `verdaccio-htpasswd` y el resto del cuerpo serían los parámetros de configuración de la extensión. +Where `htpasswd` is the sufix of the plugin name. eg: `verdaccio-htpasswd` and the rest of the body would be the plugin configuration params. ## Extensión de Middleware -Las extensiones de Middleware tienen la capacidad de modificar la capa de API, ya sea añadiendo extremos o peticiones de interceptación. +Middleware plugins have the capability to modify the API layer, either adding new endpoints or intercepting requests. -> Un muy buen ejemplo de la extensión de middleware es [sinopia-github-oauth](https://github.com/soundtrackyourbrand/sinopia-github-oauth) y [verdaccio-audit](https://github.com/verdaccio/verdaccio-audit). +```flow +interface verdaccio$IPluginMiddleware extends verdaccio$IPlugin { + register_middlewares(app: any, auth: IBasicAuth, storage: IStorageManager): void; +} +``` + +### register_middlewares + +The method provide full access to the authentification and storage via `auth` and `storage`. `app` is the express application that allows you to add new endpoints. + +> A pretty good example of middleware plugin is the [sinopia-github-oauth](https://github.com/soundtrackyourbrand/sinopia-github-oauth) and [verdaccio-audit](https://github.com/verdaccio/verdaccio-audit). ### API @@ -89,31 +116,36 @@ function register_middlewares(expressApp, authInstance, storageInstance) { } ``` -Para registrar un middleware necesitamos un objeto con un único método llamado `register_middlewares` que recibirá 3 argumentos (`expressApp, auth, storage`). *Auth* es la instancia de autentificación y *storage* es de igual manera la instancia de Almacenamiento principal que te dará el acceso a todas las acciones de almacenamiento. +To register a middleware we need an object with a single method called `register_middlewares` that will recieve 3 arguments (`expressApp, auth, storage`). *Auth* is the authentification instance and *storage* is also the main Storage instance that will give you have access to all to the storage actions. ## Extensión de Almacenamiento -Verdaccio por defecto utiliza una extensión de almacenamientos de sistema de archivos [local-storage](https://github.com/verdaccio/local-storage) pero, desde `verdaccio@3.x` puedes añadir un almacenamiento personalizado. +Verdaccio by default uses a file system storage plugin [local-storage](https://github.com/verdaccio/local-storage), but, since `verdaccio@3.x` you can plug in a custom storage replacing the default behaviour. ### API -El API de almacenamiento es un poco más complejo, necesitarás crear una clase que devuelva una implementación de `ILocalData`. Por favor, mira los detalles que aparecen a continuación. +The storage API is a bit more complex, you will need to create a class that return a `IPluginStorage` implementation. Please see details bellow. -```js -
class LocalDatabase{ - constructor(config: Config, logger: Logger): ILocalData; +```flow +class LocalDatabase{ + constructor(config: $Subtype, logger: verdaccio$Logger): ILocalData; } -declare interface verdaccio$ILocalData { +interface IPluginStorage { + logger: verdaccio$Logger; + config: $Subtype; add(name: string, callback: verdaccio$Callback): void; remove(name: string, callback: verdaccio$Callback): void; get(callback: verdaccio$Callback): void; getSecret(): Promise; setSecret(secret: string): Promise; getPackageStorage(packageInfo: string): verdaccio$IPackageStorage; + search(onPackage: verdaccio$Callback, onEnd: verdaccio$Callback, validateName: Function): void; } -declare interface verdaccio$ILocalPackageManager { +interface IPackageStorageManager { + path: string; + logger: verdaccio$Logger; writeTarball(name: string): verdaccio$IUploadTarball; readTarball(name: string): verdaccio$IReadTarball; readPackage(fileName: string, callback: verdaccio$Callback): void; @@ -128,26 +160,29 @@ declare interface verdaccio$ILocalPackageManager { savePackage(fileName: string, json: verdaccio$Package, callback: verdaccio$Callback): void; } -interface IUploadTarball extends stream$PassThrough { +class verdaccio$IUploadTarball extends stream$PassThrough { + abort: Function; + done: Function; + _transform: Function; abort(): void; done(): void; } -interface IReadTarball extends stream$PassThrough { +class verdaccio$IReadTarball extends stream$PassThrough { + abort: Function; abort(): void; - done(): void; } ``` -> El API de Almacenamiento todavía es experimental y podría cambiar en las próximas versiones menores. Para más información acerca del API de Almacenamiento por favor sigue los [tipos y definiciones en nuestro repositorio oficial](https://github.com/verdaccio/flow-types). +> The Storage API is still experimental and might change in the next minor versions. For further information about Storage API please follow the [types definitions in our official repository](https://github.com/verdaccio/flow-types). -### Ejemplos de Extensiones de Almacenamiento +### Storage Plugins Examples -La siguiente lista de extensiones implementan el API de Almacenamiento y pueden ser utilizados como ejemplo. +The following list of plugins are implementing the Storage API and might be used them as example. * [verdaccio-memory](https://github.com/verdaccio/verdaccio-memory) * [local-storage](https://github.com/verdaccio/local-storage) * [verdaccio-google-cloud](https://github.com/verdaccio/verdaccio-google-cloud) * [verdaccio-s3-storage](https://github.com/Remitly/verdaccio-s3-storage/tree/s3) -> ¿Estás dispuesto a contribuir con nuevas extensiones de almacenamiento? [Haz click aquí.](https://github.com/verdaccio/verdaccio/issues/103#issuecomment-357478295) \ No newline at end of file +> Are you willing to contribute with new Storage Plugins? [Click here.](https://github.com/verdaccio/verdaccio/issues/103#issuecomment-357478295) \ No newline at end of file diff --git a/website/translated_docs/es-ES/install.md b/website/translated_docs/es-ES/install.md index 2f9d482e4..f470ecda0 100644 --- a/website/translated_docs/es-ES/install.md +++ b/website/translated_docs/es-ES/install.md @@ -40,10 +40,8 @@ warn --- config file - /home/.config/verdaccio/config.yaml warn --- http address - http://localhost:4873/ - verdaccio/3.0.1 ``` -![](https://cdn-images-1.medium.com/max/720/1*jDHnZ7_68u5s1lFK2cygnA.gif) - -Para mas información sobre CLI, por favor[lea la sección cli](cli.md). +For more information about the CLI, please [read the cli section](cli.md). ## Imagen de Docker -` verdaccio`ofrece una imagen oficial de docker que puedes usar, y en el mayor de los casos, la configuración por defecto es suficiente. Para mas información sobre como instalar la imagen oficial, [lea la sección de docker](docker.md). \ No newline at end of file +`verdaccio` has an official docker image you can use, and in most cases, the default configuration is good enough. For more information about how to install the official image, [read the docker section](docker.md). \ No newline at end of file diff --git a/website/translated_docs/es-ES/plugins.md b/website/translated_docs/es-ES/plugins.md index e0a9971e4..24b6403ea 100644 --- a/website/translated_docs/es-ES/plugins.md +++ b/website/translated_docs/es-ES/plugins.md @@ -2,7 +2,7 @@ id: plugins title: "Plugins" --- -Verdaccio es una aplicación extensible. Puede ser extendida en muchas maneras, tanto con nuevos métodos de autenticación, añadiendo endpoints o usando un almacenamiento personalizado. +Verdaccio is an plugabble aplication. It can be extended in many ways, either new authentication methods, adding endpoints or using a custom storage. > If you are interested to develop your own plugin, read the [development](dev-plugins.md) section. @@ -68,6 +68,8 @@ middlewares: enabled: true ``` +> You might follow the [audit middle plugin](https://github.com/verdaccio/verdaccio-audit) as base example. + ### Configuración del Plugin Store (Almacén) Este es un ejemplo de como instalar un plugin de almacenamiento. Todos los plugins de almacenamiento debe estar definidos en el namespace **store**. @@ -78,7 +80,7 @@ store: limit: 1000 ``` -> Si define un almacenamiento personalizado, la propiedad **storage** en el archivo de configuración será ignorada. +> If you define a custom store, the property **storage** in the configuration file will be ignored. ## Plugins heredados @@ -104,7 +106,7 @@ store: * [sinopia-ldap](https://www.npmjs.com/package/sinopia-ldap): plugin LDAP auth para sinopia. * [sinopia-github-oauth-env](https://www.npmjs.com/package/sinopia-github-oauth-env) plugin de autenticación de Sinopia con flujo web github oauth. -> Todos los plugins de sinopia deben ser compatibles con todas las futuras versiones de verdaccio. De cualquier forma, alentamos a los contribuyentes a migrarlos a la API moderna de verdaccio y usar el prefijo como *verdaccio-xx-name*. +> 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*. ## Plugins de Verdaccio @@ -135,4 +137,4 @@ store: ## Advertencias -> No todos estos plugins han sido probados continuamente, algunos pueden no funcionar del todo. Por favor, si encontró algún problema siéntase con la libertad de notificar al dueño de cada plugin. \ No newline at end of file +> 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. \ No newline at end of file diff --git a/website/translated_docs/es-ES/web.md b/website/translated_docs/es-ES/web.md index c17148b4e..f3478e224 100644 --- a/website/translated_docs/es-ES/web.md +++ b/website/translated_docs/es-ES/web.md @@ -1,10 +1,10 @@ --- id: webui -title: "Interfaz Web de Usuario" +title: "Web User Interface2" --- -

+

Verdaccio tiene una interfaz web de usuario que solo muetra paquetes privados y puede ser personalizable. diff --git a/website/translated_docs/pt-BR/dev-plugins.md b/website/translated_docs/pt-BR/dev-plugins.md index df7e87632..384ba171a 100644 --- a/website/translated_docs/pt-BR/dev-plugins.md +++ b/website/translated_docs/pt-BR/dev-plugins.md @@ -2,28 +2,45 @@ id: dev-plugins title: "Developing Plugins" --- -There are many ways to extend `verdaccio`, currently we support `authentication plugins`, `middleware plugins` (since `v2.7.0`) and `storage plugins` since (`v3.x`). +There are many ways to extend `verdaccio`, the kind of plugins supported are: + +* Authentication plugins +* Middleware plugins (since `v2.7.0`) +* Storage plugins since (`v3.x`) + +> We recommend developing plugins using our [flow type definitions](https://github.com/verdaccio/flow-types). ## Authentication Plugin -This section will describe how it looks like a Verdaccio plugin in a ES5 way. Basically we have to return an object with a single method called `authenticate` that will recieve 3 arguments (`user, password, callback`). Once the authentication has been executed there is 2 options to give a response to `verdaccio`. +Basically we have to return an object with a single method called `authenticate` that will recieve 3 arguments (`user, password, callback`). ### API -```js -function authenticate (user, password, callback) { - ...more stuff +```flow +interface IPluginAuth extends IPlugin { + login_url?: string; + authenticate(user: string, password: string, cb: Callback): void; + adduser(user: string, password: string, cb: Callback): void; + allow_access(user: RemoteUser, pkg: $Subtype, cb: Callback): void; + allow_publish(user: RemoteUser, pkg: $Subtype, cb: Callback): void; } ``` -##### OnError +> Only `adduser`, `allow_access` and `allow_publish` are optional, verdaccio provide a fallback in all those cases. + +#### Callback + +Once the authentication has been executed there is 2 options to give a response to `verdaccio`. + +###### OnError Either something bad happened or auth was unsuccessful. - callback(null, false) - +```flow +callback(null, false) +``` -##### OnSuccess +###### OnSuccess The auth was successful. @@ -65,7 +82,7 @@ Auth.prototype.authenticate = function (user, password, callback) { module.exports = Auth; ``` -And the setup +And the configuration will looks like: ```yaml auth: @@ -79,6 +96,16 @@ Where `htpasswd` is the sufix of the plugin name. eg: `verdaccio-htpasswd` and t Middleware plugins have the capability to modify the API layer, either adding new endpoints or intercepting requests. +```flow +interface verdaccio$IPluginMiddleware extends verdaccio$IPlugin { + register_middlewares(app: any, auth: IBasicAuth, storage: IStorageManager): void; +} +``` + +### register_middlewares + +The method provide full access to the authentification and storage via `auth` and `storage`. `app` is the express application that allows you to add new endpoints. + > A pretty good example of middleware plugin is the [sinopia-github-oauth](https://github.com/soundtrackyourbrand/sinopia-github-oauth) and [verdaccio-audit](https://github.com/verdaccio/verdaccio-audit). ### API @@ -93,27 +120,32 @@ To register a middleware we need an object with a single method called `register ## Storage Plugin -Verdaccio by default uses a file system storage plugin [local-storage](https://github.com/verdaccio/local-storage) but, since `verdaccio@3.x` you can plug in a custom storage. +Verdaccio by default uses a file system storage plugin [local-storage](https://github.com/verdaccio/local-storage), but, since `verdaccio@3.x` you can plug in a custom storage replacing the default behaviour. ### API -The storage API is a bit more complex, you will need to create a class that return a `ILocalData` implementation. Please see details bellow. +The storage API is a bit more complex, you will need to create a class that return a `IPluginStorage` implementation. Please see details bellow. -```js -
class LocalDatabase{ - constructor(config: Config, logger: Logger): ILocalData; +```flow +class LocalDatabase{ + constructor(config: $Subtype, logger: verdaccio$Logger): ILocalData; } -declare interface verdaccio$ILocalData { +interface IPluginStorage { + logger: verdaccio$Logger; + config: $Subtype; add(name: string, callback: verdaccio$Callback): void; remove(name: string, callback: verdaccio$Callback): void; get(callback: verdaccio$Callback): void; getSecret(): Promise; setSecret(secret: string): Promise; getPackageStorage(packageInfo: string): verdaccio$IPackageStorage; + search(onPackage: verdaccio$Callback, onEnd: verdaccio$Callback, validateName: Function): void; } -declare interface verdaccio$ILocalPackageManager { +interface IPackageStorageManager { + path: string; + logger: verdaccio$Logger; writeTarball(name: string): verdaccio$IUploadTarball; readTarball(name: string): verdaccio$IReadTarball; readPackage(fileName: string, callback: verdaccio$Callback): void; @@ -128,14 +160,17 @@ declare interface verdaccio$ILocalPackageManager { savePackage(fileName: string, json: verdaccio$Package, callback: verdaccio$Callback): void; } -interface IUploadTarball extends stream$PassThrough { +class verdaccio$IUploadTarball extends stream$PassThrough { + abort: Function; + done: Function; + _transform: Function; abort(): void; done(): void; } -interface IReadTarball extends stream$PassThrough { +class verdaccio$IReadTarball extends stream$PassThrough { + abort: Function; abort(): void; - done(): void; } ``` diff --git a/website/translated_docs/pt-BR/install.md b/website/translated_docs/pt-BR/install.md index cd9f64625..9d8d5d5f0 100644 --- a/website/translated_docs/pt-BR/install.md +++ b/website/translated_docs/pt-BR/install.md @@ -40,8 +40,6 @@ warn --- config file - /home/.config/verdaccio/config.yaml warn --- http address - http://localhost:4873/ - verdaccio/3.0.1 ``` -![](https://cdn-images-1.medium.com/max/720/1*jDHnZ7_68u5s1lFK2cygnA.gif) - For more information about the CLI, please [read the cli section](cli.md). ## Imagem do Docker diff --git a/website/translated_docs/pt-BR/plugins.md b/website/translated_docs/pt-BR/plugins.md index 16acc1b74..9034fe5b7 100644 --- a/website/translated_docs/pt-BR/plugins.md +++ b/website/translated_docs/pt-BR/plugins.md @@ -68,6 +68,8 @@ middlewares: enabled: true ``` +> You might follow the [audit middle plugin](https://github.com/verdaccio/verdaccio-audit) as base example. + ### Store Plugin Configuration This is an example how to set up a storage plugin. All storage plugins must be defined in the **store** namespace. diff --git a/website/translated_docs/pt-BR/web.md b/website/translated_docs/pt-BR/web.md index 95e140f22..445cb67b9 100644 --- a/website/translated_docs/pt-BR/web.md +++ b/website/translated_docs/pt-BR/web.md @@ -1,10 +1,10 @@ --- id: webui -title: "Interface Web" +title: "Web User Interface2" --- -

+

Verdaccio possui uma interface web para exibir os seus pacotes e pode ser customizável. diff --git a/website/translated_docs/zh-Hans/dev-plugins.md b/website/translated_docs/zh-Hans/dev-plugins.md index e820ffea6..d2d8e9257 100644 --- a/website/translated_docs/zh-Hans/dev-plugins.md +++ b/website/translated_docs/zh-Hans/dev-plugins.md @@ -2,32 +2,49 @@ id: dev-plugins title: "插件开发" --- -有很多方法来扩展 `verdaccio`, 目前我们支持 `authentication plugins`, `middleware plugins` (自 `v2.7.0` 版本) 和 `storage plugins` 自 (`v3.x`)版本。 +There are many ways to extend `verdaccio`, the kind of plugins supported are: + +* Authentication plugins +* Middleware plugins (since `v2.7.0`) +* Storage plugins since (`v3.x`) + +> We recommend developing plugins using our [flow type definitions](https://github.com/verdaccio/flow-types). ## Authentication Plugin(认证插件) -本节将描述 Verdaccio 插件在ES5 里是如何运作的。 基本上我们要用一个叫做`authenticate` 的单纯方法来返回一个 object(对象),此方法将接收到3 个参数 (`user, password, callback`)。 一旦执行认证后,有两个选项来回应 `verdaccio`。 +Basically we have to return an object with a single method called `authenticate` that will recieve 3 arguments (`user, password, callback`). ### API -```js -function authenticate (user, password, callback) { - ...more stuff +```flow +interface IPluginAuth extends IPlugin { + login_url?: string; + authenticate(user: string, password: string, cb: Callback): void; + adduser(user: string, password: string, cb: Callback): void; + allow_access(user: RemoteUser, pkg: $Subtype, cb: Callback): void; + allow_publish(user: RemoteUser, pkg: $Subtype, cb: Callback): void; } ``` -##### OnError +> Only `adduser`, `allow_access` and `allow_publish` are optional, verdaccio provide a fallback in all those cases. -要么是发生了糟糕的事,要么是授权不成功。 +#### Callback - callback(null, false) - +Once the authentication has been executed there is 2 options to give a response to `verdaccio`. -##### OnSuccess +###### OnError -授权成功。 +Either something bad happened or auth was unsuccessful. -`groups`是用户组成的一组字符串。 +```flow +callback(null, false) +``` + +###### OnSuccess + +The auth was successful. + +`groups` is an array of strings where the user is part of. callback(null, groups); @@ -65,7 +82,7 @@ Auth.prototype.authenticate = function (user, password, callback) { module.exports = Auth; ``` -设置 +And the configuration will looks like: ```yaml auth: @@ -73,13 +90,23 @@ auth: file: ./htpasswd ``` -其中`htpasswd` 是插件名称的后缀。例如:`verdaccio-htpasswd`,剩下的组成部分是插件配置的参数。 +Where `htpasswd` is the sufix of the plugin name. eg: `verdaccio-htpasswd` and the rest of the body would be the plugin configuration params. ## Middleware Plugin(Middleware 插件) -Middleware 插件有能力修改API 接口,它可以添加新的端点,也可以截取请求。 +Middleware plugins have the capability to modify the API layer, either adding new endpoints or intercepting requests. -> Middleware 插件的一个很好的例子是 [sinopia-github-oauth](https://github.com/soundtrackyourbrand/sinopia-github-oauth) 和 [verdaccio-audit](https://github.com/verdaccio/verdaccio-audit)。 +```flow +interface verdaccio$IPluginMiddleware extends verdaccio$IPlugin { + register_middlewares(app: any, auth: IBasicAuth, storage: IStorageManager): void; +} +``` + +### register_middlewares + +The method provide full access to the authentification and storage via `auth` and `storage`. `app` is the express application that allows you to add new endpoints. + +> A pretty good example of middleware plugin is the [sinopia-github-oauth](https://github.com/soundtrackyourbrand/sinopia-github-oauth) and [verdaccio-audit](https://github.com/verdaccio/verdaccio-audit). ### API @@ -89,31 +116,36 @@ function register_middlewares(expressApp, authInstance, storageInstance) { } ``` -要注册middleware,我们需要一个object(对象) 以及一个叫做`register_middlewares` 的单纯方法,它将接收到3 个参数 (`expressApp, auth, storage`)。 *Auth* 是authentification(认证) 实例参数,*storage* 也是主存储实例,它将让您可以访问所有的存储操作。 +To register a middleware we need an object with a single method called `register_middlewares` that will recieve 3 arguments (`expressApp, auth, storage`). *Auth* is the authentification instance and *storage* is also the main Storage instance that will give you have access to all to the storage actions. ## Storage Plugin(存储插件) -Verdaccio 默认使用文件系统存储插件 [local-storage](https://github.com/verdaccio/local-storage) ,但是从`verdaccio@3.x` 版本开始,您可以插入自定义存储。 +Verdaccio by default uses a file system storage plugin [local-storage](https://github.com/verdaccio/local-storage), but, since `verdaccio@3.x` you can plug in a custom storage replacing the default behaviour. ### API -API 存储更复杂一些,您得创建一个返回实现`ILocalData`的类(class)。请参阅以下详细信息。 +The storage API is a bit more complex, you will need to create a class that return a `IPluginStorage` implementation. Please see details bellow. -```js -
class LocalDatabase{ - constructor(config: Config, logger: Logger): ILocalData; +```flow +class LocalDatabase{ + constructor(config: $Subtype, logger: verdaccio$Logger): ILocalData; } -declare interface verdaccio$ILocalData { +interface IPluginStorage { + logger: verdaccio$Logger; + config: $Subtype; add(name: string, callback: verdaccio$Callback): void; remove(name: string, callback: verdaccio$Callback): void; get(callback: verdaccio$Callback): void; getSecret(): Promise; setSecret(secret: string): Promise; getPackageStorage(packageInfo: string): verdaccio$IPackageStorage; + search(onPackage: verdaccio$Callback, onEnd: verdaccio$Callback, validateName: Function): void; } -declare interface verdaccio$ILocalPackageManager { +interface IPackageStorageManager { + path: string; + logger: verdaccio$Logger; writeTarball(name: string): verdaccio$IUploadTarball; readTarball(name: string): verdaccio$IReadTarball; readPackage(fileName: string, callback: verdaccio$Callback): void; @@ -128,26 +160,29 @@ declare interface verdaccio$ILocalPackageManager { savePackage(fileName: string, json: verdaccio$Package, callback: verdaccio$Callback): void; } -interface IUploadTarball extends stream$PassThrough { +class verdaccio$IUploadTarball extends stream$PassThrough { + abort: Function; + done: Function; + _transform: Function; abort(): void; done(): void; } -interface IReadTarball extends stream$PassThrough { +class verdaccio$IReadTarball extends stream$PassThrough { + abort: Function; abort(): void; - done(): void; } ``` -> API存储仍然还在实验阶段并在接下来的次版本中可能会有修改。 有关存储API的更多信息,请遵循[ 我们官网资源库里的类型定义](https://github.com/verdaccio/flow-types)。 +> The Storage API is still experimental and might change in the next minor versions. For further information about Storage API please follow the [types definitions in our official repository](https://github.com/verdaccio/flow-types). -### 存储插件示例 +### Storage Plugins Examples -以下插件列表执行存储API,可以作为示例。 +The following list of plugins are implementing the Storage API and might be used them as example. * [verdaccio-memory](https://github.com/verdaccio/verdaccio-memory) * [local-storage](https://github.com/verdaccio/local-storage) * [verdaccio-google-cloud](https://github.com/verdaccio/verdaccio-google-cloud) * [verdaccio-s3-storage](https://github.com/Remitly/verdaccio-s3-storage/tree/s3) -> 您是否愿意为新的存储插件做贡献?请[点击此处。](https://github.com/verdaccio/verdaccio/issues/103#issuecomment-357478295) \ No newline at end of file +> Are you willing to contribute with new Storage Plugins? [Click here.](https://github.com/verdaccio/verdaccio/issues/103#issuecomment-357478295) \ No newline at end of file diff --git a/website/translated_docs/zh-Hans/install.md b/website/translated_docs/zh-Hans/install.md index 84c4d7bd5..b3227521d 100644 --- a/website/translated_docs/zh-Hans/install.md +++ b/website/translated_docs/zh-Hans/install.md @@ -40,10 +40,8 @@ warn --- config file - /home/.config/verdaccio/config.yaml warn --- http address - http://localhost:4873/ - verdaccio/3.0.1 ``` -![](https://cdn-images-1.medium.com/max/720/1*jDHnZ7_68u5s1lFK2cygnA.gif) - -更多关于CLI的信息, 请[阅读cli章节](cli.md)。 +For more information about the CLI, please [read the cli section](cli.md). ## Docker 镜像 -`verdaccio`有官方docker镜像可以使用,在大多数情况下,默认的配置已经够好。 更多关于如何安装官方镜像的信息,请[阅读docker章节](docker.md)。 \ No newline at end of file +`verdaccio` has an official docker image you can use, and in most cases, the default configuration is good enough. For more information about how to install the official image, [read the docker section](docker.md). \ No newline at end of file diff --git a/website/translated_docs/zh-Hans/plugins.md b/website/translated_docs/zh-Hans/plugins.md index 2143aecee..a89932c2d 100644 --- a/website/translated_docs/zh-Hans/plugins.md +++ b/website/translated_docs/zh-Hans/plugins.md @@ -2,7 +2,7 @@ id: plugins title: "插件" --- -Verdaccio是一个可插拔的应用程序。它可以通过多种方式进行扩展,例如新的认证方法,添加endpoints,或者使用自定义存储。 +Verdaccio is an plugabble aplication. It can be extended in many ways, either new authentication methods, adding endpoints or using a custom storage. > If you are interested to develop your own plugin, read the [development](dev-plugins.md) section. @@ -68,6 +68,8 @@ middlewares: enabled: true ``` +> You might follow the [audit middle plugin](https://github.com/verdaccio/verdaccio-audit) as base example. + ### 存储插件配置 这是一个如何设置存储插件的示例。所有的存储插件必须在**store**命名空间进行定义。 @@ -78,7 +80,7 @@ store: limit: 1000 ``` -> 如果你定义一个自定义存储,配置文件中的**storage**属性将会被忽略。 +> If you define a custom store, the property **storage** in the configuration file will be ignored. ## 旧式插件 @@ -104,7 +106,7 @@ store: * [sinopia-ldap](https://www.npmjs.com/package/sinopia-ldap):sinopia LDAP认证插件。 * [sinopia-github-oauth-env](https://www.npmjs.com/package/sinopia-github-oauth-env):基于github oauth web flow的Sinopia认证插件。 -> 所有的sinopia插件都应该和verdaccio的未来版本兼容。 无论如何,我们鼓励贡献者将它们迁移到最新的verdaccio API并且使用*verdaccio-xx-name*格式的前缀。 +> 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插件 @@ -135,4 +137,4 @@ store: ## 警告 -> 并不是所有这些插件都被持续测试过,其中有些可能不能正常工作。如果你发现任何问题,请和插件的所有者联系。 \ No newline at end of file +> 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. \ No newline at end of file diff --git a/website/translated_docs/zh-Hans/protect-your-dependencies.md b/website/translated_docs/zh-Hans/protect-your-dependencies.md index f60e93361..7eec1fd98 100644 --- a/website/translated_docs/zh-Hans/protect-your-dependencies.md +++ b/website/translated_docs/zh-Hans/protect-your-dependencies.md @@ -1,12 +1,12 @@ --- -id: protect-your-dependencies -title: "Protecting packages" +id: protect-your-dependencies(保护-依赖项) +title: "保护包" --- -`verdaccio` allows you protect publish, to achieve that you will need to set up correctly your [packages acces](packages). +`verdaccio` 允许发布保护,为了要使用此功能,您将需要正确设置[包访问权限](packages)。 -### Package configuration +### 包配置 -Let's see for instance the following set up. You have a set of dependencies what are prefixed with `my-company-*` and you need to protect them from anonymous or another logged user without right credentials. +例如,让我们一起来看以下设置。 您有一组前缀为`my-company-*`的依赖项,您要保护它们不让匿名或另一个没有正确证书的已登录用户使用。 ```yaml 'my-company-*': @@ -15,18 +15,18 @@ Let's see for instance the following set up. You have a set of dependencies what proxy: npmjs ``` -With this configuration, basically we allow to groups **admin** and **teamA** to * publish* and **teamA** **teamB** **teamC** *access* to such dependencies. +通过此配置,大体上上我们允许**admin** 和**teamA** 团队来 *发布*,同时**teamA** **teamB** **teamC** *可访问* 这些依赖项。 -### Use case: teamD try to access the dependency +### 用例:teamD试着访问此依赖项 -So, if I am logged as **teamD**. I shouldn't be able to access all dependencies that match with `my-company-*` pattern. +因此,如果我以**teamD**身份登录。我应该无法访问匹配`my-company-*` pattern的所有依赖项。 ```bash ➜ npm whoami teamD ``` -I won't have access to such dependencies and also won't be visible via web for user **teamD**. If I try to access the following will happen. +我无法访问此类依赖项,并且在网页上也不会被用户 **teamD**看到。如果我试着访问,结果如下。 ```bash ➜ npm install my-company-core @@ -34,12 +34,12 @@ npm ERR! code E403 npm ERR! 403 Forbidden: webpack-1@latest ``` -or with `yarn` +或者用`yarn` ```bash ➜ yarn add my-company-core yarn add v0.24.6 info No lockfile found. [1/4] -error An unexpected error occurred: "http://localhost:5555/webpack-1: unregistered users are not allowed to access package my-company-core". +错误出现意外错误: "http://localhost:5555/webpack-1: 不允许未注册用户访问my-company-core包"。 ``` \ No newline at end of file diff --git a/website/translated_docs/zh-Hans/repositories.md b/website/translated_docs/zh-Hans/repositories.md index 604a57fd6..7a9fe297e 100644 --- a/website/translated_docs/zh-Hans/repositories.md +++ b/website/translated_docs/zh-Hans/repositories.md @@ -1,7 +1,7 @@ --- -id: source-code -title: "Source Code" +id: source-code(源-代码) +title: "源代码" --- `verdaccio` is composed or multiple repositories you might contribute. Look into the **issues** tab whether there is a ticket waiting for you -To see the complete list of repositories, [click here](https://github.com/verdaccio/verdaccio/wiki/Repositories). \ No newline at end of file +要查看完整资源库列表, 请[点击这里](https://github.com/verdaccio/verdaccio/wiki/Repositories)。 \ No newline at end of file diff --git a/website/translated_docs/zh-Hans/reverse-proxy.md b/website/translated_docs/zh-Hans/reverse-proxy.md index 417fdbe70..6a09015f0 100644 --- a/website/translated_docs/zh-Hans/reverse-proxy.md +++ b/website/translated_docs/zh-Hans/reverse-proxy.md @@ -1,10 +1,10 @@ --- -id: reverse-proxy -title: "Reverse Proxy Setup" +id: reverse-proxy(逆向代理服务器) +title: "逆向代理服务器设置" --- ## Apache -Apache and mod_proxy should not decode/encode slashes and leave them as they are: +不要在Apache 和mod_proxy 解码/编码slashes(斜线),要让它们保持不变: AllowEncodedSlashes NoDecode @@ -13,7 +13,7 @@ Apache and mod_proxy should not decode/encode slashes and leave them as they are -### Configuration with SSL +### 用SSL 配置 config.yaml @@ -21,7 +21,7 @@ config.yaml url_prefix: https://npm.your.domain.com ``` -Apache virtual server configuration +Apache 虚拟服务器配置 apacheconfig @@ -51,16 +51,16 @@ Apache virtual server configuration } -## Run behind reverse proxy with different domain and port +## 在逆向代理服务器后运行用不同的域名和端口 -If you run verdaccio behind reverse proxy, you may noticed all resource file served as relaticve path, like `http://127.0.0.1:4873/-/static` +如果您在逆向代理服务器后运行verdaccio,您可能会注意到所有源文件都起到相关路径的作用,如 `http://127.0.0.1:4873/-/static` -To resolve this issue, you should send real domain and port to verdaccio with `Host` heade +要解决这个问题,您应该用 `Host`heade发送实际域名和端口到 verdaccio。 -Nginx configure should look like this: +Nginx configure应该如下所示: ```nginx -location / { +ocation / { proxy_pass http://127.0.0.1:4873/; proxy_set_header Host $host:$server_port; proxy_set_header X-Forwarded-For $remote_addr; @@ -68,11 +68,11 @@ location / { } ``` -For this case, `url_prefix` should NOT set in verdaccio config +在这个例子里,verdaccio config里不应该设置`url_prefix` * * * -or a sub-directory installation: +或者子-目录安装: ```nginx location ~ ^/verdaccio/(.*)$ { @@ -83,6 +83,6 @@ location ~ ^/verdaccio/(.*)$ { } ``` -For this case, `url_prefix` should set to `/verdaccio/` +在这个例子里, `url_prefix` 应该设置为`/verdaccio/` -> Note: There is a Slash after install path (`https://your-domain:port/vardaccio/`)! \ No newline at end of file +> 请注意: 在安装路径 (`https://your-domain:port/vardaccio/`)后有一条斜线! \ No newline at end of file diff --git a/website/translated_docs/zh-Hans/server.md b/website/translated_docs/zh-Hans/server.md index 5cc0082ad..a30d82c68 100644 --- a/website/translated_docs/zh-Hans/server.md +++ b/website/translated_docs/zh-Hans/server.md @@ -1,71 +1,71 @@ --- -id: server-configuration -title: "Server Configuration" +id: server-configuration(服务器-配置) +title: "服务器配置" --- -This is mostly basic linux server configuration stuff but I felt it important to document and share the steps I took to get verdaccio running permanently on my server. You will need root (or sudo) permissions for the following. +这主要是一些基础的linux服务器配置信息,但是我觉得很重要来记录并分享我让verdaccio 在服务器上永久运行的步骤。 您将需要以下的根(或者sudo)权限。 -## Running as a separate user +## 作为单独用户运行 -First create the verdaccio user: +首先创建verdaccio 用户: ```bash $ sudo adduser --disabled-login --gecos 'Verdaccio NPM mirror' verdaccio ``` -You create a shell as the verdaccio user using the following command: +您用以下命令来创建一个 shell作为verdaccio用户: ```bash $ sudo su verdaccio $ cd ~ ``` -The 'cd ~' command send you to the home directory of the verdaccio user. Make sure you run verdaccio at least once to generate the config file. Edit it according to your needs. +'cd ~' 命令把您送到verdaccio用户的主目录。请确保您至少运行一次verdaccio来生成config文件。根据您的需求来编辑它。 -## Listening on all addresses +## 监听所有地址 -If you want to listen to every external address set the listen directive in the config to: +如果您希望监听每个外部地址,请把config里的监听指令设置为: ```yaml # you can specify listen address (or simply a port) listen: 0.0.0.0:4873 ``` -If you are running `verdaccio` in a Amazon EC2 Instance, [you will need set the listen in change your config file](https://github.com/verdaccio/verdaccio/issues/314#issuecomment-327852203) as is described above. +如果您在Amazon EC2 Instance运行 `verdaccio`, 如上所述,[您将需要设置监听config 文件](https://github.com/verdaccio/verdaccio/issues/314#issuecomment-327852203) 。 -> Apache configure? Please check out the [Reverse Proxy Setup](reverse-proxy.md) +> Apache configure? 请查看[逆向代理服务器配置](reverse-proxy.md) -## Keeping verdaccio running forever +## 让 verdaccio一直运行下去 -We can use the node package called 'forever' to keep verdaccio running all the time. https://github.com/nodejitsu/forever +我们可以使用名为'forever(永远)’的节点包来让verdaccio一直运行下去。 https://github.com/nodejitsu/forever -First install forever globally: +首先安装全局forever: ```bash $ sudo npm install -g forever ``` -Make sure you've started verdaccio at least once to generate the config file and write down the created admin user. You can then use the following command to start verdaccio: +请确保您至少已经启动一次verdaccio来生成config 文件,并记录下创建的管理员用户。然后,您可以用以下命令来启动verdaccio: ```bash $ forever start `which verdaccio` ``` -You can check the documentation for more information on how to use forever. +您可以查看文档来了解更多关于如何使用forever的信息。 -## Surviving server restarts +## 存留服务器重启 -We can use crontab and forever together to restart verdaccio after a server reboot. When you're logged in as the verdaccio user do the following: +我们可以在服务器重启后同时用crontab和forever来重启 verdaccio。当您以 verdaccio 用户登录后请执行以下操作: ```bash $ crontab -e ``` -This might ask you to choose an editor. Pick your favorite and proceed. Add the following entry to the file: +这可能会要您选择一个编辑器。请挑选您最喜欢的并继续。请将以下条目添加到文件中: @reboot /usr/bin/forever start /usr/lib/node_modules/verdaccio/bin/verdaccio -The locations may vary depending on your server setup. If you want to know where your files are you can use the 'which' command: +取决于服务器的设置,位置可能会有所不同。如果您想知道文件的位置,可以使用 'which' 命令: ```bash $ which forever diff --git a/website/translated_docs/zh-Hans/ssl.md b/website/translated_docs/zh-Hans/ssl.md index 9c04e628c..8eea51ea3 100644 --- a/website/translated_docs/zh-Hans/ssl.md +++ b/website/translated_docs/zh-Hans/ssl.md @@ -1,45 +1,45 @@ --- id: ssl -title: "Set up the SSL Certificates" +title: "设置SSL 证书" --- -Follow this instructions to configure a SSL certificate to serve NPM registry under HTTPS. +依照这些说明来配置SSL 证书来服务HTTPS 下的NPM registry。 -* Update the listen property in your `~/.config/verdaccio/config.yaml`: +* 在`~/.config/verdaccio/config.yaml`更新监听属性: listen: 'https://your.domain.com/' -Once you update the listen and try to run verdaccio again will ask for certificates. +一旦更新监听,并试着再次运行verdaccio ,将会被要求使用证书。 -* Generate your certificates +* 生成证书 $ openssl genrsa -out /Users/user/.config/verdaccio/verdaccio-key.pem 2048 $ openssl req -new -sha256 -key /Users/user/.config/verdaccio/verdaccio-key.pem -out /Users/user/.config/verdaccio/verdaccio-csr.pem $ openssl x509 -req -in /Users/user/.config/verdaccio/verdaccio-csr.pem -signkey /Users/user/.config/verdaccio/verdaccio-key.pem -out /Users/user/.config/verdaccio/verdaccio-cert.pem ```` - * Edit your config file `/Users/user/.config/verdaccio/config.yaml` and add the following section + * 编辑 config file `/Users/user/.config/verdaccio/config.yaml`并添加以下部分 https: key: /Users/user/.config/verdaccio/verdaccio-key.pem cert: /Users/user/.config/verdaccio/verdaccio-cert.pem ca: /Users/user/.config/verdaccio/verdaccio-csr.pem -
Alternatively, if you have a certificate as `server.pfx` format, you can add the following configuration section. The passphrase is optional and only needed, if your certificate is encrypted. +
或者,如果证书是server.pfx`格式,您可以添加以下配置部分。如果证书已加密,密码则是可选以及仅当需要时使用。 https: pfx: /Users/user/.config/verdaccio/server.pfx passphrase: 'secret' ```` -More info on the `key`, `cert`, `ca`, `pfx` and `passphrase` arguments on the [Node documentation](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options) +更多 关于`key`, `cert`, `ca`, `pfx` 和`passphrase` 参数信息,请参照 [节点文档](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options) -* Run `verdaccio` in your command line. +* 在命令行运行`verdaccio`。 -* Open the browser and load `https://your.domain.com:port/` +* 打开浏览器并加载`https://your.domain.com:port/` -This instructions are mostly valid under OSX and Linux, on Windows the paths will vary but, the steps are the same. +此指南主要在OSX和 Linux里有效,在 Windows 里,路径将不同,但步骤是一样的。 ## Docker -If you are using the Docker image, you have to set the `PROTOCOL` environment variable to `https` as the `listen` argument is provided on the [Dockerfile](https://github.com/verdaccio/verdaccio/blob/master/Dockerfile#L43), and thus ignored from your config file. +如果您使用Docker 镜像,您得设置`PROTOCOL` 环境变量到 `https`中,原因是因为 `listen` 参数由 [Dockerfile](https://github.com/verdaccio/verdaccio/blob/master/Dockerfile#L43)提供, 因此在您的config 文件中被忽略。 -You can also set the `PORT` environment variable if you are using a different port than `4873`. \ No newline at end of file +如果您使用不同于 `4873`的端口,您也可以设置 `PORT` 环境变量。 \ No newline at end of file diff --git a/website/translated_docs/zh-Hans/web.md b/website/translated_docs/zh-Hans/web.md index 9291d442e..80f2fe4cd 100644 --- a/website/translated_docs/zh-Hans/web.md +++ b/website/translated_docs/zh-Hans/web.md @@ -1,10 +1,10 @@ --- id: webui -title: "Web User Interface" +title: "Web User Interface2" --- -

+

Verdaccio has a web user interface to display only the private packges and can be customisable.