diff --git a/conf/default.yaml b/conf/default.yaml index 8e3bb14f6..cacde36b0 100644 --- a/conf/default.yaml +++ b/conf/default.yaml @@ -57,6 +57,6 @@ middlewares: # log settings logs: - - {type: stdout, format: pretty, level: http} + - { type: stdout, format: pretty, level: http } #- {type: file, path: verdaccio.log, level: info} diff --git a/conf/docker.yaml b/conf/docker.yaml index c5740e71f..4e75ef2b3 100644 --- a/conf/docker.yaml +++ b/conf/docker.yaml @@ -61,5 +61,5 @@ middlewares: # log settings logs: - - {type: stdout, format: pretty, level: http} + - { type: stdout, format: pretty, level: http } #- {type: file, path: verdaccio.log, level: info} diff --git a/conf/full.yaml b/conf/full.yaml index 9a2e3d3cf..9950174a2 100644 --- a/conf/full.yaml +++ b/conf/full.yaml @@ -1,196 +1,5 @@ -# path to a directory with all packages -storage: ./storage -# path to a directory with plugins to include -plugins: ./plugins - -web: - # WebUI is enabled as default, if you want disable it, just uncomment this line - #enable: false - - title: Verdaccio - - #logo: logo.png - - # If you're using this registry for a specific module scope, - # specify that scope to set it in the webui instructions header (note: escape @ with \@) - #scope: \@myscope - -auth: - htpasswd: - file: ./htpasswd - # Maximum amount of users allowed to register, defaults to "+infinity". - # You can set this to -1 to disable registration. - #max_users: 1000 - -# Configure plugins that can register custom middlewares -# To use `npm audit` uncomment the following section -middlewares: - audit: - enabled: true - -# a list of other known repositories we can talk to -uplinks: - npmjs: - url: https://registry.npmjs.org/ - - # amount of time to wait for repository to respond - # before giving up and use the local cached copy - #timeout: 30s - - # maximum time in which data is considered up to date - # - # default is 2 minutes, so server won't request the same data from - # uplink if a similar request was made less than 2 minutes ago - #maxage: 2m - - # if two subsequent requests fail, no further requests will be sent to - # this uplink for five minutes - #max_fails: 2 - #fail_timeout: 5m - - # timeouts are defined in the same way as nginx, see: - # http://wiki.nginx.org/ConfigNotation - - # add/override HTTP headers sent to the uplink server - # this allows for HTTP Basic auth for example: - #headers: - # authorization: "Basic YourBase64EncodedCredentials==" - - # set this to false to prevent tarballs from this upstream - # to be stored in the local storage (defaults to true) - #cache: false - - # set this to false to disable strict SSL cert check (defaults to true) - #strict_ssl: false - -packages: - '@*/*': - # scoped packages - access: $all - publish: $authenticated - proxy: npmjs - # uncomment this for packages with "local-" prefix to be available - # for admin only, it's a recommended way of handling private packages - #'local-*': - # access: admin - # publish: admin - # # you can override storage directory for a group of packages this way: - # storage: 'local_storage' - - '**': - # allow all users to read packages (including non-authenticated users) - # - # you can specify usernames/groupnames (depending on your auth plugin) - # and three keywords: "$all", "$anonymous", "$authenticated" - access: $all - - # allow 'admin' to publish packages - publish: $authenticated - - # if package is not available locally, proxy requests to 'npmjs' registry - proxy: npmjs - -##################################################################### -# Advanced settings -##################################################################### - -## Special packages publish configurations -#publish: -## This will allow the publisher to publish packages even if any uplink is down. -# allow_offline: true - -# if you use nginx with custom path, use this to override links -#url_prefix: https://dev.company.local/verdaccio/ - -# You can specify listen address (or simply a port). -# If you add multiple values, verdaccio will listen on all of them. -# -# Examples: -# -#listen: -# - localhost:4873 # default value -# - http://localhost:4873 # same thing -# - 0.0.0.0:4873 # listen on all addresses (INADDR_ANY) -# - https://example.org:4873 # if you want to use https -# - [::1]:4873 # ipv6 -# - unix:/tmp/verdaccio.sock # unix socket - -# Configure HTTPS, it is required if you use "https" protocol above. -#https: -# key: path/to/server.key -# cert: path/to/server.crt -# ca: path/to/server.pem - -# type: file | stdout | stderr -# level: trace | debug | info | http (default) | warn | error | fatal -# -# parameters for file: name is filename -# {type: 'file', path: 'verdaccio.log', level: 'debug'}, -# -# parameters for stdout and stderr: format: json | pretty | pretty-timestamped -# {type: 'stdout', format: 'pretty', level: 'debug'}, -logs: - - {type: stdout, format: pretty, level: http} - #- {type: file, path: verdaccio.log, level: info} - -# you can specify proxy used with all requests in wget-like manner here -# (or set up ENV variables with the same name) -#http_proxy: http://something.local/ -#https_proxy: https://something.local/ -#no_proxy: localhost,127.0.0.1 - -# maximum size of uploaded json document -# increase it if you have "request entity too large" errors -#max_body_size: 1mb - -# Notify Settings -# Notify was built primarily to use with Slack's Incoming -# webhooks, but will also deliver a simple payload to -# any endpoint. Currently only active for publish / create -# commands. -#notify: - # Choose a method. Technically this will accept any HTTP - # request method, but probably stick to GET or POST -# method: POST - # Only run this notification if the package name matches the regular - # expression -# packagePattern: ^example-package$ - # Any flags to be used with the regular expression -# packagePatternFlags: i - # If this endpoint requires specific headers, set them here - # as an array of key: value objects. -# headers: [{'Content-type': 'application/x-www-form-urlencoded'}] - # set the URL endpoint for this call -# endpoint: https://hooks.slack.com/... - # Finally, the content you will be sending in the body. - # This data will first be run through Handlebars to parse - # any Handlebar expressions. All data housed in the metadata object - # is available for use within the expressions. -# content: ' {{ handlebar-expression }}' - # For Slack, follow the following format: - # content: '{ "text": "Package *{{ name }}* published to version *{{ dist-tags.latest }}*", "username": "Verdaccio", "icon_emoji": ":package:" }' - - # Multiple notification endpoints can be created by specifying a collection -# 'example-package-1': -# method: POST - # Only run this notification if the package name matches the regular - # expression -# packagePattern: ^example-package-regex$ - # Any flags to be used with the regular expression - # since verdaccio 2.2.2 this property has been disabled read #108 - # it will be re-enabled after 2.5.0 - # packagePatternFlags: i - # If this endpoint requires specific headers, set them here - # as an array of key: value objects. - # headers supports as well a literal object -# headers: {'Content-type': 'application/x-www-form-urlencoded'} - # set the URL endpoint for this call -# endpoint: https://hooks.slack.com/... - # Finally, the content you will be sending in the body. - # This data will first be run through Handlebars to parse - # any Handlebar expressions. All data housed in the metadata object - # is available for use within the expressions. -# content: ' {{ handlebar-expression }}' - # For Slack, follow the following format: - # content: '{ "text": "Package *{{ name }}* published to version *{{ dist-tags.latest }}*", "username": "Verdaccio", "icon_emoji": ":package:" }' - +## This file is deprecated and the content does not exist anymore +## we highly recommend either visit +## https://verdaccio.org/docs/en/configuration +## or read the local file +## docs/config.md diff --git a/crowdin.yaml b/crowdin.yaml index c635b062d..e5d8d2b76 100644 --- a/crowdin.yaml +++ b/crowdin.yaml @@ -1,12 +1,11 @@ project_identifier_env: CROWDIN_VERDACCIO_PROJECT_ID api_key_env: CROWDIN_VERDACCIO_API_KEY -base_path: "./" +base_path: './' preserve_hierarchy: true commit_message: 'docs(website): new translations' files: - - - source: '/docs/*.md' + - source: '/docs/*.md' translation: '/website/translated_docs/%locale%/%original_file_name%' languages_mapping: &anchor locale: @@ -44,7 +43,6 @@ files: 'vi': 'vi' 'zh-CN': 'zh-CN' 'zh-TW': 'zh-TW' - - - source: '/website/i18n/en.json' + - source: '/website/i18n/en.json' translation: '/website/i18n/%locale%.json' languages_mapping: *anchor diff --git a/docker-compose.yaml b/docker-compose.yaml index 0043727eb..cea2958b9 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -8,7 +8,7 @@ services: ports: - $VERDACCIO_PORT:$VERDACCIO_PORT volumes: - - verdaccio-storage:/verdaccio/storage + - verdaccio-storage:/verdaccio/storage volumes: verdaccio: driver: local diff --git a/package.json b/package.json index a5ff583d6..8abb0398a 100644 --- a/package.json +++ b/package.json @@ -115,7 +115,7 @@ "normalize.css": "8.0.0", "optimize-css-assets-webpack-plugin": "5.0.0", "ora": "1.4.0", - "prettier": "1.13.7", + "prettier": "1.14.2", "prop-types": "15.6.1", "puppeteer": "1.1.1", "react": "16.2.0", @@ -193,6 +193,9 @@ } }, "lint-staged": { + "*.yaml": [ + "prettier --parser yaml --no-config --single-quote --write" + ], "*.js": [ "eslint .", "prettier --write", diff --git a/test/e2e/config/config-protected-e2e.yaml b/test/e2e/config/config-protected-e2e.yaml index a9b675913..9ec9b06f1 100644 --- a/test/e2e/config/config-protected-e2e.yaml +++ b/test/e2e/config/config-protected-e2e.yaml @@ -14,7 +14,7 @@ auth: password: test logs: - - {type: stdout, format: pretty, level: warn} + - { type: stdout, format: pretty, level: warn } packages: 'protected-*': diff --git a/test/e2e/config/config-scoped-e2e.yaml b/test/e2e/config/config-scoped-e2e.yaml index ea23f6be4..d9f59dfd8 100644 --- a/test/e2e/config/config-scoped-e2e.yaml +++ b/test/e2e/config/config-scoped-e2e.yaml @@ -14,7 +14,7 @@ auth: password: test logs: - - {type: stdout, format: pretty, level: warn} + - { type: stdout, format: pretty, level: warn } packages: '@*/*': diff --git a/test/functional/store/config-1.yaml b/test/functional/store/config-1.yaml index 89acc05fd..20e12b73d 100644 --- a/test/functional/store/config-1.yaml +++ b/test/functional/store/config-1.yaml @@ -13,7 +13,6 @@ auth: name: test password: test - uplinks: express: url: http://localhost:55550/ @@ -26,7 +25,7 @@ uplinks: url: http://localhost:55666/ logs: - - {type: stdout, format: pretty, level: trace} + - { type: stdout, format: pretty, level: trace } packages: '@test/*': diff --git a/test/functional/store/config-2.yaml b/test/functional/store/config-2.yaml index d0aeba85b..b3fe57927 100644 --- a/test/functional/store/config-2.yaml +++ b/test/functional/store/config-2.yaml @@ -13,7 +13,7 @@ middlewares: ../fixtures/plugins/middlewares: message: this is a custom route ../fixtures/plugins/middlewares.es6: - message: this is a custom route es6 + message: this is a custom route es6 max_users: 3 @@ -31,7 +31,7 @@ auth: password: blahblah-password logs: - - {type: stdout, format: pretty, level: trace} + - { type: stdout, format: pretty, level: trace } packages: '@test/*': @@ -78,7 +78,7 @@ packages: access: $all publish: $all - ## start test auth.js + ## start test auth.js 'test-auth-regular': access: $authenticated @@ -87,7 +87,7 @@ packages: 'test-deny': access: authtest2 - ## end test auth.js + ## end test auth.js '*': access: test $anonymous diff --git a/test/functional/store/config-3.yaml b/test/functional/store/config-3.yaml index 1a75bf8c0..f966a73ef 100644 --- a/test/functional/store/config-3.yaml +++ b/test/functional/store/config-3.yaml @@ -19,7 +19,7 @@ auth: password: test logs: - - {type: stdout, format: pretty, level: trace} + - { type: stdout, format: pretty, level: trace } packages: 'pkg-gh131': diff --git a/test/integration/config.yaml b/test/integration/config.yaml index 191b59401..107c6037a 100644 --- a/test/integration/config.yaml +++ b/test/integration/config.yaml @@ -9,7 +9,7 @@ uplinks: url: https://registry.npmjs.org/ logs: - - {type: stdout, format: pretty, level: trace} + - { type: stdout, format: pretty, level: trace } packages: jju: diff --git a/test/integration/config_nocache.yaml b/test/integration/config_nocache.yaml index 3916fb6ba..e019ac2f8 100644 --- a/test/integration/config_nocache.yaml +++ b/test/integration/config_nocache.yaml @@ -6,7 +6,7 @@ uplinks: cache: false logs: - - {type: stdout, format: pretty, level: trace} + - { type: stdout, format: pretty, level: trace } packages: jju: diff --git a/test/unit/api/config.spec.js b/test/unit/api/config.spec.js index 69269d81f..e7e4191b2 100644 --- a/test/unit/api/config.spec.js +++ b/test/unit/api/config.spec.js @@ -62,17 +62,10 @@ const checkDefaultConfPackages = (config) => { describe('Config file', () => { beforeAll(function() { - this.config = new Config(parseConfigFile(resolveConf('full'))); + this.config = new Config(parseConfigFile(resolveConf('default'))); }); describe('Config file', () => { - test('parse full.yaml', () => { - const config = new Config(parseConfigFile(resolveConf('full'))); - checkDefaultUplink(config); - expect(config.storage).toBe('./storage'); - checkDefaultConfPackages(config); - }); - test('parse docker.yaml', () => { const config = new Config(parseConfigFile(resolveConf('docker'))); checkDefaultUplink(config); diff --git a/test/unit/partials/config-unit-test.yaml b/test/unit/partials/config-unit-test.yaml index 2466c4cda..c299eb932 100644 --- a/test/unit/partials/config-unit-test.yaml +++ b/test/unit/partials/config-unit-test.yaml @@ -12,7 +12,7 @@ auth: password: test logs: - - {type: stdout, format: pretty, level: warn} + - { type: stdout, format: pretty, level: warn } packages: '@*/*': diff --git a/yarn.lock b/yarn.lock index cc96b7937..a6b814599 100644 Binary files a/yarn.lock and b/yarn.lock differ