0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-16 21:56:25 -05:00

docs: copy docker examples v4 (#2120)

* docs: copy docker examples v4

* docs: copy docker examples v4

* chore: update ignore files
This commit is contained in:
Juan Picado 2021-03-10 22:49:20 +01:00 committed by GitHub
parent 4cf7e3d940
commit 9cf5cee4fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
109 changed files with 95193 additions and 3 deletions

View file

@ -16,4 +16,5 @@ Dockerfile
*.jpg
*.sh
test/unit/partials/
types/custom.d.ts
types/custom.d.ts
docker-examples/

1
.gitignore vendored
View file

@ -21,7 +21,6 @@ package-lock.json
npm_test-fails-add-tarball*
yarn-error.log
# Istanbul
reports/
coverage/

51
docker-examples/README.md Normal file
View file

@ -0,0 +1,51 @@
# 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 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)
### Kubernetes
- Kubernetes (minikube) + Verdaccio (Basic Configuration)
- Kubernetes Helm and Verdaccio Chart (Basic Tutorial)
### External
- [
Verdaccio examples for Google Cloud and K8s setups. https://github.com/papezt/verdaccio-examples](https://github.com/papezt/verdaccio-examples)
### Articles
- [https://medium.com/@tompape/kubernetes-private-npm-registry-fb5f450fa611](https://medium.com/@tompape/kubernetes-private-npm-registry-fb5f450fa611)
- [Déployer Verdaccio sur rancher avec un helm](https://tommygingras.com/deployer-verdaccio-sur-rancher-avec-un-helm/)

View file

@ -0,0 +1,13 @@
# Amazon S3 Bucket (Localstack) and Verdaccio 4.x
Verdaccio running with [Localstack](https://github.com/localstack/localstack) provides an easy-to-use test/mocking framework for developing cloud applications (AWS S3 in our example).
## Usage
```
docker-compose up --force-recreate --build --always-recreate-deps
```
## Articles
- [How to fake AWS locally with LocalStack](https://dev.to/goodidea/how-to-fake-aws-locally-with-localstack-27me)

View file

@ -0,0 +1,29 @@
storage: /verdaccio/storage
store:
aws-s3-storage:
bucket: localstack.s3.plugin.test
keyPrefix: docker-test-prefix
region: eu-west-2
endpoint: http://localstack-s3:4572
uplinks:
npmjs:
url: https://registry.npmjs.org/
packages:
'@*/*':
# scoped packages
access: $all
publish: $all
proxy: npmjs
'**':
access: $all
publish: $all
proxy: npmjs
logs:
- { type: stdout, format: pretty, level: trace }
listen:
- 0.0.0.0:4873

View file

@ -0,0 +1,58 @@
version: '2.1'
services:
aws-resources:
build: localStack-resources/
environment:
- AWS_ACCESS_KEY_ID=foobar
- AWS_SECRET_ACCESS_KEY=foobar
- AWS_DEFAULT_REGION=eu-west-2
- AWS_S3_ENDPOINT=http://localstack-s3:4572
depends_on:
localstack-s3:
condition: service_healthy
links:
- localstack-s3
localstack-s3:
image: localstack/localstack:latest
container_name: localstack-s3-1
environment:
- DEBUG=0
- SERVICES=s3
- DEFAULT_REGION=eu-west-2
- DATA_DIR=/tmp/localstack/data
ports:
- '4572:4572'
- '9999:8080'
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:4572']
interval: 15s
timeout: 10s
retries: 4
volumes:
- localstack-data:/tmp/localstack
verdaccio:
container_name: verdaccio-s3-plugin
build: s3Plugin/
environment:
- AWS_ACCESS_KEY_ID=foobar
- AWS_SECRET_ACCESS_KEY=foobar
- AWS_DEFAULT_REGION=eu-west-2
- AWS_S3_ENDPOINT=http://localstack-s3:4572
- AWS_S3_PATH_STYLE=true
ports:
- '4874:4873'
volumes:
- './conf:/verdaccio/conf'
depends_on:
localstack-s3:
condition: service_healthy
links:
- localstack-s3
volumes:
verdaccio:
driver: local
aws-resources:
driver: local
localstack-data:
name: localstack-data

View file

@ -0,0 +1,10 @@
FROM python:2.7
ENV AWS_ACCESS_KEY_ID='[something]'
ENV AWS_SECRET_ACCESS_KEY='[something]'
ENV AWS_S3_ENDPOINT='http://localstack-s3:4572'
RUN pip install awscli
COPY entry.sh /entry.sh
RUN chmod +x /entry.sh
ENTRYPOINT ["/entry.sh"]

View file

@ -0,0 +1,3 @@
#!/bin/bash
aws --endpoint-url http://localstack-s3:4572 s3 mb s3://localstack.s3.plugin.test --region eu-west-2

View file

@ -0,0 +1,15 @@
FROM verdaccio/verdaccio:4
USER root
ENV NODE_ENV=production
## perhaps all of this is not fully required
RUN apk --no-cache add openssl ca-certificates wget && \
apk --no-cache add g++ gcc libgcc libstdc++ linux-headers make python && \
wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \
wget -q https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.25-r0/glibc-2.25-r0.apk && \
apk add glibc-2.25-r0.apk
RUN npm i && npm install verdaccio-aws-s3-storage
USER verdaccio

View file

@ -0,0 +1,93 @@
# Verdaccio and Apache2
Running `verdaccio` via reverse proxy is a common practice. This configuration provides a quick way to run the application through **apache2** as reverse proxy.
To run the containers, run the following command in this folder, it should start the containers in detach mode.
```bash
docker-compose up -d
```
To recreate the nginx image you can force the build.
```bash
docker-compose up --build -d
Building apacheproxy
Step 1/5 : FROM eboraas/apache
---> 1ba66e3f5580
Step 2/5 : MAINTAINER Juan Picado <juanpicado19@gmail.com>
---> Using cache
---> 4317b29c20ec
Step 3/5 : RUN a2enmod proxy
---> Using cache
---> b9334b33e2f1
Step 4/5 : COPY ./conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
---> Using cache
---> 6d464388db8f
Step 5/5 : COPY ./conf/env.load /etc/apache2/mods-enabled/env.load
---> Using cache
---> 66740b6ffb97
Successfully built 66740b6ffb97
Recreating verdaccio
Recreating apacheverdaccio_apacheproxy_1
```
To force recreate the images.
```bash
docker-compose up --build --force-recreate -d
```
To stop all containers
```bash
docker-compose stop
```
To display container logs
```bash
$> docker-compose logs
Attaching to apacheverdaccio_apacheproxy_1, verdaccio
verdaccio | warn --- config file - /verdaccio/conf/config.yaml
verdaccio | warn --- http address - http://0.0.0.0:4873/ - verdaccio/2.1.7
verdaccio | http <-- 304, user: undefined, req: 'GET /', bytes: 0/0
verdaccio | http <-- 304, user: undefined, req: 'GET /-/static/jquery.min.js', bytes: 0/0
verdaccio | http <-- 304, user: undefined, req: 'GET /-/static/main.css', bytes: 0/0
verdaccio | http <-- 304, user: undefined, req: 'GET /-/static/main.js', bytes: 0/0
verdaccio | http <-- 304, user: undefined, req: 'GET /-/logo', bytes: 0/0
verdaccio | http <-- 304, user: undefined, req: 'GET /-/static/fontello.woff?10872183', bytes: 0/0
verdaccio | http <-- 200, user: undefined, req: 'GET /-/static/favicon.png', bytes: 0/315
```
To access the apache logs
```bash
&> docker exec -it {ID} /bin/bash
root@da8ee3cb484c:~# tail -f /var/log/apache2/verdaccio-access.log
172.20.0.1 - - [31/May/2017:21:16:37 +0000] "GET /xmlhttprequest-ssl HTTP/1.1" 200 2616 "install sails" "npm/5.0.0 node/v4.6.1 darwin x64"
172.20.0.1 - - [31/May/2017:21:16:37 +0000] "GET /yeast HTTP/1.1" 200 2706 "install sails" "npm/5.0.0 node/v4.6.1 darwin x64"
172.20.0.1 - - [31/May/2017:21:16:37 +0000] "GET /has-cors HTTP/1.1" 200 1347 "install sails" "npm/5.0.0 node/v4.6.1 darwin x64"
172.20.0.1 - - [31/May/2017:21:16:37 +0000] "GET /parsejson HTTP/1.1" 200 1234 "install sails" "npm/5.0.0 node/v4.6.1 darwin x64"
172.20.0.1 - - [31/May/2017:21:16:37 +0000] "GET /better-assert HTTP/1.1" 200 2462 "install sails" "npm/5.0.0 node/v4.6.1 darwin x64"
172.20.0.1 - - [31/May/2017:21:16:37 +0000] "GET /callsite HTTP/1.1" 200 1369 "install sails" "npm/5.0.0 node/v4.6.1 darwin x64"
172.20.0.1 - - [31/May/2017:21:16:37 +0000] "GET /dot-access HTTP/1.1" 200 1477 "install sails" "npm/5.0.0 node/v4.6.1 darwin x64"
172.20.0.1 - - [31/May/2017:21:16:37 +0000] "GET /skipper-disk HTTP/1.1" 200 3801 "install sails" "npm/5.0.0 node/v4.6.1 darwin x64"
172.20.0.1 - - [31/May/2017:21:16:37 +0000] "GET /native-or-bluebird HTTP/1.1" 200 2257 "install sails" "npm/5.0.0 node/v4.6.1 darwin x64"
172.20.0.1 - - [31/May/2017:21:16:37 +0000] "GET /foreachasync HTTP/1.1" 200 2742 "install sails" "npm/5.0.0 node/v4.6.1 darwin x64"
tail: unrecognized file system type 0x794c7630 for '/var/log/apache2/verdaccio-access.log'. please report this to bug-coreutils@gnu.org. reverting to polling
```
### Display Information
To display the containers running
```bash
&> docker-compose ps
Name Command State Ports
----------------------------------------------------------------------------------------------------
apacheverdaccio_apacheproxy_1 /usr/sbin/apache2ctl -D FO ... Up 443/tcp, 0.0.0.0:80->80/tcp
verdaccio /usr/src/app/bin/verdaccio ... Up 0.0.0.0:4873->4873/tcp
```

View file

@ -0,0 +1,6 @@
FROM eboraas/apache
MAINTAINER Juan Picado <juanpicado19@gmail.com>
# http://pierrecaserta.com/apache-proxy-one-docker-server-many-domains/
RUN a2enmod proxy
COPY ./conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
COPY ./conf/env.load /etc/apache2/mods-enabled/env.load

View file

@ -0,0 +1,17 @@
ServerName localhost:80
ServerAdmin admin@localhost
<VirtualHost *:80>
ServerName localhost
<Proxy *>
Allow from localhost
</Proxy>
SSLProxyEngine On
ProxyRequests Off
ProxyPreserveHost On
AllowEncodedSlashes NoDecode
ProxyPass / http://verdaccio:4873/ nocanon
ProxyPassReverse / http://verdaccio:4873/
CustomLog /var/log/apache2/verdaccio-access.log combined
ErrorLog /var/log/apache2/verdaccio-error.log
</VirtualHost>

View file

@ -0,0 +1,4 @@
LoadModule env_module /usr/lib/apache2/modules/mod_env.so
LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so
LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so
LoadModule socache_shmcb_module /usr/lib/apache2/modules/mod_socache_shmcb.so

View file

@ -0,0 +1,23 @@
version: '2'
services:
verdaccio:
image: verdaccio/verdaccio:latest
container_name: verdaccio
ports:
- '4873:4873'
volumes:
- verdaccio:/verdaccio
apacheproxy:
build: apache_proxy/
links:
- verdaccio
ports:
- '80:80'
volumes_from:
- verdaccio
volumes:
verdaccio:
driver: local

View file

@ -0,0 +1,71 @@
#
# This is the config file used for the docker images.
# It allows all users to do anything, so don't use it on production systems.
#
# Do not configure host and port under `listen` in this file
# as it will be ignored when using docker.
# see https://github.com/verdaccio/verdaccio/blob/master/wiki/docker.md#docker-and-custom-port-configuration
#
# Look here for more config file examples:
# https://github.com/verdaccio/verdaccio/tree/master/conf
#
# path to a directory with all packages
storage: /verdaccio/storage
auth:
htpasswd:
file: /verdaccio/conf/htpasswd
# Maximum amount of users allowed to register, defaults to "+inf".
# You can set this to -1 to disable registration.
#max_users: 1000
security:
api:
jwt:
sign:
expiresIn: 60d
notBefore: 1
web:
sign:
expiresIn: 7d
# a list of other known repositories we can talk to
uplinks:
npmjs:
url: https://registry.npmjs.org/
packages:
'@jota/*':
access: $all
publish: $all
'@*/*':
# scoped packages
access: $all
publish: $all
proxy: npmjs
'**':
# allow all users (including non-authenticated users) to read and
# publish all packages
#
# you can specify usernames/groupnames (depending on your auth plugin)
# and three keywords: "$all", "$anonymous", "$authenticated"
access: $all
# allow all known users to publish packages
# (anyone can register by default, remember?)
publish: $all
# if package is not available locally, proxy requests to 'npmjs' registry
proxy: npmjs
# To use `npm audit` uncomment the following section
middlewares:
audit:
enabled: true
# log settings
logs:
- { type: stdout, format: pretty, level: trace }
#- {type: file, path: verdaccio.log, level: info}

View file

@ -0,0 +1 @@
jpicado:$6vkdNgRX2npc:autocreated 2017-07-11T18:48:38.003Z

View file

@ -0,0 +1,13 @@
version: '2.1'
services:
verdaccio:
image: verdaccio/verdaccio:4
container_name: verdaccio-docker-local-storage-vol
ports:
- '4873:4873'
volumes:
- './storage:/verdaccio/storage'
- './conf:/verdaccio/conf'
volumes:
verdaccio:
driver: local

View file

@ -0,0 +1,31 @@
# Verdaccio and simple local storage
This example shows a simple configuration for `verdaccio` plus the default local storage with the minimum configuration required using `docker-compose`.
Contains
- conf: Configuration file and default user httpasswd
- storage: A published default package with 2 versions.
```bash
$> docker-compose up
```
## Login
If you want to login into the Verdaccio instance created via these Docker Examples, please try:
Username: jpicado
Password: jpicado
## Running in Dokku
If you use Dokku, an open-source alternative for Heroku, you can run this example using the following steps:
1. Create a new application `dokku apps:create verdaccio`
2. Pull the verdaccio image `docker pull verdaccio/verdaccio:`
3. Tag the docker image for the app: `docker tag verdaccio/verdaccio:4 dokku/verdaccio:v1`
4. Create the directories for persistent storage `mkdir -p /var/lib/dokku/data/storage/verdaccio/storage`, `mkdir -p /var/lib/dokku/data/storage/verdaccio/storage`
5. Mount the volumes: `dokku storage:mount verdaccio /var/lib/dokku/data/storage/verdaccio/storage:/verdaccio/storage` and `dokku storage:mount verdaccio /var/lib/dokku/data/storage/verdaccio/conf:/verdaccio/conf`
6. Deploy the docker image `dokku tags:deploy verdaccio v1`
7. Enjoy the application

View file

@ -0,0 +1,61 @@
{
"name": "@jota/pk1-juan-1",
"versions": {
"1.0.0": {
"name": "@jota/pk1-juan-1",
"version": "1.0.0",
"description": "Simple React Webpack Babel Starter Kit",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": {
"name": "Juan Picado",
"email": "juan@jotadeveloper.com"
},
"license": "ISC",
"dependencies": {
"angular": "^1.6.8",
"angular2": "^2.0.0-beta.21",
"babel-core": "^6.26.0",
"babel-env": "^2.4.1",
"jquery": "^3.2.1",
"react": "^16.2.0",
"test_npm_18": "^1.0.1",
"typescript": "^2.6.2",
"verdaccio": "^2.7.2",
"verdaccio-memory": "0.0.3",
"webpack": "^3.10.0"
},
"readmeFilename": "README.md",
"_id": "@jota/pk1-juan-1@1.0.0",
"_npmVersion": "5.5.1",
"_nodeVersion": "8.7.0",
"_npmUser": {},
"dist": {
"integrity": "sha512-aKXCuBayXFdSVt4+94B7lqvsPsM0KIsIcXvc7Ghkir3OsE6FQl2bXBBWe6deNuTwJihsFvDbCDiMq+0TIUENBQ==",
"shasum": "faf627d746ce7c670aed088b761960716e68e186",
"tarball": "http://0.0.0.0:4873/@jota/pk1-juan-1/-/@jota/pk1-juan-1-1.0.0.tgz"
}
}
},
"dist-tags": {
"latest": "1.0.0"
},
"time": {
"modified": "2018-01-17T18:32:18.049Z",
"created": "2018-01-17T18:32:18.049Z",
"1.0.0": "2018-01-17T18:32:18.049Z"
},
"_distfiles": {},
"_attachments": {
"pk1-juan-1-1.0.0.tgz": {
"shasum": "faf627d746ce7c670aed088b761960716e68e186",
"version": "1.0.0"
}
},
"_uplinks": {},
"_rev": "3-5cf06458deec6f04",
"readme": "# react-webpack-babel\nSimple React Webpack Babel Starter Kit\n\nTired of complicated starters with 200MB of dependencies which are hard to understand and modify?\n\nTry this is a simple [React](https://facebook.github.io/react/), [Webpack](http://webpack.github.io/) and [Babel](https://babeljs.io/) application with nothing else in it.\n\n### What's in it?\n\n* Simple src/index.jsx and src/index.css (local module css).\n* Webpack configuration for development (with hot reloading) and production (with minification).\n* CSS module loading, so you can include your css by ```import styles from './path/to.css';```.\n* Both js(x) and css hot loaded during development.\n* [Webpack Dashboard Plugin](https://github.com/FormidableLabs/webpack-dashboard) on dev server.\n\n### To run\n\n* You'll need to have [git](https://git-scm.com/) and [node](https://nodejs.org/en/) installed in your system.\n* Fork and clone the project:\n\n```\ngit clone https://github.com/alicoding/react-webpack-babel.git\n```\n\n* Then install the dependencies:\n\n```\nnpm install\n```\n\n* Run development server:\n\n```\nnpm start\n```\n\n* Or you can run development server with [webpack-dashboard](https://github.com/FormidableLabs/webpack-dashboard):\n\n```\nnpm run dev\n```\n\nOpen the web browser to `http://localhost:8888/`\n\n### To build the production package\n\n```\nnpm run build\n```\n\n### Nginx Config\n\nHere is an example Nginx config:\n```\nserver {\n\t# ... root and other options\n\n\tgzip on;\n\tgzip_http_version 1.1;\n\tgzip_types text/plain text/css text/xml application/javascript image/svg+xml;\n\n\tlocation / {\n\t\ttry_files $uri $uri/ /index.html;\n\t}\n\n\tlocation ~ \\.html?$ {\n\t\texpires 1d;\n\t}\n\n\tlocation ~ \\.(svg|ttf|js|css|svgz|eot|otf|woff|jpg|jpeg|gif|png|ico)$ {\n\t\taccess_log off;\n\t\tlog_not_found off;\n\t\texpires max;\n\t}\n}\n```\n\n### Eslint\nThere is a .eslint.yaml config for eslint ready with React plugin.\nTo use it, you need to install additional dependencies though:\n\n```\nnpm install --save-dev eslint eslint-plugin-react\n```\n\nTo do the actual linting, run:\n\n```\nnpm run lint\n```\n\n### Notes on importing css styles\n* styles having /src/ in their absolute path are considered part of the application and exported as local css modules.\n* other styles are considered global styles used by many components and are included in the css bundle directly.\n\n### Contribute\nPlease contribute to the project if you know how to make it better, including this README :)"
}

View file

@ -0,0 +1,105 @@
{
"name": "@jota/pk1-juan",
"versions": {
"1.0.0": {
"name": "@jota/pk1-juan",
"version": "1.0.0",
"description": "Simple React Webpack Babel Starter Kit",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": {
"name": "Juan Picado",
"email": "juan@jotadeveloper.com"
},
"license": "ISC",
"dependencies": {
"angular": "^1.6.8",
"angular2": "^2.0.0-beta.21",
"babel-core": "^6.26.0",
"babel-env": "^2.4.1",
"jquery": "^3.2.1",
"react": "^16.2.0",
"test_npm_18": "^1.0.1",
"typescript": "^2.6.2",
"verdaccio": "^2.7.2",
"verdaccio-memory": "0.0.3",
"webpack": "^3.10.0"
},
"readmeFilename": "README.md",
"_id": "@jota/pk1-juan@1.0.0",
"_npmVersion": "5.5.1",
"_nodeVersion": "8.7.0",
"_npmUser": {},
"dist": {
"integrity": "sha512-JC4y+iHrUpD+li3Pf9z2oFxw2Mtbqi6vgnIDBB3H/P/t0gAuCKK/LJ86kV7TRyvQwVvyJk1qI61iOVLiMwjZ8Q==",
"shasum": "95a21c648054c7144a23995a519930255f35b6c2",
"tarball": "http://0.0.0.0:4873/@jota/pk1-juan/-/@jota/pk1-juan-1.0.0.tgz"
}
},
"1.0.1": {
"name": "@jota/pk1-juan",
"version": "1.0.1",
"description": "Simple React Webpack Babel Starter Kit",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": {
"name": "Juan Picado",
"email": "juan@jotadeveloper.com"
},
"license": "ISC",
"dependencies": {
"angular": "^1.6.8",
"angular2": "^2.0.0-beta.21",
"babel-core": "^6.26.0",
"babel-env": "^2.4.1",
"jquery": "^3.2.1",
"react": "^16.2.0",
"test_npm_18": "^1.0.1",
"typescript": "^2.6.2",
"verdaccio": "^2.7.2",
"verdaccio-memory": "0.0.3",
"webpack": "^3.10.0"
},
"readmeFilename": "README.md",
"_id": "@jota/pk1-juan@1.0.1",
"_npmVersion": "5.5.1",
"_nodeVersion": "8.7.0",
"_npmUser": {},
"dist": {
"integrity": "sha512-copZNn2mMX8S3W9czxd3GXKj8vKu1v7JrUD9zOtriP8v9AvZOHIt6nW8+1114cumNGukFxjBO+2VlZC793ynTA==",
"shasum": "ed59869c54d1bec7bc19732c4c23c97633ea30e2",
"tarball": "http://0.0.0.0:4873/@jota/pk1-juan/-/@jota/pk1-juan-1.0.1.tgz"
}
}
},
"dist-tags": {
"latest": "1.0.0",
"beta2": "1.0.1"
},
"time": {
"modified": "2018-01-17T18:49:09.087Z",
"created": "2018-01-17T18:27:39.952Z",
"1.0.0": "2018-01-17T18:27:39.952Z",
"1.0.1": "2018-01-17T18:49:09.087Z"
},
"_distfiles": {},
"_attachments": {
"pk1-juan-1.0.0.tgz": {
"shasum": "95a21c648054c7144a23995a519930255f35b6c2",
"version": "1.0.0"
},
"pk1-juan-1.0.1.tgz": {
"shasum": "ed59869c54d1bec7bc19732c4c23c97633ea30e2",
"version": "1.0.1"
}
},
"_uplinks": {},
"_rev": "18-5118c5019a188840",
"readme": "# react-webpack-babel\nSimple React Webpack Babel Starter Kit\n\nTired of complicated starters with 200MB of dependencies which are hard to understand and modify?\n\nTry this is a simple [React](https://facebook.github.io/react/), [Webpack](http://webpack.github.io/) and [Babel](https://babeljs.io/) application with nothing else in it.\n\n### What's in it?\n\n* Simple src/index.jsx and src/index.css (local module css).\n* Webpack configuration for development (with hot reloading) and production (with minification).\n* CSS module loading, so you can include your css by ```import styles from './path/to.css';```.\n* Both js(x) and css hot loaded during development.\n* [Webpack Dashboard Plugin](https://github.com/FormidableLabs/webpack-dashboard) on dev server.\n\n### To run\n\n* You'll need to have [git](https://git-scm.com/) and [node](https://nodejs.org/en/) installed in your system.\n* Fork and clone the project:\n\n```\ngit clone https://github.com/alicoding/react-webpack-babel.git\n```\n\n* Then install the dependencies:\n\n```\nnpm install\n```\n\n* Run development server:\n\n```\nnpm start\n```\n\n* Or you can run development server with [webpack-dashboard](https://github.com/FormidableLabs/webpack-dashboard):\n\n```\nnpm run dev\n```\n\nOpen the web browser to `http://localhost:8888/`\n\n### To build the production package\n\n```\nnpm run build\n```\n\n### Nginx Config\n\nHere is an example Nginx config:\n```\nserver {\n\t# ... root and other options\n\n\tgzip on;\n\tgzip_http_version 1.1;\n\tgzip_types text/plain text/css text/xml application/javascript image/svg+xml;\n\n\tlocation / {\n\t\ttry_files $uri $uri/ /index.html;\n\t}\n\n\tlocation ~ \\.html?$ {\n\t\texpires 1d;\n\t}\n\n\tlocation ~ \\.(svg|ttf|js|css|svgz|eot|otf|woff|jpg|jpeg|gif|png|ico)$ {\n\t\taccess_log off;\n\t\tlog_not_found off;\n\t\texpires max;\n\t}\n}\n```\n\n### Eslint\nThere is a .eslint.yaml config for eslint ready with React plugin.\nTo use it, you need to install additional dependencies though:\n\n```\nnpm install --save-dev eslint eslint-plugin-react\n```\n\nTo do the actual linting, run:\n\n```\nnpm run lint\n```\n\n### Notes on importing css styles\n* styles having /src/ in their absolute path are considered part of the application and exported as local css modules.\n* other styles are considered global styles used by many components and are included in the css bundle directly.\n\n### Contribute\nPlease contribute to the project if you know how to make it better, including this README :)"
}

View file

@ -0,0 +1,70 @@
{
"name": "npm_test_pkg1",
"versions": {
"1.0.0": {
"name": "npm_test_pkg1",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"_id": "npm_test_pkg1@1.0.0",
"_npmVersion": "5.1.0",
"_nodeVersion": "4.6.1",
"_npmUser": {},
"dist": {
"integrity": "sha512-qq8u/xKpYFCfmANLg5ohY4ZBkzM7NsKjIpYH+eSXji69aceMQvltRXx0O1qo7yAIORiCFsMTGLlkDCQtbhByxg==",
"shasum": "d058de16fdf8bde775ef2898e682faacc3eaa67f",
"tarball": "http://localhost:4873/npm_test_pkg1/-/npm_test_pkg1-1.0.0.tgz"
}
},
"1.0.1": {
"name": "npm_test_pkg1",
"version": "1.0.1",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"_id": "npm_test_pkg1@1.0.1",
"_npmVersion": "5.1.0",
"_nodeVersion": "4.6.1",
"_npmUser": {},
"dist": {
"integrity": "sha512-0YLdKRIAbZJoLpOFqXZE/JldTnGRKjIX999xV4PMJ+sUO6pWiLO8NbG4wuT5738Re3D5WTRa743y9uPvgrTD0A==",
"shasum": "1f6251ce59e375a6328958202ec07eb7de38dae6",
"tarball": "http://localhost:4873/npm_test_pkg1/-/npm_test_pkg1-1.0.1.tgz"
}
}
},
"dist-tags": {
"latest": "1.0.1"
},
"time": {
"modified": "2017-07-11T18:52:35.061Z",
"created": "2017-07-11T18:49:27.417Z",
"1.0.0": "2017-07-11T18:49:27.417Z",
"1.0.1": "2017-07-11T18:52:35.061Z"
},
"_distfiles": {},
"_attachments": {
"npm_test_pkg1-1.0.0.tgz": {
"shasum": "d058de16fdf8bde775ef2898e682faacc3eaa67f",
"version": "1.0.0"
},
"npm_test_pkg1-1.0.1.tgz": {
"shasum": "1f6251ce59e375a6328958202ec07eb7de38dae6",
"version": "1.0.1"
}
},
"_uplinks": {},
"_rev": "11-382567c9979db3fd",
"readme": "ERROR: No README data found!"
}

View file

@ -0,0 +1,61 @@
{
"name": "pk1-juan",
"versions": {
"1.0.0": {
"name": "pk1-juan",
"version": "1.0.0",
"description": "Simple React Webpack Babel Starter Kit",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": {
"name": "Juan Picado",
"email": "juan@jotadeveloper.com"
},
"license": "ISC",
"dependencies": {
"angular": "^1.6.8",
"angular2": "^2.0.0-beta.21",
"babel-core": "^6.26.0",
"babel-env": "^2.4.1",
"jquery": "^3.2.1",
"react": "^16.2.0",
"test_npm_18": "^1.0.1",
"typescript": "^2.6.2",
"verdaccio": "^2.7.2",
"verdaccio-memory": "0.0.3",
"webpack": "^3.10.0"
},
"readmeFilename": "README.md",
"_id": "pk1-juan@1.0.0",
"_npmVersion": "5.5.1",
"_nodeVersion": "8.7.0",
"_npmUser": {},
"dist": {
"integrity": "sha512-K3ifqa0DEndma1RPhM83TBVISIY3wq2JdTL0GafvJno6z6JvFBp4iQgyrKn7Yjkd0J/LZ9IJvhNWsGQZuoXMPQ==",
"shasum": "5d670df046b9bc4bc1714efe8873a614c522e41d",
"tarball": "http://0.0.0.0:4873/pk1-juan/-/pk1-juan-1.0.0.tgz"
}
}
},
"dist-tags": {
"latest": "1.0.0"
},
"time": {
"modified": "2018-01-17T18:27:09.087Z",
"created": "2018-01-17T18:27:09.087Z",
"1.0.0": "2018-01-17T18:27:09.087Z"
},
"_distfiles": {},
"_attachments": {
"pk1-juan-1.0.0.tgz": {
"shasum": "5d670df046b9bc4bc1714efe8873a614c522e41d",
"version": "1.0.0"
}
},
"_uplinks": {},
"_rev": "5-e7a0e845b8b0cdc8",
"readme": "# react-webpack-babel\nSimple React Webpack Babel Starter Kit\n\nTired of complicated starters with 200MB of dependencies which are hard to understand and modify?\n\nTry this is a simple [React](https://facebook.github.io/react/), [Webpack](http://webpack.github.io/) and [Babel](https://babeljs.io/) application with nothing else in it.\n\n### What's in it?\n\n* Simple src/index.jsx and src/index.css (local module css).\n* Webpack configuration for development (with hot reloading) and production (with minification).\n* CSS module loading, so you can include your css by ```import styles from './path/to.css';```.\n* Both js(x) and css hot loaded during development.\n* [Webpack Dashboard Plugin](https://github.com/FormidableLabs/webpack-dashboard) on dev server.\n\n### To run\n\n* You'll need to have [git](https://git-scm.com/) and [node](https://nodejs.org/en/) installed in your system.\n* Fork and clone the project:\n\n```\ngit clone https://github.com/alicoding/react-webpack-babel.git\n```\n\n* Then install the dependencies:\n\n```\nnpm install\n```\n\n* Run development server:\n\n```\nnpm start\n```\n\n* Or you can run development server with [webpack-dashboard](https://github.com/FormidableLabs/webpack-dashboard):\n\n```\nnpm run dev\n```\n\nOpen the web browser to `http://localhost:8888/`\n\n### To build the production package\n\n```\nnpm run build\n```\n\n### Nginx Config\n\nHere is an example Nginx config:\n```\nserver {\n\t# ... root and other options\n\n\tgzip on;\n\tgzip_http_version 1.1;\n\tgzip_types text/plain text/css text/xml application/javascript image/svg+xml;\n\n\tlocation / {\n\t\ttry_files $uri $uri/ /index.html;\n\t}\n\n\tlocation ~ \\.html?$ {\n\t\texpires 1d;\n\t}\n\n\tlocation ~ \\.(svg|ttf|js|css|svgz|eot|otf|woff|jpg|jpeg|gif|png|ico)$ {\n\t\taccess_log off;\n\t\tlog_not_found off;\n\t\texpires max;\n\t}\n}\n```\n\n### Eslint\nThere is a .eslint.yaml config for eslint ready with React plugin.\nTo use it, you need to install additional dependencies though:\n\n```\nnpm install --save-dev eslint eslint-plugin-react\n```\n\nTo do the actual linting, run:\n\n```\nnpm run lint\n```\n\n### Notes on importing css styles\n* styles having /src/ in their absolute path are considered part of the application and exported as local css modules.\n* other styles are considered global styles used by many components and are included in the css bundle directly.\n\n### Contribute\nPlease contribute to the project if you know how to make it better, including this README :)"
}

View file

@ -0,0 +1,43 @@
# Verdaccio loading external plugins
This example aims to show how to set up external plugins without the need to create a custom Docker Image.
This example uses the folder `plugins/` as entry point to locate external plugins.
```
plugins: /verdaccio/plugins
```
at the same time we define the plugin we want to load `verdaccio-memory`.
```
store:
memory:
limit: 1000
```
### Prerequisites
- verdaccio `>3.3.0`
### Example
To run the containers, run the following command in this folder, it should start the containers in detach mode.
```bash
$> docker-compose up -d
Recreating verdaccio-3-docker-plugin-external ... done
Attaching to verdaccio-3-docker-plugin-external
verdaccio-3-docker-plugin-external | warn --- config file - /verdaccio/conf/config.yaml
verdaccio-3-docker-plugin-external | warn --- Plugin successfully loaded: memory
verdaccio-3-docker-plugin-external | warn --- Plugin successfully loaded: htpasswd
verdaccio-3-docker-plugin-external | warn --- Plugin successfully loaded: audit
verdaccio-3-docker-plugin-external | warn --- http address - http://0.0.0.0:4873/ - verdaccio/3.2.0
```
To stop all containers
```bash
docker-compose stop
```

View file

@ -0,0 +1,31 @@
plugins: /verdaccio/plugins
auth:
htpasswd:
file: /verdaccio/conf/htpasswd
uplinks:
npmjs:
url: https://registry.npmjs.org/
store:
memory:
limit: 1000
middlewares:
audit:
enabled: true
packages:
'@*/*':
access: $all
publish: $all
proxy: npmjs
'**':
access: $all
publish: $all
proxy: npmjs
logs:
- { type: stdout, format: pretty, level: trace }

View file

@ -0,0 +1,12 @@
version: '2'
services:
verdaccio:
image: verdaccio/verdaccio:latest
container_name: verdaccio-3-docker-plugin-external
ports:
- '4873:4873'
volumes:
- './storage:/verdaccio/storage'
- './conf:/verdaccio/conf'
- './plugins:/verdaccio/plugins'

View file

@ -0,0 +1,8 @@
{
"rules": {
"max-len": 0,
"@typescript-eslint/prefer-optional-chain": 0,
"@typescript-eslint/no-unused-vars": 0,
"@typescript-eslint/explicit-member-accessibility": 0
}
}

View file

@ -0,0 +1,17 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true,
});
exports.LocalMemory = undefined;
let _localMemory = require('./local-memory');
let _localMemory2 = _interopRequireDefault(_localMemory);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
exports.LocalMemory = _localMemory2.default;
exports.default = _localMemory2.default;

