mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-12-30 22:34:10 -05:00
chore: website upgrade docusaurus v3 part 1 (#5021)
* chore: migrate website docusaurus * Update pnpm-lock.yaml * Update website.yml * remove plugin * Update pnpm-lock.yaml * reuse docs aws * fix mdx3 issues * Update website.yml
This commit is contained in:
parent
c7325acf3c
commit
fde3e2440b
16 changed files with 5851 additions and 3444 deletions
|
@ -15,7 +15,7 @@
|
|||
"author": "Juan Picado <juanpicado19@gmail.com>",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@crowdin/crowdin-api-client": "1.35.0",
|
||||
"@crowdin/crowdin-api-client": "^1.41.0",
|
||||
"clipanion": "4.0.0-rc.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
8611
pnpm-lock.yaml
8611
pnpm-lock.yaml
File diff suppressed because it is too large
Load diff
|
@ -54,3 +54,126 @@ Note: Fargate doesn't support persistent volumes, so you have to use the S3 stor
|
|||
## EKS {#eks}
|
||||
|
||||
See the documentation pages on [Kubernetes](kubernetes) and [Docker](docker).
|
||||
|
||||
### Deploying Verdaccio on AWS
|
||||
|
||||
## Setup & Configuration {#setup--configuration}
|
||||
|
||||
**Step 1:** Open SSH & Login in using your EC2 key.
|
||||
|
||||
**Step 2:** Install Node Version Manager (nvm) first, close and re-open the SSH using your EC2 key.
|
||||
|
||||
`sudo apt update`
|
||||
|
||||
`wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash`
|
||||
|
||||
`exit`
|
||||
|
||||
**Step 3:** Install Node using Node Version Manager (nvm)
|
||||
|
||||
`nvm install node`
|
||||
|
||||
**Step 4:** Install Verdaccio & pm2, will require to run Verdaccio service in background
|
||||
|
||||
`npm i -g verdaccio pm2`
|
||||
|
||||
**Step 5:** Set the verdaccio registry as a source. By default original NPM registry set.
|
||||
|
||||
`npm set registry http://localhost:4873`
|
||||
|
||||
`npm set ca null`
|
||||
|
||||
**Step 6:** Run Verdaccio and stop it (ctrl+c). It will create a config file we will use.
|
||||
|
||||
`verdaccio`
|
||||
|
||||
**Step 7:** Now do below configuration for listening to all addresses on that server machine / EC2 instance. [(read more)](https://github.com/verdaccio/verdaccio/blob/master/conf/full.yaml)
|
||||
|
||||
Open and edit `config.yaml` file:
|
||||
|
||||
` nano .config/verdaccio/config.yaml` or ` nano ~/verdaccio/config.yaml`
|
||||
|
||||
Add below lines at the end. [(read more)](https://github.com/verdaccio/verdaccio/blob/ff409ab7c05542a152100e3bc39cfadb36a8a080/conf/full.yaml#L113)
|
||||
|
||||
```
|
||||
listen:
|
||||
- 0.0.0.0:4873
|
||||
```
|
||||
|
||||
Change below line so that only authenticated person can access our registry
|
||||
|
||||
`Replace "access: $all" with "access: $authenticated"`
|
||||
|
||||
(Optional) Change below line according to how many users you wish to grant access to the scoped registry
|
||||
|
||||
`Replace "#max_users: 1000" with "max_users: 1"`
|
||||
|
||||
There are some more parameters available to configure it. Like storage, proxy, default port change. [(read more)](https://github.com/verdaccio/verdaccio/blob/ff409ab7c05542a152100e3bc39cfadb36a8a080/conf/full.yaml#L113)
|
||||
|
||||
**Step 8:** Run Verdaccio in background using PM2:
|
||||
|
||||
`pm2 start verdaccio`
|
||||
|
||||
**Step 9:** Now, You can access your Verdaccio web UI.
|
||||
|
||||
The URL will look like something:
|
||||
|
||||
`http://ec2-..compute.amazonaws.com:4873`
|
||||
|
||||
or
|
||||
|
||||
`http://your-ec2-public-ip-address:4873 (You can check your EC2 instance public ip from AWS console)`
|
||||
|
||||
To confirm Verdaccio's running status, run the command below:
|
||||
|
||||
` pm2 list`
|
||||
|
||||
To make Verdaccio launch on startup, run the commands below:
|
||||
|
||||
`pm2 stop verdaccio`
|
||||
|
||||
`pm2 delete verdaccio`
|
||||
|
||||
`pm2 startup` This will show a command in your terminal. Copy / paste it and execute it to have pm2 make a startup service for you.
|
||||
|
||||
`which verdaccio` Copy the path shown by this command.
|
||||
|
||||
`pm2 start /home/ubuntu/.nvm/versions/node/v17.1.0/bin/verdaccio` (put the path you copied from command above).
|
||||
|
||||
`pm2 status` This should show "online" on the status of verdaccio service.
|
||||
|
||||
`pm2 save` Now when you reboot the EC2 instance, it should launch verdaccio.
|
||||
|
||||
**Step 10:** Registering a user in verdaccio registry
|
||||
|
||||
` npm adduser`
|
||||
|
||||
It will ask for username, password and valid email id to be entered. Make a note of this details that will use later to login in verdaccio registry to publish our library.
|
||||
|
||||
**Step 11:** Now we are ready to use our AWS server instance work as a private registry.
|
||||
|
||||
Login into verdaccio registry. Enter the same username, password and email id set in above Step.
|
||||
|
||||
` npm set registry http://your-ec2-public-ip-address:4873`
|
||||
|
||||
` npm login`
|
||||
|
||||
**Step 12:** Go to your custom library package path. In my case this is my Angular 7 package path -> `/libraries/dist/your-library-name/your-library-name-0.0.1.tgz`
|
||||
|
||||
If you like to know how to create angular 7 library/package then [(click here)](https://www.howtoinmagento.com/2019/11/how-to-create-your-first-angular-7.html)
|
||||
|
||||
` cd [custom library package path]`
|
||||
|
||||
**Step 13:** Finally publish our library `your-library-name-0.0.1.tgz` on verdaccio registry
|
||||
|
||||
` [custom library package path] >> npm publish your-library-name-0.0.1.tgz`
|
||||
|
||||
or
|
||||
|
||||
` [custom library package path] >> npm publish`
|
||||
|
||||
or
|
||||
|
||||
` [custom library package path] >> npm publish --registry http://your-ec2-public-ip-address:4873`
|
||||
|
||||
Now browse ` http://your-ec2-public-ip-address:4873` and you will see new library package there.
|
||||
|
|
|
@ -11,10 +11,8 @@ We have a customised solution for `verdaccio` in our organization.
|
|||
|
||||
- Ansible role for Gentoo users: [jirutka/ansible-role-sinopia](https://github.com/jirutka/ansible-role-sinopia).
|
||||
- Ansible role for Ubuntu users: [jagregory/sinopia-ansible](https://github.com/jagregory/sinopia-ansible).
|
||||
- ansible-verdaccio-role [https://github.com/refinery29/ansible-verdaccio-role](https://github.com/refinery29/ansible-verdaccio-role)
|
||||
- [ansible-verdaccio-role]](https://github.com/refinery29/ansible-verdaccio-role)
|
||||
|
||||
#### Related talks {#related-talks}
|
||||
|
||||
> Only in Spanish
|
||||
|
||||
<iframe width="560" height="315" src="https://www.youtube.com/embed/EWAxCgZQMAY?enablejsapi=1" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
# Verdaccio API
|
||||
|
||||
TBA
|
|
@ -1,127 +0,0 @@
|
|||
---
|
||||
id: aws
|
||||
title: 'Amazon Web Services'
|
||||
---
|
||||
|
||||
This document describes simple steps to setup Verdaccio private registry on Amazon Web Services platform using EC2 service. This assumes you have already created an EC2 Amazon Linux instance; if not then please check this tutorial on [AWS EC2 Setup](https://www.howtoinmagento.com/2018/04/aws-cli-commands-for-aws-ec2-amazon.html).
|
||||
|
||||
## Setup & Configuration {#setup--configuration}
|
||||
|
||||
**Step 1:** Open SSH & Login in using your EC2 key.
|
||||
|
||||
**Step 2:** Install Node Version Manager (nvm) first, close and re-open the SSH using your EC2 key.
|
||||
|
||||
`sudo apt update`
|
||||
|
||||
`wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash`
|
||||
|
||||
`exit`
|
||||
|
||||
**Step 3:** Install Node using Node Version Manager (nvm)
|
||||
|
||||
`nvm install node`
|
||||
|
||||
**Step 4:** Install Verdaccio & pm2, will require to run Verdaccio service in background
|
||||
|
||||
`npm i -g verdaccio pm2`
|
||||
|
||||
**Step 5:** Set the verdaccio registry as a source. By default original NPM registry set.
|
||||
|
||||
`npm set registry http://localhost:4873`
|
||||
|
||||
`npm set ca null`
|
||||
|
||||
**Step 6:** Run Verdaccio and stop it (ctrl+c). It will create a config file we will use.
|
||||
|
||||
`verdaccio`
|
||||
|
||||
**Step 7:** Now do below configuration for listening to all addresses on that server machine / EC2 instance. [(read more)](https://github.com/verdaccio/verdaccio/blob/master/conf/full.yaml)
|
||||
|
||||
Open and edit `config.yaml` file:
|
||||
|
||||
` nano .config/verdaccio/config.yaml` or ` nano ~/verdaccio/config.yaml`
|
||||
|
||||
Add below lines at the end. [(read more)](https://github.com/verdaccio/verdaccio/blob/ff409ab7c05542a152100e3bc39cfadb36a8a080/conf/full.yaml#L113)
|
||||
|
||||
```
|
||||
listen:
|
||||
- 0.0.0.0:4873
|
||||
```
|
||||
|
||||
Change below line so that only authenticated person can access our registry
|
||||
|
||||
`Replace "access: $all" with "access: $authenticated"`
|
||||
|
||||
(Optional) Change below line according to how many users you wish to grant access to the scoped registry
|
||||
|
||||
`Replace "#max_users: 1000" with "max_users: 1"`
|
||||
|
||||
There are some more parameters available to configure it. Like storage, proxy, default port change. [(read more)](https://github.com/verdaccio/verdaccio/blob/ff409ab7c05542a152100e3bc39cfadb36a8a080/conf/full.yaml#L113)
|
||||
|
||||
**Step 8:** Run Verdaccio in background using PM2:
|
||||
|
||||
`pm2 start verdaccio`
|
||||
|
||||
**Step 9:** Now, You can access your Verdaccio web UI.
|
||||
|
||||
The URL will look like something:
|
||||
|
||||
`http://ec2-..compute.amazonaws.com:4873`
|
||||
|
||||
{or}
|
||||
|
||||
`http://your-ec2-public-ip-address:4873 (You can check your EC2 instance public ip from AWS console)`
|
||||
|
||||
To confirm Verdaccio's running status, run the command below:
|
||||
|
||||
` pm2 list`
|
||||
|
||||
To make Verdaccio launch on startup, run the commands below:
|
||||
|
||||
`pm2 stop verdaccio`
|
||||
|
||||
`pm2 delete verdaccio`
|
||||
|
||||
`pm2 startup` This will show a command in your terminal. Copy / paste it and execute it to have pm2 make a startup service for you.
|
||||
|
||||
`which verdaccio` Copy the path shown by this command.
|
||||
|
||||
`pm2 start /home/ubuntu/.nvm/versions/node/v17.1.0/bin/verdaccio` (put the path you copied from command above).
|
||||
|
||||
`pm2 status` This should show "online" on the status of verdaccio service.
|
||||
|
||||
`pm2 save` Now when you reboot the EC2 instance, it should launch verdaccio.
|
||||
|
||||
**Step 10:** Registering a user in verdaccio registry
|
||||
|
||||
` npm adduser`
|
||||
|
||||
It will ask for username, password and valid email id to be entered. Make a note of this details that will use later to login in verdaccio registry to publish our library.
|
||||
|
||||
**Step 11:** Now we are ready to use our AWS server instance work as a private registry.
|
||||
|
||||
Login into verdaccio registry. Enter the same username, password and email id set in above Step.
|
||||
|
||||
` npm set registry http://your-ec2-public-ip-address:4873`
|
||||
|
||||
` npm login`
|
||||
|
||||
**Step 12:** Go to your custom library package path. In my case this is my Angular 7 package path -> `/libraries/dist/your-library-name/your-library-name-0.0.1.tgz`
|
||||
|
||||
If you like to know how to create angular 7 library/package then [(click here)](https://www.howtoinmagento.com/2019/11/how-to-create-your-first-angular-7.html)
|
||||
|
||||
` cd [custom library package path]`
|
||||
|
||||
**Step 13:** Finally publish our library `your-library-name-0.0.1.tgz` on verdaccio registry
|
||||
|
||||
` [custom library package path] >> npm publish your-library-name-0.0.1.tgz`
|
||||
|
||||
{or}
|
||||
|
||||
` [custom library package path] >> npm publish`
|
||||
|
||||
{or}
|
||||
|
||||
` [custom library package path] >> npm publish --registry http://your-ec2-public-ip-address:4873`
|
||||
|
||||
Now browse ` http://your-ec2-public-ip-address:4873` and you will see new library package there.
|
|
@ -61,7 +61,7 @@ We use [Handlebars](https://handlebarsjs.com/) as main template engine.
|
|||
|
||||
### Properties {#properties}
|
||||
|
||||
List of properties accesible via template
|
||||
List of properties accesible via template:
|
||||
|
||||
- Metadata
|
||||
- Publisher (who is publishing)
|
||||
|
|
|
@ -19,6 +19,10 @@ const progress = translations;
|
|||
const limitLngIncluded = 80;
|
||||
console.log('limit translation is on %s%', limitLngIncluded);
|
||||
|
||||
const { themes } = require('prism-react-renderer');
|
||||
const lightTheme = themes.github;
|
||||
const darkTheme = themes.dracula;
|
||||
|
||||
const isProductionDeployment = process.env.CONTEXT === 'production';
|
||||
const filterByProgress = (items) => {
|
||||
const originLng = Object.keys(translations);
|
||||
|
@ -104,30 +108,6 @@ module.exports = {
|
|||
plugins: [
|
||||
'docusaurus-plugin-sass',
|
||||
'docusaurus-plugin-contributors',
|
||||
isProductionDeployment &&
|
||||
typeof process.env.SENTRY_KEY === 'string' && [
|
||||
'docusaurus-plugin-sentry',
|
||||
{ DSN: process.env.SENTRY_KEY },
|
||||
],
|
||||
[
|
||||
'docusaurus-plugin-typedoc',
|
||||
{
|
||||
entryPoints: ['../packages/node-api/src/index.ts'],
|
||||
tsconfig: '../packages/node-api/tsconfig.build.json',
|
||||
id: 'api/node-api',
|
||||
out: 'api/node-api',
|
||||
// theme: 'default',
|
||||
excludePrivate: false,
|
||||
excludeProtected: true,
|
||||
categorizeByGroup: false,
|
||||
excludeInternal: true,
|
||||
sidebar: {
|
||||
categoryLabel: '@verdaccio/node-api',
|
||||
// position: 1,
|
||||
fullNames: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
[
|
||||
'content-docs',
|
||||
{
|
||||
|
@ -158,61 +138,6 @@ module.exports = {
|
|||
showLastUpdateTime: true,
|
||||
},
|
||||
],
|
||||
[
|
||||
'docusaurus-plugin-typedoc',
|
||||
{
|
||||
entryPoints: ['../packages/config/src/index.ts'],
|
||||
tsconfig: '../packages/config/tsconfig.build.json',
|
||||
id: 'api/config',
|
||||
out: 'api/config',
|
||||
sidebar: {
|
||||
categoryLabel: '@verdaccio/config',
|
||||
fullNames: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
[
|
||||
'docusaurus-plugin-typedoc',
|
||||
{
|
||||
entryPoints: ['../packages/ui-components/src/index.ts'],
|
||||
tsconfig: '../packages/ui-components/tsconfig.build.json',
|
||||
id: 'api/ui-components',
|
||||
out: 'api/ui-components',
|
||||
sidebar: {
|
||||
categoryLabel: '@verdaccio/ui-components',
|
||||
fullNames: true,
|
||||
watch: process.env.TYPEDOC_WATCH,
|
||||
},
|
||||
},
|
||||
],
|
||||
[
|
||||
'docusaurus-plugin-typedoc',
|
||||
{
|
||||
entryPoints: ['../packages/core/core/src/index.ts'],
|
||||
tsconfig: '../packages/core/core/tsconfig.build.json',
|
||||
id: 'api/core',
|
||||
out: 'api/core',
|
||||
sidebar: {
|
||||
categoryLabel: '@verdaccio/core',
|
||||
fullNames: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
[
|
||||
'docusaurus-plugin-typedoc',
|
||||
{
|
||||
entryPoints: ['../packages/core/types/src/types.ts'],
|
||||
tsconfig: '../packages/core/types/tsconfig.build.json',
|
||||
id: 'api/types',
|
||||
out: 'api/types',
|
||||
categorizeByGroup: false,
|
||||
includeVersion: true,
|
||||
sidebar: {
|
||||
categoryLabel: '@verdaccio/types',
|
||||
fullNames: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
],
|
||||
markdown: {
|
||||
mermaid: true,
|
||||
|
@ -395,8 +320,8 @@ module.exports = {
|
|||
respectPrefersColorScheme: true,
|
||||
},
|
||||
prism: {
|
||||
theme: require('prism-react-renderer/themes/github'),
|
||||
darkTheme: require('prism-react-renderer/themes/nightOwl'),
|
||||
theme: lightTheme,
|
||||
darkTheme: darkTheme,
|
||||
},
|
||||
},
|
||||
presets: [
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
{
|
||||
"private": true,
|
||||
"name": "@verdaccio/website",
|
||||
"version": "6.0.1-next-8.4",
|
||||
"version": "1.0.0",
|
||||
"scripts": {
|
||||
"docusaurus": "docusaurus",
|
||||
"start": "docusaurus start --no-open",
|
||||
"start:typedoc": "TYPEDOC_WATCH=true docusaurus start --no-open",
|
||||
"build": "docusaurus build",
|
||||
"swizzle": "docusaurus swizzle",
|
||||
"deploy": "docusaurus deploy",
|
||||
|
@ -18,47 +17,38 @@
|
|||
"eslint:check": "eslint src/**/*.tsx",
|
||||
"eslint:write": "eslint src/**/*.tsx --fix"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"dependencies": {
|
||||
"@docusaurus/core": "2.4.3",
|
||||
"@docusaurus/plugin-content-docs": "2.4.3",
|
||||
"@docusaurus/plugin-google-analytics": "2.4.3",
|
||||
"@docusaurus/preset-classic": "2.4.3",
|
||||
"@docusaurus/remark-plugin-npm2yarn": "2.4.3",
|
||||
"@docusaurus/theme-common": "2.4.3",
|
||||
"@docusaurus/theme-mermaid": "2.4.3",
|
||||
"@docusaurus/theme-search-algolia": "2.4.3",
|
||||
"@docusaurus/core": "3.6.3",
|
||||
"@docusaurus/plugin-content-docs": "3.6.3",
|
||||
"@docusaurus/plugin-google-analytics": "3.6.3",
|
||||
"@docusaurus/preset-classic": "3.6.3",
|
||||
"@docusaurus/remark-plugin-npm2yarn": "3.6.3",
|
||||
"@docusaurus/theme-common": "3.6.3",
|
||||
"@docusaurus/theme-mermaid": "3.6.3",
|
||||
"@docusaurus/theme-search-algolia": "3.6.3",
|
||||
"@emotion/cache": "11.10.7",
|
||||
"@emotion/css": "11.13.0",
|
||||
"@emotion/react": "11.10.6",
|
||||
"@emotion/styled": "11.10.6",
|
||||
"@mdx-js/react": "^1.6.22",
|
||||
"@mdx-js/react": "3.1.0",
|
||||
"@mui/icons-material": "5.16.5",
|
||||
"@mui/material": "5.16.5",
|
||||
"@mui/styles": "5.16.5",
|
||||
"@orama/orama": "1.2.4",
|
||||
"@verdaccio/ui-components": "workspace:4.0.0-next-8.4",
|
||||
"classnames": "2.5.1",
|
||||
"clsx": "1.2.1",
|
||||
"clsx": "2.1.1",
|
||||
"copy-text-to-clipboard": "3.2.0",
|
||||
"docusaurus-plugin-contributors": "workspace:2.0.0",
|
||||
"docusaurus-plugin-sentry": "1.0.0",
|
||||
"docusaurus-plugin-typedoc": "0.18.0",
|
||||
"dompurify": "3.1.6",
|
||||
"p-cancelable": "2.1.1",
|
||||
"react": "17.0.2",
|
||||
"react-dom": "17.0.2",
|
||||
"dompurify": "3.2.3",
|
||||
"p-cancelable": "4.0.1",
|
||||
"react": "18.3.1",
|
||||
"react-dom": "18.3.1",
|
||||
"react-iframe": "1.8.5",
|
||||
"react-player": "2.14.1",
|
||||
"react-twitter-widgets": "^1.10.0",
|
||||
"typedoc": "0.23.25",
|
||||
"typedoc-github-wiki-theme": "^1.0.1",
|
||||
"typedoc-plugin-markdown": "3.14.0",
|
||||
"typedoc-plugin-merge-modules": "4.0.1",
|
||||
"use-is-in-viewport": "^1.0.9",
|
||||
"usehooks-ts": "2.16.0"
|
||||
"use-is-in-viewport": "1.0.9",
|
||||
"usehooks-ts": "3.1.0"
|
||||
},
|
||||
"browserslist": {
|
||||
"production": [
|
||||
|
@ -73,15 +63,15 @@
|
|||
]
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/module-type-aliases": "2.4.3",
|
||||
"@tsconfig/docusaurus": "^1.0.2",
|
||||
"@docusaurus/module-type-aliases": "3.6.3",
|
||||
"@tsconfig/docusaurus": "^2.0.3",
|
||||
"@verdaccio/crowdin-translations": "workspace:*",
|
||||
"docusaurus-plugin-sass": "^0.2.1",
|
||||
"docusaurus-plugin-sass": "^0.2.6",
|
||||
"esbuild": "0.14.10",
|
||||
"esbuild-loader": "2.16.0",
|
||||
"prism-react-renderer": "^1.2.1",
|
||||
"sass": "1.70.0",
|
||||
"sass-loader": "^12.1.0",
|
||||
"prism-react-renderer": "^2.4.1",
|
||||
"sass": "1.83.0",
|
||||
"sass-loader": "16.0.4",
|
||||
"url-loader": "4.1.1"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -103,22 +103,5 @@ module.exports = {
|
|||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
type: 'category',
|
||||
label: 'Guides',
|
||||
items: ['aws'],
|
||||
},
|
||||
],
|
||||
api: [
|
||||
{
|
||||
type: 'category',
|
||||
label: 'API Reference',
|
||||
items: [
|
||||
{
|
||||
type: 'autogenerated',
|
||||
dirName: 'api',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
|
|
@ -54,3 +54,126 @@ Note: Fargate doesn't support persistent volumes, so you have to use the S3 stor
|
|||
## EKS {#eks}
|
||||
|
||||
See the documentation pages on [Kubernetes](kubernetes) and [Docker](docker).
|
||||
|
||||
### Deploying Verdaccio on AWS
|
||||
|
||||
## Setup & Configuration {#setup--configuration}
|
||||
|
||||
**Step 1:** Open SSH & Login in using your EC2 key.
|
||||
|
||||
**Step 2:** Install Node Version Manager (nvm) first, close and re-open the SSH using your EC2 key.
|
||||
|
||||
`sudo apt update`
|
||||
|
||||
`wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash`
|
||||
|
||||
`exit`
|
||||
|
||||
**Step 3:** Install Node using Node Version Manager (nvm)
|
||||
|
||||
`nvm install node`
|
||||
|
||||
**Step 4:** Install Verdaccio & pm2, will require to run Verdaccio service in background
|
||||
|
||||
`npm i -g verdaccio pm2`
|
||||
|
||||
**Step 5:** Set the verdaccio registry as a source. By default original NPM registry set.
|
||||
|
||||
`npm set registry http://localhost:4873`
|
||||
|
||||
`npm set ca null`
|
||||
|
||||
**Step 6:** Run Verdaccio and stop it (ctrl+c). It will create a config file we will use.
|
||||
|
||||
`verdaccio`
|
||||
|
||||
**Step 7:** Now do below configuration for listening to all addresses on that server machine / EC2 instance. [(read more)](https://github.com/verdaccio/verdaccio/blob/master/conf/full.yaml)
|
||||
|
||||
Open and edit `config.yaml` file:
|
||||
|
||||
` nano .config/verdaccio/config.yaml` or ` nano ~/verdaccio/config.yaml`
|
||||
|
||||
Add below lines at the end. [(read more)](https://github.com/verdaccio/verdaccio/blob/ff409ab7c05542a152100e3bc39cfadb36a8a080/conf/full.yaml#L113)
|
||||
|
||||
```
|
||||
listen:
|
||||
- 0.0.0.0:4873
|
||||
```
|
||||
|
||||
Change below line so that only authenticated person can access our registry
|
||||
|
||||
`Replace "access: $all" with "access: $authenticated"`
|
||||
|
||||
(Optional) Change below line according to how many users you wish to grant access to the scoped registry
|
||||
|
||||
`Replace "#max_users: 1000" with "max_users: 1"`
|
||||
|
||||
There are some more parameters available to configure it. Like storage, proxy, default port change. [(read more)](https://github.com/verdaccio/verdaccio/blob/ff409ab7c05542a152100e3bc39cfadb36a8a080/conf/full.yaml#L113)
|
||||
|
||||
**Step 8:** Run Verdaccio in background using PM2:
|
||||
|
||||
`pm2 start verdaccio`
|
||||
|
||||
**Step 9:** Now, You can access your Verdaccio web UI.
|
||||
|
||||
The URL will look like something:
|
||||
|
||||
`http://ec2-..compute.amazonaws.com:4873`
|
||||
|
||||
or
|
||||
|
||||
`http://your-ec2-public-ip-address:4873 (You can check your EC2 instance public ip from AWS console)`
|
||||
|
||||
To confirm Verdaccio's running status, run the command below:
|
||||
|
||||
` pm2 list`
|
||||
|
||||
To make Verdaccio launch on startup, run the commands below:
|
||||
|
||||
`pm2 stop verdaccio`
|
||||
|
||||
`pm2 delete verdaccio`
|
||||
|
||||
`pm2 startup` This will show a command in your terminal. Copy / paste it and execute it to have pm2 make a startup service for you.
|
||||
|
||||
`which verdaccio` Copy the path shown by this command.
|
||||
|
||||
`pm2 start /home/ubuntu/.nvm/versions/node/v17.1.0/bin/verdaccio` (put the path you copied from command above).
|
||||
|
||||
`pm2 status` This should show "online" on the status of verdaccio service.
|
||||
|
||||
`pm2 save` Now when you reboot the EC2 instance, it should launch verdaccio.
|
||||
|
||||
**Step 10:** Registering a user in verdaccio registry
|
||||
|
||||
` npm adduser`
|
||||
|
||||
It will ask for username, password and valid email id to be entered. Make a note of this details that will use later to login in verdaccio registry to publish our library.
|
||||
|
||||
**Step 11:** Now we are ready to use our AWS server instance work as a private registry.
|
||||
|
||||
Login into verdaccio registry. Enter the same username, password and email id set in above Step.
|
||||
|
||||
` npm set registry http://your-ec2-public-ip-address:4873`
|
||||
|
||||
` npm login`
|
||||
|
||||
**Step 12:** Go to your custom library package path. In my case this is my Angular 7 package path -> `/libraries/dist/your-library-name/your-library-name-0.0.1.tgz`
|
||||
|
||||
If you like to know how to create angular 7 library/package then [(click here)](https://www.howtoinmagento.com/2019/11/how-to-create-your-first-angular-7.html)
|
||||
|
||||
` cd [custom library package path]`
|
||||
|
||||
**Step 13:** Finally publish our library `your-library-name-0.0.1.tgz` on verdaccio registry
|
||||
|
||||
` [custom library package path] >> npm publish your-library-name-0.0.1.tgz`
|
||||
|
||||
or
|
||||
|
||||
` [custom library package path] >> npm publish`
|
||||
|
||||
or
|
||||
|
||||
` [custom library package path] >> npm publish --registry http://your-ec2-public-ip-address:4873`
|
||||
|
||||
Now browse ` http://your-ec2-public-ip-address:4873` and you will see new library package there.
|
||||
|
|
|
@ -11,10 +11,8 @@ We have a customised solution for `verdaccio` in our organization.
|
|||
|
||||
- Ansible role for Gentoo users: [jirutka/ansible-role-sinopia](https://github.com/jirutka/ansible-role-sinopia).
|
||||
- Ansible role for Ubuntu users: [jagregory/sinopia-ansible](https://github.com/jagregory/sinopia-ansible).
|
||||
- ansible-verdaccio-role [https://github.com/refinery29/ansible-verdaccio-role](https://github.com/refinery29/ansible-verdaccio-role)
|
||||
- [ansible-verdaccio-role]](https://github.com/refinery29/ansible-verdaccio-role)
|
||||
|
||||
#### Related talks {#related-talks}
|
||||
|
||||
> Only in Spanish
|
||||
|
||||
<iframe width="560" height="315" src="https://www.youtube.com/embed/EWAxCgZQMAY?enablejsapi=1" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
# 5.x API
|
||||
# 6.x API
|
||||
|
||||
Go to [Node-API](https://verdaccio.org/docs/verdaccio-programmatically).
|
||||
|
|
|
@ -1,127 +0,0 @@
|
|||
---
|
||||
id: aws
|
||||
title: 'Amazon Web Services'
|
||||
---
|
||||
|
||||
This document describes simple steps to setup Verdaccio private registry on Amazon Web Services platform using EC2 service. This assumes you have already created an EC2 Amazon Linux instance; if not then please check this tutorial on [AWS EC2 Setup](https://www.howtoinmagento.com/2018/04/aws-cli-commands-for-aws-ec2-amazon.html).
|
||||
|
||||
## Setup & Configuration {#setup--configuration}
|
||||
|
||||
**Step 1:** Open SSH & Login in using your EC2 key.
|
||||
|
||||
**Step 2:** Install Node Version Manager (nvm) first, close and re-open the SSH using your EC2 key.
|
||||
|
||||
`sudo apt update`
|
||||
|
||||
`wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash`
|
||||
|
||||
`exit`
|
||||
|
||||
**Step 3:** Install Node using Node Version Manager (nvm)
|
||||
|
||||
`nvm install node`
|
||||
|
||||
**Step 4:** Install Verdaccio & pm2, will require to run Verdaccio service in background
|
||||
|
||||
`npm i -g verdaccio pm2`
|
||||
|
||||
**Step 5:** Set the verdaccio registry as a source. By default original NPM registry set.
|
||||
|
||||
`npm set registry http://localhost:4873`
|
||||
|
||||
`npm set ca null`
|
||||
|
||||
**Step 6:** Run Verdaccio and stop it (ctrl+c). It will create a config file we will use.
|
||||
|
||||
`verdaccio`
|
||||
|
||||
**Step 7:** Now do below configuration for listening to all addresses on that server machine / EC2 instance. [(read more)](https://github.com/verdaccio/verdaccio/blob/master/conf/full.yaml)
|
||||
|
||||
Open and edit `config.yaml` file:
|
||||
|
||||
` nano .config/verdaccio/config.yaml` or ` nano ~/verdaccio/config.yaml`
|
||||
|
||||
Add below lines at the end. [(read more)](https://github.com/verdaccio/verdaccio/blob/ff409ab7c05542a152100e3bc39cfadb36a8a080/conf/full.yaml#L113)
|
||||
|
||||
```
|
||||
listen:
|
||||
- 0.0.0.0:4873
|
||||
```
|
||||
|
||||
Change below line so that only authenticated person can access our registry
|
||||
|
||||
`Replace "access: $all" with "access: $authenticated"`
|
||||
|
||||
(Optional) Change below line according to how many users you wish to grant access to the scoped registry
|
||||
|
||||
`Replace "#max_users: 1000" with "max_users: 1"`
|
||||
|
||||
There are some more parameters available to configure it. Like storage, proxy, default port change. [(read more)](https://github.com/verdaccio/verdaccio/blob/ff409ab7c05542a152100e3bc39cfadb36a8a080/conf/full.yaml#L113)
|
||||
|
||||
**Step 8:** Run Verdaccio in background using PM2:
|
||||
|
||||
`pm2 start verdaccio`
|
||||
|
||||
**Step 9:** Now, You can access your Verdaccio web UI.
|
||||
|
||||
The URL will look like something:
|
||||
|
||||
`http://ec2-..compute.amazonaws.com:4873`
|
||||
|
||||
{or}
|
||||
|
||||
`http://your-ec2-public-ip-address:4873 (You can check your EC2 instance public ip from AWS console)`
|
||||
|
||||
To confirm Verdaccio's running status, run the command below:
|
||||
|
||||
` pm2 list`
|
||||
|
||||
To make Verdaccio launch on startup, run the commands below:
|
||||
|
||||
`pm2 stop verdaccio`
|
||||
|
||||
`pm2 delete verdaccio`
|
||||
|
||||
`pm2 startup` This will show a command in your terminal. Copy / paste it and execute it to have pm2 make a startup service for you.
|
||||
|
||||
`which verdaccio` Copy the path shown by this command.
|
||||
|
||||
`pm2 start /home/ubuntu/.nvm/versions/node/v17.1.0/bin/verdaccio` (put the path you copied from command above).
|
||||
|
||||
`pm2 status` This should show "online" on the status of verdaccio service.
|
||||
|
||||
`pm2 save` Now when you reboot the EC2 instance, it should launch verdaccio.
|
||||
|
||||
**Step 10:** Registering a user in verdaccio registry
|
||||
|
||||
` npm adduser`
|
||||
|
||||
It will ask for username, password and valid email id to be entered. Make a note of this details that will use later to login in verdaccio registry to publish our library.
|
||||
|
||||
**Step 11:** Now we are ready to use our AWS server instance work as a private registry.
|
||||
|
||||
Login into verdaccio registry. Enter the same username, password and email id set in above Step.
|
||||
|
||||
` npm set registry http://your-ec2-public-ip-address:4873`
|
||||
|
||||
` npm login`
|
||||
|
||||
**Step 12:** Go to your custom library package path. In my case this is my Angular 7 package path -> `/libraries/dist/your-library-name/your-library-name-0.0.1.tgz`
|
||||
|
||||
If you like to know how to create angular 7 library/package then [(click here)](https://www.howtoinmagento.com/2019/11/how-to-create-your-first-angular-7.html)
|
||||
|
||||
` cd [custom library package path]`
|
||||
|
||||
**Step 13:** Finally publish our library `your-library-name-0.0.1.tgz` on verdaccio registry
|
||||
|
||||
` [custom library package path] >> npm publish your-library-name-0.0.1.tgz`
|
||||
|
||||
{or}
|
||||
|
||||
` [custom library package path] >> npm publish`
|
||||
|
||||
{or}
|
||||
|
||||
` [custom library package path] >> npm publish --registry http://your-ec2-public-ip-address:4873`
|
||||
|
||||
Now browse ` http://your-ec2-public-ip-address:4873` and you will see new library package there.
|
|
@ -61,7 +61,7 @@ We use [Handlebars](https://handlebarsjs.com/) as main template engine.
|
|||
|
||||
### Properties {#properties}
|
||||
|
||||
List of properties accesible via template
|
||||
List of properties accesible via template:
|
||||
|
||||
- Metadata
|
||||
- Publisher (who is publishing)
|
||||
|
|
|
@ -89,11 +89,6 @@
|
|||
"items": ["ansible", "puppet", "chef"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "category",
|
||||
"label": "Guides",
|
||||
"items": ["aws"]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue