Compare commits
183 Commits
@verdaccio
...
@verdaccio
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
64c6cbfe9d | ||
|
|
1810ed0d81 | ||
|
|
04931c968e | ||
|
|
648575aa41 | ||
|
|
9ddce9dec7 | ||
|
|
211da6054c | ||
|
|
8339b34adb | ||
|
|
4372d27222 | ||
|
|
52d1e6537e | ||
|
|
7f5c8796be | ||
|
|
b02dab1c2f | ||
|
|
9f73472985 | ||
|
|
9b12c14543 | ||
|
|
e6a5ce9a02 | ||
|
|
7c0a0c106d | ||
|
|
64f0921477 | ||
|
|
8020936758 | ||
|
|
40e125fd2d | ||
|
|
01f9b3c3b4 | ||
|
|
aa310e4af0 | ||
|
|
d0bd58049d | ||
|
|
0e18842be5 | ||
|
|
cab90a54d9 | ||
|
|
0778eebae5 | ||
|
|
0f18f10b52 | ||
|
|
8f43bf17df | ||
|
|
9886b93e85 | ||
|
|
e8cc4232af | ||
|
|
3b0002632d | ||
|
|
b4f73b6d0f | ||
|
|
b79c6e5273 | ||
|
|
58e4ee54d1 | ||
|
|
08da6881db | ||
|
|
13f1c6efca | ||
|
|
5becf3f257 | ||
|
|
4a3e11d072 | ||
|
|
5ccb2bad16 | ||
|
|
dc05edfe60 | ||
|
|
f837e6cc61 | ||
|
|
e6c5aaaa06 | ||
|
|
8f578f88f5 | ||
|
|
23346155c6 | ||
|
|
3ba55e6199 | ||
|
|
9561bd9e82 | ||
|
|
6b6eaf6b67 | ||
|
|
558d78f32a | ||
|
|
505aa612ef | ||
|
|
d5eacc218b | ||
|
|
e2a4477c8f | ||
|
|
9433796093 | ||
|
|
856da934b8 | ||
|
|
785763738d | ||
|
|
6b8806ee71 | ||
|
|
24c14ce583 | ||
|
|
14159b31e1 | ||
|
|
71fbb410e6 | ||
|
|
c8a040e69e | ||
|
|
31d5828f46 | ||
|
|
e676d1bf1c | ||
|
|
061bfcc8d4 | ||
|
|
eab3007939 | ||
|
|
96ba927917 | ||
|
|
ca171790cf | ||
|
|
b5465751a9 | ||
|
|
8dae1f4adb | ||
|
|
c3f8d88ecc | ||
|
|
1d78376506 | ||
|
|
a610ef26b9 | ||
|
|
7cc2fe20af | ||
|
|
b61f762d6c | ||
|
|
a78ff7550a | ||
|
|
e54ec4b5d0 | ||
|
|
c3565f7157 | ||
|
|
8992b22eb3 | ||
|
|
c26ff2e768 | ||
|
|
df33fa3d79 | ||
|
|
e64f8ee294 | ||
|
|
f2bcdb91f9 | ||
|
|
dabb358e64 | ||
|
|
83677e31a2 | ||
|
|
5871760aaa | ||
|
|
821bd776f3 | ||
|
|
e9e4552658 | ||
|
|
fe60eab99c | ||
|
|
57cb03cdb7 | ||
|
|
e2152606dc | ||
|
|
7c68edfce4 | ||
|
|
3c30997072 | ||
|
|
c2621ac386 | ||
|
|
db4afeaff9 | ||
|
|
5f3eee5eaf | ||
|
|
1153a8d92f | ||
|
|
b3e8438f64 | ||
|
|
ab87898c19 | ||
|
|
10aeb4f134 | ||
|
|
1d0fc016d8 | ||
|
|
a9ba3d0649 | ||
|
|
39570af086 | ||
|
|
04b19262d0 | ||
|
|
e83e500b80 | ||
|
|
3a93da454f | ||
|
|
c5f2b07364 | ||
|
|
6384fbd0f6 | ||
|
|
68ea21214a | ||
|
|
eb686fbcaf | ||
|
|
4024205829 | ||
|
|
1f02ac53bb | ||
|
|
827376e85c | ||
|
|
1d11128051 | ||
|
|
e367c3f1e0 | ||
|
|
82c2f4e03a | ||
|
|
fbd761c8ee | ||
|
|
5f3072a819 | ||
|
|
65cb26cf31 | ||
|
|
8c730c0694 | ||
|
|
1e48f1c077 | ||
|
|
d460a2c5da | ||
|
|
8632c3a6d6 | ||
|
|
aa763baec1 | ||
|
|
ddb42431d1 | ||
|
|
8efc6feab2 | ||
|
|
168833d857 | ||
|
|
5e28d40f77 | ||
|
|
d981c1d435 | ||
|
|
8f9467ce3d | ||
|
|
c103a8252e | ||
|
|
f07a9d0c54 | ||
|
|
a280340e09 | ||
|
|
00fa01f470 | ||
|
|
8e5390d97c | ||
|
|
6823c66b87 | ||
|
|
91838002b3 | ||
|
|
5a439a791f | ||
|
|
ace64e2ea3 | ||
|
|
34e1261354 | ||
|
|
34f0f11012 | ||
|
|
716734c83c | ||
|
|
7cd1187f45 | ||
|
|
be9e23da47 | ||
|
|
4fcd6457be | ||
|
|
3838d3d212 | ||
|
|
33f8b00080 | ||
|
|
c707aee713 | ||
|
|
9ed932e589 | ||
|
|
e61bd6c78f | ||
|
|
a13e57586c | ||
|
|
49c2a66342 | ||
|
|
9f2a29a275 | ||
|
|
eb0dae5fa7 | ||
|
|
48fa727cc6 | ||
|
|
a7ba76423e | ||
|
|
d3f78e5b34 | ||
|
|
8b9a1a3372 | ||
|
|
3ad519f0c2 | ||
|
|
9946ea8bea | ||
|
|
9bb5b50c80 | ||
|
|
958a5d886f | ||
|
|
4023269866 | ||
|
|
b92935ea45 | ||
|
|
4ecf3eca4f | ||
|
|
eaf5671b92 | ||
|
|
889e267106 | ||
|
|
644d42564d | ||
|
|
fa230117a1 | ||
|
|
f414f710d6 | ||
|
|
463888165d | ||
|
|
7739e6f4a2 | ||
|
|
5fcc5d493b | ||
|
|
6e70b5c9e9 | ||
|
|
58e89dd1db | ||
|
|
a70454c7b2 | ||
|
|
73585f0262 | ||
|
|
38c40ed304 | ||
|
|
4a8551dcf2 | ||
|
|
82c5c4eb32 | ||
|
|
6c1e46b694 | ||
|
|
f49ca06c68 | ||
|
|
6ab31639fa | ||
|
|
65a1e56f56 | ||
|
|
507e55a9a5 | ||
|
|
80d669e6eb | ||
|
|
81d95ef425 | ||
|
|
6fef45f9ef |
@@ -4,7 +4,7 @@
|
||||
"commit": false,
|
||||
"linked": [],
|
||||
"access": "public",
|
||||
"baseBranch": "6.x",
|
||||
"baseBranch": "master",
|
||||
"updateInternalDependencies": "patch",
|
||||
"ignore": []
|
||||
}
|
||||
|
||||
11
.changeset/healthy-poets-compare.md
Normal file
11
.changeset/healthy-poets-compare.md
Normal file
@@ -0,0 +1,11 @@
|
||||
---
|
||||
'@verdaccio/config': patch
|
||||
---
|
||||
|
||||
Feature
|
||||
|
||||
- add option to set storage from environment variable VERDACCIO_STORAGE_PATH
|
||||
|
||||
#### Related tickets
|
||||
|
||||
https://github.com/verdaccio/verdaccio/issues/1681
|
||||
16
.changeset/many-vans-care.md
Normal file
16
.changeset/many-vans-care.md
Normal file
@@ -0,0 +1,16 @@
|
||||
---
|
||||
'@verdaccio/tarball': patch
|
||||
'@verdaccio/mock': patch
|
||||
'@verdaccio/ui-theme': patch
|
||||
'@verdaccio/server': patch
|
||||
'@verdaccio/utils': patch
|
||||
'verdaccio': patch
|
||||
---
|
||||
|
||||
Bug Fixes
|
||||
|
||||
- fix escaped slash in namespaced packages
|
||||
|
||||
#### Related tickets
|
||||
|
||||
https://github.com/verdaccio/verdaccio/pull/2193
|
||||
@@ -47,9 +47,11 @@
|
||||
"few-cooks-destroy",
|
||||
"fifty-jars-rest",
|
||||
"gentle-trains-switch",
|
||||
"healthy-poets-compare",
|
||||
"hip-hounds-destroy",
|
||||
"late-adults-love",
|
||||
"late-parents-act",
|
||||
"many-vans-care",
|
||||
"modern-spies-tell",
|
||||
"neat-toes-report",
|
||||
"perfect-kangaroos-agree",
|
||||
@@ -61,6 +63,7 @@
|
||||
"smart-apricots-kneel",
|
||||
"spicy-frogs-press",
|
||||
"tender-bags-call",
|
||||
"three-pots-sit"
|
||||
"three-pots-sit",
|
||||
"two-dolls-check"
|
||||
]
|
||||
}
|
||||
|
||||
28
.changeset/two-dolls-check.md
Normal file
28
.changeset/two-dolls-check.md
Normal file
@@ -0,0 +1,28 @@
|
||||
---
|
||||
'@verdaccio/cli': major
|
||||
'@verdaccio/config': major
|
||||
'@verdaccio/types': major
|
||||
'@verdaccio/logger': major
|
||||
'@verdaccio/node-api': major
|
||||
'verdaccio-google-cloud': major
|
||||
'verdaccio': major
|
||||
---
|
||||
|
||||
feat: node api new structure based on promise
|
||||
|
||||
```js
|
||||
import { runServer } from '@verdaccio/node-api';
|
||||
// or
|
||||
import { runServer } from 'verdaccio';
|
||||
|
||||
const app = await runServer(); // default configuration
|
||||
const app = await runServer('./config/config.yaml');
|
||||
const app = await runServer({ configuration });
|
||||
app.listen(4000, (event) => {
|
||||
// do something
|
||||
});
|
||||
```
|
||||
|
||||
### Breaking Change
|
||||
|
||||
If you are using the node-api, the new structure is Promise based and less arguments.
|
||||
@@ -9,3 +9,4 @@ node_modules/
|
||||
static/
|
||||
website/
|
||||
wiki/
|
||||
dist/
|
||||
|
||||
6
.github/workflows/changesets.yml
vendored
6
.github/workflows/changesets.yml
vendored
@@ -6,7 +6,7 @@ on:
|
||||
|
||||
push:
|
||||
branches:
|
||||
- 6.x
|
||||
- master
|
||||
|
||||
env:
|
||||
CI: true
|
||||
@@ -17,7 +17,7 @@ jobs:
|
||||
version:
|
||||
timeout-minutes: 14
|
||||
runs-on: ubuntu-latest
|
||||
if: github.ref == 'refs/heads/6.x' && github.repository == 'verdaccio/verdaccio'
|
||||
if: github.ref == 'refs/heads/master' && github.repository == 'verdaccio/verdaccio'
|
||||
steps:
|
||||
- name: checkout code repository
|
||||
uses: actions/checkout@v2
|
||||
@@ -51,7 +51,7 @@ jobs:
|
||||
run: pnpm build
|
||||
|
||||
- name: create versions
|
||||
uses: changesets/action@master
|
||||
uses: verdaccio/changeset-action@master
|
||||
with:
|
||||
version: pnpm ci:version
|
||||
commit: 'chore: update versions'
|
||||
|
||||
45
.github/workflows/ci-e2e-ui.yml
vendored
45
.github/workflows/ci-e2e-ui.yml
vendored
@@ -1,45 +0,0 @@
|
||||
name: E2E UI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 6.x
|
||||
- 'changeset-release/6.x'
|
||||
pull_request:
|
||||
paths:
|
||||
- .github/workflows/ci.yml
|
||||
- 'packages/**'
|
||||
- 'jest/**'
|
||||
- 'package.json'
|
||||
- 'pnpm-workspace.yaml'
|
||||
- 'test/**'
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
node_version: [14]
|
||||
|
||||
name: ${{ matrix.os }} / Node ${{ matrix.node_version }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.1
|
||||
- name: Use Node ${{ matrix.node_version }}
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node_version }}
|
||||
- name: Install pnpm
|
||||
run: npm i -g pnpm@latest
|
||||
- name: Install
|
||||
run: pnpm recursive install
|
||||
- name: Clean
|
||||
run: pnpm clean
|
||||
- name: Build
|
||||
run: pnpm build
|
||||
- name: Test UI
|
||||
run: pnpm test:e2e:ui
|
||||
env:
|
||||
DEBUG: verdaccio:e2e*
|
||||
45
.github/workflows/ci-e2e.yml
vendored
45
.github/workflows/ci-e2e.yml
vendored
@@ -1,45 +0,0 @@
|
||||
name: E2E CLI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 5.x
|
||||
- 'changeset-release/6.x'
|
||||
pull_request:
|
||||
paths:
|
||||
- .github/workflows/ci.yml
|
||||
- 'packages/**'
|
||||
- 'jest/**'
|
||||
- 'package.json'
|
||||
- 'pnpm-workspace.yaml'
|
||||
- 'test/**'
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
node_version: [14]
|
||||
|
||||
name: ${{ matrix.os }} / Node ${{ matrix.node_version }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.1
|
||||
- name: Use Node ${{ matrix.node_version }}
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node_version }}
|
||||
- name: Install pnpm
|
||||
run: npm i -g pnpm@latest
|
||||
- name: Install
|
||||
run: pnpm recursive install
|
||||
- name: Clean
|
||||
run: pnpm clean
|
||||
- name: Build
|
||||
run: pnpm build
|
||||
- name: Test CLI
|
||||
run: pnpm test:e2e:cli
|
||||
env:
|
||||
DEBUG: verdaccio:e2e*
|
||||
49
.github/workflows/ci-pnpm-dev.yml
vendored
49
.github/workflows/ci-pnpm-dev.yml
vendored
@@ -1,49 +0,0 @@
|
||||
name: CI with pnpm 6
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 5.x
|
||||
- 'changeset-release/6.x'
|
||||
pull_request:
|
||||
paths:
|
||||
- .changeset/**
|
||||
- .github/workflows/ci.yml
|
||||
- 'packages/**'
|
||||
- 'jest/**'
|
||||
- 'package.json'
|
||||
- 'pnpm-workspace.yaml'
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
node_version: [12, 15]
|
||||
|
||||
name: ${{ matrix.os }} / Node ${{ matrix.node_version }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.1
|
||||
- name: Use Node ${{ matrix.node_version }}
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node_version: ${{ matrix.node_version }}
|
||||
- name: Install pnpm
|
||||
run: sudo npm i pnpm@dev -g
|
||||
- name: Install
|
||||
run: pnpm recursive install
|
||||
- name: Format
|
||||
run: pnpm format:check
|
||||
- name: Lint
|
||||
run: pnpm lint
|
||||
- name: Clean
|
||||
run: pnpm clean
|
||||
- name: Build
|
||||
run: pnpm build
|
||||
- name: Test
|
||||
run: pnpm test
|
||||
env:
|
||||
DEBUG: verdaccio:web:*
|
||||
39
.github/workflows/ci-website.yml
vendored
39
.github/workflows/ci-website.yml
vendored
@@ -1,39 +0,0 @@
|
||||
name: CI Website
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
paths:
|
||||
- .github/workflows/ci-website.yml
|
||||
- 'website/**'
|
||||
jobs:
|
||||
ci:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest]
|
||||
node_version: [14]
|
||||
|
||||
name: ${{ matrix.os }} / Node ${{ matrix.node_version }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Use Node ${{ matrix.node_version }}
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node_version: ${{ matrix.node_version }}
|
||||
- name: Install pnpm
|
||||
run: npm i -g pnpm
|
||||
- name: Install
|
||||
run: pnpm recursive install
|
||||
- name: Format
|
||||
run: pnpm format:check
|
||||
- name: Lint
|
||||
run: pnpm lint
|
||||
- name: Build website
|
||||
run: |
|
||||
cd website
|
||||
pnpm build
|
||||
227
.github/workflows/ci.yml
vendored
227
.github/workflows/ci.yml
vendored
@@ -3,8 +3,8 @@ name: CI
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 6.x
|
||||
- 'changeset-release/6.x'
|
||||
- master
|
||||
- 'changeset-release/master'
|
||||
pull_request:
|
||||
paths:
|
||||
- .changeset/**
|
||||
@@ -13,37 +13,228 @@ on:
|
||||
- 'jest/**'
|
||||
- 'package.json'
|
||||
- 'pnpm-workspace.yaml'
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
prepare:
|
||||
runs-on: ubuntu-latest
|
||||
name: setup verdaccio
|
||||
services:
|
||||
verdaccio:
|
||||
image: verdaccio/verdaccio:5
|
||||
ports:
|
||||
- 4873:4873
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.1
|
||||
- name: Use Node 14
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 14
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@latest -g
|
||||
- name: set store
|
||||
run: |
|
||||
mkdir ~/.pnpm-store
|
||||
pnpm config set store-dir ~/.pnpm-store
|
||||
- name: Install
|
||||
run: pnpm recursive install --frozen-lockfile --registry http://localhost:4873
|
||||
- name: Cache .pnpm-store
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
restore-keys: |
|
||||
pnpm-
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
name: Lint
|
||||
needs: prepare
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.1
|
||||
- name: Use Node 16
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 16
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@latest -g
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
- name: Install
|
||||
run: pnpm recursive install --frozen-lockfile --ignore-scripts
|
||||
- name: Lint
|
||||
run: pnpm lint
|
||||
format:
|
||||
runs-on: ubuntu-latest
|
||||
name: Format
|
||||
needs: prepare
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.1
|
||||
- name: Use Node 16
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 16
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@latest -g
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
- name: Install
|
||||
run: pnpm recursive install --frozen-lockfile --ignore-scripts
|
||||
- name: Lint
|
||||
run: pnpm format:check
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
name: build
|
||||
needs: [format, lint]
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.1
|
||||
- name: Use Node 16
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 16
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@latest -g
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
- name: Install
|
||||
## we run scripts due gatsby needs it
|
||||
## when website is excluded we can add --ignore-scripts
|
||||
run: pnpm recursive install --frozen-lockfile --ignore-scripts
|
||||
- name: build
|
||||
run: pnpm build
|
||||
- name: tar packages
|
||||
run: |
|
||||
tar -czvf ${{ github.workspace }}/pkg.tar.gz -C ${{ github.workspace }}/packages .
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: verdaccio-artifact
|
||||
path: pkg.tar.gz
|
||||
test:
|
||||
needs: build
|
||||
strategy:
|
||||
fail-fast: false
|
||||
fail-fast: true
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest]
|
||||
os: [ubuntu-latest]
|
||||
node_version: [12, 14]
|
||||
|
||||
name: ${{ matrix.os }} / Node ${{ matrix.node_version }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.1
|
||||
- name: Use Node ${{ matrix.node_version }}
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node_version }}
|
||||
- uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: verdaccio-artifact
|
||||
- name: untar packages
|
||||
run: tar -xzvf pkg.tar.gz -C ${{ github.workspace }}/packages
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@latest -g
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
- name: Install
|
||||
run: pnpm recursive install
|
||||
- name: Format
|
||||
run: pnpm format:check
|
||||
- name: Lint
|
||||
run: pnpm lint
|
||||
- name: Clean
|
||||
run: pnpm clean
|
||||
- name: Build
|
||||
run: pnpm recursive install --frozen-lockfile --ignore-scripts
|
||||
- name: Test
|
||||
run: pnpm test
|
||||
ci-e2e-ui:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
name: UI Test E2E Node 14
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.1
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 14
|
||||
- uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: verdaccio-artifact
|
||||
- name: untar packages
|
||||
run: tar -xzvf pkg.tar.gz -C ${{ github.workspace }}/packages
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@latest -g
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
- name: Install
|
||||
## we need scripts, pupetter downloads aditional content
|
||||
run: pnpm recursive install --frozen-lockfile
|
||||
- name: Test UI
|
||||
run: pnpm test:e2e:ui
|
||||
env:
|
||||
DEBUG: verdaccio:e2e*
|
||||
ci-e2e-cli:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
name: CLI Test E2E Node 14
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.1
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 14
|
||||
- uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: verdaccio-artifact
|
||||
- name: untar packages
|
||||
run: tar -xzvf pkg.tar.gz -C ${{ github.workspace }}/packages
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@latest -g
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
- name: Install
|
||||
## we need scripts, pupetter downloads aditional content
|
||||
run: pnpm recursive install --frozen-lockfile
|
||||
- name: Test CLI
|
||||
run: pnpm test:e2e:cli
|
||||
website:
|
||||
needs: [format, lint]
|
||||
runs-on: ubuntu-latest
|
||||
name: website build node 14
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.1
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 14
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@latest -g
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
- name: Install
|
||||
run: pnpm recursive install --frozen-lockfile
|
||||
- name: Build website
|
||||
run: |
|
||||
cd website
|
||||
pnpm build:website
|
||||
test-windows:
|
||||
needs: [format, lint]
|
||||
runs-on: windows-latest
|
||||
name: windows test node 14
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.1
|
||||
- name: Use Node 14
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 14
|
||||
- name: Install pnpm
|
||||
run: npm i pnpm@latest -g
|
||||
# pnpm cache is not working for windows (we need a solution)
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
|
||||
- name: Install
|
||||
run: pnpm recursive install --frozen-lockfile --ignore-scripts
|
||||
- name: build
|
||||
run: pnpm build
|
||||
- name: Test
|
||||
run: pnpm test
|
||||
env:
|
||||
DEBUG: verdaccio:web:*
|
||||
|
||||
7
.github/workflows/codeql-analysis.yml
vendored
7
.github/workflows/codeql-analysis.yml
vendored
@@ -1,14 +1,9 @@
|
||||
name: 'Code scanning - action'
|
||||
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 5.x
|
||||
- 'changeset-release/6.x'
|
||||
- 'dev/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- .github/workflows/ci.yml
|
||||
- .github/workflows/codeql-analysis.yml
|
||||
- 'packages/**'
|
||||
schedule:
|
||||
- cron: '0 2 * * 4'
|
||||
|
||||
30
.github/workflows/docker-publish-pre-check.yml
vendored
30
.github/workflows/docker-publish-pre-check.yml
vendored
@@ -1,30 +0,0 @@
|
||||
name: Docker & Publish Pre-check
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- .github/workflows/docker-publish-pre-check.yml
|
||||
- 'packages/**'
|
||||
- 'docker-bin/**'
|
||||
- 'package.json'
|
||||
- 'lerna.json'
|
||||
|
||||
jobs:
|
||||
testDocker:
|
||||
name: Test Docker Build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.1
|
||||
- name: Build
|
||||
run: npm run docker
|
||||
env:
|
||||
VERDACCIO_BUILD_REGISTRY: https://registry.verdaccio.org
|
||||
# testVerdaccio:
|
||||
# name: Test Verdaccio Publish
|
||||
# runs-on: ubuntu-latest
|
||||
# steps:
|
||||
# - uses: actions/checkout@v1
|
||||
# - name: Publish
|
||||
# uses: verdaccio/github-actions/publish@v0.4.0
|
||||
# with:
|
||||
# args: -d
|
||||
6
.github/workflows/docker-publish.yml
vendored
6
.github/workflows/docker-publish.yml
vendored
@@ -12,7 +12,7 @@ on:
|
||||
- 'Dockerfile'
|
||||
- '.dockerignore'
|
||||
branches:
|
||||
- '6.x'
|
||||
- 'master'
|
||||
tags:
|
||||
- 'v*'
|
||||
jobs:
|
||||
@@ -34,8 +34,8 @@ jobs:
|
||||
uses: crazy-max/ghaction-docker-meta@v1
|
||||
with:
|
||||
images: ${{ github.repository }}
|
||||
tag-custom: 6.x-next
|
||||
tag-custom-only: ${{ github.ref == 'refs/heads/6.x' }}
|
||||
tag-custom: nightly-master
|
||||
tag-custom-only: ${{ github.ref == 'refs/heads/master' }}
|
||||
tag-semver: |
|
||||
{{version}}
|
||||
{{major}}
|
||||
|
||||
1
.npmrc
1
.npmrc
@@ -2,3 +2,4 @@ always-auth = true
|
||||
recursive-install = true
|
||||
registry = https://registry.verdaccio.org
|
||||
loglevel=warn
|
||||
fetch-retries="10"
|
||||
|
||||
19
CHANGELOG.md
19
CHANGELOG.md
@@ -2,6 +2,25 @@
|
||||
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
## [5.0.0](https://github.com/verdaccio/verdaccio/compare/v5.0.0-alpha.7...v5.0.0) (2021-04-09)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* prepare release for v5 ([#2175](https://github.com/verdaccio/verdaccio/issues/2175)) ([82c5c4e](https://github.com/verdaccio/verdaccio/commit/82c5c4eb32bfcbf9aec7c96340b226b626526b45))
|
||||
|
||||
## [5.0.0-alpha.7](https://github.com/verdaccio/verdaccio/compare/v5.0.0-alpha.6...v5.0.0-alpha.7) (2021-04-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* ui readme missing css ([#2174](https://github.com/verdaccio/verdaccio/issues/2174)) ([f49ca06](https://github.com/verdaccio/verdaccio/commit/f49ca06c68919f920e10f4f5878c34d5886b2e02))
|
||||
* Upgrade Node from 14.16 to 14.16.1 for security fixes ([#2172](https://github.com/verdaccio/verdaccio/issues/2172)) ([6ab3163](https://github.com/verdaccio/verdaccio/commit/6ab31639fab97b1b3e6323c4da862a1cae3ae1c6)), closes [/github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V14.md#14](https://github.com/verdaccio//github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V14.md/issues/14)
|
||||
|
||||
## [5.0.0-alpha.6](https://github.com/verdaccio/verdaccio/compare/v5.0.0-alpha.5...v5.0.0-alpha.6) (2021-04-06)
|
||||
|
||||
## [5.0.0-alpha.5](https://github.com/verdaccio/verdaccio/compare/v5.0.0-alpha.4...v5.0.0-alpha.5) (2021-04-03)
|
||||
|
||||
## [5.0.0-alpha.4](https://github.com/verdaccio/verdaccio/compare/v5.0.0-alpha.3...v5.0.0-alpha.4) (2021-04-03)
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM --platform=${BUILDPLATFORM:-linux/amd64} node:14.15.1-alpine as builder
|
||||
FROM --platform=${BUILDPLATFORM:-linux/amd64} node:14.16.1-alpine as builder
|
||||
|
||||
ENV NODE_ENV=development \
|
||||
VERDACCIO_BUILD_REGISTRY=https://registry.verdaccio.org
|
||||
@@ -19,7 +19,7 @@ RUN npm -g i pnpm@latest && \
|
||||
# FIXME: need to remove devDependencies from the build
|
||||
# RUN pnpm install --prod --ignore-scripts
|
||||
|
||||
FROM node:14.15.1-alpine
|
||||
FROM node:14.16.1-alpine
|
||||
LABEL maintainer="https://github.com/verdaccio/verdaccio"
|
||||
|
||||
ENV VERDACCIO_APPDIR=/opt/verdaccio \
|
||||
|
||||
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2018 Verdaccio community
|
||||
Copyright (c) 2021 Verdaccio contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
214
README.md
214
README.md
@@ -1,6 +1,10 @@
|
||||

|
||||
|
||||
# Version 6.x (Under development)
|
||||

|
||||
|
||||
# Version 6 (Development branch)
|
||||
|
||||
> Looking for Verdaccio 5? Check branch `5.x`.
|
||||
|
||||
[Verdaccio](https://verdaccio.org/) is a simple, **zero-config-required local private npm registry**.
|
||||
No need for an entire database just to get started! Verdaccio comes out of the box with
|
||||
@@ -10,43 +14,209 @@ For those looking to extend their storage capabilities, Verdaccio
|
||||
**supports various community-made plugins to hook into services such as Amazon's s3,
|
||||
Google Cloud Storage** or create your own plugin.
|
||||
|
||||
[](https://www.npmjs.com/package/verdaccio)
|
||||
[](https://www.npmjs.com/package/verdaccio)
|
||||
[](https://verdaccio.org/docs/en/docker.html)
|
||||
[](https://opencollective.com/verdaccio)
|
||||
[](https://stackshare.io/verdaccio)
|
||||
|
||||
[](http://chat.verdaccio.org/)
|
||||
[](https://github.com/verdaccio/verdaccio/blob/master/LICENSE)
|
||||
[](https://crowdin.com/project/verdaccio)
|
||||
[](https://www.tickgit.com/browse?repo=github.com/verdaccio/verdaccio)
|
||||
|
||||
[](https://twitter.com/verdaccio_npm)
|
||||
[](https://github.com/verdaccio/verdaccio/stargazers)
|
||||
|
||||
## Install 6.x
|
||||
## Install
|
||||
|
||||
> ⚠️ Not available on npmjs
|
||||
|
||||
With docker
|
||||
Install with npm:
|
||||
|
||||
```bash
|
||||
docker pull verdaccio/verdaccio:6.x-next
|
||||
npm install --global verdaccio@6-next --https://registry.verdaccio.org/
|
||||
```
|
||||
|
||||
## Development
|
||||
|
||||
Please check [docs/development.md](docs/development.md) for further notes.
|
||||
|
||||
## Roadmap
|
||||
|
||||
Please check [the roadmap](https://github.com/verdaccio/verdaccio/discussions/1690) if you are willing to contribute.
|
||||
> Published on a temporary registry while setup is ready to publish on npmjs
|
||||
|
||||
## Donations
|
||||
|
||||
Verdaccio 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.** 😉
|
||||
|
||||
**[Donate](https://opencollective.com/verdaccio)** 💵👍🏻 starting from _\$1/month_ or just one single contribution.
|
||||
**[Donate](https://github.com/sponsors/verdaccio)** 💵👍🏻 starting from _$1/month_ or just one single contribution.
|
||||
|
||||
## What does Verdaccio do for me?
|
||||
|
||||
### Use private packages
|
||||
|
||||
If you want to use all benefits of npm package system in your company without sending all code to the public, and use your private packages just as easy as public ones.
|
||||
|
||||
### Cache npmjs.org registry
|
||||
|
||||
If you have more than one server you want to install packages on, you might want to use this to decrease latency
|
||||
(presumably "slow" npmjs.org will be connected to only once per package/version) and provide limited failover (if npmjs.org is down, we might still find something useful in the cache) or avoid issues like _[How one developer just broke Node, Babel and thousands of projects in 11 lines of JavaScript](https://www.theregister.co.uk/2016/03/23/npm_left_pad_chaos/)_, _[Many packages suddenly disappeared](https://github.com/npm/registry-issue-archive/issues/255)_ or _[Registry returns 404 for a package I have installed before](https://github.com/npm/registry-issue-archive/issues/329)_.
|
||||
|
||||
### Link multiple registries
|
||||
|
||||
If you use multiples registries in your organization and need to fetch packages from multiple sources in one single project you might take advance of the uplinks feature with Verdaccio, chaining multiple registries and fetching from one single endpoint.
|
||||
|
||||
### Override public packages
|
||||
|
||||
If you want to use a modified version of some 3rd-party package (for example, you found a bug, but maintainer didn't accept pull request yet), you can publish your version locally under the same name. See in detail [here](https://verdaccio.org/docs/en/best#override-public-packages).
|
||||
|
||||
### E2E Testing
|
||||
|
||||
Verdaccio has proved to be a lightweight registry that can be
|
||||
booted in a couple of seconds, fast enough for any CI. Many open source projects use verdaccio for end to end testing, to mention some examples, **create-react-app**, **mozilla neutrino**, **pnpm**, **storybook**, **alfresco** or **eclipse theia**. You can read more in dedicated article to E2E in our blog.
|
||||
|
||||
## Talks
|
||||
|
||||
### **Node.js Dependency Confusion Attacks**.
|
||||
|
||||
[](https://www.youtube.com/watch?v=qTRADSp3Hpo)
|
||||
|
||||
You might want to check out as well our previous talks:
|
||||
|
||||
- [**OpenJS World 2020** about \*Cover your Projects with a Multi purpose Lightweight Node.js Registry - **Juan Picado\***](https://www.youtube.com/watch?v=oVCjDWeehAQ)
|
||||
- [ViennaJS Meetup - Introduction to Verdaccio by **Priscila Olivera** and **Juan Picado**](https://www.youtube.com/watch?v=hDIFKzmoCa)
|
||||
- [Open Source? trivago - Verdaccio (**Ayush** and **Juan Picado**) January 2020](https://www.youtube.com/watch?v=A5CWxJC9xzc)
|
||||
- [GitNation Open Source Stage - How we have built a Node.js Registry with React - **Juan Picado** December 2019](https://www.youtube.com/watch?v=gpjC8Qp9B9A)
|
||||
- [Verdaccio - A lightweight Private Proxy Registry built in Node.js | **Juan Picado** at The Destro Dev Show](https://www.youtube.com/watch?reload=9&v=P_hxy7W-IL4&ab_channel=TheDestroDevShow)
|
||||
|
||||
## Get Started
|
||||
|
||||
Run in your terminal
|
||||
|
||||
```bash
|
||||
verdaccio
|
||||
```
|
||||
|
||||
You would need set some npm configuration, this is optional.
|
||||
|
||||
```bash
|
||||
$ npm set registry http://localhost:4873/
|
||||
```
|
||||
|
||||
For one-off commands or to avoid setting the registry globally:
|
||||
|
||||
```bash
|
||||
NPM_CONFIG_REGISTRY=http://localhost:4873 npm i
|
||||
```
|
||||
|
||||
Now you can navigate to [http://localhost:4873/](http://localhost:4873/) where your local packages will be listed and can be searched.
|
||||
|
||||
> Warning: Verdaccio [does not currently support PM2's cluster mode](https://github.com/verdaccio/verdaccio/issues/1301#issuecomment-489302298), running it with cluster mode may cause unknown behavior.
|
||||
|
||||
## Publishing
|
||||
|
||||
#### 1. create a user and log in
|
||||
|
||||
```bash
|
||||
npm adduser --registry http://localhost:4873
|
||||
```
|
||||
|
||||
> if you use HTTPS, add an appropriate CA information ("null" means get CA list from OS)
|
||||
|
||||
```bash
|
||||
$ npm set ca null
|
||||
```
|
||||
|
||||
#### 2. publish your package
|
||||
|
||||
```bash
|
||||
npm publish --registry http://localhost:4873
|
||||
```
|
||||
|
||||
This will prompt you for user credentials which will be saved on the `verdaccio` server.
|
||||
|
||||
## Docker
|
||||
|
||||
Below are the most commonly needed information,
|
||||
every aspect of Docker and verdaccio is [documented separately](https://www.verdaccio.org/docs/en/docker.html)
|
||||
|
||||
```
|
||||
docker pull verdaccio/verdaccio:nightly-master
|
||||
```
|
||||
|
||||
Available as [tags](https://hub.docker.com/r/verdaccio/verdaccio/tags/).
|
||||
|
||||
### Running verdaccio using Docker
|
||||
|
||||
To run the docker container:
|
||||
|
||||
```bash
|
||||
docker run -it --rm --name verdaccio -p 4873:4873 verdaccio/verdaccio
|
||||
```
|
||||
|
||||
Docker examples are available [in this repository](https://github.com/verdaccio/docker-examples).
|
||||
|
||||
## Compatibility
|
||||
|
||||
Verdaccio aims to support all features of a standard npm client that make sense to support in private repository. Unfortunately, it isn't always possible.
|
||||
|
||||
### Basic features
|
||||
|
||||
- Installing packages (npm install, npm upgrade, etc.) - **supported**
|
||||
- Publishing packages (npm publish) - **supported**
|
||||
|
||||
### Advanced package control
|
||||
|
||||
- Unpublishing packages (npm unpublish) - **supported**
|
||||
- Tagging (npm tag) - **supported**
|
||||
- Deprecation (npm deprecate) - **supported**
|
||||
|
||||
### User management
|
||||
|
||||
- Registering new users (npm adduser {newuser}) - **supported**
|
||||
- Change password (npm profile set password) - **supported**
|
||||
- Transferring ownership (npm owner add {user} {pkg}) - not supported, _PR-welcome_
|
||||
- Token (npm token) - **supported**
|
||||
|
||||
### Miscellany
|
||||
|
||||
- Searching (npm search) - **supported** (cli / browser)
|
||||
- Ping (npm ping) - **supported**
|
||||
- Starring (npm star, npm unstar, npm stars) - **supported**
|
||||
|
||||
### Security
|
||||
|
||||
- npm/yarn audit - **supported**
|
||||
|
||||
## Report a vulnerability
|
||||
|
||||
If 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).
|
||||
|
||||
## Core Team
|
||||
|
||||
| [Juan Picado](https://github.com/juanpicado) | [Ayush Sharma](https://github.com/ayusharma) | [Sergio Hg](https://github.com/sergiohgz) |
|
||||
| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------- |
|
||||
|  |  |  |
|
||||
| [@jotadeveloper](https://twitter.com/jotadeveloper) | [@ayusharma\_](https://twitter.com/ayusharma_) | [@sergiohgz](https://twitter.com/sergiohgz) |
|
||||
| [Priscila Oliveria](https://github.com/priscilawebdev) | [Daniel Ruf](https://github.com/DanielRuf) |
|
||||
|  |  |
|
||||
| [@priscilawebdev](https://twitter.com/priscilawebdev) | [@DanielRufde](https://twitter.com/DanielRufde) |
|
||||
|
||||
You can find and chat with then over Discord, click [here](http://chat.verdaccio.org) or follow them at _Twitter_.
|
||||
|
||||
## Who is using Verdaccio?
|
||||
|
||||
- [create-react-app](https://github.com/facebook/create-react-app/blob/master/CONTRIBUTING.md#customizing-e2e-registry-configuration) _(+86.2k ⭐️)_
|
||||
- [Gatsby](https://github.com/gatsbyjs/gatsby) _(+49.2k ⭐️)_
|
||||
- [Babel.js](https://github.com/babel/babel) _(+38.5k ⭐️)_
|
||||
- [Vue CLI](https://github.com/vuejs/vue-cli) _(+27.4k ⭐️)_
|
||||
- [Angular CLI](https://github.com/angular/angular-cli) _(+24.3k ⭐️)_
|
||||
- [Uppy](https://github.com/transloadit/uppy) _(+23.8k ⭐️)_
|
||||
- [bit](https://github.com/teambit/bit) _(+13k ⭐️)_
|
||||
- [Aurelia Framework](https://github.com/aurelia/framework) _(+11.6k ⭐️)_
|
||||
- [pnpm](https://github.com/pnpm/pnpm) _(+10.1k ⭐️)_
|
||||
- [ethereum/web3.js](https://github.com/ethereum/web3.js) _(+9.8k ⭐️)_
|
||||
- [NX](https://github.com/nrwl/nx) _(+6.1k ⭐️)_
|
||||
- [webiny-js](https://github.com/webiny/webiny-js) _(+4.3k ⭐️)_
|
||||
- [Mozilla Neutrino](https://github.com/neutrinojs/neutrino) _(+3.7k ⭐️)_
|
||||
- [workshopper how to npm](https://github.com/workshopper/how-to-npm) _(+1k ⭐️)_
|
||||
- [Amazon SDK v3](https://github.com/aws/aws-sdk-js-v3)
|
||||
- [Amazon Encryption SDK for Javascript](https://github.com/aws/aws-encryption-sdk-javascript)
|
||||
|
||||
🤓 Don't be shy, you also can be in [the list](https://github.com/verdaccio/website/blob/master/docs/who-is-using.md).
|
||||
|
||||
## Open Collective Sponsors
|
||||
|
||||
Support 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)]
|
||||
@@ -74,7 +244,9 @@ Thanks to the following companies to help us to achieve our goals providing free
|
||||
|
||||
[](https://www.jetbrains.com/)
|
||||
[](https://crowdin.com/)
|
||||
[](https://balsamiq.com/)
|
||||
[](https://www.browserstack.com/)
|
||||
|
||||
Verdaccio also is part of to the [Docker Open Source Program](https://www.docker.com/blog/expanded-support-for-open-source-software-projects/).
|
||||
|
||||
## Contributors
|
||||
|
||||
@@ -87,17 +259,17 @@ This project exists thanks to all the people who contribute. [[Contribute](CONTR
|
||||
If 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.
|
||||
|
||||
- [Blog](https://verdaccio.org/blog/)
|
||||
- [Donations](https://opencollective.com/verdaccio)
|
||||
- [Reporting an issue](https://github.com/verdaccio/verdaccio/blob/master/CONTRIBUTING.md#reporting-a-bug)
|
||||
- [Donations](https://github.com/sponsors/verdaccio)
|
||||
- [Reporting an issue](https://github.com/verdaccio/verdaccio/issues/new/choose)
|
||||
- [Running discussions](https://github.com/verdaccio/verdaccio/issues?q=is%3Aissue+is%3Aopen+label%3Adiscuss)
|
||||
- [Chat](http://chat.verdaccio.org/)
|
||||
- [Logos](https://verdaccio.org/docs/en/logo)
|
||||
- [Docker Examples](https://github.com/verdaccio/docker-examples)
|
||||
- [FAQ](https://github.com/verdaccio/verdaccio/issues?utf8=%E2%9C%93&q=is%3Aissue%20label%3Aquestion%20)
|
||||
- [Docker Examples](https://github.com/verdaccio/verdaccio/tree/master/docker-examples)
|
||||
- [FAQ](https://github.com/verdaccio/verdaccio/discussions/categories/q-a)
|
||||
|
||||
### License
|
||||
|
||||
Verdaccio is [MIT licensed](https://github.com/verdaccio/verdaccio/blob/master/LICENSE)
|
||||
|
||||
The Verdaccio documentation and logos (excluding /thanks, e.g., .md, .png, .sketch) files within the /assets folder) is
|
||||
[Creative Commons licensed](https://github.com/verdaccio/verdaccio/blob/master/LICENSE-docs).
|
||||
[Creative Commons licensed](https://creativecommons.org/licenses/by/4.0/).
|
||||
|
||||
@@ -1,44 +1,19 @@
|
||||
# Docker + Kubernetes Examples
|
||||
|
||||
This folder aims to create a collection of Docker and Kubernetes examples.
|
||||
|
||||
For more information about the **Helm** Chart, please check it [owns repo](https://github.com/verdaccio/charts).
|
||||
|
||||
> Feel free to contribute whether you consider any use case is relevant for the public in general.
|
||||
|
||||
## Examples
|
||||
|
||||
The following examples aim to be demonstrative and can be either improved or updated.
|
||||
|
||||
### Verdaccio 5
|
||||
- [v4 examples](v4/README.md)
|
||||
- [v5 examples](v5/README.md)
|
||||
|
||||
- [Docker + Nginx + Verdaccio](v5/reverse_proxy/nginx/README.md)
|
||||
## Aditional data
|
||||
|
||||
### Verdaccio 4
|
||||
|
||||
#### Proxies
|
||||
|
||||
- [Docker + Apache + Verdaccio](v4/apache-verdaccio/README.md)
|
||||
- [Docker + Nginx + Verdaccio](v4/reverse_proxy/nginx/README.md)
|
||||
- [Docker + https-portal Example](v4/https-portal-example/README.md)
|
||||
|
||||
#### Plugins
|
||||
|
||||
- [Docker + Uplinks Multi Registry](v4/multi-registry-uplink/README.md)
|
||||
- [Docker + Local Storage](v4/docker-local-storage-volume/readme.md)
|
||||
- [Docker + External Plugins](v4/docker-plugin-external/README.md)
|
||||
|
||||
#### Auth
|
||||
|
||||
- [Docker + LDAP (OpenLDAP) Server + Verdaccio 4](v4/ldap-verdaccio/readme.md) by **@kopax**
|
||||
- [Docker + Gitlab](gitlab-verdaccio/README.md)
|
||||
- [Docker + Active Directory](https://github.com/Mateus-Oli/verdaccio-ad-docker)
|
||||
|
||||
#### Storage
|
||||
|
||||
- [Docker + AWS S3 Plugin(localstack) + Verdaccio 4](v4/amazon-s3-docker-example/v4/README.md)
|
||||
- [Docker + Minio](https://github.com/barolab/verdaccio-minio/tree/master/example)
|
||||
This folder aims to create a collection of Docker and Kubernetes examples.
|
||||
|
||||
For more information about the **Helm** Chart, please check it [owns repo](https://github.com/verdaccio/charts).
|
||||
### Kubernetes
|
||||
|
||||
- Kubernetes (minikube) + Verdaccio (Basic Configuration)
|
||||
@@ -46,8 +21,7 @@ The following examples aim to be demonstrative and can be either improved or upd
|
||||
|
||||
### External
|
||||
|
||||
- [
|
||||
Verdaccio examples for Google Cloud and K8s setups. https://github.com/papezt/verdaccio-examples](https://github.com/papezt/verdaccio-examples)
|
||||
- [Verdaccio examples for Google Cloud and K8s setups. https://github.com/papezt/verdaccio-examples](https://github.com/papezt/verdaccio-examples)
|
||||
|
||||
### Articles
|
||||
|
||||
|
||||
24
docker-examples/v4/README.md
Normal file
24
docker-examples/v4/README.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# Verdaccio 4
|
||||
|
||||
#### Proxies
|
||||
|
||||
- [Docker + Apache + Verdaccio](v4/apache-verdaccio/README.md)
|
||||
- [Docker + Nginx + Verdaccio](v4/reverse_proxy/nginx/README.md)
|
||||
- [Docker + https-portal Example](v4/https-portal-example/README.md)
|
||||
|
||||
#### Plugins
|
||||
|
||||
- [Docker + Uplinks Multi Registry](v4/multi-registry-uplink/README.md)
|
||||
- [Docker + Local Storage](v4/docker-local-storage-volume/readme.md)
|
||||
- [Docker + External Plugins](v4/docker-plugin-external/README.md)
|
||||
|
||||
#### Auth
|
||||
|
||||
- [Docker + LDAP (OpenLDAP) Server + Verdaccio 4](v4/ldap-verdaccio/readme.md) by **@kopax**
|
||||
- [Docker + Gitlab](gitlab-verdaccio/README.md)
|
||||
- [Docker + Active Directory](https://github.com/Mateus-Oli/verdaccio-ad-docker)
|
||||
|
||||
#### Storage
|
||||
|
||||
- [Docker + AWS S3 Plugin(localstack) + Verdaccio 4](v4/amazon-s3-docker-example/v4/README.md)
|
||||
- [Docker + Minio](https://github.com/barolab/verdaccio-minio/tree/master/example)
|
||||
5
docker-examples/v5/README.md
Normal file
5
docker-examples/v5/README.md
Normal file
@@ -0,0 +1,5 @@
|
||||
# Verdaccio 5
|
||||
|
||||
> Before run examples, build the local image by running `pnpm docker`.
|
||||
|
||||
- [Docker + Nginx + Verdaccio](v5/reverse_proxy/nginx/README.md)
|
||||
@@ -44,3 +44,7 @@ The default header to identify the protocol is `X-Forwarded-Proto`, but there ar
|
||||
```
|
||||
$ VERDACCIO_FORWARDED_PROTO=CloudFront-Forwarded-Proto verdaccio --listen 5000
|
||||
```
|
||||
|
||||
#### VERDACCIO_STORAGE_PATH
|
||||
|
||||
By default, the storage is taken from config file, but using this variable allows to set it from environment variable.
|
||||
|
||||
45
package.json
45
package.json
@@ -14,30 +14,30 @@
|
||||
"url": "https://opencollective.com/verdaccio"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/cli": "7.12.13",
|
||||
"@babel/core": "7.12.13",
|
||||
"@babel/node": "7.12.13",
|
||||
"@babel/plugin-proposal-class-properties": "7.12.13",
|
||||
"@babel/plugin-proposal-decorators": "7.12.13",
|
||||
"@babel/cli": "7.13.14",
|
||||
"@babel/core": "7.13.15",
|
||||
"@babel/node": "7.13.13",
|
||||
"@babel/plugin-proposal-class-properties": "7.13.0",
|
||||
"@babel/plugin-proposal-decorators": "7.13.15",
|
||||
"@babel/plugin-proposal-export-namespace-from": "7.12.13",
|
||||
"@babel/plugin-proposal-function-sent": "7.12.13",
|
||||
"@babel/plugin-proposal-json-strings": "7.12.13",
|
||||
"@babel/plugin-proposal-nullish-coalescing-operator": "7.12.13",
|
||||
"@babel/plugin-proposal-json-strings": "7.13.8",
|
||||
"@babel/plugin-proposal-nullish-coalescing-operator": "7.13.8",
|
||||
"@babel/plugin-proposal-numeric-separator": "7.12.13",
|
||||
"@babel/plugin-proposal-object-rest-spread": "7.12.13",
|
||||
"@babel/plugin-proposal-optional-chaining": "7.12.13",
|
||||
"@babel/plugin-proposal-object-rest-spread": "7.13.8",
|
||||
"@babel/plugin-proposal-optional-chaining": "7.13.12",
|
||||
"@babel/plugin-proposal-throw-expressions": "7.12.13",
|
||||
"@babel/plugin-syntax-dynamic-import": "7.8.3",
|
||||
"@babel/plugin-syntax-import-meta": "7.10.4",
|
||||
"@babel/plugin-transform-async-to-generator": "7.12.13",
|
||||
"@babel/plugin-transform-classes": "7.12.13",
|
||||
"@babel/plugin-transform-runtime": "7.12.15",
|
||||
"@babel/plugin-transform-async-to-generator": "7.13.0",
|
||||
"@babel/plugin-transform-classes": "7.13.0",
|
||||
"@babel/plugin-transform-runtime": "7.13.15",
|
||||
"@babel/polyfill": "7.12.1",
|
||||
"@babel/preset-env": "7.12.13",
|
||||
"@babel/preset-react": "7.12.13",
|
||||
"@babel/preset-typescript": "7.12.13",
|
||||
"@babel/register": "7.12.13",
|
||||
"@babel/runtime": "7.12.13",
|
||||
"@babel/preset-env": "7.13.15",
|
||||
"@babel/preset-react": "7.13.13",
|
||||
"@babel/preset-typescript": "7.13.0",
|
||||
"@babel/register": "7.13.14",
|
||||
"@babel/runtime": "7.13.10",
|
||||
"@changesets/changelog-github": "^0.2.8",
|
||||
"@changesets/cli": "^2.15.0",
|
||||
"@changesets/get-dependents-graph": "^1.2.0",
|
||||
@@ -78,7 +78,7 @@
|
||||
"babel-plugin-emotion": "11.0.0",
|
||||
"codecov": "3.8.1",
|
||||
"concurrently": "^5.3.0",
|
||||
"core-js": "^3.8.3",
|
||||
"core-js": "^3.10.1",
|
||||
"cross-env": "7.0.3",
|
||||
"detect-secrets": "1.0.6",
|
||||
"eslint": "7.19.0",
|
||||
@@ -110,11 +110,11 @@
|
||||
"prettier": "2.2.1",
|
||||
"rimraf": "3.0.2",
|
||||
"selfsigned": "1.10.8",
|
||||
"standard-version": "8.0.0",
|
||||
"supertest": "4.0.2",
|
||||
"ts-node": "^9.1.1",
|
||||
"typescript": "^4.1.3",
|
||||
"verdaccio": "next",
|
||||
"typescript": "^4.2.4",
|
||||
"update-ts-references": "2.3.0",
|
||||
"verdaccio": "^5.0.1",
|
||||
"verdaccio-audit": "workspace:*",
|
||||
"verdaccio-auth-memory": "workspace:*",
|
||||
"verdaccio-htpasswd": "workspace:*",
|
||||
@@ -147,7 +147,8 @@
|
||||
"ci:version": "run-s ci:version:changeset ci:version:install",
|
||||
"ci:version:install": "pnpm install --frozen-lockfile=false",
|
||||
"ci:version:changeset": "changeset version",
|
||||
"ci:publish": "changeset publish"
|
||||
"ci:publish": "changeset publish",
|
||||
"ts:ref": "update-ts-references --discardComments"
|
||||
},
|
||||
"license": "MIT",
|
||||
"commitlint": {
|
||||
|
||||
@@ -1,5 +1,32 @@
|
||||
# @verdaccio/api
|
||||
|
||||
## 6.0.0-6-next.9
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [1810ed0d]
|
||||
- Updated dependencies [648575aa]
|
||||
- @verdaccio/config@6.0.0-6-next.5
|
||||
- @verdaccio/tarball@11.0.0-6-next.5
|
||||
- @verdaccio/utils@6.0.0-6-next.4
|
||||
- @verdaccio/auth@6.0.0-6-next.7
|
||||
- @verdaccio/hooks@6.0.0-6-next.4
|
||||
- @verdaccio/store@6.0.0-6-next.7
|
||||
- @verdaccio/middleware@6.0.0-6-next.7
|
||||
|
||||
## 6.0.0-6-next.8
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [5c5057fc]
|
||||
- @verdaccio/config@6.0.0-6-next.4
|
||||
- @verdaccio/logger@6.0.0-6-next.4
|
||||
- @verdaccio/auth@6.0.0-6-next.6
|
||||
- @verdaccio/hooks@6.0.0-6-next.4
|
||||
- @verdaccio/store@6.0.0-6-next.6
|
||||
- @verdaccio/tarball@11.0.0-6-next.4
|
||||
- @verdaccio/middleware@6.0.0-6-next.6
|
||||
|
||||
## 6.0.0-6-next.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@verdaccio/api",
|
||||
"version": "6.0.0-6-next.7",
|
||||
"version": "6.0.0-6-next.9",
|
||||
"description": "loaders logic",
|
||||
"main": "./build/index.js",
|
||||
"types": "build/index.d.ts",
|
||||
@@ -39,15 +39,15 @@
|
||||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@verdaccio/auth": "workspace:6.0.0-alpha.5",
|
||||
"@verdaccio/auth": "workspace:6.0.0-6-next.7",
|
||||
"@verdaccio/commons-api": "workspace:11.0.0-alpha.3",
|
||||
"@verdaccio/config": "workspace:6.0.0-alpha.3",
|
||||
"@verdaccio/hooks": "workspace:6.0.0-alpha.3",
|
||||
"@verdaccio/logger": "workspace:6.0.0-alpha.3",
|
||||
"@verdaccio/middleware": "workspace:6.0.0-alpha.5",
|
||||
"@verdaccio/store": "workspace:6.0.0-6-next.5",
|
||||
"@verdaccio/tarball": "workspace:11.0.0-6-next.4",
|
||||
"@verdaccio/utils": "workspace:6.0.0-alpha.3",
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.5",
|
||||
"@verdaccio/hooks": "workspace:6.0.0-6-next.4",
|
||||
"@verdaccio/logger": "workspace:6.0.0-6-next.4",
|
||||
"@verdaccio/middleware": "workspace:6.0.0-6-next.7",
|
||||
"@verdaccio/store": "workspace:6.0.0-6-next.7",
|
||||
"@verdaccio/tarball": "workspace:11.0.0-6-next.5",
|
||||
"@verdaccio/utils": "workspace:6.0.0-6-next.4",
|
||||
"cookies": "0.8.0",
|
||||
"debug": "^4.1.1",
|
||||
"express": "4.17.1",
|
||||
@@ -56,8 +56,8 @@
|
||||
"semver": "7.3.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@verdaccio/server": "workspace:6.0.0-6-next.8",
|
||||
"@verdaccio/types": "workspace:11.0.0-alpha.3",
|
||||
"@verdaccio/server": "workspace:6.0.0-6-next.10",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.4",
|
||||
"body-parser": "1.19.0",
|
||||
"lodash": "^4.17.20",
|
||||
"supertest": "next"
|
||||
|
||||
@@ -7,41 +7,35 @@
|
||||
"include": ["src/**/*.ts", "types/*.d.ts"],
|
||||
"exclude": ["src/**/*.test.ts"],
|
||||
"references": [
|
||||
{
|
||||
"path": "../utils"
|
||||
},
|
||||
{
|
||||
"path": "../config"
|
||||
},
|
||||
{
|
||||
"path": "../commons"
|
||||
},
|
||||
{
|
||||
"path": "../hooks"
|
||||
},
|
||||
{
|
||||
"path": "../store"
|
||||
},
|
||||
{
|
||||
"path": "../middleware"
|
||||
},
|
||||
{
|
||||
"path": "../auth"
|
||||
},
|
||||
{
|
||||
"path": "../server"
|
||||
},
|
||||
{
|
||||
"path": "../loaders"
|
||||
},
|
||||
{
|
||||
"path": "../logger"
|
||||
"path": "../config"
|
||||
},
|
||||
{
|
||||
"path": "../core/commons-api"
|
||||
},
|
||||
{
|
||||
"path": "../core/tarball"
|
||||
},
|
||||
{
|
||||
"path": "../hooks"
|
||||
},
|
||||
{
|
||||
"path": "../logger"
|
||||
},
|
||||
{
|
||||
"path": "../middleware"
|
||||
},
|
||||
{
|
||||
"path": "../server"
|
||||
},
|
||||
{
|
||||
"path": "../store"
|
||||
},
|
||||
{
|
||||
"path": "../utils"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,5 +1,26 @@
|
||||
# @verdaccio/auth
|
||||
|
||||
## 6.0.0-6-next.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [1810ed0d]
|
||||
- Updated dependencies [648575aa]
|
||||
- @verdaccio/config@6.0.0-6-next.5
|
||||
- @verdaccio/utils@6.0.0-6-next.4
|
||||
- @verdaccio/loaders@6.0.0-6-next.4
|
||||
|
||||
## 6.0.0-6-next.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [5c5057fc]
|
||||
- @verdaccio/config@6.0.0-6-next.4
|
||||
- @verdaccio/logger@6.0.0-6-next.4
|
||||
- @verdaccio/auth@6.0.0-6-next.6
|
||||
- @verdaccio/loaders@6.0.0-6-next.4
|
||||
- verdaccio-htpasswd@11.0.0-alpha.6
|
||||
|
||||
## 5.0.0-alpha.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@verdaccio/auth",
|
||||
"version": "6.0.0-alpha.5",
|
||||
"version": "6.0.0-6-next.7",
|
||||
"description": "logger",
|
||||
"main": "./build/index.js",
|
||||
"types": "build/index.d.ts",
|
||||
@@ -39,12 +39,11 @@
|
||||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@verdaccio/auth": "workspace:6.0.0-alpha.5",
|
||||
"@verdaccio/commons-api": "workspace:11.0.0-alpha.3",
|
||||
"@verdaccio/config": "workspace:6.0.0-alpha.3",
|
||||
"@verdaccio/loaders": "workspace:6.0.0-alpha.3",
|
||||
"@verdaccio/logger": "workspace:6.0.0-alpha.3",
|
||||
"@verdaccio/utils": "workspace:6.0.0-alpha.3",
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.5",
|
||||
"@verdaccio/loaders": "workspace:6.0.0-6-next.4",
|
||||
"@verdaccio/logger": "workspace:6.0.0-6-next.4",
|
||||
"@verdaccio/utils": "workspace:6.0.0-6-next.4",
|
||||
"verdaccio-htpasswd": "workspace:11.0.0-alpha.6",
|
||||
"debug": "^4.1.1",
|
||||
"express": "4.17.1",
|
||||
@@ -52,8 +51,8 @@
|
||||
"lodash": "4.17.15"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@verdaccio/mock": "workspace:6.0.0-alpha.3",
|
||||
"@verdaccio/types": "workspace:11.0.0-alpha.3"
|
||||
"@verdaccio/mock": "workspace:6.0.0-6-next.5",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.4"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
|
||||
@@ -8,10 +8,13 @@
|
||||
"exclude": ["src/**/*.test.ts"],
|
||||
"references": [
|
||||
{
|
||||
"path": "../utils"
|
||||
"path": "../config"
|
||||
},
|
||||
{
|
||||
"path": "../commons"
|
||||
"path": "../core/commons-api"
|
||||
},
|
||||
{
|
||||
"path": "../core/htpasswd"
|
||||
},
|
||||
{
|
||||
"path": "../loaders"
|
||||
@@ -19,17 +22,11 @@
|
||||
{
|
||||
"path": "../logger"
|
||||
},
|
||||
{
|
||||
"path": "../config"
|
||||
},
|
||||
{
|
||||
"path": "../mock"
|
||||
},
|
||||
{
|
||||
"path": "../core/commons-api"
|
||||
},
|
||||
{
|
||||
"path": "../core/htpasswd"
|
||||
"path": "../utils"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,5 +1,42 @@
|
||||
# @verdaccio/cli
|
||||
|
||||
## 6.0.0-6-next.11
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [1810ed0d]
|
||||
- @verdaccio/config@6.0.0-6-next.5
|
||||
- @verdaccio/node-api@6.0.0-6-next.11
|
||||
|
||||
## 6.0.0-6-next.10
|
||||
|
||||
### Major Changes
|
||||
|
||||
- 5c5057fc: feat: node api new structure based on promise
|
||||
|
||||
```js
|
||||
import { runServer } from '@verdaccio/node-api';
|
||||
// or
|
||||
import { runServer } from 'verdaccio';
|
||||
|
||||
const app = await runServer(); // default configuration
|
||||
const app = await runServer('./config/config.yaml');
|
||||
const app = await runServer({ configuration });
|
||||
app.listen(4000, event => {
|
||||
// do something
|
||||
});
|
||||
```
|
||||
|
||||
### Breaking Change
|
||||
|
||||
If you are using the node-api, the new structure is Promise based and less arguments.
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [5c5057fc]
|
||||
- @verdaccio/config@6.0.0-6-next.4
|
||||
- @verdaccio/node-api@6.0.0-6-next.10
|
||||
|
||||
## 6.0.0-6-next.9
|
||||
|
||||
### Major Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@verdaccio/cli",
|
||||
"version": "6.0.0-6-next.9",
|
||||
"version": "6.0.0-6-next.11",
|
||||
"author": {
|
||||
"name": "Juan Picado",
|
||||
"email": "juanpicado19@gmail.com"
|
||||
@@ -43,9 +43,9 @@
|
||||
"build": "pnpm run build:js && pnpm run build:types"
|
||||
},
|
||||
"dependencies": {
|
||||
"@verdaccio/config": "workspace:6.0.0-alpha.3",
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.5",
|
||||
"@verdaccio/cli-ui": "workspace:6.0.0-alpha.3",
|
||||
"@verdaccio/node-api": "workspace:6.0.0-6-next.9",
|
||||
"@verdaccio/node-api": "workspace:6.0.0-6-next.11",
|
||||
"commander": "6.2.0",
|
||||
"clipanion": "3.0.0-rc.11",
|
||||
"envinfo": "7.4.0",
|
||||
|
||||
@@ -2,9 +2,9 @@ import envinfo from 'envinfo';
|
||||
import { Command } from 'clipanion';
|
||||
|
||||
export class InfoCommand extends Command {
|
||||
static paths = [[`--info`], [`-i`]];
|
||||
public static paths = [[`--info`], [`-i`]];
|
||||
|
||||
async execute() {
|
||||
public async execute(): Promise<void> {
|
||||
this.context.stdout.write('\nEnvironment Info:');
|
||||
const data = await envinfo.run({
|
||||
System: ['OS', 'CPU'],
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
import { Command, Option } from 'clipanion';
|
||||
|
||||
import { ConfigRuntime } from '@verdaccio/types';
|
||||
import { findConfigFile, parseConfigFile } from '@verdaccio/config';
|
||||
import { startVerdaccio, listenDefaultCallback } from '@verdaccio/node-api';
|
||||
import { initServer } from '@verdaccio/node-api';
|
||||
|
||||
export const DEFAULT_PROCESS_NAME: string = 'verdaccio';
|
||||
|
||||
export class InitCommand extends Command {
|
||||
static paths = [Command.Default];
|
||||
public static paths = [Command.Default];
|
||||
|
||||
listen = Option.String('-l,--listen', {
|
||||
private port = Option.String('-l,-p,--listen,--port', {
|
||||
description: 'host:port number to listen on (default: localhost:4873)',
|
||||
});
|
||||
|
||||
@@ -25,8 +23,8 @@ export class InitCommand extends Command {
|
||||
|
||||
The optional arguments are:
|
||||
|
||||
- \`--listen\` to switch the default server port,
|
||||
- \`--config\` to define a different configuration path location,
|
||||
- \`-l | --listen | -p | --port\` to switch the default server port,
|
||||
- \`-c | --config\` to define a different configuration path location,
|
||||
|
||||
`,
|
||||
examples: [
|
||||
@@ -39,70 +37,24 @@ export class InitCommand extends Command {
|
||||
],
|
||||
});
|
||||
|
||||
config = Option.String('-c,--config', {
|
||||
private config = Option.String('-c,--config', {
|
||||
description: 'use this configuration file (default: ./config.yaml)',
|
||||
});
|
||||
|
||||
async execute() {
|
||||
let configPathLocation;
|
||||
let verdaccioConfiguration: ConfigRuntime;
|
||||
public async execute() {
|
||||
try {
|
||||
configPathLocation = findConfigFile(this.config as string);
|
||||
verdaccioConfiguration = parseConfigFile(configPathLocation);
|
||||
const { web, https } = verdaccioConfiguration;
|
||||
const configPathLocation = findConfigFile(this.config as string);
|
||||
const configParsed = parseConfigFile(configPathLocation);
|
||||
const { web } = configParsed;
|
||||
|
||||
process.title = web?.title || DEFAULT_PROCESS_NAME;
|
||||
|
||||
if (!https) {
|
||||
verdaccioConfiguration = Object.assign({}, verdaccioConfiguration, {
|
||||
https: { enable: false },
|
||||
});
|
||||
}
|
||||
|
||||
const { version, name } = require('../../package.json');
|
||||
|
||||
startVerdaccio(
|
||||
verdaccioConfiguration,
|
||||
this.listen as string,
|
||||
configPathLocation,
|
||||
version,
|
||||
name,
|
||||
listenDefaultCallback
|
||||
);
|
||||
await initServer(configParsed, this.port as string, version, name);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// export default function initProgram(commander, pkgVersion, pkgName) {
|
||||
// const cliListener = commander.listen;
|
||||
// let configPathLocation;
|
||||
// let verdaccioConfiguration: ConfigRuntime;
|
||||
// try {
|
||||
// configPathLocation = findConfigFile(commander.config);
|
||||
// verdaccioConfiguration = parseConfigFile(configPathLocation);
|
||||
// const { web, https } = verdaccioConfiguration;
|
||||
|
||||
// process.title = web?.title || DEFAULT_PROCESS_NAME;
|
||||
|
||||
// if (!https) {
|
||||
// verdaccioConfiguration = Object.assign({}, verdaccioConfiguration, {
|
||||
// https: { enable: false },
|
||||
// });
|
||||
// }
|
||||
|
||||
// // initLogger.warn({file: configPathLocation}, 'config file - @{file}');
|
||||
|
||||
// startVerdaccio(
|
||||
// verdaccioConfiguration,
|
||||
// cliListener,
|
||||
// configPathLocation,
|
||||
// pkgVersion,
|
||||
// pkgName,
|
||||
// listenDefaultCallback
|
||||
// );
|
||||
// } catch (err) {
|
||||
// process.exit(1);
|
||||
// }
|
||||
// }
|
||||
|
||||
@@ -10,17 +10,11 @@
|
||||
{
|
||||
"path": "../config"
|
||||
},
|
||||
{
|
||||
"path": "../logger"
|
||||
},
|
||||
{
|
||||
"path": "../node-api"
|
||||
},
|
||||
{
|
||||
"path": "../core/cli-ui"
|
||||
},
|
||||
{
|
||||
"path": "../utils"
|
||||
"path": "../node-api"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,5 +1,43 @@
|
||||
# @verdaccio/config
|
||||
|
||||
## 6.0.0-6-next.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 1810ed0d: Feature
|
||||
|
||||
- add option to set storage from environment variable VERDACCIO_STORAGE_PATH
|
||||
|
||||
#### Related tickets
|
||||
|
||||
https://github.com/verdaccio/verdaccio/issues/1681
|
||||
|
||||
- Updated dependencies [648575aa]
|
||||
- @verdaccio/utils@6.0.0-6-next.4
|
||||
|
||||
## 6.0.0-6-next.4
|
||||
|
||||
### Major Changes
|
||||
|
||||
- 5c5057fc: feat: node api new structure based on promise
|
||||
|
||||
```js
|
||||
import { runServer } from '@verdaccio/node-api';
|
||||
// or
|
||||
import { runServer } from 'verdaccio';
|
||||
|
||||
const app = await runServer(); // default configuration
|
||||
const app = await runServer('./config/config.yaml');
|
||||
const app = await runServer({ configuration });
|
||||
app.listen(4000, event => {
|
||||
// do something
|
||||
});
|
||||
```
|
||||
|
||||
### Breaking Change
|
||||
|
||||
If you are using the node-api, the new structure is Promise based and less arguments.
|
||||
|
||||
## 5.0.0-alpha.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@verdaccio/config",
|
||||
"version": "6.0.0-alpha.3",
|
||||
"version": "6.0.0-6-next.5",
|
||||
"description": "logger",
|
||||
"main": "./build/index.js",
|
||||
"types": "build/index.d.ts",
|
||||
@@ -40,7 +40,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@verdaccio/commons-api": "workspace:11.0.0-alpha.3",
|
||||
"@verdaccio/utils": "workspace:6.0.0-alpha.3",
|
||||
"@verdaccio/utils": "workspace:6.0.0-6-next.4",
|
||||
"debug": "^4.2.0",
|
||||
"js-yaml": "3.14.0",
|
||||
"lodash": "^4.17.20",
|
||||
|
||||
@@ -28,8 +28,8 @@ const debug = buildDebug('verdaccio:config');
|
||||
* Find and get the first config file that match.
|
||||
* @return {String} the config file path
|
||||
*/
|
||||
function findConfigFile(configPath: string): string {
|
||||
if (_.isNil(configPath) === false) {
|
||||
function findConfigFile(configPath: string | undefined): string {
|
||||
if (typeof configPath !== 'undefined') {
|
||||
return Path.resolve(configPath);
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ class Config implements AppConfig {
|
||||
|
||||
public constructor(config: ConfigRuntime) {
|
||||
const self = this;
|
||||
this.storage = config.storage;
|
||||
this.storage = process.env.VERDACCIO_STORAGE_PATH || config.storage;
|
||||
this.config_path = config.config_path;
|
||||
this.plugins = config.plugins;
|
||||
this.security = _.merge(defaultSecurity, config.security);
|
||||
|
||||
@@ -1,14 +1,7 @@
|
||||
import path from 'path';
|
||||
import { parseConfigFile } from '../src';
|
||||
import { parseConfigurationFile } from './utils';
|
||||
|
||||
describe('Package access utilities', () => {
|
||||
const parseConfigurationFile = (conf) => {
|
||||
const { name, ext } = path.parse(conf);
|
||||
const format = ext.startsWith('.') ? ext.substring(1) : 'yaml';
|
||||
|
||||
return path.join(__dirname, `./partials/config/${format}/${name}.${format}`);
|
||||
};
|
||||
|
||||
describe('JSON format', () => {
|
||||
test('parse default.json', () => {
|
||||
const config = parseConfigFile(parseConfigurationFile('default.json'));
|
||||
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
ROLES,
|
||||
WEB_TITLE,
|
||||
} from '../src';
|
||||
import { parseConfigurationFile } from './utils';
|
||||
|
||||
const resolveConf = (conf) => {
|
||||
const { name, ext } = path.parse(conf);
|
||||
@@ -80,6 +81,32 @@ describe('check basic content parsed file', () => {
|
||||
checkDefaultConfPackages(config);
|
||||
});
|
||||
|
||||
test('should set storage to value set in VERDACCIO_STORAGE_PATH environment variable', () => {
|
||||
const storageLocation = '/tmp/verdaccio';
|
||||
process.env.VERDACCIO_STORAGE_PATH = storageLocation;
|
||||
const config = new Config(parseConfigFile(resolveConf('default')));
|
||||
expect(config.storage).toBe(storageLocation);
|
||||
delete process.env.VERDACCIO_STORAGE_PATH;
|
||||
});
|
||||
|
||||
test('should set storage path to VERDACCIO_STORAGE_PATH if both config and env are set', () => {
|
||||
const storageLocation = '/tmp/verdaccio';
|
||||
process.env.VERDACCIO_STORAGE_PATH = storageLocation;
|
||||
const config = new Config(parseConfigFile(parseConfigurationFile('storage')));
|
||||
expect(config.storage).toBe(storageLocation);
|
||||
delete process.env.VERDACCIO_STORAGE_PATH;
|
||||
});
|
||||
|
||||
test('should take storage from environment variable if not exists in configs', () => {
|
||||
const storageLocation = '/tmp/verdaccio';
|
||||
process.env.VERDACCIO_STORAGE_PATH = storageLocation;
|
||||
const defaultConfig = parseConfigFile(resolveConf('default'));
|
||||
delete defaultConfig.storage;
|
||||
const config = new Config(defaultConfig);
|
||||
expect(config.storage).toBe(storageLocation);
|
||||
delete process.env.VERDACCIO_STORAGE_PATH;
|
||||
});
|
||||
|
||||
test('parse docker.yaml', () => {
|
||||
const config = new Config(parseConfigFile(resolveConf('docker')));
|
||||
checkDefaultUplink(config);
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import path from 'path';
|
||||
import _ from 'lodash';
|
||||
|
||||
import {
|
||||
@@ -7,15 +6,9 @@ import {
|
||||
PACKAGE_ACCESS,
|
||||
} from '../src/package-access';
|
||||
import { parseConfigFile } from '../src';
|
||||
import { parseConfigurationFile } from './utils';
|
||||
|
||||
describe('Package access utilities', () => {
|
||||
const parseConfigurationFile = (conf) => {
|
||||
const { name, ext } = path.parse(conf);
|
||||
const format = ext.startsWith('.') ? ext.substring(1) : 'yaml';
|
||||
|
||||
return path.join(__dirname, `./partials/config/${format}/${name}.${format}`);
|
||||
};
|
||||
|
||||
describe('normalisePackageAccess', () => {
|
||||
test('should test basic conversion', () => {
|
||||
const { packages } = parseConfigFile(parseConfigurationFile('pkgs-basic'));
|
||||
|
||||
7
packages/config/test/partials/config/yaml/storage.yaml
Normal file
7
packages/config/test/partials/config/yaml/storage.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
storage: './storage_default_storage'
|
||||
|
||||
logs:
|
||||
- type: stdout
|
||||
format: pretty
|
||||
level: warn
|
||||
@@ -1,16 +1,8 @@
|
||||
import path from 'path';
|
||||
|
||||
import { hasProxyTo, sanityCheckUplinksProps, uplinkSanityCheck } from '../src/uplinks';
|
||||
import { normalisePackageAccess, parseConfigFile } from '../src';
|
||||
import { parseConfigurationFile } from './utils';
|
||||
|
||||
describe('Uplinks Utilities', () => {
|
||||
const parseConfigurationFile = (conf) => {
|
||||
const { name, ext } = path.parse(conf);
|
||||
const format = ext.startsWith('.') ? ext.substring(1) : 'yaml';
|
||||
|
||||
return path.join(__dirname, `./partials/config/${format}/${name}.${format}`);
|
||||
};
|
||||
|
||||
describe('uplinkSanityCheck', () => {
|
||||
test('should test basic conversion', () => {
|
||||
const uplinks = uplinkSanityCheck(
|
||||
|
||||
1
packages/config/test/utils/index.ts
Normal file
1
packages/config/test/utils/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { parseConfigurationFile } from './parse-configuration-file';
|
||||
8
packages/config/test/utils/parse-configuration-file.ts
Normal file
8
packages/config/test/utils/parse-configuration-file.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import path from 'path';
|
||||
|
||||
export const parseConfigurationFile = (conf: string) => {
|
||||
const { name, ext } = path.parse(conf);
|
||||
const format = ext.startsWith('.') ? ext.substring(1) : 'yaml';
|
||||
|
||||
return path.join(__dirname, `../partials/config/${format}/${name}.${format}`);
|
||||
};
|
||||
@@ -7,14 +7,11 @@
|
||||
"include": ["src/**/*.ts"],
|
||||
"exclude": ["src/**/*.test.ts"],
|
||||
"references": [
|
||||
{
|
||||
"path": "../utils"
|
||||
},
|
||||
{
|
||||
"path": "../core/commons-api"
|
||||
},
|
||||
{
|
||||
"path": "../logger"
|
||||
"path": "../utils"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
"lockfile": "1.0.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@verdaccio/types": "workspace:11.0.0-alpha.3"
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.4"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf ./build",
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/bcryptjs": "^2.4.2",
|
||||
"@verdaccio/types": "workspace:11.0.0-alpha.3",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.4",
|
||||
"mockdate": "^3.0.2"
|
||||
},
|
||||
"scripts": {
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
"exclude": ["src/**/*.test.ts"],
|
||||
"references": [
|
||||
{
|
||||
"path": "../file-locking"
|
||||
"path": "../commons-api"
|
||||
},
|
||||
{
|
||||
"path": "../commons-api"
|
||||
"path": "../file-locking"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/minimatch": "^3.0.3",
|
||||
"@verdaccio/types": "workspace:11.0.0-alpha.3",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.4",
|
||||
"minimatch": "^3.0.4",
|
||||
"rmdir-sync": "^1.0.1"
|
||||
},
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
"exclude": ["src/**/*.test.ts"],
|
||||
"references": [
|
||||
{
|
||||
"path": "../streams"
|
||||
"path": "../commons-api"
|
||||
},
|
||||
{
|
||||
"path": "../file-locking"
|
||||
},
|
||||
{
|
||||
"path": "../commons-api"
|
||||
"path": "../streams"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
"marked": "1.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@verdaccio/types": "workspace:11.0.0-alpha.3"
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.4"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf ./build",
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
"access": "public"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@verdaccio/types": "workspace:11.0.0-alpha.3"
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.4"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf ./build",
|
||||
|
||||
@@ -1,5 +1,20 @@
|
||||
# Change Log
|
||||
|
||||
## 11.0.0-6-next.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 648575aa: Bug Fixes
|
||||
|
||||
- fix escaped slash in namespaced packages
|
||||
|
||||
#### Related tickets
|
||||
|
||||
https://github.com/verdaccio/verdaccio/pull/2193
|
||||
|
||||
- Updated dependencies [648575aa]
|
||||
- @verdaccio/utils@6.0.0-6-next.4
|
||||
|
||||
## 11.0.0-6-next.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@verdaccio/tarball",
|
||||
"version": "11.0.0-6-next.4",
|
||||
"version": "11.0.0-6-next.5",
|
||||
"description": "tarball utilities resolver",
|
||||
"keywords": [
|
||||
"private",
|
||||
@@ -38,10 +38,10 @@
|
||||
"lodash": "^4.17.21",
|
||||
"@verdaccio/commons-api": "workspace:11.0.0-alpha.3",
|
||||
"@verdaccio/url": "workspace:11.0.0-6-next.4",
|
||||
"@verdaccio/utils": "workspace:6.0.0-alpha.3"
|
||||
"@verdaccio/utils": "workspace:6.0.0-6-next.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@verdaccio/types": "workspace:11.0.0-alpha.3",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.4",
|
||||
"express": "^4.17.1",
|
||||
"node-mocks-http": "^1.10.1"
|
||||
},
|
||||
|
||||
@@ -2,7 +2,6 @@ import URL from 'url';
|
||||
import { Request } from 'express';
|
||||
import buildDebug from 'debug';
|
||||
|
||||
import { encodeScopedUri } from '@verdaccio/utils';
|
||||
import { getPublicUrl } from '@verdaccio/url';
|
||||
|
||||
const debug = buildDebug('verdaccio:core:url');
|
||||
@@ -32,5 +31,5 @@ export function getLocalRegistryTarballUri(
|
||||
// header only set with proxy that setup with HTTPS
|
||||
const domainRegistry = getPublicUrl(urlPrefix || '', req);
|
||||
|
||||
return `${domainRegistry}${encodeScopedUri(pkgName)}/-/${tarballName}`;
|
||||
return `${domainRegistry}${pkgName}/-/${tarballName}`;
|
||||
}
|
||||
|
||||
@@ -8,14 +8,11 @@
|
||||
"exclude": ["src/**/*.test.ts"],
|
||||
"references": [
|
||||
{
|
||||
"path": "../types"
|
||||
"path": "../../utils"
|
||||
},
|
||||
{
|
||||
"path": "../commons-api"
|
||||
},
|
||||
{
|
||||
"path": "../../utils"
|
||||
},
|
||||
{
|
||||
"path": "../url"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,28 @@
|
||||
# Change Log
|
||||
|
||||
## 11.0.0-6-next.4
|
||||
|
||||
### Major Changes
|
||||
|
||||
- 5c5057fc: feat: node api new structure based on promise
|
||||
|
||||
```js
|
||||
import { runServer } from '@verdaccio/node-api';
|
||||
// or
|
||||
import { runServer } from 'verdaccio';
|
||||
|
||||
const app = await runServer(); // default configuration
|
||||
const app = await runServer('./config/config.yaml');
|
||||
const app = await runServer({ configuration });
|
||||
app.listen(4000, event => {
|
||||
// do something
|
||||
});
|
||||
```
|
||||
|
||||
### Breaking Change
|
||||
|
||||
If you are using the node-api, the new structure is Promise based and less arguments.
|
||||
|
||||
## 10.0.0-alpha.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
5
packages/core/types/index.d.ts
vendored
5
packages/core/types/index.d.ts
vendored
@@ -352,10 +352,9 @@ declare module '@verdaccio/types' {
|
||||
export type ServerSettingsConf = {
|
||||
// express-rate-limit settings
|
||||
rateLimit: RateLimit;
|
||||
// deprecated
|
||||
keepAliveTimeout?: number;
|
||||
//F
|
||||
publicUrl?: string;
|
||||
// force http2 if https is defined
|
||||
http2?: boolean;
|
||||
};
|
||||
|
||||
type URLPrefix = {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@verdaccio/types",
|
||||
"version": "11.0.0-alpha.3",
|
||||
"version": "11.0.0-6-next.4",
|
||||
"description": "verdaccio types definitions",
|
||||
"keywords": [
|
||||
"private",
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"node-mocks-http": "^1.10.1",
|
||||
"@verdaccio/types": "workspace:11.0.0-alpha.3"
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.4"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf ./build",
|
||||
|
||||
@@ -7,9 +7,6 @@
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["src/**/*.test.ts"],
|
||||
"references": [
|
||||
{
|
||||
"path": "../types"
|
||||
},
|
||||
{
|
||||
"path": "../commons-api"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @verdaccio/hooks
|
||||
|
||||
## 6.0.0-6-next.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [5c5057fc]
|
||||
- @verdaccio/logger@6.0.0-6-next.4
|
||||
|
||||
## 5.0.0-alpha.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@verdaccio/hooks",
|
||||
"version": "6.0.0-alpha.3",
|
||||
"version": "6.0.0-6-next.4",
|
||||
"description": "loaders logic",
|
||||
"main": "./build/index.js",
|
||||
"types": "build/index.d.ts",
|
||||
@@ -31,17 +31,17 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@verdaccio/commons-api": "workspace:11.0.0-alpha.3",
|
||||
"@verdaccio/logger": "workspace:6.0.0-alpha.3",
|
||||
"@verdaccio/logger": "workspace:6.0.0-6-next.4",
|
||||
"debug": "^4.2.0",
|
||||
"handlebars": "4.5.3",
|
||||
"node-fetch": "^2.6.1",
|
||||
"request": "2.87.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@verdaccio/auth": "workspace:6.0.0-alpha.5",
|
||||
"@verdaccio/auth": "workspace:6.0.0-6-next.7",
|
||||
"@verdaccio/commons-api": "workspace:11.0.0-alpha.3",
|
||||
"@verdaccio/config": "workspace:6.0.0-alpha.3",
|
||||
"@verdaccio/types": "workspace:11.0.0-alpha.3",
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.5",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.4",
|
||||
"nock": "^13.0.4"
|
||||
},
|
||||
"scripts": {
|
||||
|
||||
@@ -7,20 +7,17 @@
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["src/**/*.test.ts"],
|
||||
"references": [
|
||||
{
|
||||
"path": "../config"
|
||||
},
|
||||
{
|
||||
"path": "../auth"
|
||||
},
|
||||
{
|
||||
"path": "../commons"
|
||||
},
|
||||
{
|
||||
"path": "../logger"
|
||||
"path": "../config"
|
||||
},
|
||||
{
|
||||
"path": "../core/commons-api"
|
||||
},
|
||||
{
|
||||
"path": "../logger"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @verdaccio/loaders
|
||||
|
||||
## 6.0.0-6-next.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [5c5057fc]
|
||||
- @verdaccio/logger@6.0.0-6-next.4
|
||||
|
||||
## 5.0.0-alpha.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@verdaccio/loaders",
|
||||
"version": "6.0.0-alpha.3",
|
||||
"version": "6.0.0-6-next.4",
|
||||
"description": "loaders logic",
|
||||
"main": "./build/index.js",
|
||||
"types": "build/index.d.ts",
|
||||
@@ -13,15 +13,15 @@
|
||||
"url": "https://github.com/verdaccio/verdaccio"
|
||||
},
|
||||
"dependencies": {
|
||||
"@verdaccio/logger": "workspace:6.0.0-alpha.3",
|
||||
"@verdaccio/logger": "workspace:6.0.0-6-next.4",
|
||||
"debug": "^4.1.1",
|
||||
"lodash": "4.17.15"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@verdaccio/commons-api": "workspace:11.0.0-alpha.3",
|
||||
"@verdaccio/config": "workspace:6.0.0-alpha.3",
|
||||
"@verdaccio/mock": "workspace:6.0.0-alpha.3",
|
||||
"@verdaccio/types": "workspace:11.0.0-alpha.3"
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.5",
|
||||
"@verdaccio/mock": "workspace:6.0.0-6-next.5",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.4"
|
||||
},
|
||||
"homepage": "https://verdaccio.org",
|
||||
"keywords": [
|
||||
|
||||
@@ -10,17 +10,14 @@
|
||||
{
|
||||
"path": "../config"
|
||||
},
|
||||
{
|
||||
"path": "../core/commons-api"
|
||||
},
|
||||
{
|
||||
"path": "../logger"
|
||||
},
|
||||
{
|
||||
"path": "../mock"
|
||||
},
|
||||
{
|
||||
"path": "../node-api"
|
||||
},
|
||||
{
|
||||
"path": "../core/commons-api"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -6,5 +6,9 @@
|
||||
},
|
||||
"include": ["src/**/*.ts"],
|
||||
"exclude": ["src/**/*.test.ts"],
|
||||
"references": [{ "path": "../commons" }, { "path": "../core/commons-api" }]
|
||||
"references": [
|
||||
{
|
||||
"path": "../core/commons-api"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,5 +1,28 @@
|
||||
# @verdaccio/logger
|
||||
|
||||
## 6.0.0-6-next.4
|
||||
|
||||
### Major Changes
|
||||
|
||||
- 5c5057fc: feat: node api new structure based on promise
|
||||
|
||||
```js
|
||||
import { runServer } from '@verdaccio/node-api';
|
||||
// or
|
||||
import { runServer } from 'verdaccio';
|
||||
|
||||
const app = await runServer(); // default configuration
|
||||
const app = await runServer('./config/config.yaml');
|
||||
const app = await runServer({ configuration });
|
||||
app.listen(4000, event => {
|
||||
// do something
|
||||
});
|
||||
```
|
||||
|
||||
### Breaking Change
|
||||
|
||||
If you are using the node-api, the new structure is Promise based and less arguments.
|
||||
|
||||
## 5.0.0-alpha.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@verdaccio/logger",
|
||||
"version": "6.0.0-alpha.3",
|
||||
"version": "6.0.0-6-next.4",
|
||||
"description": "logger",
|
||||
"main": "./build/index.js",
|
||||
"types": "build/index.d.ts",
|
||||
@@ -46,7 +46,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/pino": "^6.3.3",
|
||||
"@verdaccio/types": "workspace:11.0.0-alpha.3"
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.4"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
|
||||
@@ -74,6 +74,7 @@ export function createLogger(
|
||||
|
||||
export function getLogger() {
|
||||
if (_.isNil(logger)) {
|
||||
// FIXME: not sure about display here a warning
|
||||
process.emitWarning('logger is not defined');
|
||||
return;
|
||||
}
|
||||
@@ -153,4 +154,6 @@ export function setup(options: LoggerConfig | LoggerConfigItem = [DEFAULT_LOGGER
|
||||
process.on('SIGQUIT', () => finalHandler(null, 'SIGQUIT'));
|
||||
process.on('SIGTERM', () => finalHandler(null, 'SIGTERM'));
|
||||
}
|
||||
|
||||
return logger;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,21 @@
|
||||
# @verdaccio/middleware
|
||||
|
||||
## 6.0.0-6-next.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [648575aa]
|
||||
- @verdaccio/utils@6.0.0-6-next.4
|
||||
- @verdaccio/auth@6.0.0-6-next.7
|
||||
|
||||
## 6.0.0-6-next.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [5c5057fc]
|
||||
- @verdaccio/logger@6.0.0-6-next.4
|
||||
- @verdaccio/auth@6.0.0-6-next.6
|
||||
|
||||
## 5.0.0-alpha.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@verdaccio/middleware",
|
||||
"version": "6.0.0-alpha.5",
|
||||
"version": "6.0.0-6-next.7",
|
||||
"description": "loaders logic",
|
||||
"main": "./build/index.js",
|
||||
"types": "build/index.d.ts",
|
||||
@@ -39,10 +39,10 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"debug": "^4.3.1",
|
||||
"@verdaccio/auth": "workspace:6.0.0-alpha.5",
|
||||
"@verdaccio/auth": "workspace:6.0.0-6-next.7",
|
||||
"@verdaccio/commons-api": "workspace:11.0.0-alpha.3",
|
||||
"@verdaccio/logger": "workspace:6.0.0-alpha.3",
|
||||
"@verdaccio/utils": "workspace:6.0.0-alpha.3",
|
||||
"@verdaccio/logger": "workspace:6.0.0-6-next.4",
|
||||
"@verdaccio/utils": "workspace:6.0.0-6-next.4",
|
||||
"lodash": "4.17.15"
|
||||
},
|
||||
"funding": {
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
"exclude": ["src/**/*.test.ts"],
|
||||
"references": [
|
||||
{
|
||||
"path": "../core/commons-api"
|
||||
"path": "../auth"
|
||||
},
|
||||
{
|
||||
"path": "../commons"
|
||||
"path": "../core/commons-api"
|
||||
},
|
||||
{
|
||||
"path": "../logger"
|
||||
|
||||
@@ -1,5 +1,29 @@
|
||||
# @verdaccio/mock
|
||||
|
||||
## 6.0.0-6-next.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 648575aa: Bug Fixes
|
||||
|
||||
- fix escaped slash in namespaced packages
|
||||
|
||||
#### Related tickets
|
||||
|
||||
https://github.com/verdaccio/verdaccio/pull/2193
|
||||
|
||||
- Updated dependencies [1810ed0d]
|
||||
- Updated dependencies [648575aa]
|
||||
- @verdaccio/config@6.0.0-6-next.5
|
||||
- @verdaccio/utils@6.0.0-6-next.4
|
||||
|
||||
## 6.0.0-6-next.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [5c5057fc]
|
||||
- @verdaccio/config@6.0.0-6-next.4
|
||||
|
||||
## 5.0.0-alpha.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@verdaccio/mock",
|
||||
"version": "6.0.0-alpha.3",
|
||||
"version": "6.0.0-6-next.5",
|
||||
"author": {
|
||||
"name": "Juan Picado",
|
||||
"email": "juanpicado19@gmail.com"
|
||||
@@ -40,8 +40,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@verdaccio/commons-api": "workspace:11.0.0-alpha.3",
|
||||
"@verdaccio/config": "workspace:6.0.0-alpha.3",
|
||||
"@verdaccio/utils": "workspace:6.0.0-alpha.3",
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.5",
|
||||
"@verdaccio/utils": "workspace:6.0.0-6-next.4",
|
||||
"debug": "^4.2.0",
|
||||
"fs-extra": "^8.1.0",
|
||||
"lodash": "^4.17.20",
|
||||
@@ -49,7 +49,7 @@
|
||||
"supertest": "^4.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@verdaccio/types": "workspace:11.0.0-alpha.3"
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.4"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
HTTP_STATUS,
|
||||
TOKEN_BEARER,
|
||||
} from '@verdaccio/commons-api';
|
||||
import { buildToken, encodeScopedUri } from '@verdaccio/utils';
|
||||
import { buildToken } from '@verdaccio/utils';
|
||||
import { generateRandomHexString } from '@verdaccio/utils';
|
||||
import { Package } from '@verdaccio/types';
|
||||
import { response } from 'express';
|
||||
@@ -70,7 +70,7 @@ export function putPackage(
|
||||
export function deletePackage(request: any, pkgName: string, token?: string): Promise<any[]> {
|
||||
return new Promise((resolve) => {
|
||||
const del = request
|
||||
.put(`/${encodeScopedUri(pkgName)}/-rev/${generateRandomHexString(8)}`)
|
||||
.put(`/${pkgName}/-rev/${generateRandomHexString(8)}`)
|
||||
.set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON);
|
||||
|
||||
if (_.isNil(token) === false) {
|
||||
@@ -216,18 +216,13 @@ export async function fetchPackageByVersionAndTag(
|
||||
}
|
||||
|
||||
export async function isExistPackage(app, packageName) {
|
||||
const [err] = await getPackage(request(app), '', encodeScopedUri(packageName), HTTP_STATUS.OK);
|
||||
const [err] = await getPackage(request(app), '', packageName, HTTP_STATUS.OK);
|
||||
|
||||
return _.isNull(err);
|
||||
}
|
||||
|
||||
export async function verifyPackageVersionDoesExist(app, packageName, version, token?: string) {
|
||||
const [, res] = await getPackage(
|
||||
request(app),
|
||||
token as string,
|
||||
encodeScopedUri(packageName),
|
||||
HTTP_STATUS.OK
|
||||
);
|
||||
const [, res] = await getPackage(request(app), token as string, packageName, HTTP_STATUS.OK);
|
||||
|
||||
const { versions } = res.body;
|
||||
const versionsKeys = Object.keys(versions);
|
||||
@@ -236,5 +231,5 @@ export async function verifyPackageVersionDoesExist(app, packageName, version, t
|
||||
}
|
||||
|
||||
export function generateUnPublishURI(pkgName) {
|
||||
return `/${encodeScopedUri(pkgName)}/-rev/${generateRandomHexString(8)}`;
|
||||
return `/${pkgName}/-rev/${generateRandomHexString(8)}`;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["src/**/*.test.ts"],
|
||||
"references": [
|
||||
{
|
||||
"path": "../config"
|
||||
},
|
||||
{
|
||||
"path": "../core/commons-api"
|
||||
},
|
||||
|
||||
@@ -1,5 +1,44 @@
|
||||
# @verdaccio/node-api
|
||||
|
||||
## 6.0.0-6-next.11
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [1810ed0d]
|
||||
- Updated dependencies [648575aa]
|
||||
- @verdaccio/config@6.0.0-6-next.5
|
||||
- @verdaccio/server@6.0.0-6-next.10
|
||||
|
||||
## 6.0.0-6-next.10
|
||||
|
||||
### Major Changes
|
||||
|
||||
- 5c5057fc: feat: node api new structure based on promise
|
||||
|
||||
```js
|
||||
import { runServer } from '@verdaccio/node-api';
|
||||
// or
|
||||
import { runServer } from 'verdaccio';
|
||||
|
||||
const app = await runServer(); // default configuration
|
||||
const app = await runServer('./config/config.yaml');
|
||||
const app = await runServer({ configuration });
|
||||
app.listen(4000, event => {
|
||||
// do something
|
||||
});
|
||||
```
|
||||
|
||||
### Breaking Change
|
||||
|
||||
If you are using the node-api, the new structure is Promise based and less arguments.
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [5c5057fc]
|
||||
- @verdaccio/config@6.0.0-6-next.4
|
||||
- @verdaccio/logger@6.0.0-6-next.4
|
||||
- @verdaccio/server@6.0.0-6-next.9
|
||||
|
||||
## 6.0.0-6-next.9
|
||||
|
||||
### Patch Changes
|
||||
|
||||
5
packages/node-api/examples/.eslintrc
Normal file
5
packages/node-api/examples/.eslintrc
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"rules": {
|
||||
"no-console": "off"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
const { runServer } = require('../build');
|
||||
|
||||
(async () => {
|
||||
const app = await runServer();
|
||||
app.listen(4000, () => {
|
||||
console.log('server started');
|
||||
});
|
||||
})();
|
||||
@@ -1,5 +1,3 @@
|
||||
const config = require('../../jest/config');
|
||||
|
||||
module.exports = Object.assign({}, config, {
|
||||
collectCoverage: false,
|
||||
});
|
||||
module.exports = Object.assign({}, config, {});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@verdaccio/node-api",
|
||||
"version": "6.0.0-6-next.9",
|
||||
"version": "6.0.0-6-next.11",
|
||||
"description": "node API",
|
||||
"main": "build/index.js",
|
||||
"types": "build/index.d.ts",
|
||||
@@ -25,7 +25,7 @@
|
||||
"verdaccio"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=10",
|
||||
"node": ">=12",
|
||||
"npm": ">=6"
|
||||
},
|
||||
"scripts": {
|
||||
@@ -40,18 +40,20 @@
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@verdaccio/commons-api": "workspace:11.0.0-alpha.3",
|
||||
"@verdaccio/config": "workspace:6.0.0-alpha.3",
|
||||
"@verdaccio/config": "workspace:6.0.0-6-next.5",
|
||||
"@verdaccio/cli-ui": "workspace:6.0.0-alpha.3",
|
||||
"@verdaccio/server": "workspace:6.0.0-6-next.8",
|
||||
"@verdaccio/server": "workspace:6.0.0-6-next.10",
|
||||
"@verdaccio/logger": "workspace:6.0.0-6-next.4",
|
||||
"core-js": "^3.6.5",
|
||||
"debug": "^4.2.0",
|
||||
"lodash": "^4.17.20",
|
||||
"selfsigned": "1.10.7"
|
||||
"lodash": "^4.17.20"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@verdaccio/mock": "workspace:6.0.0-alpha.3",
|
||||
"@verdaccio/types": "workspace:11.0.0-alpha.3",
|
||||
"jest-mock-process": "^1.4.0"
|
||||
"@verdaccio/mock": "workspace:6.0.0-6-next.5",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.4",
|
||||
"jest-mock-process": "^1.4.0",
|
||||
"selfsigned": "1.10.7",
|
||||
"supertest": "^6.1.3"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
||||
25
packages/node-api/src/bootstrap.d.ts
vendored
25
packages/node-api/src/bootstrap.d.ts
vendored
@@ -1,25 +0,0 @@
|
||||
import { Application } from 'express';
|
||||
import { Callback } from '@verdaccio/types';
|
||||
/**
|
||||
* Trigger the server after configuration has been loaded.
|
||||
* @param {Object} config
|
||||
* @param {Object} cliArguments
|
||||
* @param {String} configPath
|
||||
* @param {String} pkgVersion
|
||||
* @param {String} pkgName
|
||||
*/
|
||||
declare function startVerdaccio(
|
||||
config: any,
|
||||
cliListen: string,
|
||||
configPath: string,
|
||||
pkgVersion: string,
|
||||
pkgName: string,
|
||||
callback: Callback
|
||||
): void;
|
||||
declare function listenDefaultCallback(
|
||||
webServer: Application,
|
||||
addr: any,
|
||||
pkgName: string,
|
||||
pkgVersion: string
|
||||
): void;
|
||||
export { startVerdaccio, listenDefaultCallback };
|
||||
@@ -1,196 +0,0 @@
|
||||
import URL from 'url';
|
||||
import fs from 'fs';
|
||||
import http from 'http';
|
||||
import https from 'https';
|
||||
import constants from 'constants';
|
||||
import { Application } from 'express';
|
||||
import { assign, isObject, isFunction } from 'lodash';
|
||||
import buildDebug from 'debug';
|
||||
|
||||
import { displayError, displayMessage, displayLink } from '@verdaccio/cli-ui';
|
||||
|
||||
import {
|
||||
ConfigRuntime,
|
||||
Callback,
|
||||
ConfigWithHttps,
|
||||
HttpsConfKeyCert,
|
||||
HttpsConfPfx,
|
||||
} from '@verdaccio/types';
|
||||
import { API_ERROR } from '@verdaccio/commons-api';
|
||||
import server from '@verdaccio/server';
|
||||
|
||||
export const keyPem = 'verdaccio-key.pem';
|
||||
export const certPem = 'verdaccio-cert.pem';
|
||||
export const csrPem = 'verdaccio-csr.pem';
|
||||
|
||||
import { getListListenAddresses, resolveConfigPath } from './cli-utils';
|
||||
import { displayExperimentsInfoBox } from './experiments';
|
||||
|
||||
const debug = buildDebug('verdaccio:runtime');
|
||||
|
||||
function launchServer(
|
||||
app,
|
||||
addr,
|
||||
config,
|
||||
configPath: string,
|
||||
pkgVersion: string,
|
||||
pkgName: string,
|
||||
callback: Callback
|
||||
): void {
|
||||
let webServer;
|
||||
if (addr.proto === 'https') {
|
||||
debug('https enabled');
|
||||
webServer = handleHTTPS(app, configPath, config);
|
||||
} else {
|
||||
// http
|
||||
debug('http enabled');
|
||||
webServer = http.createServer(app);
|
||||
}
|
||||
if (
|
||||
config.server &&
|
||||
typeof config.server.keepAliveTimeout !== 'undefined' &&
|
||||
config.server.keepAliveTimeout !== 'null'
|
||||
) {
|
||||
// library definition for node is not up to date (doesn't contain recent 8.0 changes)
|
||||
webServer.keepAliveTimeout = config.server.keepAliveTimeout * 1000;
|
||||
}
|
||||
unlinkAddressPath(addr);
|
||||
|
||||
callback(webServer, addr, pkgName, pkgVersion);
|
||||
}
|
||||
|
||||
async function startVerdaccio(
|
||||
config: ConfigRuntime,
|
||||
cliListen: string,
|
||||
configPath: string,
|
||||
pkgVersion: string,
|
||||
pkgName: string,
|
||||
callback: Callback
|
||||
): Promise<void> {
|
||||
if (isObject(config) === false) {
|
||||
throw new Error(API_ERROR.CONFIG_BAD_FORMAT);
|
||||
}
|
||||
|
||||
const app = await server(config);
|
||||
const addresses = getListListenAddresses(cliListen, config.listen);
|
||||
displayExperimentsInfoBox(config.flags);
|
||||
|
||||
addresses.forEach((addr) =>
|
||||
launchServer(app, addr, config, configPath, pkgVersion, pkgName, callback)
|
||||
);
|
||||
}
|
||||
|
||||
function unlinkAddressPath(addr) {
|
||||
if (addr.path && fs.existsSync(addr.path)) {
|
||||
fs.unlinkSync(addr.path);
|
||||
}
|
||||
}
|
||||
|
||||
function logHTTPSError(storageLocation) {
|
||||
displayError(
|
||||
[
|
||||
'You have enabled HTTPS and need to specify either ',
|
||||
' "https.key" and "https.cert" or ',
|
||||
' "https.pfx" and optionally "https.passphrase" ',
|
||||
'to run https server',
|
||||
'',
|
||||
// commands are borrowed from node.js docs
|
||||
'To quickly create self-signed certificate, use:',
|
||||
' $ openssl genrsa -out ' + resolveConfigPath(storageLocation, keyPem) + ' 2048',
|
||||
' $ openssl req -new -sha256 -key ' +
|
||||
resolveConfigPath(storageLocation, keyPem) +
|
||||
' -out ' +
|
||||
resolveConfigPath(storageLocation, csrPem),
|
||||
' $ openssl x509 -req -in ' +
|
||||
resolveConfigPath(storageLocation, csrPem) +
|
||||
' -signkey ' +
|
||||
resolveConfigPath(storageLocation, keyPem) +
|
||||
' -out ' +
|
||||
resolveConfigPath(storageLocation, certPem),
|
||||
'',
|
||||
'And then add to config file (' + storageLocation + '):',
|
||||
' https:',
|
||||
` key: ${resolveConfigPath(storageLocation, keyPem)}`,
|
||||
` cert: ${resolveConfigPath(storageLocation, certPem)}`,
|
||||
].join('\n')
|
||||
);
|
||||
displayError(displayLink('https://verdaccio.org/docs/en/configuration#https'));
|
||||
process.exit(2);
|
||||
}
|
||||
|
||||
function handleHTTPS(app: Application, configPath: string, config: ConfigWithHttps): https.Server {
|
||||
try {
|
||||
let httpsOptions = {
|
||||
// disable insecure SSLv2 and SSLv3
|
||||
secureOptions: constants.SSL_OP_NO_SSLv2 | constants.SSL_OP_NO_SSLv3,
|
||||
};
|
||||
|
||||
const keyCertConfig = config.https as HttpsConfKeyCert;
|
||||
const pfxConfig = config.https as HttpsConfPfx;
|
||||
|
||||
// https must either have key and cert or a pfx and (optionally) a passphrase
|
||||
if (!((keyCertConfig.key && keyCertConfig.cert) || pfxConfig.pfx)) {
|
||||
logHTTPSError(configPath);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
if (pfxConfig.pfx) {
|
||||
const { pfx, passphrase } = pfxConfig;
|
||||
httpsOptions = assign(httpsOptions, {
|
||||
pfx: fs.readFileSync(pfx),
|
||||
passphrase: passphrase || '',
|
||||
});
|
||||
} else {
|
||||
const { key, cert, ca } = keyCertConfig;
|
||||
httpsOptions = assign(httpsOptions, {
|
||||
key: fs.readFileSync(key),
|
||||
cert: fs.readFileSync(cert),
|
||||
...(ca && {
|
||||
ca: fs.readFileSync(ca),
|
||||
}),
|
||||
});
|
||||
}
|
||||
return https.createServer(httpsOptions, app);
|
||||
} catch (err) {
|
||||
displayError(`cannot create server: ${err.message}`);
|
||||
process.exit(2);
|
||||
}
|
||||
}
|
||||
|
||||
function listenDefaultCallback(
|
||||
webServer: Application,
|
||||
addr: any,
|
||||
pkgName: string,
|
||||
pkgVersion: string
|
||||
): void {
|
||||
webServer
|
||||
.listen(addr.port || addr.path, addr.host, (): void => {
|
||||
// send a message for test
|
||||
if (isFunction(process.send)) {
|
||||
process.send({
|
||||
verdaccio_started: true,
|
||||
});
|
||||
}
|
||||
const addressServer = `${
|
||||
addr.path
|
||||
? URL.format({
|
||||
protocol: 'unix',
|
||||
pathname: addr.path,
|
||||
})
|
||||
: URL.format({
|
||||
protocol: addr.proto,
|
||||
hostname: addr.host,
|
||||
port: addr.port,
|
||||
pathname: '/',
|
||||
})
|
||||
}`;
|
||||
displayMessage(`http address ${displayLink(addressServer)}`);
|
||||
displayMessage(`${pkgName} / ${pkgVersion}`);
|
||||
})
|
||||
.on('error', function (err): void {
|
||||
displayError(`cannot create server: ${err.message}`);
|
||||
process.exit(2);
|
||||
});
|
||||
}
|
||||
|
||||
export { startVerdaccio, listenDefaultCallback };
|
||||
@@ -1,7 +1,3 @@
|
||||
import path from 'path';
|
||||
|
||||
import { displayLink, displayWarning } from '@verdaccio/cli-ui';
|
||||
|
||||
export const DEFAULT_PORT = '4873';
|
||||
export const DEFAULT_PROTOCOL = 'http';
|
||||
export const DEFAULT_DOMAIN = 'localhost';
|
||||
@@ -46,10 +42,6 @@ export function parseAddress(urlAddress: any): any {
|
||||
return null;
|
||||
}
|
||||
|
||||
export const resolveConfigPath = function (storageLocation: string, file: string) {
|
||||
return path.resolve(path.dirname(storageLocation), file);
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieve all addresses defined in the config file.
|
||||
* Verdaccio is able to listen multiple ports
|
||||
@@ -61,13 +53,14 @@ export const resolveConfigPath = function (storageLocation: string, file: string
|
||||
- localhost:5557
|
||||
@return {Array}
|
||||
*/
|
||||
export function getListListenAddresses(argListen: string, configListen: any): any {
|
||||
export function getListListenAddresses(argListen: string | void, configListen: any): any {
|
||||
// command line || config file || default
|
||||
let addresses;
|
||||
if (argListen) {
|
||||
addresses = [argListen];
|
||||
} else if (Array.isArray(configListen)) {
|
||||
addresses = configListen;
|
||||
process.emitWarning('multiple addresses will be deprecated in the next major, only use one');
|
||||
} else if (configListen) {
|
||||
addresses = [configListen];
|
||||
} else {
|
||||
@@ -78,11 +71,11 @@ export function getListListenAddresses(argListen: string, configListen: any): an
|
||||
const parsedAddr = parseAddress(addr);
|
||||
|
||||
if (!parsedAddr) {
|
||||
displayWarning(
|
||||
process.emitWarning(
|
||||
// eslint-disable-next-line max-len
|
||||
`invalid address - ${addr}, we expect a port (e.g. "4873"), host:port (e.g. "localhost:4873") or full url '(e.g. "http://localhost:4873/")`
|
||||
);
|
||||
displayWarning(displayLink('https://verdaccio.org/docs/en/configuration#listen-port'));
|
||||
process.emitWarning('https://verdaccio.org/docs/en/configuration#listen-port');
|
||||
}
|
||||
|
||||
return parsedAddr;
|
||||
|
||||
@@ -1 +1 @@
|
||||
export { listenDefaultCallback, startVerdaccio } from './bootstrap';
|
||||
export { initServer, runServer } from './server';
|
||||
|
||||
186
packages/node-api/src/server.ts
Normal file
186
packages/node-api/src/server.ts
Normal file
@@ -0,0 +1,186 @@
|
||||
/* eslint-disable */
|
||||
import _, { assign, isFunction } from 'lodash';
|
||||
import http from 'http';
|
||||
import https from 'https';
|
||||
import constants from 'constants';
|
||||
import buildDebug from 'debug';
|
||||
import fs from 'fs';
|
||||
import url from 'url';
|
||||
|
||||
import { findConfigFile, parseConfigFile } from '@verdaccio/config';
|
||||
import { API_ERROR } from '@verdaccio/commons-api';
|
||||
import { ConfigRuntime, HttpsConfKeyCert, HttpsConfPfx } from '@verdaccio/types';
|
||||
import { setup } from '@verdaccio/logger';
|
||||
import server from '@verdaccio/server';
|
||||
import { getListListenAddresses } from './cli-utils';
|
||||
import { displayExperimentsInfoBox } from './experiments';
|
||||
|
||||
const debug = buildDebug('verdaccio:node-api');
|
||||
|
||||
function unlinkAddressPath(addr) {
|
||||
if (addr.path && fs.existsSync(addr.path)) {
|
||||
fs.unlinkSync(addr.path);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a native HTTP/HTTPS server instance
|
||||
* @param config
|
||||
* @param addr
|
||||
* @param app
|
||||
*/
|
||||
export function createServerFactory(config: ConfigRuntime, addr, app) {
|
||||
let serverFactory;
|
||||
if (addr.proto === 'https') {
|
||||
debug('https enabled');
|
||||
try {
|
||||
let httpsOptions = {
|
||||
// disable insecure SSLv2 and SSLv3
|
||||
secureOptions: constants.SSL_OP_NO_SSLv2 | constants.SSL_OP_NO_SSLv3,
|
||||
};
|
||||
|
||||
const keyCertConfig = config.https as HttpsConfKeyCert;
|
||||
const pfxConfig = config.https as HttpsConfPfx;
|
||||
|
||||
// https must either have key and cert or a pfx and (optionally) a passphrase
|
||||
if (!((keyCertConfig.key && keyCertConfig.cert) || pfxConfig.pfx)) {
|
||||
// logHTTPSError(configPath);
|
||||
throw Error('bad format https configuration');
|
||||
}
|
||||
|
||||
if (pfxConfig.pfx) {
|
||||
const { pfx, passphrase } = pfxConfig;
|
||||
httpsOptions = assign(httpsOptions, {
|
||||
pfx: fs.readFileSync(pfx),
|
||||
passphrase: passphrase || '',
|
||||
});
|
||||
} else {
|
||||
const { key, cert, ca } = keyCertConfig;
|
||||
httpsOptions = assign(httpsOptions, {
|
||||
key: fs.readFileSync(key),
|
||||
cert: fs.readFileSync(cert),
|
||||
...(ca && {
|
||||
ca: fs.readFileSync(ca),
|
||||
}),
|
||||
});
|
||||
}
|
||||
// TODO: enable http2 as feature
|
||||
// if (config.server.http2) <-- check if force http2
|
||||
serverFactory = https.createServer(httpsOptions, app);
|
||||
} catch (err) {
|
||||
throw new Error(`cannot create https server: ${err.message}`);
|
||||
}
|
||||
} else {
|
||||
// http
|
||||
debug('http enabled');
|
||||
serverFactory = http.createServer(app);
|
||||
}
|
||||
|
||||
if (
|
||||
config.server &&
|
||||
typeof config.server.keepAliveTimeout !== 'undefined' &&
|
||||
// @ts-ignore
|
||||
config.server.keepAliveTimeout !== 'null'
|
||||
) {
|
||||
// library definition for node is not up to date (doesn't contain recent 8.0 changes)
|
||||
serverFactory.keepAliveTimeout = config.server.keepAliveTimeout * 1000;
|
||||
}
|
||||
// FIXE: I could not find the reason of this code.
|
||||
unlinkAddressPath(addr);
|
||||
|
||||
return serverFactory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start the server on the port defined
|
||||
* @param config
|
||||
* @param port
|
||||
* @param version
|
||||
* @param pkgName
|
||||
*/
|
||||
export async function initServer(
|
||||
config: ConfigRuntime,
|
||||
port: string | void,
|
||||
version: string,
|
||||
pkgName: string
|
||||
): Promise<void> {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
// FIXME: get only the first match, the multiple address will be removed
|
||||
const [addr] = getListListenAddresses(port, config.listen);
|
||||
const logger = setup((config as ConfigRuntime).logs);
|
||||
displayExperimentsInfoBox(config.flags);
|
||||
const app = await server(config);
|
||||
const serverFactory = createServerFactory(config, addr, app);
|
||||
serverFactory
|
||||
.listen(addr.port || addr.path, addr.host, (): void => {
|
||||
// send a message for test
|
||||
if (isFunction(process.send)) {
|
||||
process.send({
|
||||
verdaccio_started: true,
|
||||
});
|
||||
}
|
||||
const addressServer = `${
|
||||
addr.path
|
||||
? url.format({
|
||||
protocol: 'unix',
|
||||
pathname: addr.path,
|
||||
})
|
||||
: url.format({
|
||||
protocol: addr.proto,
|
||||
hostname: addr.host,
|
||||
port: addr.port,
|
||||
pathname: '/',
|
||||
})
|
||||
}`;
|
||||
console.log(`http address ${addressServer}`);
|
||||
console.log(`${pkgName} / ${version}`);
|
||||
resolve();
|
||||
})
|
||||
.on('error', function (err): void {
|
||||
reject(err);
|
||||
process.exitCode = 1;
|
||||
});
|
||||
|
||||
function handleShutdownGracefully() {
|
||||
logger.fatal('received shutdown signal - closing server gracefully...');
|
||||
serverFactory.close(() => {
|
||||
logger.info('server closed.');
|
||||
process.exit(0);
|
||||
});
|
||||
}
|
||||
|
||||
process.on('SIGINT', handleShutdownGracefully);
|
||||
process.on('SIGTERM', handleShutdownGracefully);
|
||||
process.on('SIGHUP', handleShutdownGracefully);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Exposes a server factory to be instantiated programmatically.
|
||||
*
|
||||
const app = await runServer(); // default configuration
|
||||
const app = await runServer('./config/config.yaml');
|
||||
const app = await runServer({ configuration });
|
||||
app.listen(4000, (event) => {
|
||||
// do something
|
||||
});
|
||||
* @param config
|
||||
*/
|
||||
export async function runServer(config?: string | ConfigRuntime): Promise<any> {
|
||||
let configurationParsed: ConfigRuntime;
|
||||
if (config === undefined || typeof config === 'string') {
|
||||
const configPathLocation = findConfigFile(config);
|
||||
configurationParsed = parseConfigFile(configPathLocation);
|
||||
} else if (_.isObject(config)) {
|
||||
configurationParsed = config;
|
||||
} else {
|
||||
throw new Error(API_ERROR.CONFIG_BAD_FORMAT);
|
||||
}
|
||||
|
||||
setup(configurationParsed.logs);
|
||||
displayExperimentsInfoBox(configurationParsed.flags);
|
||||
// FIXME: get only the first match, the multiple address will be removed
|
||||
const [addr] = getListListenAddresses(undefined, configurationParsed.listen);
|
||||
const app = await server(configurationParsed);
|
||||
return createServerFactory(configurationParsed, addr, app);
|
||||
}
|
||||
@@ -1,183 +0,0 @@
|
||||
import path from 'path';
|
||||
import os from 'os';
|
||||
import fs from 'fs';
|
||||
import selfsigned from 'selfsigned';
|
||||
|
||||
import { configExample } from '@verdaccio/mock';
|
||||
import { parseConfigFile } from '@verdaccio/config';
|
||||
|
||||
import { startVerdaccio } from '../src';
|
||||
import { DEFAULT_DOMAIN, DEFAULT_PROTOCOL } from '../src/cli-utils';
|
||||
const mockProcess = require('jest-mock-process');
|
||||
|
||||
describe('startServer via API', () => {
|
||||
const parseConfigurationFile = (name) => {
|
||||
return parseConfigFile(path.join(__dirname, `./partials/config/yaml/${name}.yaml`));
|
||||
};
|
||||
|
||||
describe('startServer launcher', () => {
|
||||
test('should provide all HTTP server data', async (done) => {
|
||||
const store = path.join(__dirname, 'partials/store');
|
||||
const serverName = 'verdaccio-test';
|
||||
const version = '1.0.0';
|
||||
const port = '6000';
|
||||
|
||||
await startVerdaccio(
|
||||
configExample(),
|
||||
port,
|
||||
store,
|
||||
version,
|
||||
serverName,
|
||||
(webServer, addrs, pkgName, pkgVersion) => {
|
||||
expect(webServer).toBeDefined();
|
||||
expect(addrs).toBeDefined();
|
||||
expect(addrs.proto).toBe(DEFAULT_PROTOCOL);
|
||||
expect(addrs.host).toBe(DEFAULT_DOMAIN);
|
||||
expect(addrs.port).toBe(port);
|
||||
expect(pkgName).toBeDefined();
|
||||
expect(pkgVersion).toBeDefined();
|
||||
expect(pkgVersion).toBe(version);
|
||||
expect(pkgName).toBe(serverName);
|
||||
done();
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
test('should set keepAliveTimeout to 0 seconds', async (done) => {
|
||||
const store = path.join(__dirname, 'partials/store');
|
||||
const serverName = 'verdaccio-test';
|
||||
const version = '1.0.0';
|
||||
const port = '6100';
|
||||
|
||||
await startVerdaccio(
|
||||
configExample(parseConfigurationFile('server/keepalivetimeout-0')),
|
||||
port,
|
||||
store,
|
||||
version,
|
||||
serverName,
|
||||
(webServer, addrs, pkgName, pkgVersion) => {
|
||||
expect(webServer).toBeDefined();
|
||||
expect(webServer.keepAliveTimeout).toBeDefined();
|
||||
expect(webServer.keepAliveTimeout).toBe(0);
|
||||
expect(addrs).toBeDefined();
|
||||
expect(addrs.proto).toBe(DEFAULT_PROTOCOL);
|
||||
expect(addrs.host).toBe(DEFAULT_DOMAIN);
|
||||
expect(addrs.port).toBe(port);
|
||||
expect(pkgName).toBeDefined();
|
||||
expect(pkgVersion).toBeDefined();
|
||||
expect(pkgVersion).toBe(version);
|
||||
expect(pkgName).toBe(serverName);
|
||||
done();
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
test('should set keepAliveTimeout to 60 seconds', async (done) => {
|
||||
const store = path.join(__dirname, 'partials/store');
|
||||
const serverName = 'verdaccio-test';
|
||||
const version = '1.0.0';
|
||||
const port = '6200';
|
||||
|
||||
await startVerdaccio(
|
||||
configExample(parseConfigurationFile('server/keepalivetimeout-60')),
|
||||
port,
|
||||
store,
|
||||
version,
|
||||
serverName,
|
||||
(webServer, addrs, pkgName, pkgVersion) => {
|
||||
expect(webServer).toBeDefined();
|
||||
expect(webServer.keepAliveTimeout).toBeDefined();
|
||||
expect(webServer.keepAliveTimeout).toBe(60000);
|
||||
expect(addrs).toBeDefined();
|
||||
expect(addrs.proto).toBe(DEFAULT_PROTOCOL);
|
||||
expect(addrs.host).toBe(DEFAULT_DOMAIN);
|
||||
expect(addrs.port).toBe(port);
|
||||
expect(pkgName).toBeDefined();
|
||||
expect(pkgVersion).toBeDefined();
|
||||
expect(pkgVersion).toBe(version);
|
||||
expect(pkgName).toBe(serverName);
|
||||
done();
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
test('should set keepAliveTimeout to 5 seconds per default', async (done) => {
|
||||
const store = path.join(__dirname, 'partials/store');
|
||||
const serverName = 'verdaccio-test';
|
||||
const version = '1.0.0';
|
||||
const port = '6300';
|
||||
|
||||
await startVerdaccio(
|
||||
configExample(parseConfigurationFile('server/keepalivetimeout-undefined')),
|
||||
port,
|
||||
store,
|
||||
version,
|
||||
serverName,
|
||||
(webServer, addrs, pkgName, pkgVersion) => {
|
||||
expect(webServer).toBeDefined();
|
||||
expect(webServer.keepAliveTimeout).toBeDefined();
|
||||
expect(webServer.keepAliveTimeout).toBe(5000);
|
||||
expect(addrs).toBeDefined();
|
||||
expect(addrs.proto).toBe(DEFAULT_PROTOCOL);
|
||||
expect(addrs.host).toBe(DEFAULT_DOMAIN);
|
||||
expect(addrs.port).toBe(port);
|
||||
expect(pkgName).toBeDefined();
|
||||
expect(pkgVersion).toBeDefined();
|
||||
expect(pkgVersion).toBe(version);
|
||||
expect(pkgName).toBe(serverName);
|
||||
done();
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
test('should provide all HTTPS server fails', async (done) => {
|
||||
let mockExit = mockProcess.mockProcessExit();
|
||||
const store = path.join(__dirname, 'partials/store');
|
||||
const serverName = 'verdaccio-test';
|
||||
const version = '1.0.0';
|
||||
const address = 'https://www.domain.com:443';
|
||||
|
||||
const conf = configExample({});
|
||||
conf.https = {};
|
||||
// save process to catch exist
|
||||
await startVerdaccio(conf, address, store, version, serverName, () => {
|
||||
expect(mockExit).toHaveBeenCalledWith(2);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
test('should start a https server with key and cert', async (done) => {
|
||||
const store = path.join(__dirname, 'partials/store');
|
||||
const serverName = 'verdaccio-test';
|
||||
const version = '1.0.0';
|
||||
const address = 'https://www.domain.com:443';
|
||||
const { private: key, cert } = selfsigned.generate();
|
||||
const keyPath = path.join(os.tmpdir(), 'key.pem');
|
||||
const certPath = path.join(os.tmpdir(), 'crt.pem');
|
||||
fs.writeFileSync(keyPath, key);
|
||||
fs.writeFileSync(certPath, cert);
|
||||
|
||||
const conf = configExample();
|
||||
conf.https = {
|
||||
key: keyPath,
|
||||
cert: certPath,
|
||||
};
|
||||
|
||||
await startVerdaccio(conf, address, store, version, serverName, (webServer, addrs) => {
|
||||
expect(webServer).toBeDefined();
|
||||
expect(addrs).toBeDefined();
|
||||
expect(addrs.proto).toBe('https');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
test('should fails if config is missing', async () => {
|
||||
try {
|
||||
// @ts-ignore
|
||||
await startVerdaccio();
|
||||
} catch (e) {
|
||||
expect(e.message).toEqual('config file must be an object');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
20
packages/node-api/test/run-server.spec.ts
Normal file
20
packages/node-api/test/run-server.spec.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import request from 'supertest';
|
||||
import { runServer } from '../src';
|
||||
describe('startServer via API', () => {
|
||||
test('should provide all HTTP server data', async () => {
|
||||
const webServer = await runServer();
|
||||
expect(webServer).toBeDefined();
|
||||
await request(webServer).get('/').expect(200);
|
||||
});
|
||||
|
||||
test('should fail on start with empty configuration', async () => {
|
||||
// @ts-expect-error
|
||||
await expect(runServer({})).rejects.toThrow(
|
||||
'AssertionError [ERR_ASSERTION]: CONFIG: storage path not defined'
|
||||
);
|
||||
});
|
||||
|
||||
test('should fail on start with null as entry', async () => {
|
||||
await expect(runServer(null)).rejects.toThrow('config file must be an object');
|
||||
});
|
||||
});
|
||||
@@ -7,23 +7,23 @@
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["src/**/*.test.ts"],
|
||||
"references": [
|
||||
{
|
||||
"path": "../config"
|
||||
},
|
||||
{
|
||||
"path": "../core/cli-ui"
|
||||
},
|
||||
{
|
||||
"path": "../core/commons-api"
|
||||
},
|
||||
{
|
||||
"path": "../logger"
|
||||
},
|
||||
{
|
||||
"path": "../server"
|
||||
},
|
||||
{
|
||||
"path": "../mock"
|
||||
},
|
||||
{
|
||||
"path": "../utils"
|
||||
},
|
||||
{
|
||||
"path": "../core/cli-ui"
|
||||
"path": "../server"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/activedirectory2": "^1.2.1",
|
||||
"@verdaccio/types": "workspace:11.0.0-alpha.3"
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.4"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf ./build",
|
||||
|
||||
@@ -9,12 +9,6 @@
|
||||
"references": [
|
||||
{
|
||||
"path": "../../core/commons-api"
|
||||
},
|
||||
{
|
||||
"path": "../../core/streams"
|
||||
},
|
||||
{
|
||||
"path": "../../core/types"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
"node-fetch": "^2.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@verdaccio/types": "workspace:11.0.0-alpha.3",
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.4",
|
||||
"body-parser": "^1.19.0",
|
||||
"nock": "^12.0.3",
|
||||
"supertest": "^4.0.2"
|
||||
|
||||
@@ -5,16 +5,5 @@
|
||||
"outDir": "./build"
|
||||
},
|
||||
"include": ["src/**/*", "types/*.d.ts"],
|
||||
"exclude": ["src/**/*.test.ts"],
|
||||
"references": [
|
||||
{
|
||||
"path": "../../core/commons-api"
|
||||
},
|
||||
{
|
||||
"path": "../../core/streams"
|
||||
},
|
||||
{
|
||||
"path": "../../core/types"
|
||||
}
|
||||
]
|
||||
"exclude": ["src/**/*.test.ts"]
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
"@verdaccio/commons-api": "workspace:11.0.0-alpha.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@verdaccio/types": "workspace:11.0.0-alpha.3"
|
||||
"@verdaccio/types": "workspace:11.0.0-6-next.4"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf ./build",
|
||||
|
||||
@@ -9,9 +9,6 @@
|
||||
"references": [
|
||||
{
|
||||
"path": "../../core/commons-api"
|
||||
},
|
||||
{
|
||||
"path": "../../core/types"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user