@verdaccio/config 6.0.0-6-next.11 → 6.0.0-6-next.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +101 -0
- package/build/conf/default.yaml +14 -5
- package/build/conf/docker.yaml +28 -3
- package/build/config.d.ts +2 -1
- package/build/config.js +4 -25
- package/build/config.js.map +1 -1
- package/build/package-access.js +2 -7
- package/build/package-access.js.map +1 -1
- package/package.json +4 -4
- package/src/conf/default.yaml +14 -5
- package/src/conf/docker.yaml +28 -3
- package/src/config.ts +5 -0
- package/test/config.spec.ts +5 -5
- package/test/partials/config/js/default.js +1 -1
- package/test/partials/config/yaml/storage.yaml +1 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,106 @@
|
|
|
1
1
|
# @verdaccio/config
|
|
2
2
|
|
|
3
|
+
## 6.0.0-6-next.14
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- d43894e8: feat: rework web header for mobile, add new settings and raw manifest button
|
|
8
|
+
|
|
9
|
+
### New set of variables to hide features
|
|
10
|
+
|
|
11
|
+
Add set of new variables that allow hide different parts of the UI, buttons, footer or download tarballs. _All are
|
|
12
|
+
enabled by default_.
|
|
13
|
+
|
|
14
|
+
```yaml
|
|
15
|
+
# login: true <-- already exist but worth the reminder
|
|
16
|
+
# showInfo: true
|
|
17
|
+
# showSettings: true
|
|
18
|
+
# In combination with darkMode you can force specific theme
|
|
19
|
+
# showThemeSwitch: true
|
|
20
|
+
# showFooter: true
|
|
21
|
+
# showSearch: true
|
|
22
|
+
# showDownloadTarball: true
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
> If you disable `showThemeSwitch` and force `darkMode: true` the local storage settings would be
|
|
26
|
+
> ignored and force all themes to the one in the configuration file.
|
|
27
|
+
|
|
28
|
+
Future could be extended to
|
|
29
|
+
|
|
30
|
+
### Raw button to display manifest package
|
|
31
|
+
|
|
32
|
+
A new experimental feature (enabled by default), button named RAW to be able navigate on the package manifest directly on the ui, kudos to [react-json-view](https://www.npmjs.com/package/react-json-view) that allows an easy integration, not configurable yet until get more feedback.
|
|
33
|
+
|
|
34
|
+
```yaml
|
|
35
|
+
showRaw: true
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
#### Rework header buttons
|
|
39
|
+
|
|
40
|
+
- The header has been rework, the mobile was not looking broken.
|
|
41
|
+
- Removed info button in the header and moved to a dialog
|
|
42
|
+
- Info dialog now contains more information about the project, license and the aid content for Ukrania now is inside of the info modal.
|
|
43
|
+
- Separate settings and info to avoid collapse too much info (for mobile still need some work)
|
|
44
|
+
|
|
45
|
+
- d08fe29d: feat(web): add a config item to web,let the developer can select whet……her enable the html cache
|
|
46
|
+
|
|
47
|
+
### Patch Changes
|
|
48
|
+
|
|
49
|
+
- @verdaccio/core@6.0.0-6-next.5
|
|
50
|
+
|
|
51
|
+
## 6.0.0-6-next.13
|
|
52
|
+
|
|
53
|
+
### Major Changes
|
|
54
|
+
|
|
55
|
+
- 82cb0f2b: feat!: config.logs throw an error, logging config not longer accept array or logs property
|
|
56
|
+
|
|
57
|
+
### 💥 Breaking change
|
|
58
|
+
|
|
59
|
+
This is valid
|
|
60
|
+
|
|
61
|
+
```yaml
|
|
62
|
+
log: { type: stdout, format: pretty, level: http }
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
This is invalid
|
|
66
|
+
|
|
67
|
+
```yaml
|
|
68
|
+
logs: { type: stdout, format: pretty, level: http }
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
or
|
|
72
|
+
|
|
73
|
+
```yaml
|
|
74
|
+
logs:
|
|
75
|
+
- [{ type: stdout, format: pretty, level: http }]
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Minor Changes
|
|
79
|
+
|
|
80
|
+
- 5167bb52: feat: ui search support for remote, local and private packages
|
|
81
|
+
|
|
82
|
+
The command `npm search` search globally and return all matches, with this improvement the user interface
|
|
83
|
+
is powered with the same capabilities.
|
|
84
|
+
|
|
85
|
+
The UI also tag where is the origin the package with a tag, also provide the latest version and description of the package.
|
|
86
|
+
|
|
87
|
+
### Patch Changes
|
|
88
|
+
|
|
89
|
+
- Updated dependencies [82cb0f2b]
|
|
90
|
+
- Updated dependencies [5167bb52]
|
|
91
|
+
- @verdaccio/core@6.0.0-6-next.5
|
|
92
|
+
- @verdaccio/utils@6.0.0-6-next.11
|
|
93
|
+
|
|
94
|
+
## 6.0.0-6-next.12
|
|
95
|
+
|
|
96
|
+
### Patch Changes
|
|
97
|
+
|
|
98
|
+
- Updated dependencies [a828271d]
|
|
99
|
+
- Updated dependencies [24b9be02]
|
|
100
|
+
- Updated dependencies [b13a3fef]
|
|
101
|
+
- @verdaccio/utils@6.0.0-6-next.10
|
|
102
|
+
- @verdaccio/core@6.0.0-6-next.4
|
|
103
|
+
|
|
3
104
|
## 6.0.0-6-next.11
|
|
4
105
|
|
|
5
106
|
### Patch Changes
|
package/build/conf/default.yaml
CHANGED
|
@@ -3,15 +3,13 @@
|
|
|
3
3
|
# so don't use it on production systems.
|
|
4
4
|
#
|
|
5
5
|
# Look here for more config file examples:
|
|
6
|
-
# https://github.com/verdaccio/verdaccio/tree/master/conf
|
|
6
|
+
# https://github.com/verdaccio/verdaccio/tree/master/packages/config/src/conf
|
|
7
7
|
#
|
|
8
8
|
|
|
9
9
|
# path to a directory with all packages
|
|
10
10
|
storage: ./storage
|
|
11
11
|
# path to a directory with plugins to include
|
|
12
12
|
plugins: ./plugins
|
|
13
|
-
# print logs
|
|
14
|
-
# logs: ./logs
|
|
15
13
|
|
|
16
14
|
web:
|
|
17
15
|
title: Verdaccio
|
|
@@ -21,6 +19,17 @@ web:
|
|
|
21
19
|
# sort_packages: asc
|
|
22
20
|
# convert your UI to the dark side
|
|
23
21
|
# darkMode: true
|
|
22
|
+
# html_cache: true
|
|
23
|
+
# by default all features are displayed
|
|
24
|
+
# login: true
|
|
25
|
+
# showInfo: true
|
|
26
|
+
# showSettings: true
|
|
27
|
+
# In combination with darkMode you can force specific theme
|
|
28
|
+
# showThemeSwitch: true
|
|
29
|
+
# showFooter: true
|
|
30
|
+
# showSearch: true
|
|
31
|
+
# showRaw: true
|
|
32
|
+
# showDownloadTarball: true
|
|
24
33
|
# HTML tags injected after manifest <scripts/>
|
|
25
34
|
# scriptsBodyAfter:
|
|
26
35
|
# - '<script type="text/javascript" src="https://my.company.com/customJS.min.js"></script>'
|
|
@@ -67,7 +76,7 @@ packages:
|
|
|
67
76
|
# and three keywords: "$all", "$anonymous", "$authenticated"
|
|
68
77
|
access: $all
|
|
69
78
|
|
|
70
|
-
# allow all known users to publish/
|
|
79
|
+
# allow all known users to publish/unpublish packages
|
|
71
80
|
# (anyone can register by default, remember?)
|
|
72
81
|
publish: $authenticated
|
|
73
82
|
unpublish: $authenticated
|
|
@@ -87,7 +96,7 @@ middlewares:
|
|
|
87
96
|
enabled: true
|
|
88
97
|
|
|
89
98
|
# log settings
|
|
90
|
-
|
|
99
|
+
log:
|
|
91
100
|
# Logger as STDOUT
|
|
92
101
|
{ type: stdout, format: pretty, level: http }
|
|
93
102
|
# Logger as STDOUT as JSON
|
package/build/conf/docker.yaml
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
# see https://verdaccio.org/docs/en/docker#docker-and-custom-port-configuration
|
|
8
8
|
#
|
|
9
9
|
# Look here for more config file examples:
|
|
10
|
-
# https://github.com/verdaccio/verdaccio/tree/master/conf
|
|
10
|
+
# https://github.com/verdaccio/verdaccio/tree/master/packages/config/src/conf
|
|
11
11
|
#
|
|
12
12
|
|
|
13
13
|
# path to a directory with all packages
|
|
@@ -23,7 +23,32 @@ web:
|
|
|
23
23
|
# gravatar: false
|
|
24
24
|
# by default packages are ordercer ascendant (asc|desc)
|
|
25
25
|
# sort_packages: asc
|
|
26
|
+
# convert your UI to the dark side
|
|
26
27
|
# darkMode: true
|
|
28
|
+
# html_cache: true
|
|
29
|
+
# by default all features are displayed
|
|
30
|
+
# login: true
|
|
31
|
+
# showInfo: true
|
|
32
|
+
# showSettings: true
|
|
33
|
+
# In combination with darkMode you can force specific theme
|
|
34
|
+
# showThemeSwitch: true
|
|
35
|
+
# showFooter: true
|
|
36
|
+
# showSearch: true
|
|
37
|
+
# showRaw: true
|
|
38
|
+
# showDownloadTarball: true
|
|
39
|
+
# HTML tags injected after manifest <scripts/>
|
|
40
|
+
# scriptsBodyAfter:
|
|
41
|
+
# - '<script type="text/javascript" src="https://my.company.com/customJS.min.js"></script>'
|
|
42
|
+
# HTML tags injected before ends </head>
|
|
43
|
+
# metaScripts:
|
|
44
|
+
# - '<script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>'
|
|
45
|
+
# - '<script type="text/javascript" src="https://browser.sentry-cdn.com/5.15.5/bundle.min.js"></script>'
|
|
46
|
+
# - '<meta name="robots" content="noindex" />'
|
|
47
|
+
# HTML tags injected first child at <body/>
|
|
48
|
+
# bodyBefore:
|
|
49
|
+
# - '<div id="myId">html before webpack scripts</div>'
|
|
50
|
+
# Public path for template manifest scripts (only manifest)
|
|
51
|
+
# publicPath: http://somedomain.org/
|
|
27
52
|
|
|
28
53
|
# translate your registry, api i18n not available yet
|
|
29
54
|
# i18n:
|
|
@@ -58,7 +83,7 @@ packages:
|
|
|
58
83
|
# and three keywords: "$all", "$anonymous", "$authenticated"
|
|
59
84
|
access: $all
|
|
60
85
|
|
|
61
|
-
# allow all known users to publish/
|
|
86
|
+
# allow all known users to publish/unpublish packages
|
|
62
87
|
# (anyone can register by default, remember?)
|
|
63
88
|
publish: $authenticated
|
|
64
89
|
unpublish: $authenticated
|
|
@@ -72,7 +97,7 @@ middlewares:
|
|
|
72
97
|
|
|
73
98
|
# log settings
|
|
74
99
|
# log settings
|
|
75
|
-
|
|
100
|
+
log:
|
|
76
101
|
# Logger as STDOUT
|
|
77
102
|
{ type: stdout, format: pretty, level: http }
|
|
78
103
|
# Logger as STDOUT as JSON
|
package/build/config.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Config as AppConfig, AuthConf, ConfigRuntime, PackageAccess, PackageList, Security, ServerSettingsConf } from '@verdaccio/types';
|
|
1
|
+
import { Config as AppConfig, AuthConf, ConfigRuntime, FlagsConfig, PackageAccess, PackageList, Security, ServerSettingsConf } from '@verdaccio/types';
|
|
2
2
|
export declare const WEB_TITLE = "Verdaccio";
|
|
3
3
|
/**
|
|
4
4
|
* Coordinates the application configuration
|
|
@@ -16,6 +16,7 @@ declare class Config implements AppConfig {
|
|
|
16
16
|
security: Security;
|
|
17
17
|
serverSettings: ServerSettingsConf;
|
|
18
18
|
secret: string;
|
|
19
|
+
flags: FlagsConfig;
|
|
19
20
|
constructor(config: ConfigRuntime);
|
|
20
21
|
/**
|
|
21
22
|
* Check for package spec
|
package/build/config.js
CHANGED
|
@@ -29,8 +29,6 @@ var _uplinks = require("./uplinks");
|
|
|
29
29
|
|
|
30
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
31
|
|
|
32
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
33
|
-
|
|
34
32
|
const strategicConfigProps = ['uplinks', 'packages'];
|
|
35
33
|
const allowedEnvConfig = ['http_proxy', 'https_proxy', 'no_proxy'];
|
|
36
34
|
const debug = (0, _debug.default)('verdaccio:config');
|
|
@@ -44,29 +42,7 @@ exports.WEB_TITLE = WEB_TITLE;
|
|
|
44
42
|
class Config {
|
|
45
43
|
// @ts-ignore
|
|
46
44
|
constructor(config) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
_defineProperty(this, "uplinks", void 0);
|
|
50
|
-
|
|
51
|
-
_defineProperty(this, "packages", void 0);
|
|
52
|
-
|
|
53
|
-
_defineProperty(this, "users", void 0);
|
|
54
|
-
|
|
55
|
-
_defineProperty(this, "auth", void 0);
|
|
56
|
-
|
|
57
|
-
_defineProperty(this, "server_id", void 0);
|
|
58
|
-
|
|
59
|
-
_defineProperty(this, "config_path", void 0);
|
|
60
|
-
|
|
61
|
-
_defineProperty(this, "storage", void 0);
|
|
62
|
-
|
|
63
|
-
_defineProperty(this, "plugins", void 0);
|
|
64
|
-
|
|
65
|
-
_defineProperty(this, "security", void 0);
|
|
66
|
-
|
|
67
|
-
_defineProperty(this, "serverSettings", void 0);
|
|
68
|
-
|
|
69
|
-
_defineProperty(this, "secret", void 0);
|
|
45
|
+
var _config$flags;
|
|
70
46
|
|
|
71
47
|
const self = this;
|
|
72
48
|
this.storage = process.env.VERDACCIO_STORAGE_PATH || config.storage;
|
|
@@ -74,6 +50,9 @@ class Config {
|
|
|
74
50
|
this.plugins = config.plugins;
|
|
75
51
|
this.security = _lodash.default.merge(_security.defaultSecurity, config.security);
|
|
76
52
|
this.serverSettings = _serverSettings.default;
|
|
53
|
+
this.flags = {
|
|
54
|
+
searchRemote: ((_config$flags = config.flags) === null || _config$flags === void 0 ? void 0 : _config$flags.searchRemote) ?? true
|
|
55
|
+
};
|
|
77
56
|
|
|
78
57
|
for (const configProp in config) {
|
|
79
58
|
if (self[configProp] == null) {
|
package/build/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/config.ts"],"names":["strategicConfigProps","allowedEnvConfig","debug","WEB_TITLE","Config","constructor","config","self","storage","process","env","VERDACCIO_STORAGE_PATH","config_path","plugins","security","_","merge","defaultSecurity","serverSettings","configProp","isNil","user_agent","isObject","APP_ERROR","CONFIG_NOT_VALID","forEach","x","uplinks","packages","envConf","toUpperCase","server_id","getMatchedPackagesSpec","pkgName","checkSecretKey","secret","isString","isEmpty"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEA;;
|
|
1
|
+
{"version":3,"sources":["../src/config.ts"],"names":["strategicConfigProps","allowedEnvConfig","debug","WEB_TITLE","Config","constructor","config","self","storage","process","env","VERDACCIO_STORAGE_PATH","config_path","plugins","security","_","merge","defaultSecurity","serverSettings","flags","searchRemote","configProp","isNil","user_agent","isObject","APP_ERROR","CONFIG_NOT_VALID","forEach","x","uplinks","packages","envConf","toUpperCase","server_id","getMatchedPackagesSpec","pkgName","checkSecretKey","secret","isString","isEmpty"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEA;;AAWA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,oBAAoB,GAAG,CAAC,SAAD,EAAY,UAAZ,CAA7B;AACA,MAAMC,gBAAgB,GAAG,CAAC,YAAD,EAAe,aAAf,EAA8B,UAA9B,CAAzB;AACA,MAAMC,KAAK,GAAG,oBAAW,kBAAX,CAAd;AAEO,MAAMC,SAAS,GAAG,WAAlB;AAEP;AACA;AACA;;;;AACA,MAAMC,MAAN,CAAkC;AAYhC;AAIOC,EAAAA,WAAW,CAACC,MAAD,EAAwB;AAAA;;AACxC,UAAMC,IAAI,GAAG,IAAb;AACA,SAAKC,OAAL,GAAeC,OAAO,CAACC,GAAR,CAAYC,sBAAZ,IAAsCL,MAAM,CAACE,OAA5D;AACA,SAAKI,WAAL,GAAmBN,MAAM,CAACM,WAA1B;AACA,SAAKC,OAAL,GAAeP,MAAM,CAACO,OAAtB;AACA,SAAKC,QAAL,GAAgBC,gBAAEC,KAAF,CAAQC,yBAAR,EAAyBX,MAAM,CAACQ,QAAhC,CAAhB;AACA,SAAKI,cAAL,GAAsBA,uBAAtB;AACA,SAAKC,KAAL,GAAa;AACXC,MAAAA,YAAY,EAAE,kBAAAd,MAAM,CAACa,KAAP,gEAAcC,YAAd,KAA8B;AADjC,KAAb;;AAIA,SAAK,MAAMC,UAAX,IAAyBf,MAAzB,EAAiC;AAC/B,UAAIC,IAAI,CAACc,UAAD,CAAJ,IAAoB,IAAxB,EAA8B;AAC5Bd,QAAAA,IAAI,CAACc,UAAD,CAAJ,GAAmBf,MAAM,CAACe,UAAD,CAAzB;AACD;AACF,KAfuC,CAiBxC;;;AACA,QAAIN,g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AAC,kBAAD,CAAL;;AACA,QAAIa,gBAAEuB,QAAF,CAAWD,MAAX,KAAsBtB,gBAAEwB,OAAF,CAAUF,MAAV,MAAsB,KAAhD,EAAuD;AACrD,WAAKA,MAAL,GAAcA,MAAd;AACAnC,MAAAA,KAAK,CAAC,sBAAD,CAAL;AACA,aAAOmC,MAAP;AACD,KAN4C,CAO7C;AACA;;;AACAnC,IAAAA,KAAK,CAAC,oBAAD,CAAL;AACA,SAAKmC,MAAL,GAAc,qCAAd;AACA,WAAO,KAAKA,MAAZ;AACD;;AA1F+B","sourcesContent":["import assert from 'assert';\nimport buildDebug from 'debug';\nimport _ from 'lodash';\n\nimport { APP_ERROR } from '@verdaccio/core';\nimport {\n Config as AppConfig,\n AuthConf,\n ConfigRuntime,\n FlagsConfig,\n PackageAccess,\n PackageList,\n Security,\n ServerSettingsConf,\n} from '@verdaccio/types';\nimport { generateRandomHexString, getMatchedPackagesSpec, isObject } from '@verdaccio/utils';\n\nimport { getUserAgent } from './agent';\nimport { normalisePackageAccess } from './package-access';\nimport { defaultSecurity } from './security';\nimport serverSettings from './serverSettings';\nimport { generateRandomSecretKey } from './token';\nimport { sanityCheckUplinksProps, uplinkSanityCheck } from './uplinks';\n\nconst strategicConfigProps = ['uplinks', 'packages'];\nconst allowedEnvConfig = ['http_proxy', 'https_proxy', 'no_proxy'];\nconst debug = buildDebug('verdaccio:config');\n\nexport const WEB_TITLE = 'Verdaccio';\n\n/**\n * Coordinates the application configuration\n */\nclass Config implements AppConfig {\n public user_agent: string;\n public uplinks: any;\n public packages: PackageList;\n public users: any;\n public auth: AuthConf;\n public server_id: string;\n public config_path: string;\n public storage: string | void;\n public plugins: string | void;\n public security: Security;\n public serverSettings: ServerSettingsConf;\n // @ts-ignore\n public secret: string;\n public flags: FlagsConfig;\n\n public constructor(config: ConfigRuntime) {\n const self = this;\n this.storage = process.env.VERDACCIO_STORAGE_PATH || config.storage;\n this.config_path = config.config_path;\n this.plugins = config.plugins;\n this.security = _.merge(defaultSecurity, config.security);\n this.serverSettings = serverSettings;\n this.flags = {\n searchRemote: config.flags?.searchRemote ?? true,\n };\n\n for (const configProp in config) {\n if (self[configProp] == null) {\n self[configProp] = config[configProp];\n }\n }\n\n // @ts-ignore\n if (_.isNil(this.user_agent)) {\n this.user_agent = getUserAgent();\n }\n\n // some weird shell scripts are valid yaml files parsed as string\n assert(_.isObject(config), APP_ERROR.CONFIG_NOT_VALID);\n\n // sanity check for strategic config properties\n strategicConfigProps.forEach(function (x): void {\n if (self[x] == null) {\n self[x] = {};\n }\n\n assert(isObject(self[x]), `CONFIG: bad \"${x}\" value (object expected)`);\n });\n\n this.uplinks = sanityCheckUplinksProps(uplinkSanityCheck(this.uplinks));\n this.packages = normalisePackageAccess(self.packages);\n\n // loading these from ENV if aren't in config\n allowedEnvConfig.forEach((envConf): void => {\n if (!(envConf in self)) {\n self[envConf] = process.env[envConf] || process.env[envConf.toUpperCase()];\n }\n });\n\n // unique identifier of self server (or a cluster), used to avoid loops\n // @ts-ignore\n if (!this.server_id) {\n this.server_id = generateRandomHexString(6);\n }\n }\n\n /**\n * Check for package spec\n */\n public getMatchedPackagesSpec(pkgName: string): PackageAccess | void {\n // TODO: remove this method and replace by library utils\n return getMatchedPackagesSpec(pkgName, this.packages);\n }\n\n /**\n * Store or create whether receive a secret key\n */\n public checkSecretKey(secret?: string): string {\n debug('check secret key');\n if (_.isString(secret) && _.isEmpty(secret) === false) {\n this.secret = secret;\n debug('reusing previous key');\n return secret;\n }\n // it generates a secret key\n // FUTURE: this might be an external secret key, perhaps within config file?\n debug('generate a new key');\n this.secret = generateRandomSecretKey();\n return this.secret;\n }\n}\n\nexport { Config };\n"],"file":"config.js"}
|
package/build/package-access.js
CHANGED
|
@@ -15,12 +15,6 @@ var _core = require("@verdaccio/core");
|
|
|
15
15
|
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
17
|
|
|
18
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
19
|
-
|
|
20
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
21
|
-
|
|
22
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
23
|
-
|
|
24
18
|
const ROLES = {
|
|
25
19
|
$ALL: '$all',
|
|
26
20
|
ALL: 'all',
|
|
@@ -58,7 +52,8 @@ function normalizeUserList(groupsList) {
|
|
|
58
52
|
}
|
|
59
53
|
|
|
60
54
|
function normalisePackageAccess(packages) {
|
|
61
|
-
const normalizedPkgs =
|
|
55
|
+
const normalizedPkgs = { ...packages
|
|
56
|
+
};
|
|
62
57
|
|
|
63
58
|
if (_lodash.default.isNil(normalizedPkgs['**'])) {
|
|
64
59
|
normalizedPkgs['**'] = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/package-access.ts"],"names":["ROLES","$ALL","ALL","$AUTH","$ANONYMOUS","DEPRECATED_ALL","DEPRECATED_AUTH","DEPRECATED_ANONYMOUS","PACKAGE_ACCESS","SCOPE","normalizeUserList","groupsList","result","_","isNil","isString","groupsArray","split","push","Array","isArray","errorUtils","getInternalError","JSON","stringify","flatten","normalisePackageAccess","packages","normalizedPkgs","access","publish","unpublish","proxy","pkg","Object","prototype","hasOwnProperty","call","packageAccess","isInvalid","isObject","isUndefined"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEA
|
|
1
|
+
{"version":3,"sources":["../src/package-access.ts"],"names":["ROLES","$ALL","ALL","$AUTH","$ANONYMOUS","DEPRECATED_ALL","DEPRECATED_AUTH","DEPRECATED_ANONYMOUS","PACKAGE_ACCESS","SCOPE","normalizeUserList","groupsList","result","_","isNil","isString","groupsArray","split","push","Array","isArray","errorUtils","getInternalError","JSON","stringify","flatten","normalisePackageAccess","packages","normalizedPkgs","access","publish","unpublish","proxy","pkg","Object","prototype","hasOwnProperty","call","packageAccess","isInvalid","isObject","isUndefined"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEA;;;;AAOO,MAAMA,KAAK,GAAG;AACnBC,EAAAA,IAAI,EAAE,MADa;AAEnBC,EAAAA,GAAG,EAAE,KAFc;AAGnBC,EAAAA,KAAK,EAAE,gBAHY;AAInBC,EAAAA,UAAU,EAAE,YAJO;AAKnBC,EAAAA,cAAc,EAAE,MALG;AAMnBC,EAAAA,eAAe,EAAE,gBANE;AAOnBC,EAAAA,oBAAoB,EAAE;AAPH,CAAd;;AAUA,MAAMC,cAAc,GAAG;AAC5BC,EAAAA,KAAK,EAAE,MADqB;AAE5BP,EAAAA,GAAG,EAAE;AAFuB,CAAvB;;;AAKA,SAASQ,iBAAT,CAA2BC,UAA3B,EAAiD;AACtD,QAAMC,MAAa,GAAG,EAAtB;;AACA,MAAIC,gBAAEC,KAAF,CAAQH,UAAR,CAAJ,EAAyB;AACvB,WAAOC,MAAP;AACD,GAJqD,CAMtD;;;AACA,MAAIC,gBAAEE,QAAF,CAAWJ,UAAX,CAAJ,EAA4B;AAC1B,UAAMK,WAAW,GAAGL,UAAU,CAACM,KAAX,CAAiB,KAAjB,CAApB;AAEAL,IAAAA,MAAM,CAACM,IAAP,CAAYF,WAAZ;AACD,GAJD,MAIO,IAAIG,KAAK,CAACC,OAAN,CAAcT,UAAd,CAAJ,EAA+B;AACpCC,IAAAA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7C,CAPuD,CAQvD;;AACAJ,MAAAA,cAAc,CAACK,GAAD,CAAd,CAAoBF,SAApB,GAAgClB,gBAAE4B,WAAF,CAAcH,aAAa,CAACP,SAA5B,IAC5B,KAD4B,GAE5BrB,iBAAiB,CAAC4B,aAAa,CAACP,SAAf,CAFrB;AAGD;AACF;;AAED,SAAOH,cAAP;AACD","sourcesContent":["import assert from 'assert';\nimport _ from 'lodash';\n\nimport { errorUtils } from '@verdaccio/core';\nimport { PackageAccess } from '@verdaccio/types';\n\nexport interface LegacyPackageList {\n [key: string]: PackageAccess;\n}\n\nexport const ROLES = {\n $ALL: '$all',\n ALL: 'all',\n $AUTH: '$authenticated',\n $ANONYMOUS: '$anonymous',\n DEPRECATED_ALL: '@all',\n DEPRECATED_AUTH: '@authenticated',\n DEPRECATED_ANONYMOUS: '@anonymous',\n};\n\nexport const PACKAGE_ACCESS = {\n SCOPE: '@*/*',\n ALL: '**',\n};\n\nexport function normalizeUserList(groupsList: any): any {\n const result: any[] = [];\n if (_.isNil(groupsList)) {\n return result;\n }\n\n // if it's a string, split it to array\n if (_.isString(groupsList)) {\n const groupsArray = groupsList.split(/\\s+/);\n\n result.push(groupsArray);\n } else if (Array.isArray(groupsList)) {\n result.push(groupsList);\n } else {\n throw errorUtils.getInternalError(\n 'CONFIG: bad package acl (array or string expected): ' + JSON.stringify(groupsList)\n );\n }\n\n return _.flatten(result);\n}\n\nexport function normalisePackageAccess(packages: LegacyPackageList): LegacyPackageList {\n const normalizedPkgs: LegacyPackageList = { ...packages };\n if (_.isNil(normalizedPkgs['**'])) {\n normalizedPkgs['**'] = {\n access: [],\n publish: [],\n unpublish: [],\n proxy: [],\n };\n }\n\n for (const pkg in packages) {\n if (Object.prototype.hasOwnProperty.call(packages, pkg)) {\n const packageAccess = packages[pkg];\n const isInvalid = _.isObject(packageAccess) && _.isArray(packageAccess) === false;\n assert(isInvalid, `CONFIG: bad \"'${pkg}'\" package description (object expected)`);\n\n normalizedPkgs[pkg].access = normalizeUserList(packageAccess.access);\n normalizedPkgs[pkg].publish = normalizeUserList(packageAccess.publish);\n normalizedPkgs[pkg].proxy = normalizeUserList(packageAccess.proxy);\n // if unpublish is not defined, we set to false to fallback in publish access\n normalizedPkgs[pkg].unpublish = _.isUndefined(packageAccess.unpublish)\n ? false\n : normalizeUserList(packageAccess.unpublish);\n }\n }\n\n return normalizedPkgs;\n}\n"],"file":"package-access.js"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@verdaccio/config",
|
|
3
|
-
"version": "6.0.0-6-next.
|
|
3
|
+
"version": "6.0.0-6-next.14",
|
|
4
4
|
"description": "logger",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
"npm": ">=6"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@verdaccio/core": "6.0.0-6-next.
|
|
34
|
-
"@verdaccio/utils": "6.0.0-6-next.
|
|
35
|
-
"debug": "4.3.
|
|
33
|
+
"@verdaccio/core": "6.0.0-6-next.5",
|
|
34
|
+
"@verdaccio/utils": "6.0.0-6-next.11",
|
|
35
|
+
"debug": "4.3.3",
|
|
36
36
|
"js-yaml": "3.14.1",
|
|
37
37
|
"lodash": "4.17.21",
|
|
38
38
|
"minimatch": "3.0.4",
|
package/src/conf/default.yaml
CHANGED
|
@@ -3,15 +3,13 @@
|
|
|
3
3
|
# so don't use it on production systems.
|
|
4
4
|
#
|
|
5
5
|
# Look here for more config file examples:
|
|
6
|
-
# https://github.com/verdaccio/verdaccio/tree/master/conf
|
|
6
|
+
# https://github.com/verdaccio/verdaccio/tree/master/packages/config/src/conf
|
|
7
7
|
#
|
|
8
8
|
|
|
9
9
|
# path to a directory with all packages
|
|
10
10
|
storage: ./storage
|
|
11
11
|
# path to a directory with plugins to include
|
|
12
12
|
plugins: ./plugins
|
|
13
|
-
# print logs
|
|
14
|
-
# logs: ./logs
|
|
15
13
|
|
|
16
14
|
web:
|
|
17
15
|
title: Verdaccio
|
|
@@ -21,6 +19,17 @@ web:
|
|
|
21
19
|
# sort_packages: asc
|
|
22
20
|
# convert your UI to the dark side
|
|
23
21
|
# darkMode: true
|
|
22
|
+
# html_cache: true
|
|
23
|
+
# by default all features are displayed
|
|
24
|
+
# login: true
|
|
25
|
+
# showInfo: true
|
|
26
|
+
# showSettings: true
|
|
27
|
+
# In combination with darkMode you can force specific theme
|
|
28
|
+
# showThemeSwitch: true
|
|
29
|
+
# showFooter: true
|
|
30
|
+
# showSearch: true
|
|
31
|
+
# showRaw: true
|
|
32
|
+
# showDownloadTarball: true
|
|
24
33
|
# HTML tags injected after manifest <scripts/>
|
|
25
34
|
# scriptsBodyAfter:
|
|
26
35
|
# - '<script type="text/javascript" src="https://my.company.com/customJS.min.js"></script>'
|
|
@@ -67,7 +76,7 @@ packages:
|
|
|
67
76
|
# and three keywords: "$all", "$anonymous", "$authenticated"
|
|
68
77
|
access: $all
|
|
69
78
|
|
|
70
|
-
# allow all known users to publish/
|
|
79
|
+
# allow all known users to publish/unpublish packages
|
|
71
80
|
# (anyone can register by default, remember?)
|
|
72
81
|
publish: $authenticated
|
|
73
82
|
unpublish: $authenticated
|
|
@@ -87,7 +96,7 @@ middlewares:
|
|
|
87
96
|
enabled: true
|
|
88
97
|
|
|
89
98
|
# log settings
|
|
90
|
-
|
|
99
|
+
log:
|
|
91
100
|
# Logger as STDOUT
|
|
92
101
|
{ type: stdout, format: pretty, level: http }
|
|
93
102
|
# Logger as STDOUT as JSON
|
package/src/conf/docker.yaml
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
# see https://verdaccio.org/docs/en/docker#docker-and-custom-port-configuration
|
|
8
8
|
#
|
|
9
9
|
# Look here for more config file examples:
|
|
10
|
-
# https://github.com/verdaccio/verdaccio/tree/master/conf
|
|
10
|
+
# https://github.com/verdaccio/verdaccio/tree/master/packages/config/src/conf
|
|
11
11
|
#
|
|
12
12
|
|
|
13
13
|
# path to a directory with all packages
|
|
@@ -23,7 +23,32 @@ web:
|
|
|
23
23
|
# gravatar: false
|
|
24
24
|
# by default packages are ordercer ascendant (asc|desc)
|
|
25
25
|
# sort_packages: asc
|
|
26
|
+
# convert your UI to the dark side
|
|
26
27
|
# darkMode: true
|
|
28
|
+
# html_cache: true
|
|
29
|
+
# by default all features are displayed
|
|
30
|
+
# login: true
|
|
31
|
+
# showInfo: true
|
|
32
|
+
# showSettings: true
|
|
33
|
+
# In combination with darkMode you can force specific theme
|
|
34
|
+
# showThemeSwitch: true
|
|
35
|
+
# showFooter: true
|
|
36
|
+
# showSearch: true
|
|
37
|
+
# showRaw: true
|
|
38
|
+
# showDownloadTarball: true
|
|
39
|
+
# HTML tags injected after manifest <scripts/>
|
|
40
|
+
# scriptsBodyAfter:
|
|
41
|
+
# - '<script type="text/javascript" src="https://my.company.com/customJS.min.js"></script>'
|
|
42
|
+
# HTML tags injected before ends </head>
|
|
43
|
+
# metaScripts:
|
|
44
|
+
# - '<script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>'
|
|
45
|
+
# - '<script type="text/javascript" src="https://browser.sentry-cdn.com/5.15.5/bundle.min.js"></script>'
|
|
46
|
+
# - '<meta name="robots" content="noindex" />'
|
|
47
|
+
# HTML tags injected first child at <body/>
|
|
48
|
+
# bodyBefore:
|
|
49
|
+
# - '<div id="myId">html before webpack scripts</div>'
|
|
50
|
+
# Public path for template manifest scripts (only manifest)
|
|
51
|
+
# publicPath: http://somedomain.org/
|
|
27
52
|
|
|
28
53
|
# translate your registry, api i18n not available yet
|
|
29
54
|
# i18n:
|
|
@@ -58,7 +83,7 @@ packages:
|
|
|
58
83
|
# and three keywords: "$all", "$anonymous", "$authenticated"
|
|
59
84
|
access: $all
|
|
60
85
|
|
|
61
|
-
# allow all known users to publish/
|
|
86
|
+
# allow all known users to publish/unpublish packages
|
|
62
87
|
# (anyone can register by default, remember?)
|
|
63
88
|
publish: $authenticated
|
|
64
89
|
unpublish: $authenticated
|
|
@@ -72,7 +97,7 @@ middlewares:
|
|
|
72
97
|
|
|
73
98
|
# log settings
|
|
74
99
|
# log settings
|
|
75
|
-
|
|
100
|
+
log:
|
|
76
101
|
# Logger as STDOUT
|
|
77
102
|
{ type: stdout, format: pretty, level: http }
|
|
78
103
|
# Logger as STDOUT as JSON
|
package/src/config.ts
CHANGED
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
Config as AppConfig,
|
|
8
8
|
AuthConf,
|
|
9
9
|
ConfigRuntime,
|
|
10
|
+
FlagsConfig,
|
|
10
11
|
PackageAccess,
|
|
11
12
|
PackageList,
|
|
12
13
|
Security,
|
|
@@ -44,6 +45,7 @@ class Config implements AppConfig {
|
|
|
44
45
|
public serverSettings: ServerSettingsConf;
|
|
45
46
|
// @ts-ignore
|
|
46
47
|
public secret: string;
|
|
48
|
+
public flags: FlagsConfig;
|
|
47
49
|
|
|
48
50
|
public constructor(config: ConfigRuntime) {
|
|
49
51
|
const self = this;
|
|
@@ -52,6 +54,9 @@ class Config implements AppConfig {
|
|
|
52
54
|
this.plugins = config.plugins;
|
|
53
55
|
this.security = _.merge(defaultSecurity, config.security);
|
|
54
56
|
this.serverSettings = serverSettings;
|
|
57
|
+
this.flags = {
|
|
58
|
+
searchRemote: config.flags?.searchRemote ?? true,
|
|
59
|
+
};
|
|
55
60
|
|
|
56
61
|
for (const configProp in config) {
|
|
57
62
|
if (self[configProp] == null) {
|
package/test/config.spec.ts
CHANGED
|
@@ -57,11 +57,11 @@ describe('check basic content parsed file', () => {
|
|
|
57
57
|
expect(config.middlewares).toBeDefined();
|
|
58
58
|
expect(config.middlewares.audit).toBeDefined();
|
|
59
59
|
expect(config.middlewares.audit.enabled).toBeTruthy();
|
|
60
|
-
//
|
|
61
|
-
expect(config.
|
|
62
|
-
expect(config.
|
|
63
|
-
expect(config.
|
|
64
|
-
expect(config.
|
|
60
|
+
// log
|
|
61
|
+
expect(config.log).toBeDefined();
|
|
62
|
+
expect(config.log.type).toEqual('stdout');
|
|
63
|
+
expect(config.log.format).toEqual('pretty');
|
|
64
|
+
expect(config.log.level).toEqual('http');
|
|
65
65
|
// must not be enabled by default
|
|
66
66
|
expect(config.notify).toBeUndefined();
|
|
67
67
|
expect(config.store).toBeUndefined();
|
|
@@ -11,5 +11,5 @@ module.exports = {
|
|
|
11
11
|
vue: { access: '$authenticated', publish: '$authenticated', proxy: 'npmjs' },
|
|
12
12
|
'*': { access: '$all', publish: '$all', proxy: 'npmjs' },
|
|
13
13
|
},
|
|
14
|
-
|
|
14
|
+
log: { type: 'stdout', format: 'pretty', level: 'warn' },
|
|
15
15
|
};
|