Skip to content

Commit

Permalink
Merged in r2-2584-docs-enable-push-notifications (pull request #6511)
Browse files Browse the repository at this point in the history
R2-2584 Enable push notifications docs
  • Loading branch information
aespinoza-quoin authored and pnabutovsky committed Sep 21, 2023
2 parents 80a5dc5 + 60ab014 commit 2550d96
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ You can login with a preseeded admin account with credentials `primero`/`primer0
For more on making code contributions, have a look at the file [CONTRIBUTING.md](CONTRIBUTING.md).

### Using WebPush
To send push messages to web browsers you can enable webpush. For this, is required set some environment variables: `PRIMERO_WEBPUSH`, `PRIMERO_WEBPUSH_VAPID_PRIVATE` and `PRIMERO_WEBPUSH_VAPID_PUBLIC`
To send push messages to web browsers you can enable webpush. For this, is required set some environment variables: `PRIMERO_WEBPUSH`, `PRIMERO_WEBPUSH_VAPID_PRIVATE` and `PRIMERO_WEBPUSH_VAPID_PUBLIC`.
PRIMERO_WEBPUSH must be placed in `inventory` file, the other two must be in `secret.yml` file.

To generate a valid VAPID key, you can execute the follow script and use for each variable

Expand Down
7 changes: 5 additions & 2 deletions ansible/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ LC_ALL=C < /dev/urandom tr -dc '_A-Z-a-z-0-9' | head -c"${1:-32}"

You also have the option of creating a variable for a private ssh key in order to clone configuration files from a private repo. If you will not be including the private ssh
key just leave the variable `ssh_private_key` out of the secrets.yml file.
```
---
primero_secret_key_base: 'generated_secret'
primero_message_secret: 'generated_secret'
Expand All @@ -207,6 +208,8 @@ key just leave the variable `ssh_private_key` out of the secrets.yml file.
secret_environment_variables:
SMTP_USER: 'secret'
SMTP_PASSWORD: 'secret'
PRIMERO_WEBPUSH_VAPID_PRIVATE: 'secret'
PRIMERO_WEBPUSH_VAPID_PUBLIC: 'secret'
ssh_private_key: |
-----BEGIN RSA PRIVATE KEY-----
klkdl;fk;lskdflkds;kf;kdsl;afkldsakf;kasd;f
Expand All @@ -222,10 +225,10 @@ key just leave the variable `ssh_private_key` out of the secrets.yml file.
klkdl;fk;lskdflkds;kf;kdsl;afkldsakf;kasd;f
afdnfdsnfjkndsfdsjkfjkdsjkfjdskljflajdfjdsl
-----END CERTIFICATE-----

```
The variables in the `inventory.yml` along with the `secrets.yml` will also be used to make the `local.env` file for the dokcer-compose files.

The optional dictionary `secret_environment_variables` can contain key/value pairs of secret environment variables. It can be used in conjuunction with the optional `environment_variables` dictionary in the inventory file, and will override those values. A good use of this dictionary is to specify SMTP settings.
The optional dictionary `secret_environment_variables` can contain key/value pairs of secret environment variables. It can be used in conjuunction with the optional `environment_variables` dictionary in the inventory file, and will override those values. A good use of this dictionary is to specify SMTP settings. Here we can add PRIMERO_WEBPUSH_VAPID_PRIVATE and PRIMERO_WEBPUSH_VAPID_PUBLIC, these keys together with PRIMERO_WEBPUSH allow us to enable webpush notifications. To generate VAPID keys follow the instruction in [README.md](../README.md) file. if we are enabling Webpush on an existing server, we must modify the `inventory.yml` and `secrets.yml` with the 3 variables, then re-execute the ansible command `local-env`

## Config promotion

Expand Down
2 changes: 2 additions & 0 deletions ansible/inventory/inventory.yml.template
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ all:
RUN_DEFAULT_PRIMERO_SEEDS: 'false' # Set to true if you want to run default seeds
PRIMERO_DEFAULT_USERS: 'true' # Seed default users when using the managed Primero SaaS configs
# LOCALE_DEFAULT: 'ar' # Optionally override English as the default locale.
PRIMERO_WEBPUSH: 'true'
PRIMERO_WEBPUSH_CONTACT: '[email protected]'

0 comments on commit 2550d96

Please sign in to comment.