@verdaccio/node-api 6.0.0-6-next.75 → 7.0.0-next-7.7
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 +418 -4
- package/LICENSE +1 -1
- package/build/cli-utils.js +3 -6
- package/build/cli-utils.js.map +1 -1
- package/build/server.js +2 -2
- package/build/server.js.map +1 -1
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,419 @@
|
|
|
1
1
|
# @verdaccio/node-api
|
|
2
2
|
|
|
3
|
+
## 7.0.0-next-7.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @verdaccio/core@7.0.0-next-7.7
|
|
8
|
+
- @verdaccio/config@7.0.0-next-7.7
|
|
9
|
+
- @verdaccio/server@7.0.0-next-7.7
|
|
10
|
+
- @verdaccio/server-fastify@7.0.0-next-7.7
|
|
11
|
+
- @verdaccio/logger@7.0.0-next-7.7
|
|
12
|
+
|
|
13
|
+
## 7.0.0-next.6
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [4d96324]
|
|
18
|
+
- @verdaccio/config@7.0.0-next.6
|
|
19
|
+
- @verdaccio/server@7.0.0-next.6
|
|
20
|
+
- @verdaccio/server-fastify@7.0.0-next.6
|
|
21
|
+
- @verdaccio/core@7.0.0-next.6
|
|
22
|
+
- @verdaccio/logger@7.0.0-next.6
|
|
23
|
+
|
|
24
|
+
## 7.0.0-next.5
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- Updated dependencies [f047cc8]
|
|
29
|
+
- @verdaccio/server@7.0.0-next.5
|
|
30
|
+
- @verdaccio/core@7.0.0-next.5
|
|
31
|
+
- @verdaccio/config@7.0.0-next.5
|
|
32
|
+
- @verdaccio/logger@7.0.0-next.5
|
|
33
|
+
- @verdaccio/server-fastify@7.0.0-next.5
|
|
34
|
+
|
|
35
|
+
## 7.0.0-next.4
|
|
36
|
+
|
|
37
|
+
### Patch Changes
|
|
38
|
+
|
|
39
|
+
- @verdaccio/server@7.0.0-next.4
|
|
40
|
+
- @verdaccio/server-fastify@7.0.0-next.4
|
|
41
|
+
- @verdaccio/core@7.0.0-next.4
|
|
42
|
+
- @verdaccio/config@7.0.0-next.4
|
|
43
|
+
- @verdaccio/logger@7.0.0-next.4
|
|
44
|
+
|
|
45
|
+
## 7.0.0-next.3
|
|
46
|
+
|
|
47
|
+
### Major Changes
|
|
48
|
+
|
|
49
|
+
- e7ebccb61: update major dependencies, remove old nodejs support
|
|
50
|
+
|
|
51
|
+
### Patch Changes
|
|
52
|
+
|
|
53
|
+
- Updated dependencies [daceb6d87]
|
|
54
|
+
- Updated dependencies [e7ebccb61]
|
|
55
|
+
- Updated dependencies [3ca405618]
|
|
56
|
+
- @verdaccio/config@7.0.0-next.3
|
|
57
|
+
- @verdaccio/core@7.0.0-next.3
|
|
58
|
+
- @verdaccio/logger@7.0.0-next.3
|
|
59
|
+
- @verdaccio/server@7.0.0-next.3
|
|
60
|
+
- @verdaccio/server-fastify@7.0.0-next.3
|
|
61
|
+
|
|
62
|
+
## 7.0.0-next.2
|
|
63
|
+
|
|
64
|
+
### Patch Changes
|
|
65
|
+
|
|
66
|
+
- @verdaccio/core@7.0.0-next.2
|
|
67
|
+
- @verdaccio/config@7.0.0-next.2
|
|
68
|
+
- @verdaccio/server@7.0.0-next.2
|
|
69
|
+
- @verdaccio/server-fastify@7.0.0-next.2
|
|
70
|
+
- @verdaccio/logger@7.0.0-next.2
|
|
71
|
+
|
|
72
|
+
## 7.0.0-next.1
|
|
73
|
+
|
|
74
|
+
### Patch Changes
|
|
75
|
+
|
|
76
|
+
- @verdaccio/core@7.0.0-next.1
|
|
77
|
+
- @verdaccio/config@7.0.0-next.1
|
|
78
|
+
- @verdaccio/server@7.0.0-next.1
|
|
79
|
+
- @verdaccio/server-fastify@7.0.0-next.1
|
|
80
|
+
- @verdaccio/logger@7.0.0-next.1
|
|
81
|
+
|
|
82
|
+
## 7.0.0-next.0
|
|
83
|
+
|
|
84
|
+
### Major Changes
|
|
85
|
+
|
|
86
|
+
- feat!: bump to v7
|
|
87
|
+
|
|
88
|
+
### Patch Changes
|
|
89
|
+
|
|
90
|
+
- Updated dependencies
|
|
91
|
+
- @verdaccio/config@7.0.0-next.0
|
|
92
|
+
- @verdaccio/core@7.0.0-next.0
|
|
93
|
+
- @verdaccio/logger@7.0.0-next.0
|
|
94
|
+
- @verdaccio/server@7.0.0-next.0
|
|
95
|
+
- @verdaccio/server-fastify@7.0.0-next.0
|
|
96
|
+
|
|
97
|
+
## 6.0.0
|
|
98
|
+
|
|
99
|
+
### Major Changes
|
|
100
|
+
|
|
101
|
+
- 292c0a37f: feat!: replace deprecated request dependency by got
|
|
102
|
+
|
|
103
|
+
This is a big refactoring of the core, fetching dependencies, improve code, more tests and better stability. This is essential for the next release, will take some time but would allow modularize more the core.
|
|
104
|
+
|
|
105
|
+
## Notes
|
|
106
|
+
|
|
107
|
+
- Remove deprecated `request` by other `got`, retry improved, custom Agent ( got does not include it built-in)
|
|
108
|
+
- Remove `async` dependency from storage (used by core) it was linked with proxy somehow safe to remove now
|
|
109
|
+
- Refactor with promises instead callback wherever is possible
|
|
110
|
+
- ~Document the API~
|
|
111
|
+
- Improve testing, integration tests
|
|
112
|
+
- Bugfix
|
|
113
|
+
- Clean up old validations
|
|
114
|
+
- Improve performance
|
|
115
|
+
|
|
116
|
+
## 💥 Breaking changes
|
|
117
|
+
|
|
118
|
+
- Plugin API methods were callbacks based are returning promises, this will break current storage plugins, check documentation for upgrade.
|
|
119
|
+
- Write Tarball, Read Tarball methods parameters change, a new set of options like `AbortController` signals are being provided to the `addAbortSignal` can be internally used with Streams when a request is aborted. eg: `addAbortSignal(signal, fs.createReadStream(pathName));`
|
|
120
|
+
- `@verdaccio/streams` stream abort support is legacy is being deprecated removed
|
|
121
|
+
- Remove AWS and Google Cloud packages for future refactoring [#2574](https://github.com/verdaccio/verdaccio/pull/2574).
|
|
122
|
+
|
|
123
|
+
- 9fc2e7961: feat(plugins): improve plugin loader
|
|
124
|
+
|
|
125
|
+
### Changes
|
|
126
|
+
|
|
127
|
+
- Add scope plugin support to 6.x https://github.com/verdaccio/verdaccio/pull/3227
|
|
128
|
+
- Avoid config collisions https://github.com/verdaccio/verdaccio/issues/928
|
|
129
|
+
- https://github.com/verdaccio/verdaccio/issues/1394
|
|
130
|
+
- `config.plugins` plugin path validations
|
|
131
|
+
- Updated algorithm for plugin loader.
|
|
132
|
+
- improved documentation (included dev)
|
|
133
|
+
|
|
134
|
+
## Features
|
|
135
|
+
|
|
136
|
+
- Add scope plugin support to 6.x https://github.com/verdaccio/verdaccio/pull/3227
|
|
137
|
+
- Custom prefix:
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
// config.yaml
|
|
141
|
+
server:
|
|
142
|
+
pluginPrefix: mycompany
|
|
143
|
+
middleware:
|
|
144
|
+
audit:
|
|
145
|
+
foo: 1
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
This configuration will look up for `mycompany-audit` instead `Verdaccio-audit`.
|
|
149
|
+
|
|
150
|
+
## Breaking Changes
|
|
151
|
+
|
|
152
|
+
### sinopia plugins
|
|
153
|
+
|
|
154
|
+
- `sinopia` fallback support is removed, but can be restored using `pluginPrefix`
|
|
155
|
+
|
|
156
|
+
### plugin filter
|
|
157
|
+
|
|
158
|
+
- method rename `filter_metadata`->`filterMetadata`
|
|
159
|
+
|
|
160
|
+
### Plugin constructor does not merge configs anymore https://github.com/verdaccio/verdaccio/issues/928
|
|
161
|
+
|
|
162
|
+
The plugin receives as first argument `config`, which represents the config of the plugin. Example:
|
|
163
|
+
|
|
164
|
+
```
|
|
165
|
+
// config.yaml
|
|
166
|
+
auth:
|
|
167
|
+
plugin:
|
|
168
|
+
foo: 1
|
|
169
|
+
bar: 2
|
|
170
|
+
|
|
171
|
+
export class Plugin<T> {
|
|
172
|
+
public constructor(config: T, options: PluginOptions) {
|
|
173
|
+
console.log(config);
|
|
174
|
+
// {foo:1, bar: 2}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
- 794af76c5: Remove Node 12 support
|
|
180
|
+
|
|
181
|
+
- We need move to the new `undici` and does not support Node.js 12
|
|
182
|
+
|
|
183
|
+
- 10aeb4f13: feat!: experiments config renamed to flags
|
|
184
|
+
|
|
185
|
+
- The `experiments` configuration is renamed to `flags`. The functionality is exactly the same.
|
|
186
|
+
|
|
187
|
+
```js
|
|
188
|
+
flags: token: false;
|
|
189
|
+
search: false;
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
- The `self_path` property from the config file is being removed in favor of `config_file` full path.
|
|
193
|
+
- Refactor `config` module, better types and utilities
|
|
194
|
+
|
|
195
|
+
- e367c3f1e: - Replace signature handler for legacy tokens by removing deprecated crypto.createDecipher by createCipheriv
|
|
196
|
+
|
|
197
|
+
- Introduce environment variables for legacy tokens
|
|
198
|
+
|
|
199
|
+
### Code Improvements
|
|
200
|
+
|
|
201
|
+
- Add debug library for improve developer experience
|
|
202
|
+
|
|
203
|
+
### Breaking change
|
|
204
|
+
|
|
205
|
+
- The new signature invalidates all previous tokens generated by Verdaccio 4 or previous versions.
|
|
206
|
+
- The secret key must have 32 characters long.
|
|
207
|
+
|
|
208
|
+
### New environment variables
|
|
209
|
+
|
|
210
|
+
- `VERDACCIO_LEGACY_ALGORITHM`: Allows to define the specific algorithm for the token signature which by default is `aes-256-ctr`
|
|
211
|
+
- `VERDACCIO_LEGACY_ENCRYPTION_KEY`: By default, the token stores in the database, but using this variable allows to get it from memory
|
|
212
|
+
|
|
213
|
+
- 82cb0f2bf: feat!: config.logs throw an error, logging config not longer accept array or logs property
|
|
214
|
+
|
|
215
|
+
### 💥 Breaking change
|
|
216
|
+
|
|
217
|
+
This is valid
|
|
218
|
+
|
|
219
|
+
```yaml
|
|
220
|
+
log: { type: stdout, format: pretty, level: http }
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
This is invalid
|
|
224
|
+
|
|
225
|
+
```yaml
|
|
226
|
+
logs: { type: stdout, format: pretty, level: http }
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
or
|
|
230
|
+
|
|
231
|
+
```yaml
|
|
232
|
+
logs:
|
|
233
|
+
- [{ type: stdout, format: pretty, level: http }]
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
- 8f43bf17d: feat: node api new structure based on promise
|
|
237
|
+
|
|
238
|
+
```js
|
|
239
|
+
import { runServer } from "@verdaccio/node-api";
|
|
240
|
+
// or
|
|
241
|
+
import { runServer } from "verdaccio";
|
|
242
|
+
|
|
243
|
+
const app = await runServer(); // default configuration
|
|
244
|
+
const app = await runServer("./config/config.yaml");
|
|
245
|
+
const app = await runServer({ configuration });
|
|
246
|
+
app.listen(4000, (event) => {
|
|
247
|
+
// do something
|
|
248
|
+
});
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### Breaking Change
|
|
252
|
+
|
|
253
|
+
If you are using the node-api, the new structure is Promise based and less arguments.
|
|
254
|
+
|
|
255
|
+
### Minor Changes
|
|
256
|
+
|
|
257
|
+
- 631abe1ac: feat: refactor logger
|
|
258
|
+
- 00d1d2a17: chore: env variable for launch fastify
|
|
259
|
+
|
|
260
|
+
- Update fastify to major release `v4.3.0`
|
|
261
|
+
- Update CLI launcher
|
|
262
|
+
|
|
263
|
+
via CLI
|
|
264
|
+
|
|
265
|
+
```
|
|
266
|
+
VERDACCIO_SERVER=fastify verdaccio
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
with docker
|
|
270
|
+
|
|
271
|
+
```
|
|
272
|
+
docker run -it --rm --name verdaccio \
|
|
273
|
+
-e "VERDACCIO_SERVER=8080" -p 8080:8080 \
|
|
274
|
+
-e "VERDACCIO_SERVER=fastify" \
|
|
275
|
+
verdaccio/verdaccio
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
- b61f762d6: feat: add server rate limit protection to all request
|
|
279
|
+
|
|
280
|
+
To modify custom values, use the server settings property.
|
|
281
|
+
|
|
282
|
+
```markdown
|
|
283
|
+
server:
|
|
284
|
+
|
|
285
|
+
## https://www.npmjs.com/package/express-rate-limit#configuration-options
|
|
286
|
+
|
|
287
|
+
rateLimit:
|
|
288
|
+
windowMs: 1000
|
|
289
|
+
max: 10000
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
The values are intended to be high, if you want to improve security of your server consider
|
|
293
|
+
using different values.
|
|
294
|
+
|
|
295
|
+
- 154b2ecd3: refactor: remove @verdaccio/commons-api in favor @verdaccio/core and remove duplications
|
|
296
|
+
- aa763baec: feat: add typescript project references settings
|
|
297
|
+
|
|
298
|
+
Reading https://ebaytech.berlin/optimizing-multi-package-apps-with-typescript-project-references-d5c57a3b4440 I realized I can use project references to solve the issue to pre-compile modules on develop mode.
|
|
299
|
+
|
|
300
|
+
It allows to navigate (IDE) trough the packages without need compile the packages.
|
|
301
|
+
|
|
302
|
+
Add two `tsconfig`, one using the previous existing configuration that is able to produce declaration files (`tsconfig.build`) and a new one `tsconfig` which is enables [_projects references_](https://www.typescriptlang.org/docs/handbook/project-references.html).
|
|
303
|
+
|
|
304
|
+
- d5eacc218: feat: improve cli loggin on start up
|
|
305
|
+
- 6c1eb021b: feat: use warning codes for deprecation warnings
|
|
306
|
+
|
|
307
|
+
### Patch Changes
|
|
308
|
+
|
|
309
|
+
- 351aeeaa8: fix(deps): @verdaccio/utils should be a prod dep of local-storage
|
|
310
|
+
- 19d272d10: fix: restore logger on init
|
|
311
|
+
|
|
312
|
+
Enable logger after parse configuration and log the very first step on startup phase.
|
|
313
|
+
|
|
314
|
+
```bash
|
|
315
|
+
warn --- experiments are enabled, it is recommended do not use experiments in production comment out this section to disable it
|
|
316
|
+
info --- support for experiment [token] is disabled
|
|
317
|
+
info --- support for experiment [search] is disabled
|
|
318
|
+
(node:50831) Warning: config.logs is deprecated, rename configuration to "config.log"
|
|
319
|
+
(Use `node --trace-warnings ...` to show where the warning was created)
|
|
320
|
+
info --- http address http://localhost:4873/
|
|
321
|
+
info --- version: 6.0.0-6-next.11
|
|
322
|
+
info --- server started
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
- a610ef26b: chore: add release step to private regisry on merge changeset pr
|
|
326
|
+
- 34f0f1101: Enable prerelease mode with **changesets**
|
|
327
|
+
- df0da3d69: Added core-js missing from dependencies though referenced in .js sources
|
|
328
|
+
- 68ea21214: ESLint Warnings Fixed
|
|
329
|
+
|
|
330
|
+
Related to issue #1461
|
|
331
|
+
|
|
332
|
+
- max-len: most of the sensible max-len errors are fixed
|
|
333
|
+
- no-unused-vars: most of these types of errors are fixed by deleting not needed declarations
|
|
334
|
+
- @typescript-eslint/no-unused-vars: same as above
|
|
335
|
+
|
|
336
|
+
- Updated dependencies [292c0a37f]
|
|
337
|
+
- Updated dependencies [974cd8c19]
|
|
338
|
+
- Updated dependencies [a828271d6]
|
|
339
|
+
- Updated dependencies [ef88da3b4]
|
|
340
|
+
- Updated dependencies [43f32687c]
|
|
341
|
+
- Updated dependencies [679c19c1b]
|
|
342
|
+
- Updated dependencies [a3a209b5e]
|
|
343
|
+
- Updated dependencies [459b6fa72]
|
|
344
|
+
- Updated dependencies [9fc2e7961]
|
|
345
|
+
- Updated dependencies [9943e2b18]
|
|
346
|
+
- Updated dependencies [ae93e039d]
|
|
347
|
+
- Updated dependencies [702d5c497]
|
|
348
|
+
- Updated dependencies [24b9be020]
|
|
349
|
+
- Updated dependencies [794af76c5]
|
|
350
|
+
- Updated dependencies [e75c0a3b9]
|
|
351
|
+
- Updated dependencies [351aeeaa8]
|
|
352
|
+
- Updated dependencies [10aeb4f13]
|
|
353
|
+
- Updated dependencies [631abe1ac]
|
|
354
|
+
- Updated dependencies [9718e0330]
|
|
355
|
+
- Updated dependencies [7ef599cc4]
|
|
356
|
+
- Updated dependencies [b702ea363]
|
|
357
|
+
- Updated dependencies [1b217fd34]
|
|
358
|
+
- Updated dependencies [e367c3f1e]
|
|
359
|
+
- Updated dependencies [a1da11308]
|
|
360
|
+
- Updated dependencies [d167f92e1]
|
|
361
|
+
- Updated dependencies [00d1d2a17]
|
|
362
|
+
- Updated dependencies [19d272d10]
|
|
363
|
+
- Updated dependencies [1810ed0d8]
|
|
364
|
+
- Updated dependencies [55ee3fdd9]
|
|
365
|
+
- Updated dependencies [a610ef26b]
|
|
366
|
+
- Updated dependencies [ddb6a2239]
|
|
367
|
+
- Updated dependencies [a23628be9]
|
|
368
|
+
- Updated dependencies [048ac95e8]
|
|
369
|
+
- Updated dependencies [648575aa4]
|
|
370
|
+
- Updated dependencies [b61f762d6]
|
|
371
|
+
- Updated dependencies [d43894e8f]
|
|
372
|
+
- Updated dependencies [154b2ecd3]
|
|
373
|
+
- Updated dependencies [061bfcc8d]
|
|
374
|
+
- Updated dependencies [aa763baec]
|
|
375
|
+
- Updated dependencies [378e907d5]
|
|
376
|
+
- Updated dependencies [16e38df8a]
|
|
377
|
+
- Updated dependencies [34f0f1101]
|
|
378
|
+
- Updated dependencies [df0da3d69]
|
|
379
|
+
- Updated dependencies [82cb0f2bf]
|
|
380
|
+
- Updated dependencies [dc571aabd]
|
|
381
|
+
- Updated dependencies [b78f35257]
|
|
382
|
+
- Updated dependencies [f859d2b1a]
|
|
383
|
+
- Updated dependencies [2c594910d]
|
|
384
|
+
- Updated dependencies [6c1eb021b]
|
|
385
|
+
- Updated dependencies [62c24b632]
|
|
386
|
+
- Updated dependencies [0a6412ca9]
|
|
387
|
+
- Updated dependencies [d08fe29d9]
|
|
388
|
+
- Updated dependencies [5167bb528]
|
|
389
|
+
- Updated dependencies [f86c31ed0]
|
|
390
|
+
- Updated dependencies [65f88b826]
|
|
391
|
+
- Updated dependencies [20c9e43ed]
|
|
392
|
+
- Updated dependencies [b3e8438f6]
|
|
393
|
+
- Updated dependencies [c9d1af0e5]
|
|
394
|
+
- Updated dependencies [730b5d8cc]
|
|
395
|
+
- Updated dependencies [4b29d715b]
|
|
396
|
+
- Updated dependencies [68ea21214]
|
|
397
|
+
- Updated dependencies [37274e4c8]
|
|
398
|
+
- Updated dependencies [8f43bf17d]
|
|
399
|
+
- Updated dependencies [45c03819e]
|
|
400
|
+
- Updated dependencies [b849128de]
|
|
401
|
+
- @verdaccio/config@6.0.0
|
|
402
|
+
- @verdaccio/core@6.0.0
|
|
403
|
+
- @verdaccio/logger@6.0.0
|
|
404
|
+
- @verdaccio/server@6.0.0
|
|
405
|
+
- @verdaccio/server-fastify@6.0.0
|
|
406
|
+
|
|
407
|
+
## 6.0.0-6-next.76
|
|
408
|
+
|
|
409
|
+
### Patch Changes
|
|
410
|
+
|
|
411
|
+
- @verdaccio/server@6.0.0-6-next.65
|
|
412
|
+
- @verdaccio/server-fastify@6.0.0-6-next.57
|
|
413
|
+
- @verdaccio/core@6.0.0-6-next.76
|
|
414
|
+
- @verdaccio/config@6.0.0-6-next.76
|
|
415
|
+
- @verdaccio/logger@6.0.0-6-next.44
|
|
416
|
+
|
|
3
417
|
## 6.0.0-6-next.75
|
|
4
418
|
|
|
5
419
|
### Patch Changes
|
|
@@ -705,14 +1119,14 @@
|
|
|
705
1119
|
- 5c5057fc: feat: node api new structure based on promise
|
|
706
1120
|
|
|
707
1121
|
```js
|
|
708
|
-
import { runServer } from
|
|
1122
|
+
import { runServer } from "@verdaccio/node-api";
|
|
709
1123
|
// or
|
|
710
|
-
import { runServer } from
|
|
1124
|
+
import { runServer } from "verdaccio";
|
|
711
1125
|
|
|
712
1126
|
const app = await runServer(); // default configuration
|
|
713
|
-
const app = await runServer(
|
|
1127
|
+
const app = await runServer("./config/config.yaml");
|
|
714
1128
|
const app = await runServer({ configuration });
|
|
715
|
-
app.listen(4000, event => {
|
|
1129
|
+
app.listen(4000, (event) => {
|
|
716
1130
|
// do something
|
|
717
1131
|
});
|
|
718
1132
|
```
|
package/LICENSE
CHANGED
package/build/cli-utils.js
CHANGED
|
@@ -7,11 +7,9 @@ exports.DEFAULT_PROTOCOL = exports.DEFAULT_PORT = exports.DEFAULT_DOMAIN = void
|
|
|
7
7
|
exports.getListListenAddresses = getListListenAddresses;
|
|
8
8
|
exports.parseAddress = parseAddress;
|
|
9
9
|
var _core = require("@verdaccio/core");
|
|
10
|
-
const DEFAULT_PORT = '4873';
|
|
11
|
-
exports.
|
|
12
|
-
const
|
|
13
|
-
exports.DEFAULT_PROTOCOL = DEFAULT_PROTOCOL;
|
|
14
|
-
const DEFAULT_DOMAIN = 'localhost';
|
|
10
|
+
const DEFAULT_PORT = exports.DEFAULT_PORT = '4873';
|
|
11
|
+
const DEFAULT_PROTOCOL = exports.DEFAULT_PROTOCOL = 'http';
|
|
12
|
+
const DEFAULT_DOMAIN = exports.DEFAULT_DOMAIN = 'localhost';
|
|
15
13
|
/**
|
|
16
14
|
* Parse an internet address
|
|
17
15
|
* Allow:
|
|
@@ -26,7 +24,6 @@ const DEFAULT_DOMAIN = 'localhost';
|
|
|
26
24
|
* @param {*} urlAddress the internet address definition
|
|
27
25
|
* @return {Object|Null} literal object that represent the address parsed
|
|
28
26
|
*/
|
|
29
|
-
exports.DEFAULT_DOMAIN = DEFAULT_DOMAIN;
|
|
30
27
|
function parseAddress(urlAddress) {
|
|
31
28
|
//
|
|
32
29
|
// TODO: refactor it to something more reasonable?
|
package/build/cli-utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-utils.js","names":["_core","require","DEFAULT_PORT","exports","DEFAULT_PROTOCOL","DEFAULT_DOMAIN","parseAddress","urlAddress","urlPattern","exec","proto","host","port","path","getListListenAddresses","argListen","configListen","addresses","Array","isArray","process","emitWarning","map","addr","parsedAddr","warningUtils","emit","Codes","VERWAR004","filter","Boolean"],"sources":["../src/cli-utils.ts"],"sourcesContent":["import { warningUtils } from '@verdaccio/core';\n\nexport const DEFAULT_PORT = '4873';\nexport const DEFAULT_PROTOCOL = 'http';\nexport const DEFAULT_DOMAIN = 'localhost';\n/**\n * Parse an internet address\n * Allow:\n - https:localhost:1234 - protocol + host + port\n - localhost:1234 - host + port\n - 1234 - port\n - http::1234 - protocol + port\n - https://localhost:443/ - full url + https\n - http://[::1]:443/ - ipv6\n - unix:/tmp/http.sock - unix sockets\n - https://unix:/tmp/http.sock - unix sockets (https)\n * @param {*} urlAddress the internet address definition\n * @return {Object|Null} literal object that represent the address parsed\n */\nexport function parseAddress(urlAddress: any): any {\n //\n // TODO: refactor it to something more reasonable?\n //\n // protocol : // ( host )|( ipv6 ): port /\n let urlPattern = /^((https?):(\\/\\/)?)?((([^\\/:]*)|\\[([^\\[\\]]+)\\]):)?(\\d+)\\/?$/.exec(urlAddress);\n\n if (urlPattern) {\n return {\n proto: urlPattern[2] || DEFAULT_PROTOCOL,\n host: urlPattern[6] || urlPattern[7] || DEFAULT_DOMAIN,\n port: urlPattern[8] || DEFAULT_PORT,\n };\n }\n\n urlPattern = /^((https?):(\\/\\/)?)?unix:(.*)$/.exec(urlAddress);\n\n if (urlPattern) {\n return {\n proto: urlPattern[2] || DEFAULT_PROTOCOL,\n path: urlPattern[4],\n };\n }\n\n return null;\n}\n\n/**\n * Retrieve all addresses defined in the config file.\n * Verdaccio is able to listen multiple ports\n * @param {String} argListen\n * @param {String} configListen\n * eg:\n * listen:\n - localhost:5555\n - localhost:5557\n @return {Array}\n */\nexport function getListListenAddresses(argListen: string | void, configListen: any): any {\n // command line || config file || default\n let addresses;\n if (argListen) {\n addresses = [argListen];\n } else if (Array.isArray(configListen)) {\n addresses = configListen;\n process.emitWarning('multiple addresses will be deprecated in the next major, only use one');\n } else if (configListen) {\n addresses = [configListen];\n } else {\n addresses = [DEFAULT_PORT];\n }\n addresses = addresses\n .map(function (addr): string {\n const parsedAddr = parseAddress(addr);\n\n if (!parsedAddr) {\n warningUtils.emit(warningUtils.Codes.VERWAR004, addr);\n }\n\n return parsedAddr;\n })\n .filter(Boolean);\n\n return addresses;\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAEO,MAAMC,YAAY,
|
|
1
|
+
{"version":3,"file":"cli-utils.js","names":["_core","require","DEFAULT_PORT","exports","DEFAULT_PROTOCOL","DEFAULT_DOMAIN","parseAddress","urlAddress","urlPattern","exec","proto","host","port","path","getListListenAddresses","argListen","configListen","addresses","Array","isArray","process","emitWarning","map","addr","parsedAddr","warningUtils","emit","Codes","VERWAR004","filter","Boolean"],"sources":["../src/cli-utils.ts"],"sourcesContent":["import { warningUtils } from '@verdaccio/core';\n\nexport const DEFAULT_PORT = '4873';\nexport const DEFAULT_PROTOCOL = 'http';\nexport const DEFAULT_DOMAIN = 'localhost';\n/**\n * Parse an internet address\n * Allow:\n - https:localhost:1234 - protocol + host + port\n - localhost:1234 - host + port\n - 1234 - port\n - http::1234 - protocol + port\n - https://localhost:443/ - full url + https\n - http://[::1]:443/ - ipv6\n - unix:/tmp/http.sock - unix sockets\n - https://unix:/tmp/http.sock - unix sockets (https)\n * @param {*} urlAddress the internet address definition\n * @return {Object|Null} literal object that represent the address parsed\n */\nexport function parseAddress(urlAddress: any): any {\n //\n // TODO: refactor it to something more reasonable?\n //\n // protocol : // ( host )|( ipv6 ): port /\n let urlPattern = /^((https?):(\\/\\/)?)?((([^\\/:]*)|\\[([^\\[\\]]+)\\]):)?(\\d+)\\/?$/.exec(urlAddress);\n\n if (urlPattern) {\n return {\n proto: urlPattern[2] || DEFAULT_PROTOCOL,\n host: urlPattern[6] || urlPattern[7] || DEFAULT_DOMAIN,\n port: urlPattern[8] || DEFAULT_PORT,\n };\n }\n\n urlPattern = /^((https?):(\\/\\/)?)?unix:(.*)$/.exec(urlAddress);\n\n if (urlPattern) {\n return {\n proto: urlPattern[2] || DEFAULT_PROTOCOL,\n path: urlPattern[4],\n };\n }\n\n return null;\n}\n\n/**\n * Retrieve all addresses defined in the config file.\n * Verdaccio is able to listen multiple ports\n * @param {String} argListen\n * @param {String} configListen\n * eg:\n * listen:\n - localhost:5555\n - localhost:5557\n @return {Array}\n */\nexport function getListListenAddresses(argListen: string | void, configListen: any): any {\n // command line || config file || default\n let addresses;\n if (argListen) {\n addresses = [argListen];\n } else if (Array.isArray(configListen)) {\n addresses = configListen;\n process.emitWarning('multiple addresses will be deprecated in the next major, only use one');\n } else if (configListen) {\n addresses = [configListen];\n } else {\n addresses = [DEFAULT_PORT];\n }\n addresses = addresses\n .map(function (addr): string {\n const parsedAddr = parseAddress(addr);\n\n if (!parsedAddr) {\n warningUtils.emit(warningUtils.Codes.VERWAR004, addr);\n }\n\n return parsedAddr;\n })\n .filter(Boolean);\n\n return addresses;\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAEO,MAAMC,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAG,MAAM;AAC3B,MAAME,gBAAgB,GAAAD,OAAA,CAAAC,gBAAA,GAAG,MAAM;AAC/B,MAAMC,cAAc,GAAAF,OAAA,CAAAE,cAAA,GAAG,WAAW;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,YAAYA,CAACC,UAAe,EAAO;EACjD;EACA;EACA;EACA;EACA,IAAIC,UAAU,GAAG,6DAA6D,CAACC,IAAI,CAACF,UAAU,CAAC;EAE/F,IAAIC,UAAU,EAAE;IACd,OAAO;MACLE,KAAK,EAAEF,UAAU,CAAC,CAAC,CAAC,IAAIJ,gBAAgB;MACxCO,IAAI,EAAEH,UAAU,CAAC,CAAC,CAAC,IAAIA,UAAU,CAAC,CAAC,CAAC,IAAIH,cAAc;MACtDO,IAAI,EAAEJ,UAAU,CAAC,CAAC,CAAC,IAAIN;IACzB,CAAC;EACH;EAEAM,UAAU,GAAG,gCAAgC,CAACC,IAAI,CAACF,UAAU,CAAC;EAE9D,IAAIC,UAAU,EAAE;IACd,OAAO;MACLE,KAAK,EAAEF,UAAU,CAAC,CAAC,CAAC,IAAIJ,gBAAgB;MACxCS,IAAI,EAAEL,UAAU,CAAC,CAAC;IACpB,CAAC;EACH;EAEA,OAAO,IAAI;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASM,sBAAsBA,CAACC,SAAwB,EAAEC,YAAiB,EAAO;EACvF;EACA,IAAIC,SAAS;EACb,IAAIF,SAAS,EAAE;IACbE,SAAS,GAAG,CAACF,SAAS,CAAC;EACzB,CAAC,MAAM,IAAIG,KAAK,CAACC,OAAO,CAACH,YAAY,CAAC,EAAE;IACtCC,SAAS,GAAGD,YAAY;IACxBI,OAAO,CAACC,WAAW,CAAC,uEAAuE,CAAC;EAC9F,CAAC,MAAM,IAAIL,YAAY,EAAE;IACvBC,SAAS,GAAG,CAACD,YAAY,CAAC;EAC5B,CAAC,MAAM;IACLC,SAAS,GAAG,CAACf,YAAY,CAAC;EAC5B;EACAe,SAAS,GAAGA,SAAS,CAClBK,GAAG,CAAC,UAAUC,IAAI,EAAU;IAC3B,MAAMC,UAAU,GAAGlB,YAAY,CAACiB,IAAI,CAAC;IAErC,IAAI,CAACC,UAAU,EAAE;MACfC,kBAAY,CAACC,IAAI,CAACD,kBAAY,CAACE,KAAK,CAACC,SAAS,EAAEL,IAAI,CAAC;IACvD;IAEA,OAAOC,UAAU;EACnB,CAAC,CAAC,CACDK,MAAM,CAACC,OAAO,CAAC;EAElB,OAAOb,SAAS;AAClB"}
|
package/build/server.js
CHANGED
|
@@ -20,8 +20,8 @@ var _server = _interopRequireDefault(require("@verdaccio/server"));
|
|
|
20
20
|
var _serverFastify = _interopRequireDefault(require("@verdaccio/server-fastify"));
|
|
21
21
|
var _cliUtils = require("./cli-utils");
|
|
22
22
|
var _experiments = require("./experiments");
|
|
23
|
-
function _getRequireWildcardCache(
|
|
24
|
-
function _interopRequireWildcard(
|
|
23
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
24
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
25
25
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
26
26
|
/* eslint-disable */
|
|
27
27
|
|
package/build/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","names":["_constants","_interopRequireDefault","require","_debug","_fs","_http","_https","_lodash","_interopRequireWildcard","_url","_config","_core","_logger","_server","_serverFastify","_cliUtils","_experiments","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","debug","buildDebug","unlinkAddressPath","addr","path","fs","existsSync","unlinkSync","createServerFactory","config","app","serverFactory","proto","httpsOptions","secureOptions","constants","SSL_OP_NO_SSLv2","SSL_OP_NO_SSLv3","keyCertConfig","https","pfxConfig","cert","pfx","Error","passphrase","assign","readFileSync","ca","createServer","err","message","http","server","keepAliveTimeout","initServer","port","version","pkgName","Promise","resolve","reject","getListListenAddresses","listen","logger","setup","log","displayExperimentsInfoBox","flags","process","env","VERDACCIO_SERVER","fastifyServer","host","expressServer","isFunction","send","verdaccio_started","addressServer","url","format","protocol","pathname","hostname","info","on","exitCode","handleShutdownGracefully","close","exit","signal","once","runServer","configurationParsed","undefined","configPathLocation","findConfigFile","parseConfigFile","_","isObject","API_ERROR","CONFIG_BAD_FORMAT"],"sources":["../src/server.ts"],"sourcesContent":["/* eslint-disable */\nimport constants from 'constants';\nimport buildDebug from 'debug';\nimport fs from 'fs';\nimport http from 'http';\nimport https from 'https';\nimport _, { assign, isFunction } from 'lodash';\nimport url from 'url';\n\nimport { findConfigFile, parseConfigFile } from '@verdaccio/config';\nimport { API_ERROR } from '@verdaccio/core';\nimport { setup } from '@verdaccio/logger';\nimport expressServer from '@verdaccio/server';\nimport fastifyServer from '@verdaccio/server-fastify';\nimport { ConfigYaml, HttpsConfKeyCert, HttpsConfPfx } from '@verdaccio/types';\n\nimport { getListListenAddresses } from './cli-utils';\nimport { displayExperimentsInfoBox } from './experiments';\n\nconst debug = buildDebug('verdaccio:node-api');\n\nfunction unlinkAddressPath(addr) {\n if (addr.path && fs.existsSync(addr.path)) {\n fs.unlinkSync(addr.path);\n }\n}\n\n/**\n * Return a native HTTP/HTTPS server instance\n * @param config\n * @param addr\n * @param app\n */\nexport function createServerFactory(config: ConfigYaml, addr, app) {\n let serverFactory;\n if (addr.proto === 'https') {\n debug('https enabled');\n try {\n let httpsOptions = {\n // disable insecure SSLv2 and SSLv3\n secureOptions: constants.SSL_OP_NO_SSLv2 | constants.SSL_OP_NO_SSLv3,\n };\n\n const keyCertConfig = config.https as HttpsConfKeyCert;\n const pfxConfig = config.https as HttpsConfPfx;\n\n // https must either have key and cert or a pfx and (optionally) a passphrase\n if (!((keyCertConfig.key && keyCertConfig.cert) || pfxConfig.pfx)) {\n // logHTTPSError(configPath);\n throw Error('bad format https configuration');\n }\n\n if (pfxConfig.pfx) {\n const { pfx, passphrase } = pfxConfig;\n httpsOptions = assign(httpsOptions, {\n pfx: fs.readFileSync(pfx),\n passphrase: passphrase || '',\n });\n } else {\n const { key, cert, ca } = keyCertConfig;\n httpsOptions = assign(httpsOptions, {\n key: fs.readFileSync(key),\n cert: fs.readFileSync(cert),\n ...(ca && {\n ca: fs.readFileSync(ca),\n }),\n });\n }\n // TODO: enable http2 as feature\n // if (config.server.http2) <-- check if force http2\n serverFactory = https.createServer(httpsOptions, app);\n } catch (err: any) {\n throw new Error(`cannot create https server: ${err.message}`);\n }\n } else {\n // http\n debug('http enabled');\n serverFactory = http.createServer(app);\n }\n\n if (\n config.server &&\n typeof config.server.keepAliveTimeout !== 'undefined' &&\n // @ts-ignore\n config.server.keepAliveTimeout !== 'null'\n ) {\n // library definition for node is not up to date (doesn't contain recent 8.0 changes)\n serverFactory.keepAliveTimeout = config.server.keepAliveTimeout * 1000;\n }\n // FIXE: I could not find the reason of this code.\n unlinkAddressPath(addr);\n\n return serverFactory;\n}\n\n/**\n * Start the server on the port defined\n * @param config\n * @param port\n * @param version\n * @param pkgName\n */\nexport async function initServer(\n config: ConfigYaml,\n port: string | void,\n version: string,\n pkgName: string\n): Promise<void> {\n return new Promise(async (resolve, reject) => {\n // FIXME: get only the first match, the multiple address will be removed\n const [addr] = getListListenAddresses(port, config.listen);\n const logger = setup(config?.log as any);\n displayExperimentsInfoBox(config.flags);\n\n let app;\n if (process.env.VERDACCIO_SERVER === 'fastify') {\n app = await fastifyServer(config);\n app.listen({ port: addr.port, host: addr.host }, (err) => {\n if (err) {\n reject(err);\n } else {\n resolve();\n }\n });\n } else {\n app = await expressServer(config);\n const serverFactory = createServerFactory(config, addr, app);\n serverFactory\n .listen(addr.port || addr.path, addr.host, (): void => {\n // send a message for test\n if (isFunction(process.send)) {\n process.send({\n verdaccio_started: true,\n });\n }\n const addressServer = `${\n addr.path\n ? url.format({\n protocol: 'unix',\n pathname: addr.path,\n })\n : url.format({\n protocol: addr.proto,\n hostname: addr.host,\n port: addr.port,\n pathname: '/',\n })\n }`;\n logger.info(`http address ${addressServer}`);\n logger.info(`version: ${version}`);\n resolve();\n })\n .on('error', function (err): void {\n reject(err);\n process.exitCode = 1;\n });\n function handleShutdownGracefully() {\n logger.info('received shutdown signal - closing server gracefully...');\n serverFactory.close(() => {\n logger.info('server closed.');\n process.exit(0);\n });\n }\n\n for (const signal of ['SIGINT', 'SIGTERM', 'SIGHUP']) {\n // Use once() so that receiving double signals exit the app.\n process.once(signal, handleShutdownGracefully);\n }\n }\n });\n}\n\n/**\n * Exposes a server factory to be instantiated programmatically.\n *\n ```ts\n const app = await runServer(); // default configuration\n const app = await runServer('./config/config.yaml');\n const app = await runServer({ configuration });\n app.listen(4000, (event) => {\n // do something\n });\n ```\n * @param config\n */\nexport async function runServer(config?: string | ConfigYaml): Promise<any> {\n let configurationParsed: ConfigYaml;\n if (config === undefined || typeof config === 'string') {\n const configPathLocation = findConfigFile(config);\n configurationParsed = parseConfigFile(configPathLocation);\n } else if (_.isObject(config)) {\n configurationParsed = config;\n } else {\n throw new Error(API_ERROR.CONFIG_BAD_FORMAT);\n }\n\n setup(configurationParsed.log as any);\n displayExperimentsInfoBox(configurationParsed.flags);\n // FIXME: get only the first match, the multiple address will be removed\n const [addr] = getListListenAddresses(undefined, configurationParsed.listen);\n const app = await expressServer(configurationParsed);\n return createServerFactory(configurationParsed, addr, app);\n}\n"],"mappings":";;;;;;;;AACA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,GAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,KAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,MAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,OAAA,GAAAC,uBAAA,CAAAN,OAAA;AACA,IAAAO,IAAA,GAAAR,sBAAA,CAAAC,OAAA;AAEA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,KAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,GAAAV,OAAA;AACA,IAAAW,OAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,cAAA,GAAAb,sBAAA,CAAAC,OAAA;AAGA,IAAAa,SAAA,GAAAb,OAAA;AACA,IAAAc,YAAA,GAAAd,OAAA;AAA0D,SAAAe,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA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0B,mBAAmB,CAACzB,KAAK,CAAC;EACpD;EACA,MAAM,CAAC5C,IAAI,CAAC,GAAG,IAAAsC,gCAAsB,EAACgC,SAAS,EAAED,mBAAmB,CAAC9B,MAAM,CAAC;EAC5E,MAAMhC,GAAG,GAAG,MAAM,IAAA2C,eAAa,EAACmB,mBAAmB,CAAC;EACpD,OAAOhE,mBAAmB,CAACgE,mBAAmB,EAAErE,IAAI,EAAEO,GAAG,CAAC;AAC5D"}
|
|
1
|
+
{"version":3,"file":"server.js","names":["_constants","_interopRequireDefault","require","_debug","_fs","_http","_https","_lodash","_interopRequireWildcard","_url","_config","_core","_logger","_server","_serverFastify","_cliUtils","_experiments","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","obj","debug","buildDebug","unlinkAddressPath","addr","path","fs","existsSync","unlinkSync","createServerFactory","config","app","serverFactory","proto","httpsOptions","secureOptions","constants","SSL_OP_NO_SSLv2","SSL_OP_NO_SSLv3","keyCertConfig","https","pfxConfig","key","cert","pfx","Error","passphrase","assign","readFileSync","ca","createServer","err","message","http","server","keepAliveTimeout","initServer","port","version","pkgName","Promise","resolve","reject","getListListenAddresses","listen","logger","setup","log","displayExperimentsInfoBox","flags","process","env","VERDACCIO_SERVER","fastifyServer","host","expressServer","isFunction","send","verdaccio_started","addressServer","url","format","protocol","pathname","hostname","info","on","exitCode","handleShutdownGracefully","close","exit","signal","once","runServer","configurationParsed","undefined","configPathLocation","findConfigFile","parseConfigFile","_","isObject","API_ERROR","CONFIG_BAD_FORMAT"],"sources":["../src/server.ts"],"sourcesContent":["/* eslint-disable */\nimport constants from 'constants';\nimport buildDebug from 'debug';\nimport fs from 'fs';\nimport http from 'http';\nimport https from 'https';\nimport _, { assign, isFunction } from 'lodash';\nimport url from 'url';\n\nimport { findConfigFile, parseConfigFile } from '@verdaccio/config';\nimport { API_ERROR } from '@verdaccio/core';\nimport { setup } from '@verdaccio/logger';\nimport expressServer from '@verdaccio/server';\nimport fastifyServer from '@verdaccio/server-fastify';\nimport { ConfigYaml, HttpsConfKeyCert, HttpsConfPfx } from '@verdaccio/types';\n\nimport { getListListenAddresses } from './cli-utils';\nimport { displayExperimentsInfoBox } from './experiments';\n\nconst debug = buildDebug('verdaccio:node-api');\n\nfunction unlinkAddressPath(addr) {\n if (addr.path && fs.existsSync(addr.path)) {\n fs.unlinkSync(addr.path);\n }\n}\n\n/**\n * Return a native HTTP/HTTPS server instance\n * @param config\n * @param addr\n * @param app\n */\nexport function createServerFactory(config: ConfigYaml, addr, app) {\n let serverFactory;\n if (addr.proto === 'https') {\n debug('https enabled');\n try {\n let httpsOptions = {\n // disable insecure SSLv2 and SSLv3\n secureOptions: constants.SSL_OP_NO_SSLv2 | constants.SSL_OP_NO_SSLv3,\n };\n\n const keyCertConfig = config.https as HttpsConfKeyCert;\n const pfxConfig = config.https as HttpsConfPfx;\n\n // https must either have key and cert or a pfx and (optionally) a passphrase\n if (!((keyCertConfig.key && keyCertConfig.cert) || pfxConfig.pfx)) {\n // logHTTPSError(configPath);\n throw Error('bad format https configuration');\n }\n\n if (pfxConfig.pfx) {\n const { pfx, passphrase } = pfxConfig;\n httpsOptions = assign(httpsOptions, {\n pfx: fs.readFileSync(pfx),\n passphrase: passphrase || '',\n });\n } else {\n const { key, cert, ca } = keyCertConfig;\n httpsOptions = assign(httpsOptions, {\n key: fs.readFileSync(key),\n cert: fs.readFileSync(cert),\n ...(ca && {\n ca: fs.readFileSync(ca),\n }),\n });\n }\n // TODO: enable http2 as feature\n // if (config.server.http2) <-- check if force http2\n serverFactory = https.createServer(httpsOptions, app);\n } catch (err: any) {\n throw new Error(`cannot create https server: ${err.message}`);\n }\n } else {\n // http\n debug('http enabled');\n serverFactory = http.createServer(app);\n }\n\n if (\n config.server &&\n typeof config.server.keepAliveTimeout !== 'undefined' &&\n // @ts-ignore\n config.server.keepAliveTimeout !== 'null'\n ) {\n // library definition for node is not up to date (doesn't contain recent 8.0 changes)\n serverFactory.keepAliveTimeout = config.server.keepAliveTimeout * 1000;\n }\n // FIXE: I could not find the reason of this code.\n unlinkAddressPath(addr);\n\n return serverFactory;\n}\n\n/**\n * Start the server on the port defined\n * @param config\n * @param port\n * @param version\n * @param pkgName\n */\nexport async function initServer(\n config: ConfigYaml,\n port: string | void,\n version: string,\n pkgName: string\n): Promise<void> {\n return new Promise(async (resolve, reject) => {\n // FIXME: get only the first match, the multiple address will be removed\n const [addr] = getListListenAddresses(port, config.listen);\n const logger = setup(config?.log as any);\n displayExperimentsInfoBox(config.flags);\n\n let app;\n if (process.env.VERDACCIO_SERVER === 'fastify') {\n app = await fastifyServer(config);\n app.listen({ port: addr.port, host: addr.host }, (err) => {\n if (err) {\n reject(err);\n } else {\n resolve();\n }\n });\n } else {\n app = await expressServer(config);\n const serverFactory = createServerFactory(config, addr, app);\n serverFactory\n .listen(addr.port || addr.path, addr.host, (): void => {\n // send a message for test\n if (isFunction(process.send)) {\n process.send({\n verdaccio_started: true,\n });\n }\n const addressServer = `${\n addr.path\n ? url.format({\n protocol: 'unix',\n pathname: addr.path,\n })\n : url.format({\n protocol: addr.proto,\n hostname: addr.host,\n port: addr.port,\n pathname: '/',\n })\n }`;\n logger.info(`http address ${addressServer}`);\n logger.info(`version: ${version}`);\n resolve();\n })\n .on('error', function (err): void {\n reject(err);\n process.exitCode = 1;\n });\n function handleShutdownGracefully() {\n logger.info('received shutdown signal - closing server gracefully...');\n serverFactory.close(() => {\n logger.info('server closed.');\n process.exit(0);\n });\n }\n\n for (const signal of ['SIGINT', 'SIGTERM', 'SIGHUP']) {\n // Use once() so that receiving double signals exit the app.\n process.once(signal, handleShutdownGracefully);\n }\n }\n });\n}\n\n/**\n * Exposes a server factory to be instantiated programmatically.\n *\n ```ts\n const app = await runServer(); // default configuration\n const app = await runServer('./config/config.yaml');\n const app = await runServer({ configuration });\n app.listen(4000, (event) => {\n // do something\n });\n ```\n * @param config\n */\nexport async function runServer(config?: string | ConfigYaml): Promise<any> {\n let configurationParsed: ConfigYaml;\n if (config === undefined || typeof config === 'string') {\n const configPathLocation = findConfigFile(config);\n configurationParsed = parseConfigFile(configPathLocation);\n } else if (_.isObject(config)) {\n configurationParsed = config;\n } else {\n throw new Error(API_ERROR.CONFIG_BAD_FORMAT);\n }\n\n setup(configurationParsed.log as any);\n displayExperimentsInfoBox(configurationParsed.flags);\n // FIXME: get only the first match, the multiple address will be removed\n const [addr] = getListListenAddresses(undefined, configurationParsed.listen);\n const app = await expressServer(configurationParsed);\n return createServerFactory(configurationParsed, addr, app);\n}\n"],"mappings":";;;;;;;;AACA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,GAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,KAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,MAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,OAAA,GAAAC,uBAAA,CAAAN,OAAA;AACA,IAAAO,IAAA,GAAAR,sBAAA,CAAAC,OAAA;AAEA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,KAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,GAAAV,OAAA;AACA,IAAAW,OAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,cAAA,GAAAb,sBAAA,CAAAC,OAAA;AAGA,IAAAa,SAAA,GAAAb,OAAA;AACA,IAAAc,YAAA,GAAAd,OAAA;AAA0D,SAAAe,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAV,wBAAAU,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA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MAAM,IAAA4C,eAAa,EAACmB,mBAAmB,CAAC;EACpD,OAAOjE,mBAAmB,CAACiE,mBAAmB,EAAEtE,IAAI,EAAEO,GAAG,CAAC;AAC5D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@verdaccio/node-api",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0-next-7.7",
|
|
4
4
|
"description": "node API",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -25,23 +25,23 @@
|
|
|
25
25
|
"verdaccio"
|
|
26
26
|
],
|
|
27
27
|
"engines": {
|
|
28
|
-
"node": ">=
|
|
29
|
-
"npm": ">=6"
|
|
28
|
+
"node": ">=18"
|
|
30
29
|
},
|
|
31
30
|
"license": "MIT",
|
|
32
31
|
"dependencies": {
|
|
33
|
-
"@verdaccio/
|
|
34
|
-
"@verdaccio/
|
|
35
|
-
"@verdaccio/logger": "
|
|
36
|
-
"@verdaccio/server": "
|
|
37
|
-
"@verdaccio/server-fastify": "
|
|
38
|
-
"core-js": "3.
|
|
32
|
+
"@verdaccio/config": "7.0.0-next-7.7",
|
|
33
|
+
"@verdaccio/core": "7.0.0-next-7.7",
|
|
34
|
+
"@verdaccio/logger": "7.0.0-next-7.7",
|
|
35
|
+
"@verdaccio/server": "7.0.0-next-7.7",
|
|
36
|
+
"@verdaccio/server-fastify": "7.0.0-next-7.7",
|
|
37
|
+
"core-js": "3.35.0",
|
|
39
38
|
"debug": "4.3.4",
|
|
40
39
|
"lodash": "4.17.21"
|
|
41
40
|
},
|
|
42
41
|
"devDependencies": {
|
|
43
|
-
"@verdaccio/types": "
|
|
44
|
-
"
|
|
42
|
+
"@verdaccio/types": "12.0.0-next.2",
|
|
43
|
+
"jest": "29.7.0",
|
|
44
|
+
"selfsigned": "2.4.1",
|
|
45
45
|
"supertest": "6.3.3"
|
|
46
46
|
},
|
|
47
47
|
"publishConfig": {
|