@verdaccio/config 6.0.0-6-next.13 → 6.0.0-6-next.16

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 +90 -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 +115 -27
  8. package/build/conf/docker.yaml +140 -38
  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 +115 -27
  36. package/src/conf/docker.yaml +140 -38
  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,95 @@
1
1
  # @verdaccio/config
2
2
 
3
+ ## 6.0.0-6-next.16
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [351aeeaa]
8
+ - @verdaccio/core@6.0.0-6-next.7
9
+ - @verdaccio/utils@6.0.0-6-next.13
10
+
11
+ ## 6.0.0-6-next.15
12
+
13
+ ### Major Changes
14
+
15
+ - 292c0a37: feat!: replace deprecated request dependency by got
16
+
17
+ 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.
18
+
19
+ ## Notes
20
+
21
+ - Remove deprecated `request` by other `got`, retry improved, custom Agent ( got does not include it built-in)
22
+ - Remove `async` dependency from storage (used by core) it was linked with proxy somehow safe to remove now
23
+ - Refactor with promises instead callback wherever is possible
24
+ - ~Document the API~
25
+ - Improve testing, integration tests
26
+ - Bugfix
27
+ - Clean up old validations
28
+ - Improve performance
29
+
30
+ ## 💥 Breaking changes
31
+
32
+ - Plugin API methods were callbacks based are returning promises, this will break current storage plugins, check documentation for upgrade.
33
+ - 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));`
34
+ - `@verdaccio/streams` stream abort support is legacy is being deprecated removed
35
+ - Remove AWS and Google Cloud packages for future refactoring [#2574](https://github.com/verdaccio/verdaccio/pull/2574).
36
+
37
+ ### Patch Changes
38
+
39
+ - Updated dependencies [292c0a37]
40
+ - Updated dependencies [a3a209b5]
41
+ - Updated dependencies [00d1d2a1]
42
+ - @verdaccio/core@6.0.0-6-next.6
43
+ - @verdaccio/utils@6.0.0-6-next.12
44
+
45
+ ## 6.0.0-6-next.14
46
+
47
+ ### Minor Changes
48
+
49
+ - d43894e8: feat: rework web header for mobile, add new settings and raw manifest button
50
+
51
+ ### New set of variables to hide features
52
+
53
+ Add set of new variables that allow hide different parts of the UI, buttons, footer or download tarballs. _All are
54
+ enabled by default_.
55
+
56
+ ```yaml
57
+ # login: true <-- already exist but worth the reminder
58
+ # showInfo: true
59
+ # showSettings: true
60
+ # In combination with darkMode you can force specific theme
61
+ # showThemeSwitch: true
62
+ # showFooter: true
63
+ # showSearch: true
64
+ # showDownloadTarball: true
65
+ ```
66
+
67
+ > If you disable `showThemeSwitch` and force `darkMode: true` the local storage settings would be
68
+ > ignored and force all themes to the one in the configuration file.
69
+
70
+ Future could be extended to
71
+
72
+ ### Raw button to display manifest package
73
+
74
+ A new experimental feature (enabled by default), button named RAW to be able navigate on the package manifest directly on the ui, kudos to [react-json-view](https://www.npmjs.com/package/react-json-view) that allows an easy integration, not configurable yet until get more feedback.
75
+
76
+ ```yaml
77
+ showRaw: true
78
+ ```
79
+
80
+ #### Rework header buttons
81
+
82
+ - The header has been rework, the mobile was not looking broken.
83
+ - Removed info button in the header and moved to a dialog
84
+ - Info dialog now contains more information about the project, license and the aid content for Ukrania now is inside of the info modal.
85
+ - Separate settings and info to avoid collapse too much info (for mobile still need some work)
86
+
87
+ - d08fe29d: feat(web): add a config item to web,let the developer can select whet……her enable the html cache
88
+
89
+ ### Patch Changes
90
+
91
+ - @verdaccio/core@6.0.0-6-next.5
92
+
3
93
  ## 6.0.0-6-next.13
4
94
 
5
95
  ### Major 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
@@ -19,6 +23,17 @@ web:
19
23
  # sort_packages: asc
20
24
  # convert your UI to the dark side
21
25
  # darkMode: true
26
+ # html_cache: true
27
+ # by default all features are displayed
28
+ # login: true
29
+ # showInfo: true
30
+ # showSettings: true
31
+ # In combination with darkMode you can force specific theme
32
+ # showThemeSwitch: true
33
+ # showFooter: true
34
+ # showSearch: true
35
+ # showRaw: true
36
+ # showDownloadTarball: true
22
37
  # HTML tags injected after manifest <scripts/>
23
38
  # scriptsBodyAfter:
24
39
  # - '<script type="text/javascript" src="https://my.company.com/customJS.min.js"></script>'
@@ -32,11 +47,8 @@ web:
32
47
  # - '<div id="myId">html before webpack scripts</div>'
33
48
  # Public path for template manifest scripts (only manifest)
34
49
  # publicPath: http://somedomain.org/
35
- # translate your registry, api i18n not available yet
36
- # i18n:
37
- # list of the available translations https://github.com/verdaccio/ui/tree/master/i18n/translations
38
- # web: en-US
39
50
 
51
+ # https://verdaccio.org/docs/configuration#authentication
40
52
  auth:
41
53
  htpasswd:
42
54
  file: ./htpasswd
@@ -44,11 +56,15 @@ auth:
44
56
  # You can set this to -1 to disable registration.
45
57
  # max_users: 1000
46
58
 
59
+ # https://verdaccio.org/docs/configuration#uplinks
47
60
  # a list of other known repositories we can talk to
48
61
  uplinks:
49
62
  npmjs:
50
63
  url: https://registry.npmjs.org/
51
64
 
65
+ # Learn how to protect your packages
66
+ # https://verdaccio.org/docs/protect-your-dependencies/
67
+ # https://verdaccio.org/docs/configuration#packages
52
68
  packages:
53
69
  '@*/*':
54
70
  # scoped packages
@@ -65,7 +81,7 @@ packages:
65
81
  # and three keywords: "$all", "$anonymous", "$authenticated"
66
82
  access: $all
67
83
 
68
- # allow all known users to publish/unpublish packages
84
+ # allow all known users to publish/publish packages
69
85
  # (anyone can register by default, remember?)
70
86
  publish: $authenticated
71
87
  unpublish: $authenticated
@@ -73,32 +89,104 @@ packages:
73
89
  # if package is not available locally, proxy requests to 'npmjs' registry
74
90
  proxy: npmjs
75
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.
76
100
  server:
77
- # deprecated
78
101
  keepAliveTimeout: 60
79
- # rateLimit:
80
- # windowMs: 1000
81
- # 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"}'
82
168
 
83
169
  middlewares:
84
170
  audit:
85
171
  enabled: true
86
172
 
173
+ # https://verdaccio.org/docs/logger
87
174
  # log settings
88
- log:
89
- # Logger as STDOUT
90
- { type: stdout, format: pretty, level: http }
91
- # Logger as STDOUT as JSON
92
- # { type: stdout, format: json, level: http }
93
- # Logger as STDOUT as JSON
94
- # { type: stdout, format: pretty-timestamped, level: http }
95
- # Logger as STDOUT as custom prettifier
96
- # { type: stdout, plugin: { dest: '@verdaccio/logger-prettify' : options: { foo: 1, bar: 2}}, level: http }
97
- # Logger as file
98
- # { type: file, path: verdaccio.log, level: http}
99
- # FIXME: this should be documented
100
- # More info about log rotation https://github.com/pinojs/pino/blob/master/docs/help.md#log-rotation
101
-
102
- # 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
103
190
  i18n:
191
+ # list of the available translations https://github.com/verdaccio/verdaccio/blob/master/packages/plugins/ui-theme/src/i18n/ABOUT_TRANSLATIONS.md
104
192
  web: en-US
@@ -1,34 +1,57 @@
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
27
+ # Convert your UI to the dark side
26
28
  # darkMode: true
29
+ # html_cache: true
30
+ # By default all features are displayed
31
+ # login: true
32
+ # showInfo: true
33
+ # showSettings: true
34
+ # In combination with darkMode you can force a specific theme
35
+ # showThemeSwitch: true
36
+ # showFooter: true
37
+ # showSearch: true
38
+ # showRaw: true
39
+ # showDownloadTarball: true
40
+ # HTML tags injected after manifest <scripts/>
41
+ # scriptsBodyAfter:
42
+ # - '<script type="text/javascript" src="https://my.company.com/customJS.min.js"></script>'
43
+ # HTML tags injected before end </head>
44
+ # metaScripts:
45
+ # - '<script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>'
46
+ # - '<script type="text/javascript" src="https://browser.sentry-cdn.com/5.15.5/bundle.min.js"></script>'
47
+ # - '<meta name="robots" content="noindex" />'
48
+ # HTML tags injected as first child at <body/>
49
+ # bodyBefore:
50
+ # - '<div id="myId">html before webpack scripts</div>'
51
+ # Public path for template manifest scripts (only manifest)
52
+ # publicPath: http://somedomain.org/
27
53
 
28
- # translate your registry, api i18n not available yet
29
- # i18n:
30
- # list of the available translations https://github.com/verdaccio/ui/tree/master/i18n/translations
31
- # web: en-US
54
+ # https://verdaccio.org/docs/configuration#authentication
32
55
 
33
56
  auth:
34
57
  htpasswd:
@@ -37,11 +60,15 @@ auth:
37
60
  # You can set this to -1 to disable registration.
38
61
  # max_users: 1000
39
62
 
40
- # 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
41
65
  uplinks:
42
66
  npmjs:
43
67
  url: https://registry.npmjs.org/
44
68
 
69
+ # Learn how to protect your packages
70
+ # https://verdaccio.org/docs/protect-your-dependencies/
71
+ # https://verdaccio.org/docs/configuration#packages
45
72
  packages:
46
73
  '@*/*':
47
74
  # scoped packages
@@ -51,14 +78,14 @@ packages:
51
78
  proxy: npmjs
52
79
 
53
80
  '**':
54
- # allow all users (including non-authenticated users) to read and
81
+ # Allow all users (including non-authenticated users) to read and
55
82
  # publish all packages
56
83
  #
57
- # you can specify usernames/groupnames (depending on your auth plugin)
84
+ # You can specify usernames/groupnames (depending on your auth plugin)
58
85
  # and three keywords: "$all", "$anonymous", "$authenticated"
59
86
  access: $all
60
87
 
61
- # allow all known users to publish/unpublish packages
88
+ # Allow all known users to publish/publish packages
62
89
  # (anyone can register by default, remember?)
63
90
  publish: $authenticated
64
91
  unpublish: $authenticated
@@ -66,31 +93,106 @@ packages:
66
93
  # if package is not available locally, proxy requests to 'npmjs' registry
67
94
  proxy: npmjs
68
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
+
69
175
  middlewares:
70
176
  audit:
71
177
  enabled: true
72
178
 
179
+ # https://verdaccio.org/docs/logger
73
180
  # log settings
74
- # log settings
75
- log:
76
- # Logger as STDOUT
77
- { type: stdout, format: pretty, level: http }
78
- # Logger as STDOUT as JSON
79
- # { type: stdout, format: json, level: http }
80
- # Logger as STDOUT as JSON
81
- # { type: stdout, format: pretty-timestamped, level: http }
82
- # Logger as STDOUT as custom prettifier
83
- # { type: stdout, plugin: { dest: '@verdaccio/logger-prettify' : options: { foo: 1, bar: 2}}, level: http }
84
- # Logger as file
85
- # { type: file, path: verdaccio.log, level: http}
86
- # FIXME: this should be documented
87
- # More info about log rotation https://github.com/pinojs/pino/blob/master/docs/help.md#log-rotation
88
-
89
- flags:
90
- # support for npm token command
91
- token: false
92
- # support for the new v1 search endpoint, functional by incomplete read more on ticket 1732
93
- search: false
94
- # This affect the web and api (not developed yet)
95
- #i18n:
96
- #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
+ };