Skip to content
Snippets Groups Projects
Unverified Commit 3fddcda3 authored by HonkingGoose's avatar HonkingGoose Committed by GitHub
Browse files

docs(configuration options): explain short vs long host names for matchHost (#16928)

parent ce93e602
No related branches found
No related tags found
No related merge requests found
......@@ -1206,6 +1206,25 @@ If the value starts with `http(s)` then it will only match against URLs which st
Otherwise, it will be matched by checking if the URL's hostname matches the `matchHost` directly or ends with it.
When checking the end of the hostname, a single dot is prefixed to the value of `matchHost`, if one is not already present, to ensure it can only match against whole domain segments.
The `matchHost` URL must be the same as the `registryUrl` set in `.npmrc`, or you'll get authentication issues when the artifacts are updated when yarn or npm runs.
```json
{
"hostRules": [
{
"matchHost": "https://gitlab.myorg.com/api/v4/packages/npm/",
"token": "abc123"
}
]
}
```
The above corresponds with an `.npmrc` like the following:
```
registry=https://gitlab.myorg.com/api/v4/packages/npm/
```
<!-- prettier-ignore -->
!!! note
Values containing a URL path but missing a scheme will be prepended with 'https://' (e.g. `domain.com/path` -> `https://domain.com/path`)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment