@verdaccio/config 6.0.0-6-next.14 → 6.0.0-6-next.17

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.
Files changed (55) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/build/agent.js +1 -11
  3. package/build/agent.js.map +1 -1
  4. package/build/builder.d.ts +18 -0
  5. package/build/builder.js +77 -0
  6. package/build/builder.js.map +1 -0
  7. package/build/conf/default.yaml +104 -27
  8. package/build/conf/docker.yaml +120 -43
  9. package/build/conf/index.d.ts +4 -0
  10. package/build/conf/index.js +16 -0
  11. package/build/conf/index.js.map +1 -0
  12. package/build/config-path.js.map +1 -1
  13. package/build/config-utils.js.map +1 -1
  14. package/build/config.d.ts +5 -2
  15. package/build/config.js +9 -1
  16. package/build/config.js.map +1 -1
  17. package/build/index.d.ts +3 -1
  18. package/build/index.js +43 -11
  19. package/build/index.js.map +1 -1
  20. package/build/package-access.js +3 -1
  21. package/build/package-access.js.map +1 -1
  22. package/build/parse.d.ts +6 -2
  23. package/build/parse.js +33 -3
  24. package/build/parse.js.map +1 -1
  25. package/build/security.js.map +1 -1
  26. package/build/serverSettings.js.map +1 -1
  27. package/build/token.js.map +1 -1
  28. package/build/uplinks.js +1 -1
  29. package/build/uplinks.js.map +1 -1
  30. package/build/user.js.map +1 -1
  31. package/jest.config.js +10 -1
  32. package/package.json +58 -57
  33. package/src/agent.ts +1 -7
  34. package/src/builder.ts +72 -0
  35. package/src/conf/default.yaml +104 -27
  36. package/src/conf/docker.yaml +120 -43
  37. package/src/conf/index.ts +8 -0
  38. package/src/config.ts +11 -3
  39. package/src/index.ts +3 -1
  40. package/src/package-access.ts +2 -0
  41. package/src/parse.ts +33 -5
  42. package/src/uplinks.ts +1 -1
  43. package/test/__snapshots__/builder.spec.ts.snap +24 -0
  44. package/test/__snapshots__/config-parsing.spec.ts.snap +44 -0
  45. package/test/builder.spec.ts +65 -0
  46. package/test/config-parsing.spec.ts +54 -30
  47. package/test/config-utils.spec.ts +21 -0
  48. package/test/config.spec.ts +3 -2
  49. package/test/partials/config/js/from-js-to-yaml.js +15 -0
  50. package/test/partials/exist/README.md +1 -0
  51. package/test/utils.spec.ts +20 -35
  52. package/build/string.d.ts +0 -1
  53. package/build/string.js +0 -11
  54. package/build/string.js.map +0 -1
  55. package/src/string.ts +0 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,55 @@
1
1
  # @verdaccio/config
2
2
 