View file

@ -0,0 +1,96 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true,
});
let _memoryHandler = require('./memory-handler');
let _memoryHandler2 = _interopRequireDefault(_memoryHandler);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
const DEFAULT_LIMIT = 1000;
class LocalMemory {
constructor(config, options) {
this.config = config;
this.limit = config.limit || DEFAULT_LIMIT;
this.logger = options.logger;
this.data = this._createEmtpyDatabase();
}
getSecret() {
return Promise.resolve(this.data.secret);
}
setSecret(secret) {
return new Promise((resolve, reject) => {
this.data.secret = secret;
resolve(null);
});
}
add(name, cb) {
const list = this.data.list;
if (list.length < this.limit) {
if (list.indexOf(name) === -1) {
list.push(name);
}
cb(null);
} else {
this.logger.info(
{ limit: this.limit },
'Storage memory has reached limit of @{limit} packages'
);
cb(new Error('Storage memory has reached limit of limit packages'));
}
}
search(onPackage, onEnd, validateName) {
// TODO: pending to implement
onEnd();
}
remove(name, cb) {
const list = this.data.list;
const item = list.indexOf(name);
if (item !== -1) {
list.splice(item, 1);
}
cb(null);
}
get(cb) {
cb(null, this.data.list);
}
sync() {
// nothing to do
}
getPackageStorage(packageInfo) {
// eslint-disable-next-line new-cap
return new _memoryHandler2.default(packageInfo, this.data.files, this.logger);
}
_createEmtpyDatabase() {
const list = [];
const files = {};
const emptyDatabase = {
list,
files,
secret: '',
};
return emptyDatabase;
}
}
exports.default = LocalMemory;

View file

@ -0,0 +1,182 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true,
});
exports.fileExist = exports.noSuchFile = undefined;
let _httpErrors = require('http-errors');
let _httpErrors2 = _interopRequireDefault(_httpErrors);
let _memoryFs = require('memory-fs');
let _memoryFs2 = _interopRequireDefault(_memoryFs);
let _streams = require('@verdaccio/streams');
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
// $FlowFixMe
const noSuchFile = (exports.noSuchFile = 'ENOENT');
const fileExist = (exports.fileExist = 'EEXISTS');
const fSError = function fSError(message, code = 404) {
const err = (0, _httpErrors2.default)(code, message);
// $FlowFixMe
err.code = message;
return err;
};
const noPackageFoundError = function noPackageFoundError(message = 'no such package') {
const err = (0, _httpErrors2.default)(404, message);
// $FlowFixMe
err.code = noSuchFile;
return err;
};
// eslint-disable-next-line new-cap
const fs = new _memoryFs2.default();
class MemoryHandler {
constructor(packageName, data, logger) {
// this is not need it
this.data = data;
this.name = packageName;
this.logger = logger;
}
updatePackage(pkgFileName, updateHandler, onWrite, transformPackage, onEnd) {
let json = this._getStorage(pkgFileName);
try {
json = JSON.parse(json);
} catch (err) {
return onEnd(err);
}
updateHandler(json, (err) => {
if (err) {
return onEnd(err);
}
try {
onWrite(pkgFileName, transformPackage(json), onEnd);
} catch (err) {
return onEnd(fSError('error on parse', 500));
}
});
}
deletePackage(pkgName, callback) {
delete this.data[pkgName];
callback(null);
}
removePackage(callback) {
callback(null);
}
createPackage(name, value, cb) {
this.savePackage(name, value, cb);
}
savePackage(name, value, cb) {
try {
const json = JSON.stringify(value, null, '\t');
this.data[name] = json;
} catch (err) {
cb(fSError(err.message, 500));
}
cb(null);
}
readPackage(name, cb) {
const json = this._getStorage(name);
const isJson = typeof json === 'undefined';
try {
cb(isJson ? noPackageFoundError() : null, JSON.parse(json));
} catch (err) {
cb(noPackageFoundError());
}
}
writeTarball(name) {
const uploadStream = new _streams.UploadTarball();
const temporalName = `/${name}`;
process.nextTick(function () {
fs.exists(temporalName, function (exists) {
if (exists) {
return uploadStream.emit('error', fSError(fileExist));
}
try {
const file = fs.createWriteStream(temporalName);
uploadStream.pipe(file);
uploadStream.done = function () {
const onEnd = function onEnd() {
uploadStream.emit('success');
};
uploadStream.on('end', onEnd);
};
uploadStream.abort = function () {
uploadStream.emit('error', fSError('transmision aborted', 400));
file.end();
};
uploadStream.emit('open');
} catch (err) {
uploadStream.emit('error', err);
}
});
});
return uploadStream;
}
readTarball(name) {
const pathName = `/${name}`;
const readTarballStream = new _streams.ReadTarball();
process.nextTick(function () {
fs.exists(pathName, function (exists) {
if (!exists) {
readTarballStream.emit('error', noPackageFoundError());
} else {
const readStream = fs.createReadStream(pathName);
readTarballStream.emit('content-length', fs.data[name].length);
readTarballStream.emit('open');
readStream.pipe(readTarballStream);
readStream.on('error', (error) => {
readTarballStream.emit('error', error);
});
readTarballStream.abort = function () {
readStream.destroy(fSError('read has been aborted', 400));
};
}
});
});
return readTarballStream;
}
_getStorage(name = '') {
return this.data[name];
}
}
exports.default = MemoryHandler;

View file

@ -0,0 +1 @@
'use strict';

View file

@ -0,0 +1,72 @@
{
"name": "verdaccio-memory",
"version": "1.0.3",
"description": "storage implementation in memory",
"main": "lib/index.js",
"scripts": {
"release": "standard-version -a -s",
"pretest": "npm run lint",
"test": "jest",
"precommit": "lint-staged",
"format": "prettier --single-quote --trailing-comma none --write \"{src,test}/**/*.js\"",
"lint": "npm run flow && eslint .",
"flow": "flow",
"prepublish": "npm run build",
"commitmsg": "commitlint -e $GIT_PARAMS",
"build": "babel src/ --out-dir lib/ --copy-files --ignore ___tests___"
},
"dependencies": {
"@verdaccio/streams": "^1.0.0",
"http-errors": "1.6.3",
"memory-fs": "^0.4.1"
},
"devDependencies": {
"@commitlint/cli": "7.0.0",
"@commitlint/config-conventional": "7.0.1",
"@commitlint/travis-cli": "7.0.0",
"@verdaccio/types": "3.3.0",
"babel-cli": "6.26.0",
"babel-core": "6.26.3",
"babel-eslint": "8.2.6",
"babel-jest": "23.4.0",
"babel-plugin-flow-runtime": "0.17.0",
"babel-plugin-transform-async-to-generator": "6.24.1",
"babel-preset-env": "1.7.0",
"babel-preset-flow": "6.23.0",
"cross-env": "5.2.0",
"eslint": "5.1.0",
"eslint-config-google": "0.9.1",
"eslint-config-prettier": "2.9.0",
"eslint-plugin-flowtype": "2.50.0",
"eslint-plugin-jest": "21.17.0",
"eslint-plugin-prettier": "2.6.2",
"flow-bin": "0.76.0",
"flow-runtime": "0.17.0",
"husky": "0.14.3",
"jest": "23.4.1",
"lint-staged": "7.2.0",
"prettier": "1.13.7",
"rmdir-sync": "1.0.1",
"standard-version": "4.3.0"
},
"keywords": [
"verdaccio",
"plugin",
"storage"
],
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
},
"lint-staged": {
"*.js": [
"npm run format",
"npm run lint",
"git add"
]
},
"author": "Juan Picado <juanpicado19@gmail.com>",
"private": false,
"license": "MIT"
}

View file

@ -0,0 +1,17 @@
# Verdaccio and Gitlab Authentication
The [verdaccio-gitlab](https://github.com/bufferoverflow/verdaccio-gitlab) plugin can be used to authenticate users against gitlab.
## Running with the provided verdaccio-gitlab docker image
If the only extra plugin you require is verdaccio-gitlab, [you can use the image provided by the plugin project](https://hub.docker.com/r/bufferoverflow/verdaccio-gitlab/). It takes care of the whole plugin setup and is based on the [official verdaccio docker image](https://hub.docker.com/r/verdaccio/verdaccio/).
More information about the configuration required can be found in the [verdaccio-gitlab readme](https://github.com/bufferoverflow/verdaccio-gitlab/blob/master/README.md).
https://hub.docker.com/r/bufferoverflow/verdaccio-gitlab/
## Building your own docker image
There's a [sample docker-compose file in the verdaccio-gitlab repo](https://github.com/bufferoverflow/verdaccio-gitlab/blob/master/docker-compose.yml) that shows how to build & start both gitlab and verdaccio with support for the gitlab plugin, but this is generic enough to be used with any other extra plugins.
You can also extend the [official verdaccio-gitlab image Dockerfile](https://github.com/bufferoverflow/verdaccio-gitlab/blob/master/Dockerfile).

View file

@ -0,0 +1,69 @@
# Verdaccio and https-portal Example
Run `verdaccio` under fully automated HTTPS server powered by Nginx, Let's Encrypt was never so easy. Using [https-portal](https://github.com/SteveLTN/https-portal) all is builtin and no need for extra configuration.
## Prerequisites
In order to make it work, this is just a local setup, so you must update your `host` file.
On Mac
```
➜ sudo vi /etc/hosts
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
127.0.0.1 example.com
```
## Usage
To run the containers, run the followingcommands in this folder, it should start the containers in detach mode.
```bash
docker-compose up -d
```
To recreate the nginx image you can force the build.
```bash
docker-compose up --build -d
```
To force recreate the images.
```bash
docker-compose up --build --force-recreate -d
```
To stop all containers
```bash
docker-compose stop
```
From your Javascript project
```bash
npm publish --registry https://example.com
```
## NPM and self-signed certificates
Be aware of disabling strict SSL in `./npmrc`config file as explained [here](https://stackoverflow.com/questions/9626990/receiving-error-error-ssl-error-self-signed-cert-in-chain-while-using-npm).
```bash
npm config set strict-ssl false
```
## Login
If you want to login into the Verdaccio instance created via these Docker Examples, please try:
Username: jpicado
Password: jpicado

View file

@ -0,0 +1,28 @@
plugins: /verdaccio/plugins
storage: /verdaccio/storage
auth:
htpasswd:
file: /verdaccio/conf/htpasswd
uplinks:
npmjs:
url: https://registry.npmjs.org/
middlewares:
audit:
enabled: true
packages:
'@*/*':
access: $all
publish: $all
proxy: npmjs
'**':
access: $all
publish: $all
proxy: npmjs
logs:
- { type: stdout, format: pretty, level: trace }

View file

@ -0,0 +1 @@
jpicado:$6vkdNgRX2npc:autocreated 2018-09-22T10:24:17.535Z

View file

@ -0,0 +1,22 @@
version: '2'
services:
verdaccio:
image: verdaccio/verdaccio:4
container_name: verdaccio-https
ports:
- '4873:4873'
volumes:
- './storage:/verdaccio/storage'
- './conf:/verdaccio/conf'
https-portal:
image: steveltn/https-portal:1
ports:
- '80:80'
- '443:443'
links:
- verdaccio:verdaccio
environment:
DOMAINS: 'example.com -> http://verdaccio:4873'
STAGE: local
FORCE_RENEW: 'true'

View file

@ -0,0 +1,51 @@
{
"name": "@scope/example",
"versions": {
"1.0.0": {
"name": "@scope/example",
"version": "1.0.0",
"description": "exampled scoped module",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"example"
],
"author": {
"name": "Juan Picado"
},
"license": "ISC",
"dependencies": {
"jquery": "^3.3.1"
},
"_id": "@scope/example@1.0.0",
"_npmVersion": "6.3.0",
"_nodeVersion": "10.1.0",
"_npmUser": {},
"dist": {
"integrity": "sha512-UrpRhmCAwyGF2pWWd+fGDN8tFsVcCoLmK/qHaVAamphR+E4ZUjGf6N5GGgneFwbSeZ0FQrDYtUTPKrysxGIihQ==",
"shasum": "4c36e40e65049b32cd49599f65cb50b81b9d8810",
"tarball": "http://example.com/@scope/example/-/@scope/example-1.0.0.tgz"
}
}
},
"time": {
"modified": "2018-09-22T10:27:32.723Z",
"created": "2018-09-22T10:27:32.723Z",
"1.0.0": "2018-09-22T10:27:32.723Z"
},
"dist-tags": {
"latest": "1.0.0"
},
"_uplinks": {},
"_distfiles": {},
"_attachments": {
"example-1.0.0.tgz": {
"shasum": "4c36e40e65049b32cd49599f65cb50b81b9d8810",
"version": "1.0.0"
}
},
"_rev": "7-24f17006c03f69b9",
"readme": "ERROR: No README data found!"
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,18 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: verdaccio-deployment
spec:
replicas: 1
template:
metadata:
labels:
app: verdaccio
spec:
containers:
- name: verdaccio
image: verdaccio/verdaccio
imagePullPolicy: Always
ports:
- containerPort: 4873
# vim: set ts=2 expandtab!:

View file

@ -0,0 +1,61 @@
# Kubernetes Example
This example will use the latest `verdaccio` tag. If you want you set a different that, update the `deployment.yaml` file.
⚠️ There is newer Kubernetes example here that is woth to check out https://github.com/verdaccio/docker-examples/tree/master/kubernetes-helm-example
- Install Minikube
https://github.com/kubernetes/minikube
```bash
$> brew cask install minikube
```
- Run it
```bash
$> minikube start
```
- Deploy
```bash
$> kubectl create -f deployment.yaml
deployment "verdaccio-deployment" created
```
- Check whether the deployment was successful
```bash
$> kubectl get deployments
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
verdaccio-deployment 1 1 1 1 19m
```
- Deploy the service
```bash
$> kubectl create -f service.yaml
```
- Check the service
```bash
kubectl get services
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes 10.0.0.1 <none> 443/TCP 11h
verdaccio 10.0.0.160 <pending> 4873:30061/TCP 20m
```
- Browse the service
```bash
http://192.168.99.100:30061/
```
You can see the dashboard in action
```
http://192.168.99.100:30000/#!/service?namespace=default
```

View file

@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: verdaccio
labels:
app: verdaccio
spec:
selector:
app: verdaccio
ports:
- port: 4873
protocol: TCP
nodePort: 30061
type: LoadBalancer

View file

@ -0,0 +1,181 @@
# Kubernetes using Helm
## Prerequisites
- Kubernetes cluster running
- Read Verdaccio Helm [readme](https://github.com/kubernetes/charts/blob/master/stable/verdaccio/README.md).
#### Install Helm
```
brew install kubernetes-helm
```
Initialize `helm`.
```
➜ helm init --service-account default
Creating /Users/user/.helm
Creating /Users/user/.helm/repository
Creating /Users/user/.helm/repository/cache
Creating /Users/user/.helm/repository/local
Creating /Users/user/.helm/plugins
Creating /Users/user/.helm/starters
Creating /Users/user/.helm/cache/archive
Creating /Users/user/.helm/repository/repositories.yaml
Adding stable repo with URL: https://kubernetes-charts.storage.googleapis.com
Adding local repo with URL: http://127.0.0.1:8879/charts
$HELM_HOME has been configured at /Users/user/.helm.
Tiller (the Helm server-side component) has been installed into your Kubernetes Cluster.
Please note: by default, Tiller is deployed with an insecure 'allow unauthenticated users' policy.
For more information on securing your installation see: https://docs.helm.sh/using_helm/#securing-your-helm-installation
Happy Helming!
```
Let's update the helm repo
```
➜ helm repo update
Hang tight while we grab the latest from your chart repositories...
...Skip local chart repository
...Successfully got an update from the "stable" chart repository
Update Complete. ⎈ Happy Helming!⎈
```
Let's install verdaccio
```
➜ helm install stable/verdaccio
NAME: joking-porcupine
LAST DEPLOYED: Tue May 1 17:15:22 2018
NAMESPACE: default
STATUS: DEPLOYED
RESOURCES:
==> v1/Pod(related)
NAME READY STATUS RESTARTS AGE
joking-porcupine-verdaccio-594ff959b4-rr4nq 0/1 ContainerCreating 0 0s
==> v1/ConfigMap
NAME DATA AGE
joking-porcupine-verdaccio 1 0s
==> v1/PersistentVolumeClaim
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
joking-porcupine-verdaccio Bound pvc-78008a6a-4d52-11e8-86f2-080027bd643e 8Gi RWO standard 0s
==> v1/Service
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
joking-porcupine-verdaccio ClusterIP 10.100.245.159 <none> 4873/TCP 0s
==> v1beta1/Deployment
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
joking-porcupine-verdaccio 1 1 1 0 0s
NOTES:
1. Get the application URL by running these commands:
export POD_NAME=$(kubectl get pods --namespace default -l "app=verdaccio,release=vested-lobster" -o jsonpath="{.items[0].metadata.name}")
kubectl port-forward $POD_NAME 8080:4873
echo "Visit http://127.0.0.1:8080 to use your application"
```
![alt verdaccio](media/kubernetes_dashboard.png 'verdaccio app')
Then, follow the notes.
We export the application
```
export POD_NAME=$(kubectl get pods --namespace default -l "app=verdaccio,release=veering-gorilla" -o jsonpath="{.items[0].metadata.name}")
```
and we expose the port
```
➜ kubectl port-forward $POD_NAME 8080:4873
Forwarding from 127.0.0.1:8080 -> 4873
Forwarding from [::1]:8080 -> 4873
```
Verdaccio is up and running.
```
http://127.0.0.1:8080/#/
```
### Publishing a Package
Let's log in.
```
➜ npm adduser --registry http://127.0.0.1:8080
Username: user
Password: ***
Email: (this IS public) user@domain.com
Logged in as user on http://127.0.0.1:8080/.
```
and now we can publish
```
➜ npm publish --registry http://127.0.0.1:8080
+ @kubernetes/hellonode-example@1.0.0
```
![alt verdaccio](media/kubernetes_verdaccio.png 'verdaccio app')
### Scale
Check the pod name (if you do not include --name) on install helm, kubernetes generate a random name.
```
➜ kubectl get pods
NAME READY STATUS RESTARTS AGE
veering-gorilla-verdaccio-666d9488bc-n9p27 1/1 Running 0 11m
```
Let's scale
```
➜ kubectl scale deployment veering-gorilla-verdaccio --replicas=3
deployment.extensions "veering-gorilla-verdaccio" scaled
```
![alt verdaccio](media/kubernetes_scale.png 'verdaccio scaled')
## Problems
I had this issue trying to install verdaccio helm, to solve it I just run a command and all works perfectly.
### [Registered user can't login](https://github.com/verdaccio/verdaccio/issues/943)
If you are facing this issue please read the following link https://github.com/verdaccio/verdaccio/issues/943#issuecomment-427670085
### Connection refused
```
➜ helm install stable/verdaccio
Error: Get http://localhost:8080/api/v1/namespaces/kube-system/configmaps?labelSelector=OWNER%!D(MISSING)TILLER: dial tcp 127.0.0.1:8080: connect: connection refused
```
Run the following script to solve it.
```
kubectl -n kube-system patch deployment tiller-deploy -p '{"spec": {"template": {"spec": {"automountServiceAccountToken": true}}}}'
```
#### Tiller pod is missing
```
➜ helm install stable/verdaccio
Error: could not find a ready tiller pod
```
Run this to fix it.
```
helm init --upgrade
```

Binary file not shown.

After

Width:  |  Height:  |  Size: 403 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 KiB

View file

@ -0,0 +1,78 @@
#
# This is the config file used for the docker images.
# It allows all users to do anything, so don't use it on production systems.
#
# Do not configure host and port under `listen` in this file
# as it will be ignored when using docker.
# see https://github.com/verdaccio/verdaccio/blob/master/wiki/docker.md#docker-and-custom-port-configuration
#
# Look here for more config file examples:
# https://github.com/verdaccio/verdaccio/tree/master/conf
#
# path to a directory with all packages
storage: /verdaccio/storage
auth:
ldap:
type: ldap
client_options:
url: 'ldap://openldap:389'
# Only required if you need auth to bind
adminDn: 'cn=admin,dc=example,dc=org'
adminPassword: 'admin'
# Search base for users
searchBase: 'ou=People,dc=example,dc=org'
searchFilter: '(cn={{username}})'
# If you are using groups, this is also needed
groupDnProperty: 'cn'
groupSearchBase: 'ou=Groups,dc=example,dc=org'
# If you have memberOf support on your ldap
searchAttributes: ['*', 'memberOf']
# Else, if you don't (use one or the other):
# groupSearchFilter: '(memberUid={{dn}})'
#
# Optional, default false.
# If true, then up to 100 credentials at a time will be cached for 5 minutes.
cache: false
# Optional
reconnect: true
# a list of other known repositories we can talk to
uplinks:
npmjs:
url: https://registry.npmjs.org/
packages:
'@scope/*':
# scoped packages
access: marpontes zach leonardo
publish: $authenticated
proxy: npmjs
'@*/*':
# scoped packages
access: $all
publish: $authenticated
proxy: npmjs
'**':
# allow all users (including non-authenticated users) to read and
# publish all packages
#
# you can specify usernames/groupnames (depending on your auth plugin)
# and three keywords: "$all", "$anonymous", "$authenticated"
access: $all
# allow all known users to publish packages
# (anyone can register by default, remember?)
publish: $authenticated
# if package is not available locally, proxy requests to 'npmjs' registry
proxy: npmjs
# log settings
logs:
- { type: stdout, format: pretty, level: trace }
#- {type: file, path: verdaccio.log, level: info}
listen:
- 0.0.0.0:4873

View file

@ -0,0 +1,48 @@
version: '2'
services:
verdaccio:
container_name: verdaccio-ldap-1
build: verdaccio-ldap/
ports:
- '4873:4873'
volumes:
- './storage:/verdaccio/storage'
- './conf:/verdaccio/conf'
openldap:
image: osixia/openldap
container_name: openldap
hostname: openldap
environment:
LDAP_ORGANISATION: 'LDAP Verdaccio Auth'
LDAP_SSL_HELPER_PREFIX: 'ldap'
LDAP_TLS_VERIFY_CLIENT: 'never'
LDAP_LOG_LEVEL: 256
LDAP_ADMIN_PASSWORD: 'admin'
ports:
- '389:389'
links:
- verdaccio
openldap-seed:
image: osixia/openldap
volumes:
- ./docker/ldap/ldif_files:/ldif_files
links:
- openldap
entrypoint: sh -c '/ldif_files/addAll.sh'
openldap-admin:
image: osixia/phpldapadmin
container_name: openldap-admin
hostname: openldap-admin
environment:
PHPLDAPADMIN_HTTPS=false:
PHPLDAPADMIN_LDAP_HOSTS: 'openldap'
ports:
- '8080:80'
links:
- 'openldap:openldap'
depends_on:
- openldap
volumes:
verdaccio:
driver: local

View file

@ -0,0 +1,4 @@
#!/usr/bin/env bash
sleep 5
ldapsearch -v -h openldap -x -D "cn=admin,dc=example,dc=org" -w admin -b "dc=example,dc=org" -s sub
ldapadd -v -h openldap -c -D "cn=admin,dc=example,dc=org" -w admin -f /ldif_files/people.ldif

View file

@ -0,0 +1,69 @@
# --- OUs -------------------------------------
dn: ou=Groups,dc=example,dc=org
objectClass: organizationalunit
objectClass: top
ou: Groups
dn: ou=People,dc=example,dc=org
objectClass: organizationalunit
objectClass: top
ou: People
# --- People ----------------------------------
dn: cn=marpontes,ou=People,dc=example,dc=org
objectClass: person
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: top
cn: marpontes
userpassword: pass
givenname: Marcello
sn: Pontes
mail: marcello@oncase.com.br
uid: 1001
dn: cn=zach,ou=People,dc=example,dc=org
objectClass: person
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: top
cn: zach
userpassword: pass
givenname: Zachary
sn: Zeus
mail: zach@oncase.com.br
uid: 1002
dn: cn=leonardo,ou=People,dc=example,dc=org
objectClass: person
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: top
cn: leonardo
userpassword: pass
givenname: Leonardo
sn: Luiz
mail: zach@oncase.com.br
uid: 1003
# --- Groups ----------------------------------
dn: cn=Administrator,ou=Groups,dc=example,dc=org
objectClass: groupofuniquenames
objectClass: top
ou: Groups
cn: Administrator
uniquemember: cn=marpontes, ou=People, dc=example,dc=org
dn: cn=Developers,ou=Groups,dc=example,dc=org
objectClass: groupofuniquenames
objectClass: top
ou: Groups
cn: Administrator
uniquemember: cn=marpontes, ou=People, dc=example,dc=org
uniquemember: cn=zach, ou=People, dc=example,dc=org
uniquemember: cn=leonardo, ou=People, dc=example,dc=org

View file

@ -0,0 +1,86 @@
# Verdaccio and OpenLDAP Server
Running `verdaccio` with the plugin [https://github.com/Alexandre-io/verdaccio-ldap](https://github.com/Alexandre-io/verdaccio-ldap).
## Introduction
This example is based on:
- **OpenLDAP** (ldap://localhost:389)
- **phpLDAP Admin** (http://localhost:8080/)
- **Verdaccio** (http://localhost:4873/)
It provides a published package named `@scope/example` that only authenticated users can access.
```
packages:
'@scope/*':
access: marpontes zach leonardo
publish: $authenticated
proxy: npmjs
'@*/*':
access: $all
publish: $authenticated
proxy: npmjs
'**':
access: $all
publish: $authenticated
proxy: npmjs
```
## Usage
To run the containers, run the following command in this folder, it should starts the containers in detach mode.
```bash
➜ docker-compose up --force-recreate --build
Building verdaccio
Step 1/4 : FROM verdaccio/verdaccio:4.2.2
---> 0d58a1eae16d
Step 2/4 : USER root
---> Using cache
---> fb3300bf15cc
Step 3/4 : RUN npm i && npm i verdaccio-ldap
---> Using cache
---> 97701fa53b43
Step 4/4 : USER verdaccio
---> Using cache
---> fd5ddaa03d8f
Successfully built fd5ddaa03d8f
Successfully tagged ldap-verdaccio_verdaccio:latest
Recreating verdaccio-ldap-1 ... done
Recreating openldap ... done
Recreating ldap-verdaccio_openldap-seed_1 ... done
Recreating openldap-admin ... done
Attaching to verdaccio-ldap-1, openldap, ldap-verdaccio_openldap-seed_1, openldap-admin
verdaccio-ldap-1 | warn --- config file - /verdaccio/conf/config.yaml
verdaccio-ldap-1 | warn --- Plugin successfully loaded: verdaccio-ldap
verdaccio-ldap-1 | warn --- http address - http://0.0.0.0:4873/ - verdaccio/4.2.2
openldap | *** CONTAINER_LOG_LEVEL = 3 (info)
openldap | *** Search service in CONTAINER_SERVICE_DIR = /container/service :
openldap | *** link /container/service/:ssl-tools/startup.sh to /container/run/startup/:ssl-tools
openldap | *** link /container/service/slapd/startup.sh to /container/run/startup/slapd
openldap | *** link /container/service/slapd/process.sh to /container/run/process/slapd/run
openldap | *** Set environment for startup files
openldap | *** Environment files will be proccessed in this order :
openldap | Caution: previously defined variables will not be overriden.
openldap | /container/environment/99-default/default.yaml
openldap | /container/environment/99-default/default.startup.yaml
```
To stop all containers
```bash
docker-compose stop
```
## Credentials
You can find the complete list of users in the `people.ldif` file. However here a brief list of credentials.
```
marpontes: pass
zach: pass
leonardo: pass
```

View file

@ -0,0 +1,51 @@
{
"name": "@scope/example",
"versions": {
"1.0.0": {
"name": "@scope/example",
"version": "1.0.0",
"description": "exampled scoped module",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"example"
],
"author": {
"name": "Juan Picado"
},
"license": "ISC",
"dependencies": {
"jquery": "^3.3.1"
},
"_id": "@scope/example@1.0.0",
"_npmVersion": "6.3.0",
"_nodeVersion": "10.1.0",
"_npmUser": {},
"dist": {
"integrity": "sha512-UrpRhmCAwyGF2pWWd+fGDN8tFsVcCoLmK/qHaVAamphR+E4ZUjGf6N5GGgneFwbSeZ0FQrDYtUTPKrysxGIihQ==",
"shasum": "4c36e40e65049b32cd49599f65cb50b81b9d8810",
"tarball": "http://localhost:4873/@scope/example/-/@scope/example-1.0.0.tgz"
}
}
},
"time": {
"modified": "2018-09-22T17:08:29.339Z",
"created": "2018-09-22T17:08:29.339Z",
"1.0.0": "2018-09-22T17:08:29.339Z"
},
"dist-tags": {
"latest": "1.0.0"
},
"_uplinks": {},
"_distfiles": {},
"_attachments": {
"example-1.0.0.tgz": {
"shasum": "4c36e40e65049b32cd49599f65cb50b81b9d8810",
"version": "1.0.0"
}
},
"_rev": "9-664a1a1732f461c8",
"readme": "ERROR: No README data found!"
}

View file

@ -0,0 +1,4 @@
FROM verdaccio/verdaccio:4.2.2
USER root
RUN npm i && npm i verdaccio-ldap
USER verdaccio

View file

View file

@ -0,0 +1,41 @@
# Verdaccio Uplinks
## Context
This is an experiment for the **uplinks** feature.
https://verdaccio.org/docs/en/uplinks
Furthermore, this experiment also proves the oldest Verdaccio (2.x) still is able to communicate with the latest development version (4.x).
## Objective
We have 3 registries:
- Server 1 (verdaccio@4.x)
- Server 2 (verdaccio@2.x)
- Server 3 (verdaccio@3.x)
The servers have no authentication in order to simplify the configuration. The server 3 and server 1 are chained with server 2 which is the unique that contains the dependency `@jota/pk1-juan`.
The request will go through `server 1 --> server 3 --> server 2` and should retrieve the tarball to the local project executing the following:
```
npm install @jota/pk1-juan --registry http://localhost:4873
```
The result is a successful installation of the package.
## Usage
To force recreate the images.
```bash
docker-compose up --build --force-recreate -d
```
To stop all containers
```bash
docker-compose stop
```

View file

@ -0,0 +1,41 @@
version: '3'
services:
verdaccio:
image: verdaccio/verdaccio:4
container_name: verdaccio-multi-1
ports:
- '4873:4873'
volumes:
- './server1/storage:/verdaccio/storage'
- './server1/conf:/verdaccio/conf'
links:
- verdaccio3:verdaccio3
depends_on:
- verdaccio3
verdaccio2:
image: verdaccio/verdaccio:2
container_name: verdaccio-multi-2
ports:
- '4874:4873'
volumes:
- './server2/storage:/verdaccio/storage'
- './server2/conf:/verdaccio/conf'
verdaccio3:
image: verdaccio/verdaccio:3
container_name: verdaccio-multi-3
ports:
- '4875:4873'
links:
- verdaccio2:verdaccio2
volumes:
- './server3/storage:/verdaccio/storage'
- './server3/conf:/verdaccio/conf'
depends_on:
- verdaccio2
volumes:
verdaccio:
driver: local
verdaccio2:
driver: local
verdaccio3:
driver: local

View file

@ -0,0 +1,55 @@
#
# This is the config file used for the docker images.
# It allows all users to do anything, so don't use it on production systems.
#
# Do not configure host and port under `listen` in this file
# as it will be ignored when using docker.
# see https://github.com/verdaccio/verdaccio/blob/master/wiki/docker.md#docker-and-custom-port-configuration
#
# Look here for more config file examples:
# https://github.com/verdaccio/verdaccio/tree/master/conf
#
# path to a directory with all packages
storage: /verdaccio/storage
auth:
htpasswd:
file: /verdaccio/conf/htpasswd
security:
api:
jwt:
sign:
expiresIn: 60d
notBefore: 1
web:
sign:
expiresIn: 7d
# a list of other known repositories we can talk to
uplinks:
server3:
url: http://verdaccio3:4873/
max_fails: 100
timeout: 100s
packages:
'@jota/*':
access: $all
publish: $all
proxy: server3
'@*/*':
access: $all
publish: $all
proxy: server3
'**':
access: $all
publish: $all
proxy: server3
middlewares:
audit:
enabled: true
logs:
- { type: stdout, format: pretty, level: trace }

View file

@ -0,0 +1,96 @@
{
"name": "@jota/pk1-juan",
"versions": {
"1.0.0": {
"name": "@jota/pk1-juan",
"version": "1.0.0",
"description": "Simple React Webpack Babel Starter Kit",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": {
"name": "Juan Picado",
"email": "juan@jotadeveloper.com"
},
"license": "ISC",
"dependencies": {
"jquery": "^3.2.1"
},
"readmeFilename": "README.md",
"_id": "@jota/pk1-juan@1.0.0",
"_npmVersion": "5.5.1",
"_nodeVersion": "8.7.0",
"_npmUser": {},
"dist": {
"integrity": "sha512-JC4y+iHrUpD+li3Pf9z2oFxw2Mtbqi6vgnIDBB3H/P/t0gAuCKK/LJ86kV7TRyvQwVvyJk1qI61iOVLiMwjZ8Q==",
"shasum": "95a21c648054c7144a23995a519930255f35b6c2",
"tarball": "http://verdaccio3:4873/@jota%2fpk1-juan/-/pk1-juan-1.0.0.tgz"
}
},
"1.0.1": {
"name": "@jota/pk1-juan",
"version": "1.0.1",
"description": "Simple React Webpack Babel Starter Kit",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": {
"name": "Juan Picado",
"email": "juan@jotadeveloper.com"
},
"license": "ISC",
"dependencies": {
"jquery": "^3.2.1"
},
"readmeFilename": "README.md",
"_id": "@jota/pk1-juan@1.0.1",
"_npmVersion": "5.5.1",
"_nodeVersion": "8.7.0",
"_npmUser": {},
"dist": {
"integrity": "sha512-copZNn2mMX8S3W9czxd3GXKj8vKu1v7JrUD9zOtriP8v9AvZOHIt6nW8+1114cumNGukFxjBO+2VlZC793ynTA==",
"shasum": "ed59869c54d1bec7bc19732c4c23c97633ea30e2",
"tarball": "http://verdaccio3:4873/@jota%2fpk1-juan/-/pk1-juan-1.0.1.tgz"
}
}
},
"time": {
"modified": "2018-01-17T18:49:09.087Z",
"created": "2018-01-17T18:27:39.952Z",
"1.0.0": "2018-01-17T18:27:39.952Z",
"1.0.1": "2018-01-17T18:49:09.087Z"
},
"dist-tags": {
"latest": "1.0.0",
"beta2": "1.0.1"
},
"_uplinks": {
"server3": {
"etag": "\"3ad640b1f8542d53fd0806e5e8462af7\"",
"fetched": 1549659258060
}
},
"_distfiles": {
"pk1-juan-1.0.0.tgz": {
"url": "http://verdaccio3:4873/@jota%2fpk1-juan/-/pk1-juan-1.0.0.tgz",
"sha": "95a21c648054c7144a23995a519930255f35b6c2",
"registry": "server3"
},
"pk1-juan-1.0.1.tgz": {
"url": "http://verdaccio3:4873/@jota%2fpk1-juan/-/pk1-juan-1.0.1.tgz",
"sha": "ed59869c54d1bec7bc19732c4c23c97633ea30e2",
"registry": "server3"
}
},
"_attachments": {
"pk1-juan-1.0.0.tgz": {
"shasum": "95a21c648054c7144a23995a519930255f35b6c2"
}
},
"_rev": "3-0c63867229e7ec25",
"readme": "# react-webpack-babel\nSimple React Webpack Babel Starter Kit\n\nTired of complicated starters with 200MB of dependencies which are hard to understand and modify?\n\nTry this is a simple [React](https://facebook.github.io/react/), [Webpack](http://webpack.github.io/) and [Babel](https://babeljs.io/) application with nothing else in it.\n\n### What's in it?\n\n* Simple src/index.jsx and src/index.css (local module css).\n* Webpack configuration for development (with hot reloading) and production (with minification).\n* CSS module loading, so you can include your css by ```import styles from './path/to.css';```.\n* Both js(x) and css hot loaded during development.\n* [Webpack Dashboard Plugin](https://github.com/FormidableLabs/webpack-dashboard) on dev server.\n\n### To run\n\n* You'll need to have [git](https://git-scm.com/) and [node](https://nodejs.org/en/) installed in your system.\n* Fork and clone the project:\n\n```\ngit clone https://github.com/alicoding/react-webpack-babel.git\n```\n\n* Then install the dependencies:\n\n```\nnpm install\n```\n\n* Run development server:\n\n```\nnpm start\n```\n\n* Or you can run development server with [webpack-dashboard](https://github.com/FormidableLabs/webpack-dashboard):\n\n```\nnpm run dev\n```\n\nOpen the web browser to `http://localhost:8888/`\n\n### To build the production package\n\n```\nnpm run build\n```\n\n### Nginx Config\n\nHere is an example Nginx config:\n```\nserver {\n\t# ... root and other options\n\n\tgzip on;\n\tgzip_http_version 1.1;\n\tgzip_types text/plain text/css text/xml application/javascript image/svg+xml;\n\n\tlocation / {\n\t\ttry_files $uri $uri/ /index.html;\n\t}\n\n\tlocation ~ \\.html?$ {\n\t\texpires 1d;\n\t}\n\n\tlocation ~ \\.(svg|ttf|js|css|svgz|eot|otf|woff|jpg|jpeg|gif|png|ico)$ {\n\t\taccess_log off;\n\t\tlog_not_found off;\n\t\texpires max;\n\t}\n}\n```\n\n### Eslint\nThere is a .eslint.yaml config for eslint ready with React plugin.\nTo use it, you need to install additional dependencies though:\n\n```\nnpm install --save-dev eslint eslint-plugin-react\n```\n\nTo do the actual linting, run:\n\n```\nnpm run lint\n```\n\n### Notes on importing css styles\n* styles having /src/ in their absolute path are considered part of the application and exported as local css modules.\n* other styles are considered global styles used by many components and are included in the css bundle directly.\n\n### Contribute\nPlease contribute to the project if you know how to make it better, including this README :)"
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,56 @@
#
# This is the config file used for the docker images.
# It allows all users to do anything, so don't use it on production systems.
#
# Do not configure host and port under `listen` in this file
# as it will be ignored when using docker.
# see https://github.com/verdaccio/verdaccio/blob/master/wiki/docker.md#docker-and-custom-port-configuration
#
# Look here for more config file examples:
# https://github.com/verdaccio/verdaccio/tree/master/conf
#
# path to a directory with all packages
storage: /verdaccio/storage
auth:
htpasswd:
file: /verdaccio/conf/htpasswd
sign:
expiresIn: 7d
# a list of other known repositories we can talk to
uplinks:
npmjs:
url: https://registry.npmjs.org/
packages:
'@jota/*':
access: $all
publish: $all
'@*/*':
# scoped packages
access: $all
publish: $all
proxy: npmjs
'**':
# allow all users (including non-authenticated users) to read and
# publish all packages
#
# you can specify usernames/groupnames (depending on your auth plugin)
# and three keywords: "$all", "$anonymous", "$authenticated"
access: $all
# allow all known users to publish packages
# (anyone can register by default, remember?)
publish: $all
# if package is not available locally, proxy requests to 'npmjs' registry
proxy: npmjs
# log settings
logs:
- { type: stdout, format: pretty, level: trace }
#- {type: file, path: verdaccio.log, level: info}

View file

@ -0,0 +1,85 @@
{
"name": "@jota/pk1-juan",
"versions": {
"1.0.0": {
"name": "@jota/pk1-juan",
"version": "1.0.0",
"description": "Simple React Webpack Babel Starter Kit",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": {
"name": "Juan Picado",
"email": "juan@jotadeveloper.com"
},
"license": "ISC",
"dependencies": {
"jquery": "^3.2.1"
},
"readmeFilename": "README.md",
"_id": "@jota/pk1-juan@1.0.0",
"_npmVersion": "5.5.1",
"_nodeVersion": "8.7.0",
"_npmUser": {},
"dist": {
"integrity": "sha512-JC4y+iHrUpD+li3Pf9z2oFxw2Mtbqi6vgnIDBB3H/P/t0gAuCKK/LJ86kV7TRyvQwVvyJk1qI61iOVLiMwjZ8Q==",
"shasum": "95a21c648054c7144a23995a519930255f35b6c2",
"tarball": "http://0.0.0.0:4873/@jota/pk1-juan/-/@jota/pk1-juan-1.0.0.tgz"
}
},
"1.0.1": {
"name": "@jota/pk1-juan",
"version": "1.0.1",
"description": "Simple React Webpack Babel Starter Kit",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": {
"name": "Juan Picado",
"email": "juan@jotadeveloper.com"
},
"license": "ISC",
"dependencies": {
"jquery": "^3.2.1"
},
"readmeFilename": "README.md",
"_id": "@jota/pk1-juan@1.0.1",
"_npmVersion": "5.5.1",
"_nodeVersion": "8.7.0",
"_npmUser": {},
"dist": {
"integrity": "sha512-copZNn2mMX8S3W9czxd3GXKj8vKu1v7JrUD9zOtriP8v9AvZOHIt6nW8+1114cumNGukFxjBO+2VlZC793ynTA==",
"shasum": "ed59869c54d1bec7bc19732c4c23c97633ea30e2",
"tarball": "http://0.0.0.0:4873/@jota/pk1-juan/-/@jota/pk1-juan-1.0.1.tgz"
}
}
},
"dist-tags": {
"latest": "1.0.0",
"beta2": "1.0.1"
},
"time": {
"modified": "2018-01-17T18:49:09.087Z",
"created": "2018-01-17T18:27:39.952Z",
"1.0.0": "2018-01-17T18:27:39.952Z",
"1.0.1": "2018-01-17T18:49:09.087Z"
},
"_distfiles": {},
"_attachments": {
"pk1-juan-1.0.0.tgz": {
"shasum": "95a21c648054c7144a23995a519930255f35b6c2",
"version": "1.0.0"
},
"pk1-juan-1.0.1.tgz": {
"shasum": "ed59869c54d1bec7bc19732c4c23c97633ea30e2",
"version": "1.0.1"
}
},
"_uplinks": {},
"_rev": "20-62a9d1d0a27eb84e",
"readme": "# react-webpack-babel\nSimple React Webpack Babel Starter Kit\n\nTired of complicated starters with 200MB of dependencies which are hard to understand and modify?\n\nTry this is a simple [React](https://facebook.github.io/react/), [Webpack](http://webpack.github.io/) and [Babel](https://babeljs.io/) application with nothing else in it.\n\n### What's in it?\n\n* Simple src/index.jsx and src/index.css (local module css).\n* Webpack configuration for development (with hot reloading) and production (with minification).\n* CSS module loading, so you can include your css by ```import styles from './path/to.css';```.\n* Both js(x) and css hot loaded during development.\n* [Webpack Dashboard Plugin](https://github.com/FormidableLabs/webpack-dashboard) on dev server.\n\n### To run\n\n* You'll need to have [git](https://git-scm.com/) and [node](https://nodejs.org/en/) installed in your system.\n* Fork and clone the project:\n\n```\ngit clone https://github.com/alicoding/react-webpack-babel.git\n```\n\n* Then install the dependencies:\n\n```\nnpm install\n```\n\n* Run development server:\n\n```\nnpm start\n```\n\n* Or you can run development server with [webpack-dashboard](https://github.com/FormidableLabs/webpack-dashboard):\n\n```\nnpm run dev\n```\n\nOpen the web browser to `http://localhost:8888/`\n\n### To build the production package\n\n```\nnpm run build\n```\n\n### Nginx Config\n\nHere is an example Nginx config:\n```\nserver {\n\t# ... root and other options\n\n\tgzip on;\n\tgzip_http_version 1.1;\n\tgzip_types text/plain text/css text/xml application/javascript image/svg+xml;\n\n\tlocation / {\n\t\ttry_files $uri $uri/ /index.html;\n\t}\n\n\tlocation ~ \\.html?$ {\n\t\texpires 1d;\n\t}\n\n\tlocation ~ \\.(svg|ttf|js|css|svgz|eot|otf|woff|jpg|jpeg|gif|png|ico)$ {\n\t\taccess_log off;\n\t\tlog_not_found off;\n\t\texpires max;\n\t}\n}\n```\n\n### Eslint\nThere is a .eslint.yaml config for eslint ready with React plugin.\nTo use it, you need to install additional dependencies though:\n\n```\nnpm install --save-dev eslint eslint-plugin-react\n```\n\nTo do the actual linting, run:\n\n```\nnpm run lint\n```\n\n### Notes on importing css styles\n* styles having /src/ in their absolute path are considered part of the application and exported as local css modules.\n* other styles are considered global styles used by many components and are included in the css bundle directly.\n\n### Contribute\nPlease contribute to the project if you know how to make it better, including this README :)"
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,53 @@
#
# This is the config file used for the docker images.
# It allows all users to do anything, so don't use it on production systems.
#
# Do not configure host and port under `listen` in this file
# as it will be ignored when using docker.
# see https://github.com/verdaccio/verdaccio/blob/master/wiki/docker.md#docker-and-custom-port-configuration
#
# Look here for more config file examples:
# https://github.com/verdaccio/verdaccio/tree/master/conf
#
# path to a directory with all packages
storage: /verdaccio/storage
auth:
htpasswd:
file: /verdaccio/conf/htpasswd
security:
api:
jwt:
sign:
expiresIn: 60d
notBefore: 1
web:
sign:
expiresIn: 7d
# a list of other known repositories we can talk to
uplinks:
server2:
url: http://verdaccio2:4873/
packages:
'@jota/*':
access: $all
publish: $all
proxy: server2
'@*/*':
access: $all
publish: $all
proxy: server2
'**':
access: $all
publish: $all
proxy: server2
middlewares:
audit:
enabled: true
logs:
- { type: stdout, format: pretty, level: trace }

View file

@ -0,0 +1,96 @@
{
"name": "@jota/pk1-juan",
"versions": {
"1.0.0": {
"name": "@jota/pk1-juan",
"version": "1.0.0",
"description": "Simple React Webpack Babel Starter Kit",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": {
"name": "Juan Picado",
"email": "juan@jotadeveloper.com"
},
"license": "ISC",
"dependencies": {
"jquery": "^3.2.1"
},
"readmeFilename": "README.md",
"_id": "@jota/pk1-juan@1.0.0",
"_npmVersion": "5.5.1",
"_nodeVersion": "8.7.0",
"_npmUser": {},
"dist": {
"integrity": "sha512-JC4y+iHrUpD+li3Pf9z2oFxw2Mtbqi6vgnIDBB3H/P/t0gAuCKK/LJ86kV7TRyvQwVvyJk1qI61iOVLiMwjZ8Q==",
"shasum": "95a21c648054c7144a23995a519930255f35b6c2",
"tarball": "http://verdaccio2:4873/@jota%2fpk1-juan/-/pk1-juan-1.0.0.tgz"
}
},
"1.0.1": {
"name": "@jota/pk1-juan",
"version": "1.0.1",
"description": "Simple React Webpack Babel Starter Kit",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": {
"name": "Juan Picado",
"email": "juan@jotadeveloper.com"
},
"license": "ISC",
"dependencies": {
"jquery": "^3.2.1"
},
"readmeFilename": "README.md",
"_id": "@jota/pk1-juan@1.0.1",
"_npmVersion": "5.5.1",
"_nodeVersion": "8.7.0",
"_npmUser": {},
"dist": {
"integrity": "sha512-copZNn2mMX8S3W9czxd3GXKj8vKu1v7JrUD9zOtriP8v9AvZOHIt6nW8+1114cumNGukFxjBO+2VlZC793ynTA==",
"shasum": "ed59869c54d1bec7bc19732c4c23c97633ea30e2",
"tarball": "http://verdaccio2:4873/@jota%2fpk1-juan/-/pk1-juan-1.0.1.tgz"
}
}
},
"time": {
"modified": "2018-01-17T18:49:09.087Z",
"created": "2018-01-17T18:27:39.952Z",
"1.0.0": "2018-01-17T18:27:39.952Z",
"1.0.1": "2018-01-17T18:49:09.087Z"
},
"dist-tags": {
"latest": "1.0.0",
"beta2": "1.0.1"
},
"_uplinks": {
"server2": {
"etag": "\"4e442b596e437876e8a8719282df3389\"",
"fetched": 1549659258012
}
},
"_distfiles": {
"pk1-juan-1.0.0.tgz": {
"url": "http://verdaccio2:4873/@jota%2fpk1-juan/-/pk1-juan-1.0.0.tgz",
"sha": "95a21c648054c7144a23995a519930255f35b6c2",
"registry": "server2"
},
"pk1-juan-1.0.1.tgz": {
"url": "http://verdaccio2:4873/@jota%2fpk1-juan/-/pk1-juan-1.0.1.tgz",
"sha": "ed59869c54d1bec7bc19732c4c23c97633ea30e2",
"registry": "server2"
}
},
"_attachments": {
"pk1-juan-1.0.0.tgz": {
"shasum": "95a21c648054c7144a23995a519930255f35b6c2"
}
},
"_rev": "4-e9be49402b9052ce",
"readme": "# react-webpack-babel\nSimple React Webpack Babel Starter Kit\n\nTired of complicated starters with 200MB of dependencies which are hard to understand and modify?\n\nTry this is a simple [React](https://facebook.github.io/react/), [Webpack](http://webpack.github.io/) and [Babel](https://babeljs.io/) application with nothing else in it.\n\n### What's in it?\n\n* Simple src/index.jsx and src/index.css (local module css).\n* Webpack configuration for development (with hot reloading) and production (with minification).\n* CSS module loading, so you can include your css by ```import styles from './path/to.css';```.\n* Both js(x) and css hot loaded during development.\n* [Webpack Dashboard Plugin](https://github.com/FormidableLabs/webpack-dashboard) on dev server.\n\n### To run\n\n* You'll need to have [git](https://git-scm.com/) and [node](https://nodejs.org/en/) installed in your system.\n* Fork and clone the project:\n\n```\ngit clone https://github.com/alicoding/react-webpack-babel.git\n```\n\n* Then install the dependencies:\n\n```\nnpm install\n```\n\n* Run development server:\n\n```\nnpm start\n```\n\n* Or you can run development server with [webpack-dashboard](https://github.com/FormidableLabs/webpack-dashboard):\n\n```\nnpm run dev\n```\n\nOpen the web browser to `http://localhost:8888/`\n\n### To build the production package\n\n```\nnpm run build\n```\n\n### Nginx Config\n\nHere is an example Nginx config:\n```\nserver {\n\t# ... root and other options\n\n\tgzip on;\n\tgzip_http_version 1.1;\n\tgzip_types text/plain text/css text/xml application/javascript image/svg+xml;\n\n\tlocation / {\n\t\ttry_files $uri $uri/ /index.html;\n\t}\n\n\tlocation ~ \\.html?$ {\n\t\texpires 1d;\n\t}\n\n\tlocation ~ \\.(svg|ttf|js|css|svgz|eot|otf|woff|jpg|jpeg|gif|png|ico)$ {\n\t\taccess_log off;\n\t\tlog_not_found off;\n\t\texpires max;\n\t}\n}\n```\n\n### Eslint\nThere is a .eslint.yaml config for eslint ready with React plugin.\nTo use it, you need to install additional dependencies though:\n\n```\nnpm install --save-dev eslint eslint-plugin-react\n```\n\nTo do the actual linting, run:\n\n```\nnpm run lint\n```\n\n### Notes on importing css styles\n* styles having /src/ in their absolute path are considered part of the application and exported as local css modules.\n* other styles are considered global styles used by many components and are included in the css bundle directly.\n\n### Contribute\nPlease contribute to the project if you know how to make it better, including this README :)"
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,10 @@
FROM verdaccio/verdaccio
USER root
ENV NODE_ENV=production
RUN npm i && npm install verdaccio-aws-s3-storage
USER verdaccio

View file

@ -0,0 +1,3 @@
# How to extend an Verdaccio Docker image?
Depends of your version the approach is different, please check each version.

View file

@ -0,0 +1,60 @@
# Verdaccio and Nginx
Running `verdaccio` via reverse proxy is a common practice. This configuration provides a quick way to run the application behind **nginx**.
This folder provides the following examples:
- root_path: Using reverse proxy with `/` as a path.
- relative_path: Using `/verdaccio/` as a subdirectory. It includes also SSL examples with reverse proxy.
To run the containers, run the following commands in this folder. The containers should start in detach mode.
```bash
docker-compose up -d
```
To recreate the nginx image you can force the build.
```bash
docker-compose up --build -d
```
To force recreate the images.
```bash
docker-compose up --build --force-recreate -d
```
To stop all containers
```bash
docker-compose stop
```
To display container logs
```bash
$> docker-compose logs
Attaching to nginxverdaccio_nginx_1, verdaccio
verdaccio | warn --- config file - /verdaccio/conf/config.yaml
verdaccio | warn --- http address - http://0.0.0.0:4873/ - verdaccio/2.1.7
verdaccio | http <-- 304, user: undefined, req: 'GET /', bytes: 0/0
verdaccio | http <-- 304, user: undefined, req: 'GET /-/static/jquery.min.js', bytes: 0/0
verdaccio | http <-- 304, user: undefined, req: 'GET /-/static/main.css', bytes: 0/0
verdaccio | http <-- 304, user: undefined, req: 'GET /-/static/main.js', bytes: 0/0
verdaccio | http <-- 304, user: undefined, req: 'GET /-/logo', bytes: 0/0
verdaccio | http <-- 304, user: undefined, req: 'GET /-/static/fontello.woff?10872183', bytes: 0/0
verdaccio | http <-- 200, user: undefined, req: 'GET /-/static/favicon.png', bytes: 0/315
```
### Display Information
To display the containers running
```bash
&> docker-compose ps
Name Command State Ports
----------------------------------------------------------------------------------------
nginxverdaccio_nginx_1 /usr/sbin/nginx Up 0.0.0.0:80->80/tcp
verdaccio /usr/src/app/bin/verdaccio ... Up 0.0.0.0:4873->4873/tcp
```

View file

@ -0,0 +1,32 @@
# Nginx Relative Path
This example runs two verdaccio versions:
- Running `verdaccio:4.x` http://localhost/verdaccio/
- Running the latest `verdaccio:3` http://localhost/verdacciov3/
Note: we should add more sort of configurations here.
**Nginx HTTP Example**
```bash
docker-compose up --build --force-recreate
```
open the browser
```
http://localhost/verdaccio/
```
**Nginx SSL Example**
```bash
docker-compose -f docker-compose_ssl.yml up --build --force-recreate
```
open the browser
```
https://localhost/verdaccio/
```

View file

@ -0,0 +1,49 @@
storage: /verdaccio/storage
web:
enable: true
title: VerdaccioV3 Relative Path
auth:
htpasswd:
file: /verdaccio/conf/htpasswd
security:
api:
jwt:
sign:
expiresIn: 60d
notBefore: 1
web:
sign:
expiresIn: 7d
## IMPORTANT
##
url_prefix: /verdacciov3/
uplinks:
npmjs:
url: https://registry.npmjs.org/
packages:
'@jota/*':
access: $all
publish: $all
'@*/*':
# scoped packages
access: $all
publish: $all
proxy: npmjs
'**':
access: $all
publish: $all
proxy: npmjs
middlewares:
audit:
enabled: true
logs:
- { type: stdout, format: pretty, level: trace }

View file

@ -0,0 +1 @@
test:$6FrCaT/v0dwE:autocreated 2019-05-01T09:29:55.707Z

View file

@ -0,0 +1,50 @@
storage: /verdaccio/storage
web:
enable: true
title: VerdaccioV4 Relative Path
primary_color: red
auth:
htpasswd:
file: /verdaccio/conf/htpasswd
security:
api:
jwt:
sign:
expiresIn: 60d
notBefore: 1
web:
sign:
expiresIn: 7d
## IMPORTANT
##
url_prefix: /verdaccio
uplinks:
npmjs:
url: https://registry.npmjs.org/
packages:
'@jota/*':
access: $all
publish: $all
'@*/*':
# scoped packages
access: $all
publish: $all
proxy: npmjs
'**':
access: $all
publish: $all
proxy: npmjs
middlewares:
audit:
enabled: true
logs:
- { type: stdout, format: pretty, level: trace }

View file

@ -0,0 +1,2 @@
jpicado:$6vkdNgRX2npc:autocreated 2017-07-11T18:48:38.003Z
test:$6FrCaT/v0dwE:autocreated 2019-05-06T22:06:54.513Z

View file

@ -0,0 +1,46 @@
storage: /verdaccio/storage
web:
enable: true
title: VerdaccioV4 Relative Path
primary_color: red
auth:
htpasswd:
file: /verdaccio/conf/htpasswd
security:
api:
jwt:
sign:
expiresIn: 60d
notBefore: 1
web:
sign:
expiresIn: 7d
uplinks:
npmjs:
url: https://registry.npmjs.org/
packages:
'@jota/*':
access: $all
publish: $all
'@*/*':
# scoped packages
access: $all
publish: $all
proxy: npmjs
'**':
access: $all
publish: $all
proxy: npmjs
middlewares:
audit:
enabled: true
logs:
- { type: stdout, format: pretty, level: trace }

View file

@ -0,0 +1 @@
jpicado:$6vkdNgRX2npc:autocreated 2017-07-11T18:48:38.003Z

View file

@ -0,0 +1,56 @@
version: '3.1'
services:
nginx:
build:
context: ''
dockerfile: nginx/Dockerfile
ports:
- '80:80'
networks:
- node-network
container_name: 'nginx'
depends_on:
- verdaccio
- verdaccio3
- verdaccio-root
verdaccio:
image: verdaccio/verdaccio:4
container_name: 'verdaccio_relative_path_v4'
networks:
- node-network
environment:
- VERDACCIO_PORT=4873
ports:
- '4873:4873'
volumes:
- './storage:/verdaccio/storage'
- './conf/v4:/verdaccio/conf'
verdaccio-root:
image: verdaccio/verdaccio:4
container_name: 'verdaccio_relative_path_v4_root'
networks:
- node-network
environment:
- VERDACCIO_PORT=8000
ports:
- '8000:8000'
volumes:
- './storage:/verdaccio/storage'
- './conf/v4_root:/verdaccio/conf'
verdaccio3:
image: verdaccio/verdaccio:3
container_name: 'verdaccio_relative_path_latest_v3'
networks:
- node-network
ports:
- '7771:7771'
environment:
- PORT=7771
volumes:
- './storage:/verdaccio/storage'
- './conf/v3:/verdaccio/conf'
networks:
node-network:
driver: bridge

View file

@ -0,0 +1,46 @@
version: '3.1'
services:
nginx:
build:
context: './nginx_ssl'
dockerfile: Dockerfile
ports:
- '443:443'
- '80:80'
environment:
- REMOTE_URL=http://verdaccio_relative_path_v4:4873/
networks:
- node-network
container_name: 'nginx_ssl'
depends_on:
- verdaccio
- verdaccio-root
verdaccio:
image: verdaccio/verdaccio:4
container_name: 'verdaccio_relative_path_v4'
networks:
- node-network
environment:
- VERDACCIO_PORT=4873
ports:
- '4873:4873'
volumes:
- './storage:/verdaccio/storage'
- './conf/v4:/verdaccio/conf'
verdaccio-root:
image: verdaccio/verdaccio:4
container_name: 'verdaccio_relative_path_v4_root'
networks:
- node-network
environment:
- VERDACCIO_PORT=8000
ports:
- '8000:8000'
volumes:
- './storage:/verdaccio/storage'
- './conf/v4_root:/verdaccio/conf'
networks:
node-network:
driver: bridge

View file

@ -0,0 +1,2 @@
FROM nginx:1.14.2-alpine
COPY nginx/default.conf /etc/nginx/conf.d/default.conf

View file

@ -0,0 +1,49 @@
upstream verdaccio_v4 {
server verdaccio_relative_path_v4:4873;
keepalive 8;
}
upstream verdaccio_v4_root {
server verdaccio_relative_path_v4_root:8000;
keepalive 8;
}
upstream verdaccio_v3 {
server verdaccio_relative_path_latest_v3:7771;
keepalive 8;
}
server {
listen 80 default_server;
access_log /var/log/nginx/verdaccio.log;
charset utf-8;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://verdaccio_v4_root;
proxy_redirect off;
}
location ~ ^/verdaccio/(.*)$ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://verdaccio_v4/$1;
proxy_redirect off;
}
location ~ ^/verdacciov3/(.*)$ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://verdaccio_v3/$1;
proxy_redirect off;
}
}

View file

@ -0,0 +1,10 @@
FROM nginx
COPY cert.crt /etc/nginx/cert.crt
COPY cert.key /etc/nginx/cert.key
COPY nginx-default.conf /etc/nginx/conf.d/default.conf
COPY run.sh /run.sh
ENV REMOTE_URL="http://localhost:8080/"
CMD ["/run.sh"]

View file

@ -0,0 +1,5 @@
Example taken from:
[https://github.com/foxylion/docker-nginx-self-signed-https](https://github.com/foxylion/docker-nginx-self-signed-https)
by [@foxylion](https://github.com/foxylion)

View file

@ -0,0 +1,22 @@
-----BEGIN CERTIFICATE-----
MIIDrzCCApegAwIBAgIJAPVnhyCGRxmMMA0GCSqGSIb3DQEBCwUAMG4xCzAJBgNV
BAYTAlhYMQswCQYDVQQIDAJYWDELMAkGA1UEBwwCWFgxCzAJBgNVBAoMAlhYMQsw
CQYDVQQLDAJYWDESMBAGA1UEAwwJbG9jYWxob3N0MRcwFQYJKoZIhvcNAQkBFghY
WEBYWC5YWDAeFw0xNzExMjQxNDI0MzVaFw0xODExMjQxNDI0MzVaMG4xCzAJBgNV
BAYTAlhYMQswCQYDVQQIDAJYWDELMAkGA1UEBwwCWFgxCzAJBgNVBAoMAlhYMQsw
CQYDVQQLDAJYWDESMBAGA1UEAwwJbG9jYWxob3N0MRcwFQYJKoZIhvcNAQkBFghY
WEBYWC5YWDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANTsFvryPfKK
4CSP58DEVJRDdlsurNz7Z3jbE9RwLmPbyhp+oVZ8gouufLrYxIFxKR0b+JrSbrSh
klvyAov1KcbKSl5W/k4uewgksLV5oWUIM2d6cII+esVNPeRGY6lG3T9nMrjBFC3/
r6HIQpsMiJbfZ0XkHhMFciJ0oVQ+/Y+IeJ2JyjBaXw+3CbCGmTO+4mNVxtHyzz4d
o6mHPASHn+utts+W2/+3/4bSYkJo+/KPxWeF2jyPasv6Kpif+/dJ44gOM+uecBPy
AJx6CCKfGUU9X5EGBynOroFqEY2m7Ndx1uWipfSuULWf9x/LSugC35DfNl+1hXGq
lLJHKI8h+c0CAwEAAaNQME4wHQYDVR0OBBYEFEOBWTm2wyyS3ETaI32FhbTDQ3Hc
MB8GA1UdIwQYMBaAFEOBWTm2wyyS3ETaI32FhbTDQ3HcMAwGA1UdEwQFMAMBAf8w
DQYJKoZIhvcNAQELBQADggEBAGva7AiwB2qSy+Mm1T6m3FkLzUabFStRwkj2TQsz
03E4P2G7j7s9rYdL6hz58kV9UwrWLYeceNioFTn7CxLdn12kHyYC21EO66fuLLaa
nb94GRVJ0IcZOVp+2WgihKM2/WW5WOqhD1NqZp+HUnJkiOCqdgrGj7lfzx1q45wG
NXGplOcGudxb1rLdA8U/kNmGZjCNQsNCdUxUdbqXjeb2piRBbtOnZqOXa2EN9h1/
C89RVuaQt8cQ/bK5QAIeDF/8eyY6B5j00wEa7DSgyRAwJtDU1X2LU6U+04LpU4Iw
sUDO17n2GlI9mPqg0j8EawbbQC70j8rgclDjUE9erf0K7m8=
-----END CERTIFICATE-----

View file

@ -0,0 +1,28 @@
-----BEGIN PRIVATE KEY-----
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDU7Bb68j3yiuAk
j+fAxFSUQ3ZbLqzc+2d42xPUcC5j28oafqFWfIKLrny62MSBcSkdG/ia0m60oZJb
8gKL9SnGykpeVv5OLnsIJLC1eaFlCDNnenCCPnrFTT3kRmOpRt0/ZzK4wRQt/6+h
yEKbDIiW32dF5B4TBXIidKFUPv2PiHidicowWl8PtwmwhpkzvuJjVcbR8s8+HaOp
hzwEh5/rrbbPltv/t/+G0mJCaPvyj8Vnhdo8j2rL+iqYn/v3SeOIDjPrnnAT8gCc
egginxlFPV+RBgcpzq6BahGNpuzXcdbloqX0rlC1n/cfy0roAt+Q3zZftYVxqpSy
RyiPIfnNAgMBAAECggEANohVBmaeiQ0ahSK6N3vRMbvph0b4DQzynlh1xrYIm5jC
NXDzP2RaRw4kcfJsub5SylrMnFKC+g5bnuLn1hKvZXOQAoODVGDBL/+9pm0Fcgvc
pocMY78+0GONE3cXtVYp+kAjFICW+4T95ZCVxoI6RXHoUFUxgqulZL+8RghwBp90
r9X6OWb7e0cq4Msupm7qVTCh9u8X1jTBQ4gE/tny8oiTUW6YCvQlKld0NK1geB1x
BnF4osiOTRe8+6B++kTCf9mon9c6V0Bl1lN5y3znNN1eRMvvDSy554bPy1flo7vo
Z52xluItJwRxNn+brhvFUKqDuMl5D/YX9SGOOJ+PPQKBgQDt7usOECPcsc9Mc0F7
Ol4a3+KQHcp5M8Byc77b87k4gWxNROSOGhOobRRIBsgULkPC32EQ+XhoAcef+VjS
UKU0Rbor7oI5tnl2GuRMGocEzRvU5wa3IjU49ffnYAJty/6Y3wPzmA/sLj0m3Tzo
JTF761UjNQPZwi4wSRgp6jUIGwKBgQDlFv4eP+M4rovgMmUEU50iSkG0Sv8B6FAs
47V8UFSbWuOZ64vVDKNBa6KE3vNDKa0pQfaGyo18I0g2iK7RwkiNc7X8WBLcPEWZ
Vcb3FjjE38XckDA2QKy8cjGF6jwVU1K5OKD3Ujxid4fHuE1Zib04Uzp8Ss+oZlYY
rsTxtUN0NwKBgQCSRvdFjxCtJre+VYFlZA3k0c21Mkt/VhyzgItPKDiwD4lou7kT
z95UBrOYUGsDVSodjT1ctTKcJrP2mtJLgn7+cvuw9JIlLxTfUksWqpxljD/XFS1g
u2wjF70QB0uW+voMO9dvFAZ9+jNoSE2gnvUcLSMLYRV789B3qQhtBGsUDwKBgQCm
RU/fCKOUKitfZ3Ql9cHgd2DEyIHZEpHOYt8AARXHQ+pZdrogwXFkNAjawy5wGrmR
bkzNfAnAhaMN4Zpwp8Ac2lTFd+8IZb5mEfm8sCY3zeo/sW8skThN9du3xFAjcjxi
LpW1q7wkA3lLHZsWV4A8dzvFpk6dfNkURRSwEc2JdQKBgH1n8Io2gnrQd1Yhh5rH
pajY9Pdzp+mv9PW8G1Y7Z57RKxAorYfszmR5Qj2oZ3+0lqJ5+K7K4PffH3CkiCBz
i9HBnq/NczJggQ9BTifIdyznWkuAqZAjup5V+g7+CIhpa+XaeGzB4BpTsXrJFiy0
ZTYk/5J1N3d6rURRlybaoRGj
-----END PRIVATE KEY-----

Some files were not shown because too many files have changed in this diff Show more