@verdaccio/config 7.0.0-next.6 → 8.0.0-next-8.0
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 +167 -0
- package/README.md +69 -0
- package/build/agent.js +1 -1
- package/build/agent.js.map +1 -1
- package/build/builder.js +2 -3
- package/build/builder.js.map +1 -1
- package/build/conf/default.yaml +10 -1
- package/build/conf/docker.yaml +10 -1
- package/build/conf/index.js.map +1 -1
- package/build/config-path.d.ts +2 -3
- package/build/config-path.js +51 -22
- package/build/config-path.js.map +1 -1
- package/build/config-utils.js +14 -3
- package/build/config-utils.js.map +1 -1
- package/build/config.d.ts +13 -5
- package/build/config.js +71 -35
- package/build/config.js.map +1 -1
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/build/package-access.js +4 -1
- package/build/package-access.js.map +1 -1
- package/build/parse.js +1 -1
- package/build/parse.js.map +1 -1
- package/build/security.js +2 -1
- package/build/security.js.map +1 -1
- package/build/serverSettings.js.map +1 -1
- package/build/token.d.ts +1 -0
- package/build/token.js +2 -0
- package/build/token.js.map +1 -1
- package/build/uplinks.js +1 -1
- package/build/uplinks.js.map +1 -1
- package/build/user.js.map +1 -1
- package/package.json +8 -10
- package/src/builder.ts +1 -2
- package/src/conf/default.yaml +10 -1
- package/src/conf/docker.yaml +10 -1
- package/src/config-path.ts +57 -25
- package/src/config-utils.ts +13 -2
- package/src/config.ts +79 -35
- package/src/package-access.ts +4 -0
- package/src/security.ts +1 -0
- package/src/token.ts +2 -0
- package/test/__snapshots__/builder.spec.ts.snap +2 -2
- package/test/__snapshots__/config-parsing.spec.ts.snap +2 -2
- package/test/agent.spec.ts +2 -0
- package/test/builder.spec.ts +55 -0
- package/test/config-parsing.spec.ts +1 -0
- package/test/config-utils.spec.ts +1 -0
- package/test/config.path.spec.ts +102 -74
- package/test/config.spec.ts +71 -12
- package/test/package-access.spec.ts +1 -0
- package/test/token.spec.ts +2 -0
- package/test/uplinks.spec.ts +2 -0
- package/test/utils.spec.ts +2 -0
- package/jest.config.js +0 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,172 @@
|
|
|
1
1
|
# @verdaccio/config
|
|
2
2
|
|
|
3
|
+
## 8.0.0-next-8.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- chore: move v7 next to v8 next
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
- @verdaccio/core@8.0.0-next-8.0
|
|
13
|
+
- @verdaccio/utils@7.0.1-next-8.0
|
|
14
|
+
|
|
15
|
+
## 7.0.0
|
|
16
|
+
|
|
17
|
+
### Major Changes
|
|
18
|
+
|
|
19
|
+
- 47f61c6: feat!: bump to v7
|
|
20
|
+
- e7ebccb: update major dependencies, remove old nodejs support
|
|
21
|
+
|
|
22
|
+
### Minor Changes
|
|
23
|
+
|
|
24
|
+
- daceb6d: restore legacy support
|
|
25
|
+
- c9962fe: feat: forbidden user interface
|
|
26
|
+
- f047cc8: refactor: auth with legacy sign support
|
|
27
|
+
- bd8703e: feat: add migrateToSecureLegacySignature and remove enhancedLegacySignature property
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- 10dd81f: feat: complete overhaul of web user interface
|
|
32
|
+
- 6e764e3: feat: add support for npm owner
|
|
33
|
+
- 8c10a3e: chore: improve debug code and refactor code
|
|
34
|
+
- a99a4bb: fix config builder erroring when passed partial config
|
|
35
|
+
- a05a7d8: fix(config): test runs on Windows
|
|
36
|
+
- c31aec8: fix: typo in config docs regarding check_owners
|
|
37
|
+
- 4d96324: chore(config): increase test coverage
|
|
38
|
+
- Updated dependencies [47f61c6]
|
|
39
|
+
- Updated dependencies [6e764e3]
|
|
40
|
+
- Updated dependencies [daceb6d]
|
|
41
|
+
- Updated dependencies [e7ebccb]
|
|
42
|
+
- Updated dependencies [f047cc8]
|
|
43
|
+
- Updated dependencies [7c9f3cf]
|
|
44
|
+
- Updated dependencies [bd8703e]
|
|
45
|
+
- @verdaccio/core@7.0.0
|
|
46
|
+
- @verdaccio/utils@7.0.0
|
|
47
|
+
|
|
48
|
+
## 7.0.0-next-8.21
|
|
49
|
+
|
|
50
|
+
### Patch Changes
|
|
51
|
+
|
|
52
|
+
- 8c10a3e: chore: improve debug code and refactor code
|
|
53
|
+
- a05a7d8: fix(config): test runs on Windows
|
|
54
|
+
- Updated dependencies [7c9f3cf]
|
|
55
|
+
- @verdaccio/core@7.0.0-next-8.21
|
|
56
|
+
- @verdaccio/utils@7.0.0-next-8.21
|
|
57
|
+
|
|
58
|
+
## 7.0.0-next-7.20
|
|
59
|
+
|
|
60
|
+
### Patch Changes
|
|
61
|
+
|
|
62
|
+
- @verdaccio/core@7.0.0-next-7.20
|
|
63
|
+
- @verdaccio/utils@7.0.0-next-7.20
|
|
64
|
+
|
|
65
|
+
## 7.0.0-next-7.19
|
|
66
|
+
|
|
67
|
+
### Patch Changes
|
|
68
|
+
|
|
69
|
+
- c31aec8: fix: typo in config docs regarding check_owners
|
|
70
|
+
- @verdaccio/core@7.0.0-next-7.19
|
|
71
|
+
- @verdaccio/utils@7.0.0-next-7.19
|
|
72
|
+
|
|
73
|
+
## 7.0.0-next-7.18
|
|
74
|
+
|
|
75
|
+
### Patch Changes
|
|
76
|
+
|
|
77
|
+
- 10dd81f: feat: complete overhaul of web user interface
|
|
78
|
+
- @verdaccio/core@7.0.0-next-7.18
|
|
79
|
+
- @verdaccio/utils@7.0.0-next-7.18
|
|
80
|
+
|
|
81
|
+
## 7.0.0-next-7.17
|
|
82
|
+
|
|
83
|
+
### Patch Changes
|
|
84
|
+
|
|
85
|
+
- 6e764e3: feat: add support for npm owner
|
|
86
|
+
- Updated dependencies [6e764e3]
|
|
87
|
+
- @verdaccio/core@7.0.0-next-7.17
|
|
88
|
+
- @verdaccio/utils@7.0.0-next-7.17
|
|
89
|
+
|
|
90
|
+
## 7.0.0-next-7.16
|
|
91
|
+
|
|
92
|
+
### Patch Changes
|
|
93
|
+
|
|
94
|
+
- @verdaccio/core@7.0.0-next-7.16
|
|
95
|
+
- @verdaccio/utils@7.0.0-next-7.16
|
|
96
|
+
|
|
97
|
+
## 7.0.0-next-7.15
|
|
98
|
+
|
|
99
|
+
### Minor Changes
|
|
100
|
+
|
|
101
|
+
- bd8703e: feat: add migrateToSecureLegacySignature and remove enhancedLegacySignature property
|
|
102
|
+
|
|
103
|
+
### Patch Changes
|
|
104
|
+
|
|
105
|
+
- Updated dependencies [bd8703e]
|
|
106
|
+
- @verdaccio/core@7.0.0-next-7.15
|
|
107
|
+
- @verdaccio/utils@7.0.0-next-7.15
|
|
108
|
+
|
|
109
|
+
## 7.0.0-next-7.14
|
|
110
|
+
|
|
111
|
+
### Patch Changes
|
|
112
|
+
|
|
113
|
+
- @verdaccio/core@7.0.0-next-7.14
|
|
114
|
+
- @verdaccio/utils@7.0.0-next-7.14
|
|
115
|
+
|
|
116
|
+
## 7.0.0-next-7.13
|
|
117
|
+
|
|
118
|
+
### Patch Changes
|
|
119
|
+
|
|
120
|
+
- a99a4bb: fix config builder erroring when passed partial config
|
|
121
|
+
- @verdaccio/core@7.0.0-next-7.13
|
|
122
|
+
- @verdaccio/utils@7.0.0-next-7.13
|
|
123
|
+
|
|
124
|
+
## 7.0.0-next-7.12
|
|
125
|
+
|
|
126
|
+
### Patch Changes
|
|
127
|
+
|
|
128
|
+
- @verdaccio/core@7.0.0-next-7.12
|
|
129
|
+
- @verdaccio/utils@7.0.0-next-7.12
|
|
130
|
+
|
|
131
|
+
## 7.0.0-next-7.11
|
|
132
|
+
|
|
133
|
+
### Minor Changes
|
|
134
|
+
|
|
135
|
+
- c9962fe: feat: forbidden user interface
|
|
136
|
+
|
|
137
|
+
### Patch Changes
|
|
138
|
+
|
|
139
|
+
- @verdaccio/core@7.0.0-next-7.11
|
|
140
|
+
- @verdaccio/utils@7.0.0-next-7.11
|
|
141
|
+
|
|
142
|
+
## 7.0.0-next-7.10
|
|
143
|
+
|
|
144
|
+
### Patch Changes
|
|
145
|
+
|
|
146
|
+
- @verdaccio/core@7.0.0-next-7.10
|
|
147
|
+
- @verdaccio/utils@7.0.0-next-7.10
|
|
148
|
+
|
|
149
|
+
## 7.0.0-next-7.9
|
|
150
|
+
|
|
151
|
+
### Patch Changes
|
|
152
|
+
|
|
153
|
+
- @verdaccio/core@7.0.0-next-7.9
|
|
154
|
+
- @verdaccio/utils@7.0.0-next-7.9
|
|
155
|
+
|
|
156
|
+
## 7.0.0-next-7.8
|
|
157
|
+
|
|
158
|
+
### Patch Changes
|
|
159
|
+
|
|
160
|
+
- @verdaccio/core@7.0.0-next-7.8
|
|
161
|
+
- @verdaccio/utils@7.0.0-next-7.8
|
|
162
|
+
|
|
163
|
+
## 7.0.0-next-7.7
|
|
164
|
+
|
|
165
|
+
### Patch Changes
|
|
166
|
+
|
|
167
|
+
- @verdaccio/core@7.0.0-next-7.7
|
|
168
|
+
- @verdaccio/utils@7.0.0-next-7.7
|
|
169
|
+
|
|
3
170
|
## 7.0.0-next.6
|
|
4
171
|
|
|
5
172
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,5 +1,74 @@
|
|
|
1
1
|
# @verdaccio/config
|
|
2
2
|
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
The `@verdaccio/config` package provides a powerful configuration builder constructor for programmatically creating configuration objects for Verdaccio, a lightweight private npm proxy registry. With this package, users can easily manage various configuration aspects such as package access, uplinks, security settings, authentication, logging, and storage options.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
You can install via npm:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @verdaccio/config
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
To start using `@verdaccio/config`, import the `ConfigBuilder` class and begin constructing your configuration object:
|
|
18
|
+
|
|
19
|
+
## `ConfigBuilder` constructor
|
|
20
|
+
|
|
21
|
+
The `ConfigBuilder` class is a helper configuration builder constructor used to programmatically create configuration objects for testing or other purposes.
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
|
|
25
|
+
import { ConfigBuilder } from '@verdaccio/config';
|
|
26
|
+
|
|
27
|
+
// Create a new configuration builder instance
|
|
28
|
+
const config = ConfigBuilder.build({ security: { api: { legacy: false } } });
|
|
29
|
+
|
|
30
|
+
// Add package access configuration
|
|
31
|
+
configBuilder.addPackageAccess('@scope/*', { access: 'read', publish: 'write' });
|
|
32
|
+
|
|
33
|
+
// Add an uplink configuration
|
|
34
|
+
configBuilder.addUplink('npmjs', { url: 'https://registry.npmjs.org/' });
|
|
35
|
+
|
|
36
|
+
// Add security configuration
|
|
37
|
+
configBuilder.addSecurity({ allow_offline: true });
|
|
38
|
+
|
|
39
|
+
// Get the configuration object
|
|
40
|
+
const config = configBuilder.getConfig();
|
|
41
|
+
|
|
42
|
+
// Get the configuration yaml text
|
|
43
|
+
const config = configBuilder.getAsYaml();
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Methods
|
|
47
|
+
|
|
48
|
+
- `addPackageAccess(pattern: string, pkgAccess: PackageAccessYaml)`: Adds package access configuration.
|
|
49
|
+
- `addUplink(id: string, uplink: UpLinkConf)`: Adds an uplink configuration.
|
|
50
|
+
- `addSecurity(security: Partial<Security>)`: Adds security configuration.
|
|
51
|
+
- `addAuth(auth: Partial<AuthConf>)`: Adds authentication configuration.
|
|
52
|
+
- `addLogger(log: LoggerConfItem)`: Adds logger configuration.
|
|
53
|
+
- `addStorage(storage: string | object)`: Adds storage configuration.
|
|
54
|
+
- `getConfig(): ConfigYaml`: Retrieves the configuration object.
|
|
55
|
+
- `getAsYaml(): string`: Retrieves the configuration object as YAML format.
|
|
56
|
+
|
|
57
|
+
## `getDefaultConfig`
|
|
58
|
+
|
|
59
|
+
This method is available in the package's index and retrieves the default configuration object.
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
import { getDefaultConfig } from '@verdaccio/config';
|
|
63
|
+
|
|
64
|
+
const defaultConfig = getDefaultConfig();
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Other Methods
|
|
68
|
+
|
|
69
|
+
- `fromJStoYAML(config: ConfigYaml): string`: Converts a JavaScript configuration object to YAML format.
|
|
70
|
+
- `parseConfigFile(filePath: string): ConfigYaml`: Parses a configuration file from the specified path and returns the configuration object.
|
|
71
|
+
|
|
3
72
|
### License
|
|
4
73
|
|
|
5
74
|
Verdaccio is [MIT licensed](https://github.com/verdaccio/verdaccio/blob/master/LICENSE)
|
package/build/agent.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getUserAgent = getUserAgent;
|
|
7
7
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
8
|
-
function _interopRequireDefault(
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
9
|
function getUserAgent(customUserAgent, version, name) {
|
|
10
10
|
if (customUserAgent === true) {
|
|
11
11
|
return `${name}/${version}`;
|
package/build/agent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.js","names":["_lodash","_interopRequireDefault","require","
|
|
1
|
+
{"version":3,"file":"agent.js","names":["_lodash","_interopRequireDefault","require","e","__esModule","default","getUserAgent","customUserAgent","version","name","_","isString","isEmpty"],"sources":["../src/agent.ts"],"sourcesContent":["import _ from 'lodash';\n\nexport function getUserAgent(\n customUserAgent?: boolean | string,\n version?: string,\n name?: string\n): string {\n if (customUserAgent === true) {\n return `${name}/${version}`;\n } else if (_.isString(customUserAgent) && _.isEmpty(customUserAgent) === false) {\n return customUserAgent;\n } else if (customUserAgent === false) {\n return 'hidden';\n }\n\n return `${name}/${version}`;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAuB,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEhB,SAASG,YAAYA,CAC1BC,eAAkC,EAClCC,OAAgB,EAChBC,IAAa,EACL;EACR,IAAIF,eAAe,KAAK,IAAI,EAAE;IAC5B,OAAO,GAAGE,IAAI,IAAID,OAAO,EAAE;EAC7B,CAAC,MAAM,IAAIE,eAAC,CAACC,QAAQ,CAACJ,eAAe,CAAC,IAAIG,eAAC,CAACE,OAAO,CAACL,eAAe,CAAC,KAAK,KAAK,EAAE;IAC9E,OAAOA,eAAe;EACxB,CAAC,MAAM,IAAIA,eAAe,KAAK,KAAK,EAAE;IACpC,OAAO,QAAQ;EACjB;EAEA,OAAO,GAAGE,IAAI,IAAID,OAAO,EAAE;AAC7B","ignoreList":[]}
|
package/build/builder.js
CHANGED
|
@@ -12,12 +12,11 @@ var _ = require(".");
|
|
|
12
12
|
*/
|
|
13
13
|
class ConfigBuilder {
|
|
14
14
|
constructor(config) {
|
|
15
|
-
|
|
16
|
-
this.config = config !== null && config !== void 0 ? config : {
|
|
15
|
+
this.config = (0, _lodash.merge)(config, {
|
|
17
16
|
uplinks: {},
|
|
18
17
|
packages: {},
|
|
19
18
|
security: {}
|
|
20
|
-
};
|
|
19
|
+
});
|
|
21
20
|
}
|
|
22
21
|
static build(config) {
|
|
23
22
|
return new ConfigBuilder(config);
|
package/build/builder.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder.js","names":["_lodash","require","_","ConfigBuilder","constructor","config","uplinks","packages","security","build","addPackageAccess","pattern","pkgAccess","addUplink","id","uplink","addSecurity","
|
|
1
|
+
{"version":3,"file":"builder.js","names":["_lodash","require","_","ConfigBuilder","constructor","config","merge","uplinks","packages","security","build","addPackageAccess","pattern","pkgAccess","addUplink","id","uplink","addSecurity","addAuth","auth","addLogger","log","addStorage","storage","store","getConfig","getAsYaml","fromJStoYAML","exports","default"],"sources":["../src/builder.ts"],"sourcesContent":["import { merge } from 'lodash';\n\nimport {\n AuthConf,\n ConfigYaml,\n LoggerConfItem,\n PackageAccessYaml,\n Security,\n UpLinkConf,\n} from '@verdaccio/types';\n\nimport { fromJStoYAML } from '.';\n\n/**\n * Helper configuration builder constructor, used to build the configuration for testing or\n * programatically creating a configuration.\n */\nexport default class ConfigBuilder {\n private config: ConfigYaml;\n\n public constructor(config?: Partial<ConfigYaml>) {\n this.config = merge(config, { uplinks: {}, packages: {}, security: {} });\n }\n\n public static build(config?: Partial<ConfigYaml>): ConfigBuilder {\n return new ConfigBuilder(config);\n }\n\n public addPackageAccess(pattern: string, pkgAccess: PackageAccessYaml) {\n // @ts-ignore\n this.config.packages[pattern] = pkgAccess;\n return this;\n }\n\n public addUplink(id: string, uplink: UpLinkConf) {\n this.config.uplinks[id] = uplink;\n return this;\n }\n\n public addSecurity(security: Partial<Security>) {\n this.config.security = merge(this.config.security, security);\n return this;\n }\n\n public addAuth(auth: Partial<AuthConf>) {\n this.config.auth = merge(this.config.auth, auth);\n return this;\n }\n\n public addLogger(log: LoggerConfItem) {\n this.config.log = log;\n return this;\n }\n\n public addStorage(storage: string | object) {\n if (typeof storage === 'string') {\n this.config.storage = storage;\n } else {\n this.config.store = storage;\n }\n return this;\n }\n\n public getConfig(): ConfigYaml {\n return this.config;\n }\n\n public getAsYaml(): string {\n return fromJStoYAML(this.config) as string;\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAWA,IAAAC,CAAA,GAAAD,OAAA;AAEA;AACA;AACA;AACA;AACe,MAAME,aAAa,CAAC;EAG1BC,WAAWA,CAACC,MAA4B,EAAE;IAC/C,IAAI,CAACA,MAAM,GAAG,IAAAC,aAAK,EAACD,MAAM,EAAE;MAAEE,OAAO,EAAE,CAAC,CAAC;MAAEC,QAAQ,EAAE,CAAC,CAAC;MAAEC,QAAQ,EAAE,CAAC;IAAE,CAAC,CAAC;EAC1E;EAEA,OAAcC,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B,aAAA","ignoreList":[]}
|
package/build/conf/default.yaml
CHANGED
|
@@ -18,6 +18,12 @@ storage: ./storage
|
|
|
18
18
|
# https://verdaccio.org/docs/webui
|
|
19
19
|
web:
|
|
20
20
|
title: Verdaccio
|
|
21
|
+
# custom colors for header background and font
|
|
22
|
+
# primaryColor: "#4b5e40"
|
|
23
|
+
# custom logos and favicon
|
|
24
|
+
# logo: ./path/to/logo.png
|
|
25
|
+
# logoDark: ./path/to/logoDark.png
|
|
26
|
+
# favicon: ./path/to/favicon.ico
|
|
21
27
|
# comment out to disable gravatar support
|
|
22
28
|
# gravatar: false
|
|
23
29
|
# by default packages are ordercer ascendant (asc|desc)
|
|
@@ -35,6 +41,7 @@ web:
|
|
|
35
41
|
# showSearch: true
|
|
36
42
|
# showRaw: true
|
|
37
43
|
# showDownloadTarball: true
|
|
44
|
+
# showUplinks: true
|
|
38
45
|
# HTML tags injected after manifest <scripts/>
|
|
39
46
|
# scriptsBodyAfter:
|
|
40
47
|
# - '<script type="text/javascript" src="https://my.company.com/customJS.min.js"></script>'
|
|
@@ -82,7 +89,7 @@ packages:
|
|
|
82
89
|
# and three keywords: "$all", "$anonymous", "$authenticated"
|
|
83
90
|
access: $all
|
|
84
91
|
|
|
85
|
-
# allow all known users to publish/
|
|
92
|
+
# allow all known users to publish/unpublish packages
|
|
86
93
|
# (anyone can register by default, remember?)
|
|
87
94
|
publish: $authenticated
|
|
88
95
|
unpublish: $authenticated
|
|
@@ -113,6 +120,7 @@ server:
|
|
|
113
120
|
# https://verdaccio.org/docs/configuration#offline-publish
|
|
114
121
|
# publish:
|
|
115
122
|
# allow_offline: false
|
|
123
|
+
# check_owners: false
|
|
116
124
|
|
|
117
125
|
# https://verdaccio.org/docs/configuration#url-prefix
|
|
118
126
|
# url_prefix: /verdaccio/
|
|
@@ -179,6 +187,7 @@ server:
|
|
|
179
187
|
middlewares:
|
|
180
188
|
audit:
|
|
181
189
|
enabled: true
|
|
190
|
+
# timeout: 10000
|
|
182
191
|
|
|
183
192
|
# https://verdaccio.org/docs/logger
|
|
184
193
|
# log settings
|
package/build/conf/docker.yaml
CHANGED
|
@@ -21,6 +21,12 @@ plugins: /verdaccio/plugins
|
|
|
21
21
|
# https://verdaccio.org/docs/webui
|
|
22
22
|
web:
|
|
23
23
|
title: Verdaccio
|
|
24
|
+
# custom colors for header background and font
|
|
25
|
+
# primaryColor: "#4b5e40"
|
|
26
|
+
# custom logos and favicon
|
|
27
|
+
# logo: ./path/to/logo.png
|
|
28
|
+
# logoDark: ./path/to/logoDark.png
|
|
29
|
+
# favicon: ./path/to/favicon.ico
|
|
24
30
|
# Comment out to disable gravatar support
|
|
25
31
|
# gravatar: false
|
|
26
32
|
# By default packages are ordered ascendant (asc|desc)
|
|
@@ -38,6 +44,7 @@ web:
|
|
|
38
44
|
# showSearch: true
|
|
39
45
|
# showRaw: true
|
|
40
46
|
# showDownloadTarball: true
|
|
47
|
+
# showUplinks: true
|
|
41
48
|
# HTML tags injected after manifest <scripts/>
|
|
42
49
|
# scriptsBodyAfter:
|
|
43
50
|
# - '<script type="text/javascript" src="https://my.company.com/customJS.min.js"></script>'
|
|
@@ -86,7 +93,7 @@ packages:
|
|
|
86
93
|
# and three keywords: "$all", "$anonymous", "$authenticated"
|
|
87
94
|
access: $all
|
|
88
95
|
|
|
89
|
-
# Allow all known users to publish/
|
|
96
|
+
# Allow all known users to publish/unpublish packages
|
|
90
97
|
# (anyone can register by default, remember?)
|
|
91
98
|
publish: $authenticated
|
|
92
99
|
unpublish: $authenticated
|
|
@@ -119,6 +126,7 @@ server:
|
|
|
119
126
|
# https://verdaccio.org/docs/configuration#offline-publish
|
|
120
127
|
# publish:
|
|
121
128
|
# allow_offline: false
|
|
129
|
+
# check_owners: false
|
|
122
130
|
|
|
123
131
|
# https://verdaccio.org/docs/configuration#url-prefix
|
|
124
132
|
# url_prefix: /verdaccio/
|
|
@@ -185,6 +193,7 @@ server:
|
|
|
185
193
|
middlewares:
|
|
186
194
|
audit:
|
|
187
195
|
enabled: true
|
|
196
|
+
# timeout: 10000
|
|
188
197
|
|
|
189
198
|
# https://verdaccio.org/docs/logger
|
|
190
199
|
# log settings
|
package/build/conf/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_path","require","_parse","getDefaultConfig","fileName","file","join","__dirname","parseConfigFile"],"sources":["../../src/conf/index.ts"],"sourcesContent":["import { join } from 'path';\n\nimport { parseConfigFile } from '../parse';\n\nexport function getDefaultConfig(fileName = 'default.yaml') {\n const file = join(__dirname, `./${fileName}`);\n return parseConfigFile(file);\n}\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAEO,SAASE,gBAAgBA,CAACC,QAAQ,GAAG,cAAc,EAAE;EAC1D,MAAMC,IAAI,GAAG,IAAAC,UAAI,EAACC,SAAS,
|
|
1
|
+
{"version":3,"file":"index.js","names":["_path","require","_parse","getDefaultConfig","fileName","file","join","__dirname","parseConfigFile"],"sources":["../../src/conf/index.ts"],"sourcesContent":["import { join } from 'path';\n\nimport { parseConfigFile } from '../parse';\n\nexport function getDefaultConfig(fileName = 'default.yaml') {\n const file = join(__dirname, `./${fileName}`);\n return parseConfigFile(file);\n}\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAEO,SAASE,gBAAgBA,CAACC,QAAQ,GAAG,cAAc,EAAE;EAC1D,MAAMC,IAAI,GAAG,IAAAC,UAAI,EAACC,SAAS,EAAE,KAAKH,QAAQ,EAAE,CAAC;EAC7C,OAAO,IAAAI,sBAAe,EAACH,IAAI,CAAC;AAC9B","ignoreList":[]}
|
package/build/config-path.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
export type SetupDirectory = {
|
|
3
2
|
path: string;
|
|
4
|
-
type:
|
|
3
|
+
type: 'xdg' | 'win' | 'win32' | 'def' | 'old';
|
|
5
4
|
};
|
|
6
5
|
/**
|
|
7
6
|
* Find and get the first config file that match.
|
|
8
7
|
* @return {String} the config file path
|
|
9
8
|
*/
|
|
10
9
|
declare function findConfigFile(configPath?: string): string;
|
|
11
|
-
export declare function readDefaultConfig():
|
|
10
|
+
export declare function readDefaultConfig(): string;
|
|
12
11
|
export { findConfigFile };
|
package/build/config-path.js
CHANGED
|
@@ -8,31 +8,33 @@ exports.readDefaultConfig = readDefaultConfig;
|
|
|
8
8
|
var _debug = _interopRequireDefault(require("debug"));
|
|
9
9
|
var _fs = _interopRequireDefault(require("fs"));
|
|
10
10
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
11
|
+
var _os = _interopRequireDefault(require("os"));
|
|
11
12
|
var _path = _interopRequireDefault(require("path"));
|
|
12
|
-
var _core = require("@verdaccio/core");
|
|
13
13
|
var _configUtils = require("./config-utils");
|
|
14
|
-
function _interopRequireDefault(
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
15
|
const CONFIG_FILE = 'config.yaml';
|
|
16
16
|
const XDG = 'xdg';
|
|
17
|
-
const WIN = 'win';
|
|
18
|
-
const WIN32 = 'win32';
|
|
19
17
|
// eslint-disable-next-line
|
|
20
18
|
const pkgJSON = {
|
|
21
19
|
name: 'verdaccio'
|
|
22
20
|
};
|
|
23
|
-
const debug = (0, _debug.default)('verdaccio:config');
|
|
21
|
+
const debug = (0, _debug.default)('verdaccio:config:config-path');
|
|
24
22
|
|
|
25
23
|
/**
|
|
26
24
|
* Find and get the first config file that match.
|
|
27
25
|
* @return {String} the config file path
|
|
28
26
|
*/
|
|
29
27
|
function findConfigFile(configPath) {
|
|
28
|
+
debug('searching for config file %o', configPath);
|
|
30
29
|
if (typeof configPath !== 'undefined') {
|
|
31
|
-
|
|
30
|
+
const configLocation = _path.default.resolve(configPath);
|
|
31
|
+
debug('custom location %s', configLocation);
|
|
32
|
+
return configLocation;
|
|
32
33
|
}
|
|
33
34
|
const configPaths = getConfigPaths();
|
|
34
35
|
debug('%o posible locations found', configPaths.length);
|
|
35
|
-
if (
|
|
36
|
+
if (configPaths.length === 0) {
|
|
37
|
+
debug('no configuration files can be processed');
|
|
36
38
|
// this should never happens
|
|
37
39
|
throw new Error('no configuration files can be processed');
|
|
38
40
|
}
|
|
@@ -40,12 +42,12 @@ function findConfigFile(configPath) {
|
|
|
40
42
|
// find the first location that already exist
|
|
41
43
|
const primaryConf = _lodash.default.find(configPaths, configLocation => (0, _configUtils.fileExists)(configLocation.path));
|
|
42
44
|
if (typeof primaryConf !== 'undefined') {
|
|
43
|
-
debug('
|
|
45
|
+
debug('at least one primary location detected at %s', primaryConf === null || primaryConf === void 0 ? void 0 : primaryConf.path);
|
|
44
46
|
return primaryConf.path;
|
|
45
47
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
return createConfigFile(
|
|
48
|
+
debug('no previous location found, creating a new one');
|
|
49
|
+
debug('generating the first match path location %s', configPaths[0].path);
|
|
50
|
+
return createConfigFile(configPaths[0]).path;
|
|
49
51
|
}
|
|
50
52
|
function createConfigFile(configLocation) {
|
|
51
53
|
createConfigFolder(configLocation);
|
|
@@ -56,22 +58,34 @@ function createConfigFile(configLocation) {
|
|
|
56
58
|
function readDefaultConfig() {
|
|
57
59
|
const pathDefaultConf = _path.default.resolve(__dirname, 'conf/default.yaml');
|
|
58
60
|
try {
|
|
59
|
-
debug('default
|
|
61
|
+
debug('the path of default config used from %s', pathDefaultConf);
|
|
60
62
|
_fs.default.accessSync(pathDefaultConf, _fs.default.constants.R_OK);
|
|
63
|
+
debug('configuration file has enough permissions for reading');
|
|
61
64
|
} catch {
|
|
65
|
+
debug('configuration file does not have enough permissions for reading');
|
|
62
66
|
throw new TypeError('configuration file does not have enough permissions for reading');
|
|
63
67
|
}
|
|
64
|
-
|
|
65
|
-
return _fs.default.readFileSync(pathDefaultConf, _core.CHARACTER_ENCODING.UTF8);
|
|
68
|
+
return _fs.default.readFileSync(pathDefaultConf, 'utf8');
|
|
66
69
|
}
|
|
67
70
|
function createConfigFolder(configLocation) {
|
|
68
|
-
|
|
71
|
+
const folder = _path.default.dirname(configLocation.path);
|
|
72
|
+
debug(`creating default config file folder at %o`, folder);
|
|
73
|
+
_fs.default.mkdirSync(folder, {
|
|
69
74
|
recursive: true
|
|
70
75
|
});
|
|
71
|
-
debug(`
|
|
76
|
+
debug(`folder %o created`, folder);
|
|
72
77
|
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Update the storage links to the new location if it is necessary.
|
|
81
|
+
* @param configLocation
|
|
82
|
+
* @param defaultConfig
|
|
83
|
+
* @returns
|
|
84
|
+
*/
|
|
73
85
|
function updateStorageLinks(configLocation, defaultConfig) {
|
|
86
|
+
debug('checking storage links for %s and type %s', configLocation.path, configLocation.type);
|
|
74
87
|
if (configLocation.type !== XDG) {
|
|
88
|
+
debug(`skip storage override for %s`, configLocation.type);
|
|
75
89
|
return defaultConfig;
|
|
76
90
|
}
|
|
77
91
|
|
|
@@ -97,7 +111,7 @@ function getConfigPaths() {
|
|
|
97
111
|
const listPaths = [getXDGDirectory(), getWindowsDirectory(), getRelativeDefaultDirectory(), getOldDirectory()];
|
|
98
112
|
return listPaths.reduce(function (acc, currentValue) {
|
|
99
113
|
if (typeof currentValue !== 'undefined') {
|
|
100
|
-
debug('directory
|
|
114
|
+
debug('posible directory path generated %s for type %s', currentValue === null || currentValue === void 0 ? void 0 : currentValue.path, currentValue.type);
|
|
101
115
|
acc.push(currentValue);
|
|
102
116
|
}
|
|
103
117
|
return acc;
|
|
@@ -106,10 +120,21 @@ function getConfigPaths() {
|
|
|
106
120
|
|
|
107
121
|
/**
|
|
108
122
|
* Get XDG_CONFIG_HOME or HOME location (usually unix)
|
|
123
|
+
*
|
|
124
|
+
* The XDG_CONFIG_HOME environment variable is also part of the XDG Base Directory Specification,
|
|
125
|
+
* which aims to standardize the locations where applications store configuration files and other
|
|
126
|
+
* user-specific data on Unix-like operating systems.
|
|
127
|
+
*
|
|
128
|
+
*
|
|
129
|
+
*
|
|
130
|
+
* https://specifications.freedesktop.org/basedir-spec/latest/
|
|
131
|
+
*
|
|
132
|
+
*
|
|
109
133
|
* @returns
|
|
110
134
|
*/
|
|
111
135
|
const getXDGDirectory = () => {
|
|
112
136
|
const xDGConfigPath = process.env.XDG_CONFIG_HOME || process.env.HOME && _path.default.join(process.env.HOME, '.config');
|
|
137
|
+
debug('XDGConfig folder path %s', xDGConfigPath);
|
|
113
138
|
if (xDGConfigPath && (0, _configUtils.folderExists)(xDGConfigPath)) {
|
|
114
139
|
debug('XDGConfig folder path %s', xDGConfigPath);
|
|
115
140
|
return {
|
|
@@ -125,11 +150,11 @@ const getXDGDirectory = () => {
|
|
|
125
150
|
* @returns
|
|
126
151
|
*/
|
|
127
152
|
const getWindowsDirectory = () => {
|
|
128
|
-
if (
|
|
129
|
-
debug('
|
|
153
|
+
if (_os.default.platform() === 'win32' && process.env.APPDATA && (0, _configUtils.folderExists)(process.env.APPDATA)) {
|
|
154
|
+
debug('windows appdata folder path %s', process.env.APPDATA);
|
|
130
155
|
return {
|
|
131
156
|
path: _path.default.resolve(_path.default.join(process.env.APPDATA, pkgJSON.name, CONFIG_FILE)),
|
|
132
|
-
type:
|
|
157
|
+
type: 'win'
|
|
133
158
|
};
|
|
134
159
|
}
|
|
135
160
|
};
|
|
@@ -140,8 +165,10 @@ const getWindowsDirectory = () => {
|
|
|
140
165
|
* @returns
|
|
141
166
|
*/
|
|
142
167
|
const getRelativeDefaultDirectory = () => {
|
|
168
|
+
const relativePath = _path.default.resolve(_path.default.join('.', pkgJSON.name, CONFIG_FILE));
|
|
169
|
+
debug('relative folder path %s', relativePath);
|
|
143
170
|
return {
|
|
144
|
-
path:
|
|
171
|
+
path: relativePath,
|
|
145
172
|
type: 'def'
|
|
146
173
|
};
|
|
147
174
|
};
|
|
@@ -151,8 +178,10 @@ const getRelativeDefaultDirectory = () => {
|
|
|
151
178
|
* @returns
|
|
152
179
|
*/
|
|
153
180
|
const getOldDirectory = () => {
|
|
181
|
+
const oldPath = _path.default.resolve(_path.default.join('.', CONFIG_FILE));
|
|
182
|
+
debug('old folder path %s', oldPath);
|
|
154
183
|
return {
|
|
155
|
-
path:
|
|
184
|
+
path: oldPath,
|
|
156
185
|
type: 'old'
|
|
157
186
|
};
|
|
158
187
|
};
|
package/build/config-path.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-path.js","names":["_debug","_interopRequireDefault","require","_fs","_lodash","_path","_core","_configUtils","obj","__esModule","default","CONFIG_FILE","XDG","WIN","WIN32","pkgJSON","name","debug","buildDebug","findConfigFile","configPath","path","resolve","configPaths","getConfigPaths","length","_","isEmpty","Error","primaryConf","find","configLocation","fileExists","createConfigFile","head","createConfigFolder","defaultConfig","updateStorageLinks","readDefaultConfig","fs","writeFileSync","pathDefaultConf","__dirname","accessSync","constants","R_OK","TypeError","readFileSync","CHARACTER_ENCODING","UTF8","mkdirSync","dirname","recursive","type","dataDir","process","env","XDG_DATA_HOME","join","HOME","folderExists","replace","listPaths","getXDGDirectory","getWindowsDirectory","getRelativeDefaultDirectory","getOldDirectory","reduce","acc","currentValue","push","xDGConfigPath","XDG_CONFIG_HOME","platform","APPDATA"],"sources":["../src/config-path.ts"],"sourcesContent":["import buildDebug from 'debug';\nimport fs from 'fs';\nimport _ from 'lodash';\nimport path from 'path';\n\nimport { CHARACTER_ENCODING } from '@verdaccio/core';\n\nimport { fileExists, folderExists } from './config-utils';\n\nconst CONFIG_FILE = 'config.yaml';\nconst XDG = 'xdg';\nconst WIN = 'win';\nconst WIN32 = 'win32';\n// eslint-disable-next-line\nconst pkgJSON = {\n name: 'verdaccio',\n};\n\nexport type SetupDirectory = {\n path: string;\n type: string;\n};\n\nconst debug = buildDebug('verdaccio:config');\n\n/**\n * Find and get the first config file that match.\n * @return {String} the config file path\n */\nfunction findConfigFile(configPath?: string): string {\n if (typeof configPath !== 'undefined') {\n return path.resolve(configPath);\n }\n\n const configPaths: SetupDirectory[] = getConfigPaths();\n debug('%o posible locations found', configPaths.length);\n if (_.isEmpty(configPaths)) {\n // this should never happens\n throw new Error('no configuration files can be processed');\n }\n\n // find the first location that already exist\n const primaryConf: SetupDirectory | void = _.find(configPaths, (configLocation: SetupDirectory) =>\n fileExists(configLocation.path)\n );\n\n if (typeof primaryConf !== 'undefined') {\n debug('previous location exist already %s', primaryConf?.path);\n return primaryConf.path;\n }\n\n // @ts-ignore\n return createConfigFile(_.head(configPaths)).path;\n}\n\nfunction createConfigFile(configLocation: SetupDirectory): SetupDirectory {\n createConfigFolder(configLocation);\n\n const defaultConfig = updateStorageLinks(configLocation, readDefaultConfig());\n\n fs.writeFileSync(configLocation.path, defaultConfig);\n\n return configLocation;\n}\n\nexport function readDefaultConfig(): Buffer {\n const pathDefaultConf: string = path.resolve(__dirname, 'conf/default.yaml');\n try {\n debug('default configuration file %s', pathDefaultConf);\n fs.accessSync(pathDefaultConf, fs.constants.R_OK);\n } catch {\n throw new TypeError('configuration file does not have enough permissions for reading');\n }\n // @ts-ignore\n return fs.readFileSync(pathDefaultConf, CHARACTER_ENCODING.UTF8);\n}\n\nfunction createConfigFolder(configLocation): void {\n fs.mkdirSync(path.dirname(configLocation.path), { recursive: true });\n debug(`Creating default config file in %o`, configLocation?.path);\n}\n\nfunction updateStorageLinks(configLocation, defaultConfig): string {\n if (configLocation.type !== XDG) {\n return defaultConfig;\n }\n\n // $XDG_DATA_HOME defines the base directory relative to which user specific data\n // files should be stored, If $XDG_DATA_HOME is either not set or empty, a default\n // equal to $HOME/.local/share should be used.\n let dataDir =\n process.env.XDG_DATA_HOME || path.join(process.env.HOME as string, '.local', 'share');\n if (folderExists(dataDir)) {\n debug(`previous storage located`);\n debug(`update storage links to %s`, dataDir);\n dataDir = path.resolve(path.join(dataDir, pkgJSON.name, 'storage'));\n return defaultConfig.replace(/^storage: .\\/storage$/m, `storage: ${dataDir}`);\n }\n debug(`could not find a previous storage location, skip override`);\n return defaultConfig;\n}\n\n/**\n * Return a list of configuration locations by platform.\n * @returns\n */\nfunction getConfigPaths(): SetupDirectory[] {\n const listPaths: (SetupDirectory | void)[] = [\n getXDGDirectory(),\n getWindowsDirectory(),\n getRelativeDefaultDirectory(),\n getOldDirectory(),\n ];\n\n return listPaths.reduce(function (acc, currentValue: SetupDirectory | void): SetupDirectory[] {\n if (typeof currentValue !== 'undefined') {\n debug('directory detected path %s for type %s', currentValue?.path, currentValue.type);\n acc.push(currentValue);\n }\n return acc;\n }, [] as SetupDirectory[]);\n}\n\n/**\n * Get XDG_CONFIG_HOME or HOME location (usually unix)\n * @returns\n */\nconst getXDGDirectory = (): SetupDirectory | void => {\n const xDGConfigPath =\n process.env.XDG_CONFIG_HOME || (process.env.HOME && path.join(process.env.HOME, '.config'));\n if (xDGConfigPath && folderExists(xDGConfigPath)) {\n debug('XDGConfig folder path %s', xDGConfigPath);\n return {\n path: path.join(xDGConfigPath, pkgJSON.name, CONFIG_FILE),\n type: XDG,\n };\n }\n};\n\n/**\n * Detect windows location, APPDATA\n * usually something like C:\\User\\<Build User>\\AppData\\Local\n * @returns\n */\nconst getWindowsDirectory = (): SetupDirectory | void => {\n if (process.platform === WIN32 && process.env.APPDATA && folderExists(process.env.APPDATA)) {\n debug('is windows appdata: %s', process.env.APPDATA);\n return {\n path: path.resolve(path.join(process.env.APPDATA, pkgJSON.name, CONFIG_FILE)),\n type: WIN,\n };\n }\n};\n\n/**\n * Return relative directory, this is the default.\n * It will cretate config in your {currentLocation/verdaccio/config.yaml}\n * @returns\n */\nconst getRelativeDefaultDirectory = (): SetupDirectory => {\n return {\n path: path.resolve(path.join('.', pkgJSON.name, CONFIG_FILE)),\n type: 'def',\n };\n};\n\n/**\n * This should never happens, consider it DEPRECATED\n * @returns\n */\nconst getOldDirectory = (): SetupDirectory => {\n return {\n path: path.resolve(path.join('.', CONFIG_FILE)),\n type: 'old',\n };\n};\n\nexport { findConfigFile };\n"],"mappings":";;;;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O;IACL7C,IAAI,EAAEA,aAAI,CAACC,OAAO,CAACD,aAAI,CAACqC,IAAI,CAAC,GAAG,EAAE/C,WAAW,CAAC,CAAC;IAC/C0C,IAAI,EAAE;EACR,CAAC;AACH,CAAC"}
|
|
1
|
+
{"version":3,"file":"config-path.js","names":["_debug","_interopRequireDefault","require","_fs","_lodash","_os","_path","_configUtils","e","__esModule","default","CONFIG_FILE","XDG","pkgJSON","name","debug","buildDebug","findConfigFile","configPath","configLocation","path","resolve","configPaths","getConfigPaths","length","Error","primaryConf","_","find","fileExists","createConfigFile","createConfigFolder","defaultConfig","updateStorageLinks","readDefaultConfig","fs","writeFileSync","pathDefaultConf","__dirname","accessSync","constants","R_OK","TypeError","readFileSync","folder","dirname","mkdirSync","recursive","type","dataDir","process","env","XDG_DATA_HOME","join","HOME","folderExists","replace","listPaths","getXDGDirectory","getWindowsDirectory","getRelativeDefaultDirectory","getOldDirectory","reduce","acc","currentValue","push","xDGConfigPath","XDG_CONFIG_HOME","os","platform","APPDATA","relativePath","oldPath"],"sources":["../src/config-path.ts"],"sourcesContent":["import buildDebug from 'debug';\nimport fs from 'fs';\nimport _ from 'lodash';\nimport os from 'os';\nimport path from 'path';\n\nimport { fileExists, folderExists } from './config-utils';\n\nconst CONFIG_FILE = 'config.yaml';\nconst XDG = 'xdg';\n// eslint-disable-next-line\nconst pkgJSON = {\n name: 'verdaccio',\n};\n\nexport type SetupDirectory = {\n path: string;\n type: 'xdg' | 'win' | 'win32' | 'def' | 'old';\n};\n\nconst debug = buildDebug('verdaccio:config:config-path');\n\n/**\n * Find and get the first config file that match.\n * @return {String} the config file path\n */\nfunction findConfigFile(configPath?: string): string {\n debug('searching for config file %o', configPath);\n if (typeof configPath !== 'undefined') {\n const configLocation = path.resolve(configPath);\n debug('custom location %s', configLocation);\n return configLocation;\n }\n\n const configPaths: SetupDirectory[] = getConfigPaths();\n debug('%o posible locations found', configPaths.length);\n if (configPaths.length === 0) {\n debug('no configuration files can be processed');\n // this should never happens\n throw new Error('no configuration files can be processed');\n }\n\n // find the first location that already exist\n const primaryConf: SetupDirectory | void = _.find(configPaths, (configLocation: SetupDirectory) =>\n fileExists(configLocation.path)\n );\n\n if (typeof primaryConf !== 'undefined') {\n debug('at least one primary location detected at %s', primaryConf?.path);\n return primaryConf.path;\n }\n debug('no previous location found, creating a new one');\n debug('generating the first match path location %s', configPaths[0].path);\n return createConfigFile(configPaths[0]).path;\n}\n\nfunction createConfigFile(configLocation: SetupDirectory): SetupDirectory {\n createConfigFolder(configLocation);\n\n const defaultConfig = updateStorageLinks(configLocation, readDefaultConfig());\n\n fs.writeFileSync(configLocation.path, defaultConfig);\n\n return configLocation;\n}\n\nexport function readDefaultConfig(): string {\n const pathDefaultConf: string = path.resolve(__dirname, 'conf/default.yaml');\n try {\n debug('the path of default config used from %s', pathDefaultConf);\n fs.accessSync(pathDefaultConf, fs.constants.R_OK);\n debug('configuration file has enough permissions for reading');\n } catch {\n debug('configuration file does not have enough permissions for reading');\n throw new TypeError('configuration file does not have enough permissions for reading');\n }\n\n return fs.readFileSync(pathDefaultConf, 'utf8');\n}\n\nfunction createConfigFolder(configLocation): void {\n const folder = path.dirname(configLocation.path);\n debug(`creating default config file folder at %o`, folder);\n fs.mkdirSync(folder, { recursive: true });\n debug(`folder %o created`, folder);\n}\n\n/**\n * Update the storage links to the new location if it is necessary.\n * @param configLocation\n * @param defaultConfig\n * @returns\n */\nfunction updateStorageLinks(configLocation: SetupDirectory, defaultConfig: string): string {\n debug('checking storage links for %s and type %s', configLocation.path, configLocation.type);\n if (configLocation.type !== XDG) {\n debug(`skip storage override for %s`, configLocation.type);\n return defaultConfig;\n }\n\n // $XDG_DATA_HOME defines the base directory relative to which user specific data\n // files should be stored, If $XDG_DATA_HOME is either not set or empty, a default\n // equal to $HOME/.local/share should be used.\n let dataDir =\n process.env.XDG_DATA_HOME || path.join(process.env.HOME as string, '.local', 'share');\n if (folderExists(dataDir)) {\n debug(`previous storage located`);\n debug(`update storage links to %s`, dataDir);\n dataDir = path.resolve(path.join(dataDir, pkgJSON.name, 'storage'));\n return defaultConfig.replace(/^storage: .\\/storage$/m, `storage: ${dataDir}`);\n }\n debug(`could not find a previous storage location, skip override`);\n return defaultConfig;\n}\n\n/**\n * Return a list of configuration locations by platform.\n * @returns\n */\nfunction getConfigPaths(): SetupDirectory[] {\n const listPaths: (SetupDirectory | void)[] = [\n getXDGDirectory(),\n getWindowsDirectory(),\n getRelativeDefaultDirectory(),\n getOldDirectory(),\n ];\n\n return listPaths.reduce(function (acc, currentValue: SetupDirectory | void): SetupDirectory[] {\n if (typeof currentValue !== 'undefined') {\n debug(\n 'posible directory path generated %s for type %s',\n currentValue?.path,\n currentValue.type\n );\n acc.push(currentValue);\n }\n return acc;\n }, [] as SetupDirectory[]);\n}\n\n/**\n * Get XDG_CONFIG_HOME or HOME location (usually unix)\n *\n * The XDG_CONFIG_HOME environment variable is also part of the XDG Base Directory Specification,\n * which aims to standardize the locations where applications store configuration files and other\n * user-specific data on Unix-like operating systems.\n *\n *\n *\n * https://specifications.freedesktop.org/basedir-spec/latest/\n *\n *\n * @returns\n */\nconst getXDGDirectory = (): SetupDirectory | void => {\n const xDGConfigPath =\n process.env.XDG_CONFIG_HOME || (process.env.HOME && path.join(process.env.HOME, '.config'));\n debug('XDGConfig folder path %s', xDGConfigPath);\n if (xDGConfigPath && folderExists(xDGConfigPath)) {\n debug('XDGConfig folder path %s', xDGConfigPath);\n return {\n path: path.join(xDGConfigPath, pkgJSON.name, CONFIG_FILE),\n type: XDG,\n };\n }\n};\n\n/**\n * Detect windows location, APPDATA\n * usually something like C:\\User\\<Build User>\\AppData\\Local\n * @returns\n */\nconst getWindowsDirectory = (): SetupDirectory | void => {\n if (os.platform() === 'win32' && process.env.APPDATA && folderExists(process.env.APPDATA)) {\n debug('windows appdata folder path %s', process.env.APPDATA);\n return {\n path: path.resolve(path.join(process.env.APPDATA, pkgJSON.name, CONFIG_FILE)),\n type: 'win',\n };\n }\n};\n\n/**\n * Return relative directory, this is the default.\n * It will cretate config in your {currentLocation/verdaccio/config.yaml}\n * @returns\n */\nconst getRelativeDefaultDirectory = (): SetupDirectory => {\n const relativePath = path.resolve(path.join('.', pkgJSON.name, CONFIG_FILE));\n debug('relative folder path %s', relativePath);\n return {\n path: relativePath,\n type: 'def',\n };\n};\n\n/**\n * This should never happens, consider it DEPRECATED\n * @returns\n */\nconst getOldDirectory = (): SetupDirectory => {\n const oldPath = path.resolve(path.join('.', CONFIG_FILE));\n debug('old folder path %s', oldPath);\n return {\n path: oldPath,\n type: 'old',\n };\n};\n\nexport { findConfigFile };\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,GAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,GAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,KAAA,GAAAL,sBAAA,CAAAC,OAAA;AAEA,IAAAK,YAAA,GAAAL,OAAA;AAA0D,SAAAD,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE1D,MAAMG,WAAW,GAAG,aAAa;AACjC,MAAMC,GAAG,GAAG,KAAK;AACjB;AACA,MAAMC,OAAO,GAAG;EACdC,IAAI,EAAE;AACR,CAAC;AAOD,MAAMC,KAAK,GAAG,IAAAC,cAAU,EAAC,8BAA8B,CAAC;;AAExD;AACA;AACA;AACA;AACA,SAASC,cAAcA,CAACC,UAAmB,EAAU;EACnDH,KAAK,CAAC,8BAA8B,EAAEG,UAAU,CAAC;EACjD,IAAI,OAAOA,UAAU,KAAK,WAAW,EAAE;IACrC,MAAMC,cAAc,GAAGC,aAAI,CAACC,OAAO,CAACH,UAAU,CAAC;IAC/CH,KAAK,CAAC,oBAAoB,EAAEI,cAAc,CAAC;IAC3C,OAAOA,cAAc;EACvB;E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