3
+ ## 6.0.0-6-next.17
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [b849128d]
8
+ - @verdaccio/core@6.0.0-6-next.8
9
+ - @verdaccio/utils@6.0.0-6-next.14
10
+
11
+ ## 6.0.0-6-next.16
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies [351aeeaa]
16
+ - @verdaccio/core@6.0.0-6-next.7
17
+ - @verdaccio/utils@6.0.0-6-next.13
18
+
19
+ ## 6.0.0-6-next.15
20
+
21
+ ### Major Changes
22
+
23
+ - 292c0a37: feat!: replace deprecated request dependency by got
24
+
25
+ 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.
26
+
27
+ ## Notes
28
+
29
+ - Remove deprecated `request` by other `got`, retry improved, custom Agent ( got does not include it built-in)
30
+ - Remove `async` dependency from storage (used by core) it was linked with proxy somehow safe to remove now
31
+ - Refactor with promises instead callback wherever is possible
32
+ - ~Document the API~
33
+ - Improve testing, integration tests
34
+ - Bugfix
35
+ - Clean up old validations
36
+ - Improve performance
37
+
38
+ ## 💥 Breaking changes
39
+
40
+ - Plugin API methods were callbacks based are returning promises, this will break current storage plugins, check documentation for upgrade.
41
+ - 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));`
42
+ - `@verdaccio/streams` stream abort support is legacy is being deprecated removed
43
+ - Remove AWS and Google Cloud packages for future refactoring [#2574](https://github.com/verdaccio/verdaccio/pull/2574).
44
+
45
+ ### Patch Changes
46
+
47
+ - Updated dependencies [292c0a37]
48
+ - Updated dependencies [a3a209b5]
49
+ - Updated dependencies [00d1d2a1]
50
+ - @verdaccio/core@6.0.0-6-next.6
51
+ - @verdaccio/utils@6.0.0-6-next.12
52
+
3
53
  ## 6.0.0-6-next.14
4
54
 
5
55
  ### Minor Changes
package/build/agent.js CHANGED
@@ -5,19 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.getUserAgent = getUserAgent;
7
7
 
8
- var _assert = _interopRequireDefault(require("assert"));
9
-
10
- var _lodash = _interopRequireDefault(require("lodash"));
11
-
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
14
8
  const pkgVersion = require('../package.json').version;
15
9
 
16
- const pkgName = require('../package.json').name;
17
-
18
10
  function getUserAgent() {
19
- (0, _assert.default)(_lodash.default.isString(pkgName));
20
- (0, _assert.default)(_lodash.default.isString(pkgVersion));
21
- return `${pkgName}/${pkgVersion}`;
11
+ return `verdaccio/${pkgVersion}`;
22
12
  }
23
13
  //# sourceMappingURL=agent.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/agent.ts"],"names":["pkgVersion","require","version","pkgName","name","getUserAgent","_","isString"],"mappings":";;;;;;;AAAA;;AACA;;;;AAEA,MAAMA,UAAU,GAAGC,OAAO,CAAC,iBAAD,CAAP,CAA2BC,OAA9C;;AACA,MAAMC,OAAO,GAAGF,OAAO,CAAC,iBAAD,CAAP,CAA2BG,IAA3C;;AAEO,SAASC,YAAT,GAAgC;AACrC,uBAAOC,gBAAEC,QAAF,CAAWJ,OAAX,CAAP;AACA,uBAAOG,gBAAEC,QAAF,CAAWP,UAAX,CAAP;AACA,SAAQ,GAAEG,OAAQ,IAAGH,UAAW,EAAhC;AACD","sourcesContent":["import assert from 'assert';\nimport _ from 'lodash';\n\nconst pkgVersion = require('../package.json').version;\nconst pkgName = require('../package.json').name;\n\nexport function getUserAgent(): string {\n assert(_.isString(pkgName));\n assert(_.isString(pkgVersion));\n return `${pkgName}/${pkgVersion}`;\n}\n"],"file":"agent.js"}
1
+ {"version":3,"file":"agent.js","names":["pkgVersion","require","version","getUserAgent"],"sources":["../src/agent.ts"],"sourcesContent":["const pkgVersion = require('../package.json').version;\n\nexport function getUserAgent(): string {\n return `verdaccio/${pkgVersion}`;\n}\n"],"mappings":";;;;;;;AAAA,MAAMA,UAAU,GAAGC,OAAO,CAAC,iBAAD,CAAP,CAA2BC,OAA9C;;AAEO,SAASC,YAAT,GAAgC;EACrC,OAAQ,aAAYH,UAAW,EAA/B;AACD"}
@@ -0,0 +1,18 @@
1
+ import { AuthConf, ConfigYaml, LoggerConfItem, PackageAccessYaml, Security, UpLinkConf } from '@verdaccio/types';
2
+ /**
3
+ * Helper configuration builder constructor, used to build the configuration for testing or
4
+ * programatically creating a configuration.
5
+ */
6
+ export default class ConfigBuilder {
7
+ private config;
8
+ constructor(config?: Partial<ConfigYaml>);
9
+ static build(config?: Partial<ConfigYaml>): ConfigBuilder;
10
+ addPackageAccess(pattern: string, pkgAccess: PackageAccessYaml): this;
11
+ addUplink(id: string, uplink: UpLinkConf): this;
12
+ addSecurity(security: Partial<Security>): this;
13
+ addAuth(auth: Partial<AuthConf>): this;
14
+ addLogger(log: LoggerConfItem): this;
15
+ addStorage(storage: string | object): this;
16
+ getConfig(): ConfigYaml;
17
+ getAsYaml(): string;
18
+ }
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _lodash = require("lodash");
9
+
10
+ var _ = require(".");
11
+
12
+ /**
13
+ * Helper configuration builder constructor, used to build the configuration for testing or
14
+ * programatically creating a configuration.
15
+ */
16
+ class ConfigBuilder {
17
+ constructor(config) {
18
+ // @ts-ignore
19
+ this.config = config ?? {
20
+ uplinks: {},
21
+ packages: {},
22
+ security: {}
23
+ };
24
+ }
25
+
26
+ static build(config) {
27
+ return new ConfigBuilder(config);
28
+ }
29
+
30
+ addPackageAccess(pattern, pkgAccess) {
31
+ // @ts-ignore
32
+ this.config.packages[pattern] = pkgAccess;
33
+ return this;
34
+ }
35
+
36
+ addUplink(id, uplink) {
37
+ this.config.uplinks[id] = uplink;
38
+ return this;
39
+ }
40
+
41
+ addSecurity(security) {
42
+ this.config.security = (0, _lodash.merge)(this.config.security, security);
43
+ return this;
44
+ }
45
+
46
+ addAuth(auth) {
47
+ this.config.auth = (0, _lodash.merge)(this.config.auth, auth);
48
+ return this;
49
+ }
50
+
51
+ addLogger(log) {
52
+ this.config.log = log;
53
+ return this;
54
+ }
55
+
56
+ addStorage(storage) {
57
+ if (typeof storage === 'string') {
58
+ this.config.storage = storage;
59
+ } else {
60
+ this.config.store = storage;
61
+ }
62
+
63
+ return this;
64
+ }
65
+
66
+ getConfig() {
67
+ return this.config;
68
+ }
69
+
70
+ getAsYaml() {
71
+ return (0, _.fromJStoYAML)(this.config);
72
+ }
73
+
74
+ }
75
+
76
+ exports.default = ConfigBuilder;
77
+ //# sourceMappingURL=builder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builder.js","names":["ConfigBuilder","constructor","config","uplinks","packages","security","build","addPackageAccess","pattern","pkgAccess","addUplink","id","uplink","addSecurity","merge","addAuth","auth","addLogger","log","addStorage","storage","store","getConfig","getAsYaml","fromJStoYAML"],"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 // @ts-ignore\n this.config = 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;;AAWA;;AAEA;AACA;AACA;AACA;AACe,MAAMA,aAAN,CAAoB;EAG1BC,WAAW,CAACC,MAAD,EAA+B;IAC/C;IACA,KAAKA,MAAL,GAAcA,MAAM,IAAI;MAAEC,OAAO,EAAE,EAAX;MAAeC,QAAQ,EAAE,EAAzB;MAA6BC,QAAQ,EAAE;IAAvC,CAAxB;EACD;;EAEkB,OAALC,KAAK,CAACJ,MAAD,EAA8C;IAC/D,OAAO,IAAIF,aAAJ,CAAkBE,MAAlB,CAAP;EACD;;EAEMK,gBAAgB,CAACC,OAAD,EAAkBC,SAAlB,EAAgD;IACrE;IACA,KAAKP,MAAL,CAAYE,QAAZ,CAAqBI,OAArB,IAAgCC,SAAhC;IACA,OAAO,IAAP;EACD;;EAEMC,SAAS,CAACC,EAAD,EAAaC,MAAb,EAAiC;IAC/C,KAAKV,MAAL,CAAYC,OAAZ,CAAoBQ,EAApB,IAA0BC,MAA1B;IACA,OAAO,IAAP;EACD;;EAEMC,WAAW,CAACR,QAAD,EAA8B;IAC9C,KAAKH,MAAL,CAAYG,QAAZ,GAAuB,IAAAS,aAAA,EAAM,KAAKZ,MAAL,CAAYG,QAAlB,EAA4BA,QAA5B,CAAvB;IACA,OAAO,IAAP;EACD;;EAEMU,OAAO,CAACC,IAAD,EAA0B;IACtC,KAAKd,MAAL,CAAYc,IAAZ,GAAmB,IAAAF,aAAA,EAAM,KAAKZ,MAAL,CAAYc,IAAlB,EAAwBA,IAAxB,CAAnB;IACA,OAAO,IAAP;EACD;;EAEMC,SAAS,CAACC,GAAD,EAAsB;IACpC,KAAKhB,MAAL,CAAYgB,GAAZ,GAAkBA,GAAlB;IACA,OAAO,IAAP;EACD;;EAEMC,UAAU,CAACC,OAAD,EAA2B;IAC1C,IAAI,OAAOA,OAAP,KAAmB,QAAvB,EAAiC;MAC/B,KAAKlB,MAAL,CAAYkB,OAAZ,GAAsBA,OAAtB;IACD,CAFD,MAEO;MACL,KAAKlB,MAAL,CAAYmB,KAAZ,GAAoBD,OAApB;IACD;;IACD,OAAO,IAAP;EACD;;EAEME,SAAS,GAAe;IAC7B,OAAO,KAAKpB,MAAZ;EACD;;EAEMqB,SAAS,GAAW;IACzB,OAAO,IAAAC,cAAA,EAAa,KAAKtB,MAAlB,CAAP;EACD;;AArDgC"}
@@ -1,16 +1,20 @@
1
1
  #
2
- # This is the default config file. It allows all users to do anything,
3
- # so don't use it on production systems.
2
+ # This is the default configuration file. It allows all users to do anything,
3
+ # please read carefully the documentation and best practices to
4
+ # improve security.
4
5
  #
5
6
  # Look here for more config file examples:
6
- # https://github.com/verdaccio/verdaccio/tree/master/packages/config/src/conf
7
+ # https://github.com/verdaccio/verdaccio/tree/5.x/packages/config/src/conf/default.yaml
7
8
  #
9
+ # Read about the best practices
10
+ # https://verdaccio.org/docs/best
8
11
 
9
12
  # path to a directory with all packages
10
13
  storage: ./storage
11
14
  # path to a directory with plugins to include
12
15
  plugins: ./plugins
13
16
 
17
+ # https://verdaccio.org/docs/webui
14
18
  web:
15
19
  title: Verdaccio
16
20
  # comment out to disable gravatar support
@@ -43,11 +47,8 @@ web:
43
47
  # - '<div id="myId">html before webpack scripts</div>'
44
48
  # Public path for template manifest scripts (only manifest)
45
49
  # publicPath: http://somedomain.org/
46
- # translate your registry, api i18n not available yet
47
- # i18n:
48
- # list of the available translations https://github.com/verdaccio/ui/tree/master/i18n/translations
49
- # web: en-US
50
50
 
51
+ # https://verdaccio.org/docs/configuration#authentication
51
52
  auth:
52
53
  htpasswd:
53
54
  file: ./htpasswd
@@ -55,11 +56,15 @@ auth:
55
56
  # You can set this to -1 to disable registration.
56
57
  # max_users: 1000
57
58
 
59
+ # https://verdaccio.org/docs/configuration#uplinks
58
60
  # a list of other known repositories we can talk to
59
61
  uplinks:
60
62
  npmjs:
61
63
  url: https://registry.npmjs.org/
62
64
 
65
+ # Learn how to protect your packages
66
+ # https://verdaccio.org/docs/protect-your-dependencies/
67
+ # https://verdaccio.org/docs/configuration#packages
63
68
  packages:
64
69
  '@*/*':
65
70
  # scoped packages
@@ -76,7 +81,7 @@ packages:
76
81
  # and three keywords: "$all", "$anonymous", "$authenticated"
77
82
  access: $all
78
83
 
79
- # allow all known users to publish/unpublish packages
84
+ # allow all known users to publish/publish packages
80
85
  # (anyone can register by default, remember?)
81
86
  publish: $authenticated
82
87
  unpublish: $authenticated
@@ -84,32 +89,104 @@ packages:
84
89
  # if package is not available locally, proxy requests to 'npmjs' registry
85
90
  proxy: npmjs
86
91
 
92
+ # To improve your security configuration and avoid dependency confusion
93
+ # consider removing the proxy property for private packages
94
+ # https://verdaccio.org/docs/best#remove-proxy-to-increase-security-at-private-packages
95
+
96
+ # https://verdaccio.org/docs/configuration#server
97
+ # You can specify HTTP/1.1 server keep alive timeout in seconds for incoming connections.
98
+ # A value of 0 makes the http server behave similarly to Node.js versions prior to 8.0.0, which did not have a keep-alive timeout.
99
+ # WORKAROUND: Through given configuration you can workaround following issue https://github.com/verdaccio/verdaccio/issues/301. Set to 0 in case 60 is not enough.
87
100
  server:
88
- # deprecated
89
101
  keepAliveTimeout: 60
90
- # rateLimit:
91
- # windowMs: 1000
92
- # max: 10000
102
+
103
+ # https://verdaccio.org/docs/configuration#offline-publish
104
+ # publish:
105
+ # allow_offline: false
106
+
107
+ # https://verdaccio.org/docs/configuration#url-prefix
108
+ # url_prefix: /verdaccio/
109
+ # VERDACCIO_PUBLIC_URL='https://somedomain.org';
110
+ # url_prefix: '/my_prefix'
111
+ # // url -> https://somedomain.org/my_prefix/
112
+ # VERDACCIO_PUBLIC_URL='https://somedomain.org';
113
+ # url_prefix: '/'
114
+ # // url -> https://somedomain.org/
115
+ # VERDACCIO_PUBLIC_URL='https://somedomain.org/first_prefix';
116
+ # url_prefix: '/second_prefix'
117
+ # // url -> https://somedomain.org/second_prefix/'
118
+
119
+ # https://verdaccio.org/docs/configuration#security
120
+ # security:
121
+ # api:
122
+ # legacy: true
123
+ # jwt:
124
+ # sign:
125
+ # expiresIn: 29d
126
+ # verify:
127
+ # someProp: [value]
128
+ # web:
129
+ # sign:
130
+ # expiresIn: 1h # 1 hour by default
131
+ # verify:
132
+ # someProp: [value]
133
+
134
+ # https://verdaccio.org/docs/configuration#user-rate-limit
135
+ # userRateLimit:
136
+ # windowMs: 50000
137
+ # max: 1000
138
+
139
+ # https://verdaccio.org/docs/configuration#max-body-size
140
+ # max_body_size: 10mb
141
+
142
+ # https://verdaccio.org/docs/configuration#listen-port
143
+ # listen:
144
+ # - localhost:4873 # default value
145
+ # - http://localhost:4873 # same thing
146
+ # - 0.0.0.0:4873 # listen on all addresses (INADDR_ANY)
147
+ # - https://example.org:4873 # if you want to use https
148
+ # - "[::1]:4873" # ipv6
149
+ # - unix:/tmp/verdaccio.sock # unix socket
150
+
151
+ # The HTTPS configuration is useful if you do not consider use a HTTP Proxy
152
+ # https://verdaccio.org/docs/configuration#https
153
+ # https:
154
+ # key: ./path/verdaccio-key.pem
155
+ # cert: ./path/verdaccio-cert.pem
156
+ # ca: ./path/verdaccio-csr.pem
157
+
158
+ # https://verdaccio.org/docs/configuration#proxy
159
+ # http_proxy: http://something.local/
160
+ # https_proxy: https://something.local/
161
+
162
+ # https://verdaccio.org/docs/configuration#notifications
163
+ # notify:
164
+ # method: POST
165
+ # headers: [{ "Content-Type": "application/json" }]
166
+ # endpoint: https://usagge.hipchat.com/v2/room/3729485/notification?auth_token=mySecretToken
167
+ # content: '{"color":"green","message":"New package published: * {{ name }}*","notify":true,"message_format":"text"}'
93
168
 
94
169
  middlewares:
95
170
  audit:
96
171
  enabled: true
97
172
 
173
+ # https://verdaccio.org/docs/logger
98
174
  # log settings
99
- log:
100
- # Logger as STDOUT
101
- { type: stdout, format: pretty, level: http }
102
- # Logger as STDOUT as JSON
103
- # { type: stdout, format: json, level: http }
104
- # Logger as STDOUT as JSON
105
- # { type: stdout, format: pretty-timestamped, level: http }
106
- # Logger as STDOUT as custom prettifier
107
- # { type: stdout, plugin: { dest: '@verdaccio/logger-prettify' : options: { foo: 1, bar: 2}}, level: http }
108
- # Logger as file
109
- # { type: file, path: verdaccio.log, level: http}
110
- # FIXME: this should be documented
111
- # More info about log rotation https://github.com/pinojs/pino/blob/master/docs/help.md#log-rotation
112
-
113
- # This affect the web and api (not developed yet)
175
+ log: { type: stdout, format: pretty, level: http }
176
+ #experiments:
177
+ # # support for npm token command
178
+ # token: false
179
+ # # disable writing body size to logs, read more on ticket 1912
180
+ # bytesin_off: false
181
+ # # enable tarball URL redirect for hosting tarball with a different server, the tarball_url_redirect can be a template string
182
+ # tarball_url_redirect: 'https://mycdn.com/verdaccio/${packageName}/${filename}'
183
+ # # the tarball_url_redirect can be a function, takes packageName and filename and returns the url, when working with a js configuration file
184
+ # tarball_url_redirect(packageName, filename) {
185
+ # const signedUrl = // generate a signed url
186
+ # return signedUrl;
187
+ # }
188
+
189
+ # translate your registry, api i18n not available yet
114
190
  i18n:
191
+ # list of the available translations https://github.com/verdaccio/verdaccio/blob/master/packages/plugins/ui-theme/src/i18n/ABOUT_TRANSLATIONS.md
115
192
  web: en-US
@@ -1,36 +1,37 @@
1
1
  #
2
- # This is the config file used for the docker images.
3
- # It allows all users to do anything, so don't use it on production systems.
2
+ # This is the default configuration file. As it allows all users to do anything,
3
+ # please read carefully the documentation and best practices to improve security.
4
4
  #
5
5
  # Do not configure host and port under `listen` in this file
6
6
  # as it will be ignored when using docker.
7
7
  # see https://verdaccio.org/docs/en/docker#docker-and-custom-port-configuration
8
8
  #
9
9
  # Look here for more config file examples:
10
- # https://github.com/verdaccio/verdaccio/tree/master/packages/config/src/conf
10
+ # https://github.com/verdaccio/verdaccio/tree/5.x/packages/config/src/conf/docker.yaml
11
11
  #
12
+ # Read about the best practices
13
+ # https://verdaccio.org/docs/best
12
14
 
13
15
  # path to a directory with all packages
14
16
  storage: /verdaccio/storage/data
15
17
  # path to a directory with plugins to include
16
18
  plugins: /verdaccio/plugins
17
19
 
20
+ # https://verdaccio.org/docs/webui
18
21
  web:
19
- # WebUI is enabled as default, if you want disable it, just uncomment this line
20
- #enable: false
21
22
  title: Verdaccio
22
- # comment out to disable gravatar support
23
+ # Comment out to disable gravatar support
23
24
  # gravatar: false
24
- # by default packages are ordercer ascendant (asc|desc)
25
+ # By default packages are ordered ascendant (asc|desc)
25
26
  # sort_packages: asc
26
- # convert your UI to the dark side
27
+ # Convert your UI to the dark side
27
28
  # darkMode: true
28
29
  # html_cache: true
29
- # by default all features are displayed
30
+ # By default all features are displayed
30
31
  # login: true
31
32
  # showInfo: true
32
33
  # showSettings: true
33
- # In combination with darkMode you can force specific theme
34
+ # In combination with darkMode you can force a specific theme
34
35
  # showThemeSwitch: true
35
36
  # showFooter: true
36
37
  # showSearch: true
@@ -39,21 +40,18 @@ web:
39
40
  # HTML tags injected after manifest <scripts/>
40
41
  # scriptsBodyAfter:
41
42
  # - '<script type="text/javascript" src="https://my.company.com/customJS.min.js"></script>'
42
- # HTML tags injected before ends </head>
43
+ # HTML tags injected before end </head>
43
44
  # metaScripts:
44
45
  # - '<script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>'
45
46
  # - '<script type="text/javascript" src="https://browser.sentry-cdn.com/5.15.5/bundle.min.js"></script>'
46
47
  # - '<meta name="robots" content="noindex" />'
47
- # HTML tags injected first child at <body/>
48
+ # HTML tags injected as first child at <body/>
48
49
  # bodyBefore:
49
50
  # - '<div id="myId">html before webpack scripts</div>'
50
51
  # Public path for template manifest scripts (only manifest)
51
52
  # publicPath: http://somedomain.org/
52
53
 
53
- # translate your registry, api i18n not available yet
54
- # i18n:
55
- # list of the available translations https://github.com/verdaccio/ui/tree/master/i18n/translations
56
- # web: en-US
54
+ # https://verdaccio.org/docs/configuration#authentication
57
55
 
58
56
  auth:
59
57
  htpasswd:
@@ -62,11 +60,15 @@ auth:
62
60
  # You can set this to -1 to disable registration.
63
61
  # max_users: 1000
64
62
 
65
- # a list of other known repositories we can talk to
63
+ # https://verdaccio.org/docs/configuration#uplinks
64
+ # A list of other known repositories we can talk to
66
65
  uplinks:
67
66
  npmjs:
68
67
  url: https://registry.npmjs.org/
69
68
 
69
+ # Learn how to protect your packages
70
+ # https://verdaccio.org/docs/protect-your-dependencies/
71
+ # https://verdaccio.org/docs/configuration#packages
70
72
  packages:
71
73
  '@*/*':
72
74
  # scoped packages
@@ -76,14 +78,14 @@ packages:
76
78
  proxy: npmjs
77
79
 
78
80
  '**':
79
- # allow all users (including non-authenticated users) to read and
81
+ # Allow all users (including non-authenticated users) to read and
80
82
  # publish all packages
81
83
  #
82
- # you can specify usernames/groupnames (depending on your auth plugin)
84
+ # You can specify usernames/groupnames (depending on your auth plugin)
83
85
  # and three keywords: "$all", "$anonymous", "$authenticated"
84
86
  access: $all
85
87
 
86
- # allow all known users to publish/unpublish packages
88
+ # Allow all known users to publish/publish packages
87
89
  # (anyone can register by default, remember?)
88
90
  publish: $authenticated
89
91
  unpublish: $authenticated
@@ -91,31 +93,106 @@ packages:
91
93
  # if package is not available locally, proxy requests to 'npmjs' registry
92
94
  proxy: npmjs
93
95
 
96
+ # To improve your security configuration and avoid dependency confusion
97
+ # consider removing the proxy property for private packages
98
+ # https://verdaccio.org/docs/best#remove-proxy-to-increase-security-at-private-packages
99
+
100
+ # https://verdaccio.org/docs/configuration#server
101
+ # You can specify the HTTP/1.1 server keep alive timeout in seconds for incoming connections.
102
+ # A value of 0 makes the http server behave similarly to Node.js versions prior to 8.0.0, which did not have a
103
+ # keep-alive timeout.
104
+ # WORKAROUND: Through given configuration you can work around the following issue:
105
+ # https://github.com/verdaccio/verdaccio/issues/301. Set to 0 in case 60 is not enough.
106
+ server:
107
+ keepAliveTimeout: 60
108
+
109
+ # https://verdaccio.org/docs/configuration#offline-publish
110
+ # publish:
111
+ # allow_offline: false
112
+
113
+ # https://verdaccio.org/docs/configuration#url-prefix
114
+ # url_prefix: /verdaccio/
115
+ # VERDACCIO_PUBLIC_URL='https://somedomain.org';
116
+ # url_prefix: '/my_prefix'
117
+ # // url -> https://somedomain.org/my_prefix/
118
+ # VERDACCIO_PUBLIC_URL='https://somedomain.org';
119
+ # url_prefix: '/'
120
+ # // url -> https://somedomain.org/
121
+ # VERDACCIO_PUBLIC_URL='https://somedomain.org/first_prefix';
122
+ # url_prefix: '/second_prefix'
123
+ # // url -> https://somedomain.org/second_prefix/'
124
+
125
+ # https://verdaccio.org/docs/configuration#security
126
+ # security:
127
+ # api:
128
+ # legacy: true
129
+ # jwt:
130
+ # sign:
131
+ # expiresIn: 29d
132
+ # verify:
133
+ # someProp: [value]
134
+ # web:
135
+ # sign:
136
+ # expiresIn: 1h # 1 hour by default
137
+ # verify:
138
+ # someProp: [value]
139
+
140
+ # https://verdaccio.org/docs/configuration#user-rate-limit
141
+ # userRateLimit:
142
+ # windowMs: 50000
143
+ # max: 1000
144
+
145
+ # https://verdaccio.org/docs/configuration#max-body-size
146
+ # max_body_size: 10mb
147
+
148
+ # https://verdaccio.org/docs/configuration#listen-port
149
+ # listen:
150
+ # - localhost:4873 # default value
151
+ # - http://localhost:4873 # same thing
152
+ # - 0.0.0.0:4873 # listen on all addresses (INADDR_ANY)
153
+ # - https://example.org:4873 # if you want to use https
154
+ # - "[::1]:4873" # ipv6
155
+ # - unix:/tmp/verdaccio.sock # unix socket
156
+
157
+ # The HTTPS configuration is useful if you do not consider using an HTTP Proxy
158
+ # https://verdaccio.org/docs/configuration#https
159
+ # https:
160
+ # key: ./path/verdaccio-key.pem
161
+ # cert: ./path/verdaccio-cert.pem
162
+ # ca: ./path/verdaccio-csr.pem
163
+
164
+ # https://verdaccio.org/docs/configuration#proxy
165
+ # http_proxy: http://something.local/
166
+ # https_proxy: https://something.local/
167
+
168
+ # https://verdaccio.org/docs/configuration#notifications
169
+ # notify:
170
+ # method: POST
171
+ # headers: [{ "Content-Type": "application/json" }]
172
+ # endpoint: https://usagge.hipchat.com/v2/room/3729485/notification?auth_token=mySecretToken
173
+ # content: '{"color":"green","message":"New package published: * {{ name }}*","notify":true,"message_format":"text"}'
174
+
94
175
  middlewares:
95
176
  audit:
96
177
  enabled: true
97
178
 
179
+ # https://verdaccio.org/docs/logger
98
180
  # log settings
99
- # log settings
100
- log:
101
- # Logger as STDOUT
102
- { type: stdout, format: pretty, level: http }
103
- # Logger as STDOUT as JSON
104
- # { type: stdout, format: json, level: http }
105
- # Logger as STDOUT as JSON
106
- # { type: stdout, format: pretty-timestamped, level: http }
107
- # Logger as STDOUT as custom prettifier
108
- # { type: stdout, plugin: { dest: '@verdaccio/logger-prettify' : options: { foo: 1, bar: 2}}, level: http }
109
- # Logger as file
110
- # { type: file, path: verdaccio.log, level: http}
111
- # FIXME: this should be documented
112
- # More info about log rotation https://github.com/pinojs/pino/blob/master/docs/help.md#log-rotation
113
-
114
- flags:
115
- # support for npm token command
116
- token: false
117
- # support for the new v1 search endpoint, functional by incomplete read more on ticket 1732
118
- search: false
119
- # This affect the web and api (not developed yet)
120
- #i18n:
121
- #web: en-US
181
+ log: { type: stdout, format: pretty, level: http }
182
+ #experiments:
183
+ # # Support for npm token command
184
+ # token: false
185
+ # # Enable tarball URL redirect for hosting tarball with a different server.
186
+ # # The tarball_url_redirect can be a template string
187
+ # tarball_url_redirect: 'https://mycdn.com/verdaccio/${packageName}/${filename}'
188
+ # # The tarball_url_redirect can be a function, takes packageName and filename and returns the url,
189
+ # # when working with a js configuration file
190
+ # tarball_url_redirect(packageName, filename) {
191
+ # const signedUrl = // generate a signed url
192
+ # return signedUrl;
193
+ # }
194
+
195
+ # Translate your registry, api i18n not available yet
196
+ # i18n:
197
+ # list of the available translations https://github.com/verdaccio/verdaccio/blob/master/packages/plugins/ui-theme/src/i18n/ABOUT_TRANSLATIONS.md
198
+ # web: en-US
@@ -0,0 +1,4 @@
1
+ export declare function getDefaultConfig(fileName?: string): import("@verdaccio/types").ConfigYaml & {
2
+ config_path: string;
3
+ configPath: string;
4
+ };
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getDefaultConfig = getDefaultConfig;
7
+
8
+ var _path = require("path");
9
+
10
+ var _parse = require("../parse");
11
+
12
+ function getDefaultConfig(fileName = 'default.yaml') {
13
+ const file = (0, _path.join)(__dirname, `./${fileName}`);
14
+ return (0, _parse.parseConfigFile)(file);
15
+ }
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["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;;AAEA;;AAEO,SAASA,gBAAT,CAA0BC,QAAQ,GAAG,cAArC,EAAqD;EAC1D,MAAMC,IAAI,GAAG,IAAAC,UAAA,EAAKC,SAAL,EAAiB,KAAIH,QAAS,EAA9B,CAAb;EACA,OAAO,IAAAI,sBAAA,EAAgBH,IAAhB,CAAP;AACD"}