Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] add a docker method to generating VAPID keypair #102

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,16 @@ When exposing your self-hosted Huly deployment to the internet, it's crucial to

## Generating Public and Private VAPID keys for front-end

You'll need `Node.js` installed on your machine. Installing `npm` on Debian based distro:
A VAPID key pair allows your self-hosted application server to deliver Web Push Notifications to your clients via push services.

### Generate the VAPID keys

A VAPID key pair can be generated by a plethora of methods, use whichever method is most convenient for you.\
Some example methods are provided below.

#### Using `Node.js` on your machine to generate VAPID keys:

Install `npm` on Debian based distro:
```
sudo apt-get install npm
```
Expand All @@ -72,6 +81,26 @@ asdfsadfasdfsfd

=======================================
```

#### Using `Node.js` in Docker to generate VAPID keys:
Run this docker one-liner to generate a VAPID key pair:
```
docker run --rm node npm exec --package=web-push -- web-push generate-vapid-keys
```
It will generate both keys that looks like this:
```
=======================================

Public Key:
sdfgsdgsdfgsdfggsdf

Private Key:
asdfsadfasdfsfd

=======================================
```

### Store your VAPID keys
Keep these keys secure, as you will need them to set up your push notification service on the server.

Add these keys into `compose.yaml` in section `services:front:environment`:
Expand Down