diff --git a/conf/default.yaml b/conf/default.yaml index 75f639944..8e3bb14f6 100644 --- a/conf/default.yaml +++ b/conf/default.yaml @@ -13,6 +13,7 @@ plugins: ./plugins web: # WebUI is enabled as default, if you want disable it, just uncomment this line + #enable: false title: Verdaccio auth: diff --git a/conf/docker.yaml b/conf/docker.yaml index eb703725b..22f947f69 100644 --- a/conf/docker.yaml +++ b/conf/docker.yaml @@ -17,6 +17,7 @@ plugins: /verdaccio/plugins web: # WebUI is enabled as default, if you want disable it, just uncomment this line + #enable: false title: Verdaccio auth: diff --git a/conf/full.yaml b/conf/full.yaml index 42b6b36d9..a1cac48a9 100644 --- a/conf/full.yaml +++ b/conf/full.yaml @@ -9,7 +9,11 @@ web: title: Verdaccio - # logo: logo.png + #logo: logo.png + + # If you're using this registry for a specific module scope, + # specify that scope to set it in the webui instructions header (note: escape @ with \\@) + #scope: \@myscope auth: htpasswd: diff --git a/src/api/web/index.js b/src/api/web/index.js index cc37b5ca4..1124ecb56 100644 --- a/src/api/web/index.js +++ b/src/api/web/index.js @@ -43,7 +43,8 @@ module.exports = function(config, auth, storage) { const base = Utils.combineBaseUrl(Utils.getWebProtocol(req), req.get('host'), config.url_prefix); let webPage = template .replace(/ToReplaceByVerdaccio/g, base) - .replace(/ToReplaceByTitle/g, _.get(config, 'web.title') ? config.web.title : WEB_TITLE); + .replace(/ToReplaceByTitle/g, _.get(config, 'web.title') ? config.web.title : WEB_TITLE) + .replace(/ToReplaceByScope/g, _.get(config, 'web.scope') ? config.web.scope : ''); res.setHeader('Content-Type', 'text/html'); diff --git a/src/webui/components/Header/index.js b/src/webui/components/Header/index.js index 9bcdcabcd..2c45f9b5b 100644 --- a/src/webui/components/Header/index.js +++ b/src/webui/components/Header/index.js @@ -21,8 +21,9 @@ export default class Header extends React.Component { username: '', password: '', logo: '', - loginError: null - } + loginError: null, + scope: (window.VERDACCIO_SCOPE) ? `${window.VERDACCIO_SCOPE}:` : '' + }; constructor(props) { super(props); @@ -158,7 +159,7 @@ export default class Header extends React.Component {
- npm set registry { registryURL } + npm set { this.state.scope }registry { registryURL }
npm adduser --registry { registryURL }
diff --git a/src/webui/template/index.html b/src/webui/template/index.html index 0a51e0a0d..8c603a972 100644 --- a/src/webui/template/index.html +++ b/src/webui/template/index.html @@ -7,6 +7,7 @@ diff --git a/tools/webpack.dev.config.babel.js b/tools/webpack.dev.config.babel.js index a435214b2..6c59a55f9 100644 --- a/tools/webpack.dev.config.babel.js +++ b/tools/webpack.dev.config.babel.js @@ -35,6 +35,7 @@ export default { }), new HTMLWebpackPlugin({ title: 'Verdaccio', + scope: '', filename: 'index.html', verdaccioURL: '//localhost:4873', template: `${env.SRC_ROOT}/webui/template/index.html`, diff --git a/tools/webpack.prod.config.babel.js b/tools/webpack.prod.config.babel.js index ae41b5eaa..79fdb8748 100644 --- a/tools/webpack.prod.config.babel.js +++ b/tools/webpack.prod.config.babel.js @@ -45,6 +45,7 @@ const prodConf = { }), new HTMLWebpackPlugin({ title: 'ToReplaceByTitle', + scope: 'ToReplaceByScope', filename: 'index.html', favicon: `${env.SRC_ROOT}/webui/template/favicon.ico`, verdaccioURL: 'ToReplaceByVerdaccio', diff --git a/website/translated_docs/ar/web.md b/website/translated_docs/ar/web.md index a9aa6a9ec..ed49a0f0f 100644 --- a/website/translated_docs/ar/web.md +++ b/website/translated_docs/ar/web.md @@ -13,6 +13,7 @@ web: enable: true title: Verdaccio logo: logo.png + scope: ``` ### Configuration @@ -21,4 +22,5 @@ web: | -------- | ------- | -------- | ------------------------------ | ------- | ---------------------------------- | | enable | boolean | No | true/false | all | allow to display the web interface | | title | string | No | $authenticated | all | HTML head title description | -| logo | string | No | http://my.logo.domain/logo.png | all | a URI where logo is located | \ No newline at end of file +| logo | string | No | http://my.logo.domain/logo.png | all | a URI where logo is located | +| scope | string | No | \\@myscopy | all | If you're using this registry for a specific module scope, specify that scope to set it in the webui instructions header (note: escape @ with \\@) | diff --git a/website/translated_docs/de/web.md b/website/translated_docs/de/web.md index a9aa6a9ec..ed49a0f0f 100644 --- a/website/translated_docs/de/web.md +++ b/website/translated_docs/de/web.md @@ -13,6 +13,7 @@ web: enable: true title: Verdaccio logo: logo.png + scope: ``` ### Configuration @@ -21,4 +22,5 @@ web: | -------- | ------- | -------- | ------------------------------ | ------- | ---------------------------------- | | enable | boolean | No | true/false | all | allow to display the web interface | | title | string | No | $authenticated | all | HTML head title description | -| logo | string | No | http://my.logo.domain/logo.png | all | a URI where logo is located | \ No newline at end of file +| logo | string | No | http://my.logo.domain/logo.png | all | a URI where logo is located | +| scope | string | No | \\@myscopy | all | If you're using this registry for a specific module scope, specify that scope to set it in the webui instructions header (note: escape @ with \\@) | diff --git a/website/translated_docs/es-ES/web.md b/website/translated_docs/es-ES/web.md index f3478e224..ebe53e8ac 100644 --- a/website/translated_docs/es-ES/web.md +++ b/website/translated_docs/es-ES/web.md @@ -13,6 +13,7 @@ web: enable: true title: Verdaccio logo: logo.png + scope: ``` All access restrictions defined to [protect your packages](protect-your-dependencies.md) will also apply to the Web Interface. @@ -23,4 +24,5 @@ All access restrictions defined to [protect your packages](protect-your-dependen | --------- | ------- | --------- | ------------------------------ | ------- | ------------------------------------ | | enable | boolean | No | true/false | all | habilita la interfaz web | | title | string | No | Verdaccio | all | El título de la interfaz web | -| logo | string | No | http://my.logo.domain/logo.png | all | el URI donde el logo esta localizado | \ No newline at end of file +| logo | string | No | http://my.logo.domain/logo.png | all | el URI donde el logo esta localizado | +| scope | string | No | \\@myscopy | all | If you're using this registry for a specific module scope, specify that scope to set it in the webui instructions header (note: escape @ with \\@) | diff --git a/website/translated_docs/fr/web.md b/website/translated_docs/fr/web.md index a9aa6a9ec..ed49a0f0f 100644 --- a/website/translated_docs/fr/web.md +++ b/website/translated_docs/fr/web.md @@ -13,6 +13,7 @@ web: enable: true title: Verdaccio logo: logo.png + scope: ``` ### Configuration @@ -21,4 +22,5 @@ web: | -------- | ------- | -------- | ------------------------------ | ------- | ---------------------------------- | | enable | boolean | No | true/false | all | allow to display the web interface | | title | string | No | $authenticated | all | HTML head title description | -| logo | string | No | http://my.logo.domain/logo.png | all | a URI where logo is located | \ No newline at end of file +| logo | string | No | http://my.logo.domain/logo.png | all | a URI where logo is located | +| scope | string | No | \\@myscopy | all | If you're using this registry for a specific module scope, specify that scope to set it in the webui instructions header (note: escape @ with \\@) | diff --git a/website/translated_docs/ja/web.md b/website/translated_docs/ja/web.md index a9aa6a9ec..ed49a0f0f 100644 --- a/website/translated_docs/ja/web.md +++ b/website/translated_docs/ja/web.md @@ -13,6 +13,7 @@ web: enable: true title: Verdaccio logo: logo.png + scope: ``` ### Configuration @@ -21,4 +22,5 @@ web: | -------- | ------- | -------- | ------------------------------ | ------- | ---------------------------------- | | enable | boolean | No | true/false | all | allow to display the web interface | | title | string | No | $authenticated | all | HTML head title description | -| logo | string | No | http://my.logo.domain/logo.png | all | a URI where logo is located | \ No newline at end of file +| logo | string | No | http://my.logo.domain/logo.png | all | a URI where logo is located | +| scope | string | No | \\@myscopy | all | If you're using this registry for a specific module scope, specify that scope to set it in the webui instructions header (note: escape @ with \\@) | diff --git a/website/translated_docs/pt-BR/web.md b/website/translated_docs/pt-BR/web.md index 445cb67b9..a3c2bb5af 100644 --- a/website/translated_docs/pt-BR/web.md +++ b/website/translated_docs/pt-BR/web.md @@ -13,6 +13,7 @@ web: enable: true title: Verdaccio logo: logo.png + scope: ``` All access restrictions defined to [protect your packages](protect-your-dependencies.md) will also apply to the Web Interface. @@ -23,4 +24,5 @@ All access restrictions defined to [protect your packages](protect-your-dependen | ------ | ------- | ----------- | ------------------------------ | ------- | --------------------------- | | enable | boolean | Não | true/false | all | habilitar a interface web | | title | string | Não | Verdaccio | all | Título da página web | -| logo | string | Não | http://my.logo.domain/logo.png | all | URI onde o logo se encontra | \ No newline at end of file +| logo | string | Não | http://my.logo.domain/logo.png | all | URI onde o logo se encontra | +| scope | string | Não | \\@myscopy | all | If you're using this registry for a specific module scope, specify that scope to set it in the webui instructions header (note: escape @ with \\@) | diff --git a/website/translated_docs/ur-IN/web.md b/website/translated_docs/ur-IN/web.md index a9aa6a9ec..ed49a0f0f 100644 --- a/website/translated_docs/ur-IN/web.md +++ b/website/translated_docs/ur-IN/web.md @@ -13,6 +13,7 @@ web: enable: true title: Verdaccio logo: logo.png + scope: ``` ### Configuration @@ -21,4 +22,5 @@ web: | -------- | ------- | -------- | ------------------------------ | ------- | ---------------------------------- | | enable | boolean | No | true/false | all | allow to display the web interface | | title | string | No | $authenticated | all | HTML head title description | -| logo | string | No | http://my.logo.domain/logo.png | all | a URI where logo is located | \ No newline at end of file +| logo | string | No | http://my.logo.domain/logo.png | all | a URI where logo is located | +| scope | string | No | \\@myscopy | all | If you're using this registry for a specific module scope, specify that scope to set it in the webui instructions header (note: escape @ with \\@) | diff --git a/website/translated_docs/ur-PK/web.md b/website/translated_docs/ur-PK/web.md index a9aa6a9ec..ed49a0f0f 100644 --- a/website/translated_docs/ur-PK/web.md +++ b/website/translated_docs/ur-PK/web.md @@ -13,6 +13,7 @@ web: enable: true title: Verdaccio logo: logo.png + scope: ``` ### Configuration @@ -21,4 +22,5 @@ web: | -------- | ------- | -------- | ------------------------------ | ------- | ---------------------------------- | | enable | boolean | No | true/false | all | allow to display the web interface | | title | string | No | $authenticated | all | HTML head title description | -| logo | string | No | http://my.logo.domain/logo.png | all | a URI where logo is located | \ No newline at end of file +| logo | string | No | http://my.logo.domain/logo.png | all | a URI where logo is located | +| scope | string | No | \\@myscopy | all | If you're using this registry for a specific module scope, specify that scope to set it in the webui instructions header (note: escape @ with \\@) | diff --git a/website/translated_docs/zh-HK/web.md b/website/translated_docs/zh-HK/web.md index a9aa6a9ec..ed49a0f0f 100644 --- a/website/translated_docs/zh-HK/web.md +++ b/website/translated_docs/zh-HK/web.md @@ -13,6 +13,7 @@ web: enable: true title: Verdaccio logo: logo.png + scope: ``` ### Configuration @@ -21,4 +22,5 @@ web: | -------- | ------- | -------- | ------------------------------ | ------- | ---------------------------------- | | enable | boolean | No | true/false | all | allow to display the web interface | | title | string | No | $authenticated | all | HTML head title description | -| logo | string | No | http://my.logo.domain/logo.png | all | a URI where logo is located | \ No newline at end of file +| logo | string | No | http://my.logo.domain/logo.png | all | a URI where logo is located | +| scope | string | No | \\@myscopy | all | If you're using this registry for a specific module scope, specify that scope to set it in the webui instructions header (note: escape @ with \\@) | diff --git a/website/translated_docs/zh-Hans/web.md b/website/translated_docs/zh-Hans/web.md index 50ff010d1..2c705760f 100644 --- a/website/translated_docs/zh-Hans/web.md +++ b/website/translated_docs/zh-Hans/web.md @@ -13,6 +13,7 @@ web: enable: true title: Verdaccio logo: logo.png + scope: ``` 所有访问限制定义为[保护包](protect-your-dependencies.md),它也将应用于网页界面。 @@ -23,4 +24,5 @@ web: | ------ | ------- | -- | ------------------------------ | --- | ----------- | | enable | boolean | No | true/false | all | 允许显示网页界面 | | title | string | No | Verdaccio | all | HTML 页眉标题说明 | -| logo | string | No | http://my.logo.domain/logo.png | all | logo 位于的URI | \ No newline at end of file +| logo | string | No | http://my.logo.domain/logo.png | all | logo 位于的URI | +| scope | string | No | \\@myscopy | all | If you're using this registry for a specific module scope, specify that scope to set it in the webui instructions header (note: escape @ with \\@) | diff --git a/website/translated_docs/zh-Hant/web.md b/website/translated_docs/zh-Hant/web.md index a9aa6a9ec..ed49a0f0f 100644 --- a/website/translated_docs/zh-Hant/web.md +++ b/website/translated_docs/zh-Hant/web.md @@ -13,6 +13,7 @@ web: enable: true title: Verdaccio logo: logo.png + scope: ``` ### Configuration @@ -21,4 +22,5 @@ web: | -------- | ------- | -------- | ------------------------------ | ------- | ---------------------------------- | | enable | boolean | No | true/false | all | allow to display the web interface | | title | string | No | $authenticated | all | HTML head title description | -| logo | string | No | http://my.logo.domain/logo.png | all | a URI where logo is located | \ No newline at end of file +| logo | string | No | http://my.logo.domain/logo.png | all | a URI where logo is located | +| scope | string | No | \\@myscopy | all | If you're using this registry for a specific module scope, specify that scope to set it in the webui instructions header (note: escape @ with \\@) | diff --git a/website/versioned_docs/version-3.3.0/web.md b/website/versioned_docs/version-3.3.0/web.md index 6de482fca..1ddda0097 100644 --- a/website/versioned_docs/version-3.3.0/web.md +++ b/website/versioned_docs/version-3.3.0/web.md @@ -13,6 +13,7 @@ web: enable: true title: Verdaccio logo: logo.png + scope: ``` All access restrictions defined to [protect your packages](protect-your-dependencies.md) will also apply to the Web Interface. @@ -24,3 +25,4 @@ Property | Type | Required | Example | Support | Description enable | boolean | No | true/false | all | allow to display the web interface title | string | No | Verdaccio | all | HTML head title description logo | string | No | http://my.logo.domain/logo.png | all | a URI where logo is located +scope | string | No | \\@myscopy | all | If you're using this registry for a specific module scope, specify that scope to set it in the webui instructions header (note: escape @ with \\@)