mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-12-16 21:56:25 -05:00
feat: adds option to set scope in webui instructions header
If you're using this registry for a specific module scope, specify that scope to set it in the webui instructions header e.g. npm set @coolsp:registry http://localhost:4873. Added as webui.scope option in .yaml. > Note: in .yaml, escape @ with \\@. See also feature request #593.
This commit is contained in:
parent
d1b46df423
commit
ac039cfcb8
20 changed files with 51 additions and 16 deletions
|
@ -13,6 +13,7 @@ plugins: ./plugins
|
||||||
|
|
||||||
web:
|
web:
|
||||||
# WebUI is enabled as default, if you want disable it, just uncomment this line
|
# WebUI is enabled as default, if you want disable it, just uncomment this line
|
||||||
|
#enable: false
|
||||||
title: Verdaccio
|
title: Verdaccio
|
||||||
|
|
||||||
auth:
|
auth:
|
||||||
|
|
|
@ -17,6 +17,7 @@ plugins: /verdaccio/plugins
|
||||||
|
|
||||||
web:
|
web:
|
||||||
# WebUI is enabled as default, if you want disable it, just uncomment this line
|
# WebUI is enabled as default, if you want disable it, just uncomment this line
|
||||||
|
#enable: false
|
||||||
title: Verdaccio
|
title: Verdaccio
|
||||||
|
|
||||||
auth:
|
auth:
|
||||||
|
|
|
@ -9,7 +9,11 @@ web:
|
||||||
|
|
||||||
title: Verdaccio
|
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:
|
auth:
|
||||||
htpasswd:
|
htpasswd:
|
||||||
|
|
|
@ -43,7 +43,8 @@ module.exports = function(config, auth, storage) {
|
||||||
const base = Utils.combineBaseUrl(Utils.getWebProtocol(req), req.get('host'), config.url_prefix);
|
const base = Utils.combineBaseUrl(Utils.getWebProtocol(req), req.get('host'), config.url_prefix);
|
||||||
let webPage = template
|
let webPage = template
|
||||||
.replace(/ToReplaceByVerdaccio/g, base)
|
.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');
|
res.setHeader('Content-Type', 'text/html');
|
||||||
|
|
||||||
|
|
|
@ -21,8 +21,9 @@ export default class Header extends React.Component {
|
||||||
username: '',
|
username: '',
|
||||||
password: '',
|
password: '',
|
||||||
logo: '',
|
logo: '',
|
||||||
loginError: null
|
loginError: null,
|
||||||
}
|
scope: (window.VERDACCIO_SCOPE) ? `${window.VERDACCIO_SCOPE}:` : ''
|
||||||
|
};
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
|
@ -158,7 +159,7 @@ export default class Header extends React.Component {
|
||||||
<img src={ this.state.logo } className={ classes.logo } />
|
<img src={ this.state.logo } className={ classes.logo } />
|
||||||
</Link>
|
</Link>
|
||||||
<figure>
|
<figure>
|
||||||
npm set registry { registryURL }
|
npm set { this.state.scope }registry { registryURL }
|
||||||
<br/>
|
<br/>
|
||||||
npm adduser --registry { registryURL }
|
npm adduser --registry { registryURL }
|
||||||
</figure>
|
</figure>
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<script>
|
<script>
|
||||||
window.VERDACCIO_API_URL = '<%= htmlWebpackPlugin.options.verdaccioURL %>/-/verdaccio/';
|
window.VERDACCIO_API_URL = '<%= htmlWebpackPlugin.options.verdaccioURL %>/-/verdaccio/';
|
||||||
|
window.VERDACCIO_SCOPE = '<%= htmlWebpackPlugin.options.scope %>';
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body class="body">
|
<body class="body">
|
||||||
|
|
|
@ -35,6 +35,7 @@ export default {
|
||||||
}),
|
}),
|
||||||
new HTMLWebpackPlugin({
|
new HTMLWebpackPlugin({
|
||||||
title: 'Verdaccio',
|
title: 'Verdaccio',
|
||||||
|
scope: '',
|
||||||
filename: 'index.html',
|
filename: 'index.html',
|
||||||
verdaccioURL: '//localhost:4873',
|
verdaccioURL: '//localhost:4873',
|
||||||
template: `${env.SRC_ROOT}/webui/template/index.html`,
|
template: `${env.SRC_ROOT}/webui/template/index.html`,
|
||||||
|
|
|
@ -45,6 +45,7 @@ const prodConf = {
|
||||||
}),
|
}),
|
||||||
new HTMLWebpackPlugin({
|
new HTMLWebpackPlugin({
|
||||||
title: 'ToReplaceByTitle',
|
title: 'ToReplaceByTitle',
|
||||||
|
scope: 'ToReplaceByScope',
|
||||||
filename: 'index.html',
|
filename: 'index.html',
|
||||||
favicon: `${env.SRC_ROOT}/webui/template/favicon.ico`,
|
favicon: `${env.SRC_ROOT}/webui/template/favicon.ico`,
|
||||||
verdaccioURL: 'ToReplaceByVerdaccio',
|
verdaccioURL: 'ToReplaceByVerdaccio',
|
||||||
|
|
|
@ -13,6 +13,7 @@ web:
|
||||||
enable: true
|
enable: true
|
||||||
title: Verdaccio
|
title: Verdaccio
|
||||||
logo: logo.png
|
logo: logo.png
|
||||||
|
scope:
|
||||||
```
|
```
|
||||||
|
|
||||||
### Configuration
|
### Configuration
|
||||||
|
@ -21,4 +22,5 @@ web:
|
||||||
| -------- | ------- | -------- | ------------------------------ | ------- | ---------------------------------- |
|
| -------- | ------- | -------- | ------------------------------ | ------- | ---------------------------------- |
|
||||||
| enable | boolean | No | true/false | all | allow to display the web interface |
|
| enable | boolean | No | true/false | all | allow to display the web interface |
|
||||||
| title | string | No | $authenticated | all | HTML head title description |
|
| 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 |
|
| 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 \\@) |
|
||||||
|
|
|
@ -13,6 +13,7 @@ web:
|
||||||
enable: true
|
enable: true
|
||||||
title: Verdaccio
|
title: Verdaccio
|
||||||
logo: logo.png
|
logo: logo.png
|
||||||
|
scope:
|
||||||
```
|
```
|
||||||
|
|
||||||
### Configuration
|
### Configuration
|
||||||
|
@ -21,4 +22,5 @@ web:
|
||||||
| -------- | ------- | -------- | ------------------------------ | ------- | ---------------------------------- |
|
| -------- | ------- | -------- | ------------------------------ | ------- | ---------------------------------- |
|
||||||
| enable | boolean | No | true/false | all | allow to display the web interface |
|
| enable | boolean | No | true/false | all | allow to display the web interface |
|
||||||
| title | string | No | $authenticated | all | HTML head title description |
|
| 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 |
|
| 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 \\@) |
|
||||||
|
|
|
@ -13,6 +13,7 @@ web:
|
||||||
enable: true
|
enable: true
|
||||||
title: Verdaccio
|
title: Verdaccio
|
||||||
logo: logo.png
|
logo: logo.png
|
||||||
|
scope:
|
||||||
```
|
```
|
||||||
|
|
||||||
All access restrictions defined to [protect your packages](protect-your-dependencies.md) will also apply to the Web Interface.
|
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 |
|
| enable | boolean | No | true/false | all | habilita la interfaz web |
|
||||||
| title | string | No | Verdaccio | all | El título de 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 |
|
| 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 \\@) |
|
||||||
|
|
|
@ -13,6 +13,7 @@ web:
|
||||||
enable: true
|
enable: true
|
||||||
title: Verdaccio
|
title: Verdaccio
|
||||||
logo: logo.png
|
logo: logo.png
|
||||||
|
scope:
|
||||||
```
|
```
|
||||||
|
|
||||||
### Configuration
|
### Configuration
|
||||||
|
@ -21,4 +22,5 @@ web:
|
||||||
| -------- | ------- | -------- | ------------------------------ | ------- | ---------------------------------- |
|
| -------- | ------- | -------- | ------------------------------ | ------- | ---------------------------------- |
|
||||||
| enable | boolean | No | true/false | all | allow to display the web interface |
|
| enable | boolean | No | true/false | all | allow to display the web interface |
|
||||||
| title | string | No | $authenticated | all | HTML head title description |
|
| 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 |
|
| 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 \\@) |
|
||||||
|
|
|
@ -13,6 +13,7 @@ web:
|
||||||
enable: true
|
enable: true
|
||||||
title: Verdaccio
|
title: Verdaccio
|
||||||
logo: logo.png
|
logo: logo.png
|
||||||
|
scope:
|
||||||
```
|
```
|
||||||
|
|
||||||
### Configuration
|
### Configuration
|
||||||
|
@ -21,4 +22,5 @@ web:
|
||||||
| -------- | ------- | -------- | ------------------------------ | ------- | ---------------------------------- |
|
| -------- | ------- | -------- | ------------------------------ | ------- | ---------------------------------- |
|
||||||
| enable | boolean | No | true/false | all | allow to display the web interface |
|
| enable | boolean | No | true/false | all | allow to display the web interface |
|
||||||
| title | string | No | $authenticated | all | HTML head title description |
|
| 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 |
|
| 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 \\@) |
|
||||||
|
|
|
@ -13,6 +13,7 @@ web:
|
||||||
enable: true
|
enable: true
|
||||||
title: Verdaccio
|
title: Verdaccio
|
||||||
logo: logo.png
|
logo: logo.png
|
||||||
|
scope:
|
||||||
```
|
```
|
||||||
|
|
||||||
All access restrictions defined to [protect your packages](protect-your-dependencies.md) will also apply to the Web Interface.
|
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 |
|
| enable | boolean | Não | true/false | all | habilitar a interface web |
|
||||||
| title | string | Não | Verdaccio | all | Título da página 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 |
|
| 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 \\@) |
|
||||||
|
|
|
@ -13,6 +13,7 @@ web:
|
||||||
enable: true
|
enable: true
|
||||||
title: Verdaccio
|
title: Verdaccio
|
||||||
logo: logo.png
|
logo: logo.png
|
||||||
|
scope:
|
||||||
```
|
```
|
||||||
|
|
||||||
### Configuration
|
### Configuration
|
||||||
|
@ -21,4 +22,5 @@ web:
|
||||||
| -------- | ------- | -------- | ------------------------------ | ------- | ---------------------------------- |
|
| -------- | ------- | -------- | ------------------------------ | ------- | ---------------------------------- |
|
||||||
| enable | boolean | No | true/false | all | allow to display the web interface |
|
| enable | boolean | No | true/false | all | allow to display the web interface |
|
||||||
| title | string | No | $authenticated | all | HTML head title description |
|
| 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 |
|
| 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 \\@) |
|
||||||
|
|
|
@ -13,6 +13,7 @@ web:
|
||||||
enable: true
|
enable: true
|
||||||
title: Verdaccio
|
title: Verdaccio
|
||||||
logo: logo.png
|
logo: logo.png
|
||||||
|
scope:
|
||||||
```
|
```
|
||||||
|
|
||||||
### Configuration
|
### Configuration
|
||||||
|
@ -21,4 +22,5 @@ web:
|
||||||
| -------- | ------- | -------- | ------------------------------ | ------- | ---------------------------------- |
|
| -------- | ------- | -------- | ------------------------------ | ------- | ---------------------------------- |
|
||||||
| enable | boolean | No | true/false | all | allow to display the web interface |
|
| enable | boolean | No | true/false | all | allow to display the web interface |
|
||||||
| title | string | No | $authenticated | all | HTML head title description |
|
| 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 |
|
| 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 \\@) |
|
||||||
|
|
|
@ -13,6 +13,7 @@ web:
|
||||||
enable: true
|
enable: true
|
||||||
title: Verdaccio
|
title: Verdaccio
|
||||||
logo: logo.png
|
logo: logo.png
|
||||||
|
scope:
|
||||||
```
|
```
|
||||||
|
|
||||||
### Configuration
|
### Configuration
|
||||||
|
@ -21,4 +22,5 @@ web:
|
||||||
| -------- | ------- | -------- | ------------------------------ | ------- | ---------------------------------- |
|
| -------- | ------- | -------- | ------------------------------ | ------- | ---------------------------------- |
|
||||||
| enable | boolean | No | true/false | all | allow to display the web interface |
|
| enable | boolean | No | true/false | all | allow to display the web interface |
|
||||||
| title | string | No | $authenticated | all | HTML head title description |
|
| 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 |
|
| 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 \\@) |
|
||||||
|
|
|
@ -13,6 +13,7 @@ web:
|
||||||
enable: true
|
enable: true
|
||||||
title: Verdaccio
|
title: Verdaccio
|
||||||
logo: logo.png
|
logo: logo.png
|
||||||
|
scope:
|
||||||
```
|
```
|
||||||
|
|
||||||
所有访问限制定义为[保护包](protect-your-dependencies.md),它也将应用于网页界面。
|
所有访问限制定义为[保护包](protect-your-dependencies.md),它也将应用于网页界面。
|
||||||
|
@ -23,4 +24,5 @@ web:
|
||||||
| ------ | ------- | -- | ------------------------------ | --- | ----------- |
|
| ------ | ------- | -- | ------------------------------ | --- | ----------- |
|
||||||
| enable | boolean | No | true/false | all | 允许显示网页界面 |
|
| enable | boolean | No | true/false | all | 允许显示网页界面 |
|
||||||
| title | string | No | Verdaccio | all | HTML 页眉标题说明 |
|
| title | string | No | Verdaccio | all | HTML 页眉标题说明 |
|
||||||
| logo | string | No | http://my.logo.domain/logo.png | all | logo 位于的URI |
|
| 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 \\@) |
|
||||||
|
|
|
@ -13,6 +13,7 @@ web:
|
||||||
enable: true
|
enable: true
|
||||||
title: Verdaccio
|
title: Verdaccio
|
||||||
logo: logo.png
|
logo: logo.png
|
||||||
|
scope:
|
||||||
```
|
```
|
||||||
|
|
||||||
### Configuration
|
### Configuration
|
||||||
|
@ -21,4 +22,5 @@ web:
|
||||||
| -------- | ------- | -------- | ------------------------------ | ------- | ---------------------------------- |
|
| -------- | ------- | -------- | ------------------------------ | ------- | ---------------------------------- |
|
||||||
| enable | boolean | No | true/false | all | allow to display the web interface |
|
| enable | boolean | No | true/false | all | allow to display the web interface |
|
||||||
| title | string | No | $authenticated | all | HTML head title description |
|
| 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 |
|
| 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 \\@) |
|
||||||
|
|
|
@ -13,6 +13,7 @@ web:
|
||||||
enable: true
|
enable: true
|
||||||
title: Verdaccio
|
title: Verdaccio
|
||||||
logo: logo.png
|
logo: logo.png
|
||||||
|
scope:
|
||||||
```
|
```
|
||||||
|
|
||||||
All access restrictions defined to [protect your packages](protect-your-dependencies.md) will also apply to the Web Interface.
|
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
|
enable | boolean | No | true/false | all | allow to display the web interface
|
||||||
title | string | No | Verdaccio | all | HTML head title description
|
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
|
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 \\@)
|
||||||
|
|
Loading…
Reference in a new issue