@verdaccio/server 6.0.0-6-next.29 → 6.0.0-6-next.32
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/.babelrc +1 -1
- package/CHANGELOG.md +91 -0
- package/build/debug/index.d.ts +1 -1
- package/build/debug/index.js +1 -1
- package/build/debug/index.js.map +1 -1
- package/build/env.js.map +1 -1
- package/build/index.js.map +1 -1
- package/build/server.d.ts +2 -2
- package/build/server.js +5 -3
- package/build/server.js.map +1 -1
- package/build/utils.d.ts +1 -0
- package/build/utils.js +19 -0
- package/build/utils.js.map +1 -0
- package/jest.config.js +7 -2
- package/package.json +70 -71
- package/src/debug/index.ts +2 -2
- package/src/server.ts +8 -7
- package/src/utils.ts +11 -0
- package/test/_helper.ts +29 -0
- package/test/config/conf.yaml +28 -0
- package/test/config/no_debug.yaml +26 -0
- package/test/config/powered-custom.yaml +29 -0
- package/test/config/powered-disabled.yaml +29 -0
- package/test/config/web-disabled.yaml +27 -0
- package/test/server.spec.ts +113 -0
- package/tsconfig.build.json +1 -1
- package/tsconfig.json +14 -14
- package/jest.setup.js +0 -1
- package/test/.eslintrc +0 -8
- package/test/README.md +0 -12
- package/test/api/api.spec.yaml +0 -87
- package/test/api/helpers/publish-api.js +0 -60
- package/test/api/helpers/utils.ts +0 -149
- package/test/api/htpasswd +0 -10
- package/test/api/index.spec.ts +0 -862
- package/test/api/mock/store/@jquery/jquery/jquery-1.5.1.tgz +0 -0
- package/test/api/mock/store/@jquery/jquery/package.json +0 -76
- package/test/api/mock/store/corrupted-package/package.json +0 -12
- package/test/api/mock/store/jquery/jquery-1.5.1.tgz +0 -0
- package/test/api/mock/store/jquery/package.json +0 -4919
- package/test/api/mock/store/npm_test/package.json +0 -75
- package/test/api/mock/store/vue/package.json +0 -25169
- package/test/api/plugin/filter.ts +0 -25
- package/test/basic/basic.yaml +0 -14
- package/test/basic/index.spec.ts +0 -64
- package/test/jwt/index.spec.ts +0 -163
- package/test/jwt/jwt.yaml +0 -35
- package/test/jwt/mock/store/vue/package.json +0 -25169
- package/test/package-access/index.spec.ts +0 -100
- package/test/package-access/mock/store/.gitkeep +0 -0
- package/test/package-access/mock/store/jquery/jquery-1.5.1.tgz +0 -0
- package/test/package-access/mock/store/jquery/package.json +0 -4919
- package/test/package-access/mock/store/vue/package.json +0 -25169
- package/test/package-access/pkg.access.yaml +0 -12
- package/test/profile/index.spec.ts +0 -129
- package/test/profile/mock/store/.gitkeep +0 -0
- package/test/profile/profile.yaml +0 -21
- package/test/storage/index.spec.ts +0 -219
- package/test/storage/mock/store/@jquery/jquery/jquery-1.5.1.tgz +0 -0
- package/test/storage/mock/store/@jquery/jquery/package.json +0 -76
- package/test/storage/mock/store/corrupted-package/package.json +0 -12
- package/test/storage/mock/store/jquery/jquery-1.5.1.tgz +0 -0
- package/test/storage/mock/store/jquery/package.json +0 -4919
- package/test/storage/mock/store/npm_test/package.json +0 -75
- package/test/storage/store.spec.yaml +0 -24
- package/test/token/index.spec.ts +0 -227
- package/test/token/mock/store/.gitkeep +0 -0
- package/test/token/token.spec.yaml +0 -26
- package/test/web/index.spec.ts +0 -157
- package/test/web/mock/store/.gitkeep +0 -0
- package/test/web/partials/forbidden-place.js +0 -50
- package/test/web/partials/publish-api.js +0 -50
- package/test/web/web.yaml +0 -20
package/.babelrc
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,96 @@
|
|
|
1
1
|
# @verdaccio/server
|
|
2
2
|
|
|
3
|
+
## 6.0.0-6-next.32
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 292c0a37: feat!: replace deprecated request dependency by got
|
|
8
|
+
|
|
9
|
+
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.
|
|
10
|
+
|
|
11
|
+
## Notes
|
|
12
|
+
|
|
13
|
+
- Remove deprecated `request` by other `got`, retry improved, custom Agent ( got does not include it built-in)
|
|
14
|
+
- Remove `async` dependency from storage (used by core) it was linked with proxy somehow safe to remove now
|
|
15
|
+
- Refactor with promises instead callback wherever is possible
|
|
16
|
+
- ~Document the API~
|
|
17
|
+
- Improve testing, integration tests
|
|
18
|
+
- Bugfix
|
|
19
|
+
- Clean up old validations
|
|
20
|
+
- Improve performance
|
|
21
|
+
|
|
22
|
+
## 💥 Breaking changes
|
|
23
|
+
|
|
24
|
+
- Plugin API methods were callbacks based are returning promises, this will break current storage plugins, check documentation for upgrade.
|
|
25
|
+
- 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));`
|
|
26
|
+
- `@verdaccio/streams` stream abort support is legacy is being deprecated removed
|
|
27
|
+
- Remove AWS and Google Cloud packages for future refactoring [#2574](https://github.com/verdaccio/verdaccio/pull/2574).
|
|
28
|
+
|
|
29
|
+
### Minor Changes
|
|
30
|
+
|
|
31
|
+
- 00d1d2a1: chore: env variable for launch fastify
|
|
32
|
+
|
|
33
|
+
- Update fastify to major release `v4.3.0`
|
|
34
|
+
- Update CLI launcher
|
|
35
|
+
|
|
36
|
+
via CLI
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
VERDACCIO_SERVER=fastify verdaccio
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
with docker
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
docker run -it --rm --name verdaccio \
|
|
46
|
+
-e "VERDACCIO_SERVER=8080" -p 8080:8080 \
|
|
47
|
+
-e "VERDACCIO_SERVER=fastify" \
|
|
48
|
+
verdaccio/verdaccio
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Patch Changes
|
|
52
|
+
|
|
53
|
+
- Updated dependencies [292c0a37]
|
|
54
|
+
- Updated dependencies [a3a209b5]
|
|
55
|
+
- Updated dependencies [00d1d2a1]
|
|
56
|
+
- @verdaccio/api@6.0.0-6-next.26
|
|
57
|
+
- @verdaccio/auth@6.0.0-6-next.23
|
|
58
|
+
- @verdaccio/config@6.0.0-6-next.15
|
|
59
|
+
- @verdaccio/core@6.0.0-6-next.6
|
|
60
|
+
- @verdaccio/loaders@6.0.0-6-next.13
|
|
61
|
+
- @verdaccio/logger@6.0.0-6-next.12
|
|
62
|
+
- @verdaccio/middleware@6.0.0-6-next.23
|
|
63
|
+
- verdaccio-audit@11.0.0-6-next.9
|
|
64
|
+
- @verdaccio/store@6.0.0-6-next.23
|
|
65
|
+
- @verdaccio/utils@6.0.0-6-next.12
|
|
66
|
+
- @verdaccio/web@6.0.0-6-next.30
|
|
67
|
+
|
|
68
|
+
## 6.0.0-6-next.31
|
|
69
|
+
|
|
70
|
+
### Patch Changes
|
|
71
|
+
|
|
72
|
+
- Updated dependencies [a828a5f6]
|
|
73
|
+
- @verdaccio/web@6.0.0-6-next.29
|
|
74
|
+
- @verdaccio/api@6.0.0-6-next.25
|
|
75
|
+
- @verdaccio/store@6.0.0-6-next.22
|
|
76
|
+
|
|
77
|
+
## 6.0.0-6-next.30
|
|
78
|
+
|
|
79
|
+
### Patch Changes
|
|
80
|
+
|
|
81
|
+
- Updated dependencies [d43894e8]
|
|
82
|
+
- Updated dependencies [d08fe29d]
|
|
83
|
+
- @verdaccio/config@6.0.0-6-next.14
|
|
84
|
+
- @verdaccio/web@6.0.0-6-next.28
|
|
85
|
+
- @verdaccio/api@6.0.0-6-next.25
|
|
86
|
+
- @verdaccio/auth@6.0.0-6-next.22
|
|
87
|
+
- @verdaccio/loaders@6.0.0-6-next.12
|
|
88
|
+
- @verdaccio/store@6.0.0-6-next.22
|
|
89
|
+
- @verdaccio/core@6.0.0-6-next.5
|
|
90
|
+
- @verdaccio/logger@6.0.0-6-next.11
|
|
91
|
+
- verdaccio-audit@11.0.0-6-next.8
|
|
92
|
+
- @verdaccio/middleware@6.0.0-6-next.22
|
|
93
|
+
|
|
3
94
|
## 6.0.0-6-next.29
|
|
4
95
|
|
|
5
96
|
### Major Changes
|
package/build/debug/index.d.ts
CHANGED
package/build/debug/index.js
CHANGED
package/build/debug/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":["app","configPath","get","req","res","next","global","gc","pid","process","main","conf","mem","memoryUsage"],"sources":["../../src/debug/index.ts"],"sourcesContent":["import { Application } from 'express';\n\nimport { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../../types/custom';\n\nexport default (app: Application, configPath?: string): void => {\n // Hook for tests only\n app.get(\n '/-/_debug',\n function (req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer): void {\n if (global.gc) {\n global.gc();\n }\n\n next({\n pid: process.pid,\n // @ts-ignore\n main: process.main,\n conf: configPath,\n mem: process.memoryUsage(),\n gc: global.gc,\n });\n }\n );\n};\n"],"mappings":";;;;;;;eAIe,CAACA,GAAD,EAAmBC,UAAnB,KAAiD;EAC9D;EACAD,GAAG,CAACE,GAAJ,CACE,WADF,EAEE,UAAUC,GAAV,EAA+BC,GAA/B,EAAqDC,IAArD,EAAmF;IACjF,IAAIC,MAAM,CAACC,EAAX,EAAe;MACbD,MAAM,CAACC,EAAP;IACD;;IAEDF,IAAI,CAAC;MACHG,GAAG,EAAEC,OAAO,CAACD,GADV;MAEH;MACAE,IAAI,EAAED,OAAO,CAACC,IAHX;MAIHC,IAAI,EAAEV,UAJH;MAKHW,GAAG,EAAEH,OAAO,CAACI,WAAR,EALF;MAMHN,EAAE,EAAED,MAAM,CAACC;IANR,CAAD,CAAJ;EAQD,CAfH;AAiBD,C"}
|
package/build/env.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"env.js","names":[],"sources":["../src/env.ts"],"sourcesContent":["// const path = require('path');\n//\n// const APP_ROOT = path.resolve(__dirname, '../../');\n//\n// module.exports = {\n// APP_ROOT,\n// SRC_ROOT: path.resolve(APP_ROOT, 'src/')\n// };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["export { default } from './server';\n"],"mappings":";;;;;;;;;;;;AAAA"}
|
package/build/server.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { IBasicAuth } from '@verdaccio/auth';
|
|
2
2
|
import { Storage } from '@verdaccio/store';
|
|
3
|
-
import {
|
|
3
|
+
import { ConfigYaml } from '@verdaccio/types';
|
|
4
4
|
import { IPlugin } from '@verdaccio/types';
|
|
5
5
|
export interface IPluginMiddleware<T> extends IPlugin<T> {
|
|
6
6
|
register_middlewares(app: any, auth: IBasicAuth<T>, storage: Storage): void;
|
|
7
7
|
}
|
|
8
|
-
declare const _default: (configHash:
|
|
8
|
+
declare const _default: (configHash: ConfigYaml) => Promise<any>;
|
|
9
9
|
export default _default;
|
package/build/server.js
CHANGED
|
@@ -39,6 +39,8 @@ var _web = _interopRequireDefault(require("@verdaccio/web"));
|
|
|
39
39
|
|
|
40
40
|
var _debug2 = _interopRequireDefault(require("./debug"));
|
|
41
41
|
|
|
42
|
+
var _utils = require("./utils");
|
|
43
|
+
|
|
42
44
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
43
45
|
|
|
44
46
|
const debug = (0, _debug.default)('verdaccio:server');
|
|
@@ -56,7 +58,7 @@ const defineAPI = function (config, storage) {
|
|
|
56
58
|
app.use(_middleware.log);
|
|
57
59
|
app.use(_middleware.errorReportingMiddleware);
|
|
58
60
|
app.use(function (req, res, next) {
|
|
59
|
-
res.setHeader('
|
|
61
|
+
res.setHeader('x-powered-by', (0, _utils.getUserAgent)(config.user_agent));
|
|
60
62
|
next();
|
|
61
63
|
});
|
|
62
64
|
app.use((0, _compression.default)());
|
|
@@ -66,7 +68,7 @@ const defineAPI = function (config, storage) {
|
|
|
66
68
|
}); // Hook for tests only
|
|
67
69
|
|
|
68
70
|
if (config._debug) {
|
|
69
|
-
(0, _debug2.default)(app, config.
|
|
71
|
+
(0, _debug2.default)(app, config.configPath);
|
|
70
72
|
} // register middleware plugins
|
|
71
73
|
|
|
72
74
|
|
|
@@ -105,7 +107,7 @@ const defineAPI = function (config, storage) {
|
|
|
105
107
|
|
|
106
108
|
|
|
107
109
|
app.get('/*', function (req, res, next) {
|
|
108
|
-
next(_core.errorUtils.getNotFound(
|
|
110
|
+
next(_core.errorUtils.getNotFound('resource not found'));
|
|
109
111
|
});
|
|
110
112
|
app.use(function (err, req, res, next) {
|
|
111
113
|
if (_lodash.default.isError(err)) {
|
package/build/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"server.js","names":["debug","buildDebug","defineAPI","config","storage","auth","Auth","app","express","limiter","RateLimit","serverSettings","rateLimit","set","process","env","NODE_ENV","use","cors","log","errorReportingMiddleware","req","res","next","setHeader","getUserAgent","user_agent","compression","get","url","_debug","hookDebug","configPath","plugin_params","logger","plugins","loadPlugin","middlewares","plugin","register_middlewares","_","isEmpty","push","AuditMiddleware","enabled","strict_ssl","forEach","apiEndpoint","webMiddleware","errorUtils","getNotFound","API_ERROR","WEB_DISABLED","err","isError","code","statusCode","HTTP_STATUS","NOT_MODIFIED","isFunction","locals","report_error","noop","final","configHash","AppConfig","cloneDeep","filters","filter_metadata","Storage","init","error","msg","Error"],"sources":["../src/server.ts"],"sourcesContent":["import compression from 'compression';\nimport cors from 'cors';\nimport buildDebug from 'debug';\nimport express, { Application } from 'express';\nimport RateLimit from 'express-rate-limit';\nimport { HttpError } from 'http-errors';\nimport _ from 'lodash';\nimport AuditMiddleware from 'verdaccio-audit';\n\nimport apiEndpoint from '@verdaccio/api';\nimport { Auth, IBasicAuth } from '@verdaccio/auth';\nimport { Config as AppConfig } from '@verdaccio/config';\nimport { API_ERROR, HTTP_STATUS, errorUtils } from '@verdaccio/core';\nimport { loadPlugin } from '@verdaccio/loaders';\nimport { logger } from '@verdaccio/logger';\nimport { errorReportingMiddleware, final, log } from '@verdaccio/middleware';\nimport { Storage } from '@verdaccio/store';\nimport { ConfigYaml } from '@verdaccio/types';\nimport { Config as IConfig, IPlugin, IPluginStorageFilter } from '@verdaccio/types';\nimport webMiddleware from '@verdaccio/web';\n\nimport { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../types/custom';\nimport hookDebug from './debug';\nimport { getUserAgent } from './utils';\n\nexport interface IPluginMiddleware<T> extends IPlugin<T> {\n register_middlewares(app: any, auth: IBasicAuth<T>, storage: Storage): void;\n}\n\nconst debug = buildDebug('verdaccio:server');\n\nconst defineAPI = function (config: IConfig, storage: Storage): any {\n const auth: Auth = new Auth(config);\n const app: Application = express();\n const limiter = new RateLimit(config.serverSettings.rateLimit);\n // run in production mode by default, just in case\n // it shouldn't make any difference anyway\n app.set('env', process.env.NODE_ENV || 'production');\n app.use(cors());\n app.use(limiter);\n\n // Router setup\n app.use(log);\n app.use(errorReportingMiddleware);\n app.use(function (req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer): void {\n res.setHeader('x-powered-by', getUserAgent(config.user_agent));\n next();\n });\n\n app.use(compression());\n\n app.get(\n '/favicon.ico',\n function (req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer): void {\n req.url = '/-/static/favicon.png';\n next();\n }\n );\n\n // Hook for tests only\n if (config._debug) {\n hookDebug(app, config.configPath);\n }\n\n // register middleware plugins\n const plugin_params = {\n config: config,\n logger: logger,\n };\n\n const plugins: IPluginMiddleware<IConfig>[] = loadPlugin(\n config,\n config.middlewares,\n plugin_params,\n function (plugin: IPluginMiddleware<IConfig>) {\n return plugin.register_middlewares;\n }\n );\n\n if (_.isEmpty(plugins)) {\n plugins.push(\n new AuditMiddleware(\n { ...config, enabled: true, strict_ssl: true },\n { config, logger: logger }\n )\n );\n }\n\n plugins.forEach((plugin: IPluginMiddleware<IConfig>) => {\n plugin.register_middlewares(app, auth, storage);\n });\n\n // For npm request\n // @ts-ignore\n app.use(apiEndpoint(config, auth, storage));\n\n // For WebUI & WebUI API\n if (_.get(config, 'web.enable', true)) {\n app.use(webMiddleware(config, auth, storage));\n } else {\n app.get('/', function (req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer) {\n next(errorUtils.getNotFound(API_ERROR.WEB_DISABLED));\n });\n }\n\n // Catch 404\n app.get('/*', function (req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer) {\n next(errorUtils.getNotFound('resource not found'));\n });\n\n app.use(function (\n err: HttpError,\n req: $RequestExtend,\n res: $ResponseExtend,\n next: $NextFunctionVer\n ) {\n if (_.isError(err)) {\n if (err.code === 'ECONNABORT' && res.statusCode === HTTP_STATUS.NOT_MODIFIED) {\n return next();\n }\n if (_.isFunction(res.locals.report_error) === false) {\n // in case of very early error this middleware may not be loaded before error is generated\n // fixing that\n errorReportingMiddleware(req, res, _.noop);\n }\n res.locals.report_error(err);\n } else {\n // Fall to Middleware.final\n return next(err);\n }\n });\n\n app.use(final);\n\n return app;\n};\n\nexport default (async function (configHash: ConfigYaml): Promise<any> {\n debug('start server');\n const config: IConfig = new AppConfig(_.cloneDeep(configHash) as any);\n // register middleware plugins\n const plugin_params = {\n config: config,\n logger,\n };\n const filters = loadPlugin(\n config,\n config.filters || {},\n plugin_params,\n (plugin: IPluginStorageFilter<IConfig>) => plugin.filter_metadata\n );\n debug('loaded filter plugin');\n // @ts-ignore\n const storage: Storage = new Storage(config);\n try {\n // waits until init calls have been initialized\n debug('storage init start');\n await storage.init(config, filters);\n debug('storage init end');\n } catch (err: any) {\n logger.error({ error: err.msg }, 'storage has failed: @{error}');\n throw new Error(err);\n }\n return defineAPI(config, storage);\n});\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAGA;;AAGA;;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C,CAAhB;EAMApE,KAAK,CAAC,sBAAD,CAAL,CAdoE,CAepE;;EACA,MAAMI,OAAgB,GAAG,IAAIiE,cAAJ,CAAYlE,MAAZ,CAAzB;;EACA,IAAI;IACF;IACAH,KAAK,CAAC,oBAAD,CAAL;IACA,MAAMI,OAAO,CAACkE,IAAR,CAAanE,MAAb,EAAqBgE,OAArB,CAAN;IACAnE,KAAK,CAAC,kBAAD,CAAL;EACD,CALD,CAKE,OAAOqD,GAAP,EAAiB;IACjBnB,cAAA,CAAOqC,KAAP,CAAa;MAAEA,KAAK,EAAElB,GAAG,CAACmB;IAAb,CAAb,EAAiC,8BAAjC;;IACA,MAAM,IAAIC,KAAJ,CAAUpB,GAAV,CAAN;EACD;;EACD,OAAOnD,SAAS,CAACC,MAAD,EAASC,OAAT,CAAhB;AACD,C"}
|
package/build/utils.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getUserAgent(userAgent: string): string;
|
package/build/utils.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getUserAgent = getUserAgent;
|
|
7
|
+
|
|
8
|
+
const pkgVersion = require('../package.json').version;
|
|
9
|
+
|
|
10
|
+
function getUserAgent(userAgent) {
|
|
11
|
+
if (typeof userAgent === 'string') {
|
|
12
|
+
return userAgent;
|
|
13
|
+
} else if (userAgent === false) {
|
|
14
|
+
return 'hidden';
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return `verdaccio/${pkgVersion}`;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","names":["pkgVersion","require","version","getUserAgent","userAgent"],"sources":["../src/utils.ts"],"sourcesContent":["const pkgVersion = require('../package.json').version;\n\nexport function getUserAgent(userAgent: string): string {\n if (typeof userAgent === 'string') {\n return userAgent;\n } else if (userAgent === false) {\n return 'hidden';\n }\n\n return `verdaccio/${pkgVersion}`;\n}\n"],"mappings":";;;;;;;AAAA,MAAMA,UAAU,GAAGC,OAAO,CAAC,iBAAD,CAAP,CAA2BC,OAA9C;;AAEO,SAASC,YAAT,CAAsBC,SAAtB,EAAiD;EACtD,IAAI,OAAOA,SAAP,KAAqB,QAAzB,EAAmC;IACjC,OAAOA,SAAP;EACD,CAFD,MAEO,IAAIA,SAAS,KAAK,KAAlB,EAAyB;IAC9B,OAAO,QAAP;EACD;;EAED,OAAQ,aAAYJ,UAAW,EAA/B;AACD"}
|
package/jest.config.js
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
const config = require('
|
|
1
|
+
const config = require('../../../jest/config');
|
|
2
2
|
|
|
3
3
|
module.exports = Object.assign({}, config, {
|
|
4
|
-
|
|
4
|
+
coverageThreshold: {
|
|
5
|
+
global: {
|
|
6
|
+
// FIXME: increase to 90
|
|
7
|
+
lines: 85,
|
|
8
|
+
},
|
|
9
|
+
},
|
|
5
10
|
});
|
package/package.json
CHANGED
|
@@ -1,72 +1,71 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
2
|
+
"name": "@verdaccio/server",
|
|
3
|
+
"version": "6.0.0-6-next.32",
|
|
4
|
+
"description": "server logic",
|
|
5
|
+
"main": "./build/index.js",
|
|
6
|
+
"types": "build/index.d.ts",
|
|
7
|
+
"author": {
|
|
8
|
+
"name": "Juan Picado",
|
|
9
|
+
"email": "juanpicado19@gmail.com"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "https",
|
|
13
|
+
"url": "https://github.com/verdaccio/verdaccio"
|
|
14
|
+
},
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"homepage": "https://verdaccio.org",
|
|
17
|
+
"keywords": [
|
|
18
|
+
"private",
|
|
19
|
+
"package",
|
|
20
|
+
"repository",
|
|
21
|
+
"registry",
|
|
22
|
+
"enterprise",
|
|
23
|
+
"modules",
|
|
24
|
+
"proxy",
|
|
25
|
+
"server",
|
|
26
|
+
"verdaccio"
|
|
27
|
+
],
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": ">=14",
|
|
30
|
+
"npm": ">=6"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@verdaccio/api": "6.0.0-6-next.26",
|
|
34
|
+
"@verdaccio/auth": "6.0.0-6-next.23",
|
|
35
|
+
"@verdaccio/core": "6.0.0-6-next.6",
|
|
36
|
+
"@verdaccio/config": "6.0.0-6-next.15",
|
|
37
|
+
"@verdaccio/loaders": "6.0.0-6-next.13",
|
|
38
|
+
"@verdaccio/logger": "6.0.0-6-next.12",
|
|
39
|
+
"@verdaccio/middleware": "6.0.0-6-next.23",
|
|
40
|
+
"@verdaccio/store": "6.0.0-6-next.23",
|
|
41
|
+
"@verdaccio/utils": "6.0.0-6-next.12",
|
|
42
|
+
"@verdaccio/web": "6.0.0-6-next.30",
|
|
43
|
+
"verdaccio-audit": "11.0.0-6-next.9",
|
|
44
|
+
"compression": "1.7.4",
|
|
45
|
+
"cors": "2.8.5",
|
|
46
|
+
"debug": "4.3.4",
|
|
47
|
+
"express": "4.18.1",
|
|
48
|
+
"express-rate-limit": "5.5.1",
|
|
49
|
+
"lodash": "4.17.21"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@types/node": "16.11.47",
|
|
53
|
+
"@verdaccio/proxy": "6.0.0-6-next.21",
|
|
54
|
+
"@verdaccio/test-helper": "1.1.0-6-next.1",
|
|
55
|
+
"http-errors": "1.8.1"
|
|
56
|
+
},
|
|
57
|
+
"funding": {
|
|
58
|
+
"type": "opencollective",
|
|
59
|
+
"url": "https://opencollective.com/verdaccio"
|
|
60
|
+
},
|
|
61
|
+
"scripts": {
|
|
62
|
+
"clean": "rimraf ./build",
|
|
63
|
+
"test": "jest",
|
|
64
|
+
"type-check": "tsc --noEmit -p tsconfig.build.json",
|
|
65
|
+
"build:types": "tsc --emitDeclarationOnly -p tsconfig.build.json",
|
|
66
|
+
"watch": "pnpm build:js -- --watch",
|
|
67
|
+
"build:js": "babel src/ --out-dir build/ --copy-files --extensions \".ts,.tsx\" --source-maps",
|
|
68
|
+
"build": "pnpm run build:js && pnpm run build:types"
|
|
69
|
+
},
|
|
70
|
+
"readme": "# @verdaccio/server\n\n[](https://opencollective.com/verdaccio)\n[](https://stackshare.io/verdaccio)\n[](https://github.com/verdaccio/verdaccio/blob/master/LICENSE)\n[](https://crowdin.com/project/verdaccio)\n[](https://www.tickgit.com/browse?repo=github.com/verdaccio/verdaccio)\n\n[](https://twitter.com/verdaccio_npm)\n[](https://github.com/verdaccio/verdaccio/stargazers)\n\n## Donations\n\nVerdaccio is run by **volunteers**; nobody is working full-time on it. If you find this project to be useful and would like to support its development, consider making a donation - **your logo might end up in this readme.** 😉\n\n**[Donate](https://opencollective.com/verdaccio)** 💵👍🏻 starting from _\\$1/month_ or just one single contribution.\n\n## Report a vulnerability\n\nIf you want to report a security vulnerability, please follow the steps which we have defined for you in our [security policy](https://github.com/verdaccio/verdaccio/security/policy).\n\n## Open Collective Sponsors\n\nSupport this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/verdaccio#sponsor)]\n\n[](https://opencollective.com/verdaccio/sponsor/0/website)\n[](https://opencollective.com/verdaccio/sponsor/1/website)\n[](https://opencollective.com/verdaccio/sponsor/2/website)\n[](https://opencollective.com/verdaccio/sponsor/3/website)\n[](https://opencollective.com/verdaccio/sponsor/4/website)\n[](https://opencollective.com/verdaccio/sponsor/5/website)\n[](https://opencollective.com/verdaccio/sponsor/6/website)\n[](https://opencollective.com/verdaccio/sponsor/7/website)\n[](https://opencollective.com/verdaccio/sponsor/8/website)\n[](https://opencollective.com/verdaccio/sponsor/9/website)\n\n## Open Collective Backers\n\nThank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/verdaccio#backer)]\n\n[](https://opencollective.com/verdaccio#backers)\n\n## Special Thanks\n\nThanks to the following companies to help us to achieve our goals providing free open source licenses.\n\n[](https://www.jetbrains.com/)\n[](https://crowdin.com/)\n[](https://balsamiq.com/)\n\n## Contributors\n\nThis project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].\n\n[](../../graphs/contributors)\n\n### FAQ / Contact / Troubleshoot\n\nIf you have any issue you can try the following options, do no desist to ask or check our issues database, perhaps someone has asked already what you are looking for.\n\n- [Blog](https://verdaccio.org/blog/)\n- [Donations](https://opencollective.com/verdaccio)\n- [Reporting an issue](https://github.com/verdaccio/verdaccio/blob/master/CONTRIBUTING.md#reporting-a-bug)\n- [Running discussions](https://github.com/verdaccio/verdaccio/issues?q=is%3Aissue+is%3Aopen+label%3Adiscuss)\n- [Chat](http://chat.verdaccio.org/)\n- [Logos](https://verdaccio.org/docs/en/logo)\n- [Docker Examples](https://github.com/verdaccio/docker-examples)\n- [FAQ](https://github.com/verdaccio/verdaccio/issues?utf8=%E2%9C%93&q=is%3Aissue%20label%3Aquestion%20)\n\n### License\n\nVerdaccio is [MIT licensed](https://github.com/verdaccio/verdaccio/blob/master/LICENSE)\n\nThe Verdaccio documentation and logos (excluding /thanks, e.g., .md, .png, .sketch) files within the /assets folder) is\n[Creative Commons licensed](https://github.com/verdaccio/verdaccio/blob/master/LICENSE-docs).\n"
|
|
71
|
+
}
|
package/src/debug/index.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Application } from 'express';
|
|
|
2
2
|
|
|
3
3
|
import { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../../types/custom';
|
|
4
4
|
|
|
5
|
-
export default (app: Application, configPath
|
|
5
|
+
export default (app: Application, configPath?: string): void => {
|
|
6
6
|
// Hook for tests only
|
|
7
7
|
app.get(
|
|
8
8
|
'/-/_debug',
|
|
@@ -14,7 +14,7 @@ export default (app: Application, configPath: string): void => {
|
|
|
14
14
|
next({
|
|
15
15
|
pid: process.pid,
|
|
16
16
|
// @ts-ignore
|
|
17
|
-
main: process.
|
|
17
|
+
main: process.main,
|
|
18
18
|
conf: configPath,
|
|
19
19
|
mem: process.memoryUsage(),
|
|
20
20
|
gc: global.gc,
|
package/src/server.ts
CHANGED
|
@@ -15,12 +15,13 @@ import { loadPlugin } from '@verdaccio/loaders';
|
|
|
15
15
|
import { logger } from '@verdaccio/logger';
|
|
16
16
|
import { errorReportingMiddleware, final, log } from '@verdaccio/middleware';
|
|
17
17
|
import { Storage } from '@verdaccio/store';
|
|
18
|
-
import {
|
|
18
|
+
import { ConfigYaml } from '@verdaccio/types';
|
|
19
19
|
import { Config as IConfig, IPlugin, IPluginStorageFilter } from '@verdaccio/types';
|
|
20
20
|
import webMiddleware from '@verdaccio/web';
|
|
21
21
|
|
|
22
22
|
import { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../types/custom';
|
|
23
23
|
import hookDebug from './debug';
|
|
24
|
+
import { getUserAgent } from './utils';
|
|
24
25
|
|
|
25
26
|
export interface IPluginMiddleware<T> extends IPlugin<T> {
|
|
26
27
|
register_middlewares(app: any, auth: IBasicAuth<T>, storage: Storage): void;
|
|
@@ -42,7 +43,7 @@ const defineAPI = function (config: IConfig, storage: Storage): any {
|
|
|
42
43
|
app.use(log);
|
|
43
44
|
app.use(errorReportingMiddleware);
|
|
44
45
|
app.use(function (req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer): void {
|
|
45
|
-
res.setHeader('
|
|
46
|
+
res.setHeader('x-powered-by', getUserAgent(config.user_agent));
|
|
46
47
|
next();
|
|
47
48
|
});
|
|
48
49
|
|
|
@@ -58,7 +59,7 @@ const defineAPI = function (config: IConfig, storage: Storage): any {
|
|
|
58
59
|
|
|
59
60
|
// Hook for tests only
|
|
60
61
|
if (config._debug) {
|
|
61
|
-
hookDebug(app, config.
|
|
62
|
+
hookDebug(app, config.configPath);
|
|
62
63
|
}
|
|
63
64
|
|
|
64
65
|
// register middleware plugins
|
|
@@ -104,7 +105,7 @@ const defineAPI = function (config: IConfig, storage: Storage): any {
|
|
|
104
105
|
|
|
105
106
|
// Catch 404
|
|
106
107
|
app.get('/*', function (req: $RequestExtend, res: $ResponseExtend, next: $NextFunctionVer) {
|
|
107
|
-
next(errorUtils.getNotFound(
|
|
108
|
+
next(errorUtils.getNotFound('resource not found'));
|
|
108
109
|
});
|
|
109
110
|
|
|
110
111
|
app.use(function (
|
|
@@ -134,13 +135,13 @@ const defineAPI = function (config: IConfig, storage: Storage): any {
|
|
|
134
135
|
return app;
|
|
135
136
|
};
|
|
136
137
|
|
|
137
|
-
export default (async function (configHash:
|
|
138
|
+
export default (async function (configHash: ConfigYaml): Promise<any> {
|
|
138
139
|
debug('start server');
|
|
139
|
-
const config: IConfig = new AppConfig(_.cloneDeep(configHash));
|
|
140
|
+
const config: IConfig = new AppConfig(_.cloneDeep(configHash) as any);
|
|
140
141
|
// register middleware plugins
|
|
141
142
|
const plugin_params = {
|
|
142
143
|
config: config,
|
|
143
|
-
logger
|
|
144
|
+
logger,
|
|
144
145
|
};
|
|
145
146
|
const filters = loadPlugin(
|
|
146
147
|
config,
|
package/src/utils.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const pkgVersion = require('../package.json').version;
|
|
2
|
+
|
|
3
|
+
export function getUserAgent(userAgent: string): string {
|
|
4
|
+
if (typeof userAgent === 'string') {
|
|
5
|
+
return userAgent;
|
|
6
|
+
} else if (userAgent === false) {
|
|
7
|
+
return 'hidden';
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
return `verdaccio/${pkgVersion}`;
|
|
11
|
+
}
|
package/test/_helper.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Application } from 'express';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
|
|
4
|
+
import { parseConfigFile } from '@verdaccio/config';
|
|
5
|
+
import { fileUtils } from '@verdaccio/core';
|
|
6
|
+
import { setup } from '@verdaccio/logger';
|
|
7
|
+
import { generateRandomHexString } from '@verdaccio/utils';
|
|
8
|
+
|
|
9
|
+
import apiMiddleware from '../src';
|
|
10
|
+
|
|
11
|
+
setup();
|
|
12
|
+
|
|
13
|
+
export const getConf = async (conf) => {
|
|
14
|
+
const configPath = path.join(__dirname, 'config', conf);
|
|
15
|
+
const config = parseConfigFile(configPath);
|
|
16
|
+
// generate and create storage folder
|
|
17
|
+
const storage = await fileUtils.createTempFolder('config');
|
|
18
|
+
config.storage = storage;
|
|
19
|
+
// custom config to avoid conflict with other tests
|
|
20
|
+
config.auth.htpasswd.file = path.join(
|
|
21
|
+
storage,
|
|
22
|
+
`${config.auth.htpasswd.file}-${generateRandomHexString()}`
|
|
23
|
+
);
|
|
24
|
+
return config;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export async function initializeServer(configName): Promise<Application> {
|
|
28
|
+
return apiMiddleware(await getConf(configName));
|
|
29
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# storage: this is generated on _helper file
|
|
2
|
+
|
|
3
|
+
auth:
|
|
4
|
+
htpasswd:
|
|
5
|
+
file: ./htpasswd-package
|
|
6
|
+
|
|
7
|
+
web:
|
|
8
|
+
enable: true
|
|
9
|
+
title: verdaccio
|
|
10
|
+
|
|
11
|
+
publish:
|
|
12
|
+
allow_offline: false
|
|
13
|
+
|
|
14
|
+
uplinks:
|
|
15
|
+
|
|
16
|
+
log: { type: stdout, format: pretty, level: trace }
|
|
17
|
+
|
|
18
|
+
packages:
|
|
19
|
+
'@*/*':
|
|
20
|
+
access: $all
|
|
21
|
+
publish: $all
|
|
22
|
+
unpublish: none
|
|
23
|
+
'**':
|
|
24
|
+
access: $all
|
|
25
|
+
publish: $all
|
|
26
|
+
unpublish: none
|
|
27
|
+
|
|
28
|
+
_debug: true
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# storage: this is generated on _helper file
|
|
2
|
+
|
|
3
|
+
auth:
|
|
4
|
+
htpasswd:
|
|
5
|
+
file: ./htpasswd-package
|
|
6
|
+
|
|
7
|
+
web:
|
|
8
|
+
enable: true
|
|
9
|
+
title: verdaccio
|
|
10
|
+
|
|
11
|
+
publish:
|
|
12
|
+
allow_offline: false
|
|
13
|
+
|
|
14
|
+
uplinks:
|
|
15
|
+
|
|
16
|
+
log: { type: stdout, format: pretty, level: trace }
|
|
17
|
+
|
|
18
|
+
packages:
|
|
19
|
+
'@*/*':
|
|
20
|
+
access: $all
|
|
21
|
+
publish: $all
|
|
22
|
+
unpublish: none
|
|
23
|
+
'**':
|
|
24
|
+
access: $all
|
|
25
|
+
publish: $all
|
|
26
|
+
unpublish: none
|