From 9652ae01d041a4545e3bd81976a44289785823bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorben=20G=C3=BCnther?= Date: Mon, 3 Jul 2023 15:19:21 +0200 Subject: [PATCH] ntfy_server: Update config 2.6.2 release. Enable web push notifications. --- roles/ntfy_server/tasks/main.yml | 1 + roles/ntfy_server/templates/server.yml.j2 | 26 +++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/roles/ntfy_server/tasks/main.yml b/roles/ntfy_server/tasks/main.yml index ed079e1..74fab8a 100644 --- a/roles/ntfy_server/tasks/main.yml +++ b/roles/ntfy_server/tasks/main.yml @@ -2,6 +2,7 @@ - name: Get secrets ansible.builtin.set_fact: email_secrets: "{{ lookup('community.hashi_vault.hashi_vault', 'ansible/data/email') }}" + ntfy_secrets: "{{ lookup('community.hashi_vault.hashi_vault', 'ansible/data/ntfy') }}" - name: Install community.general.pacman: diff --git a/roles/ntfy_server/templates/server.yml.j2 b/roles/ntfy_server/templates/server.yml.j2 index 4464625..d1b44fe 100644 --- a/roles/ntfy_server/templates/server.yml.j2 +++ b/roles/ntfy_server/templates/server.yml.j2 @@ -154,6 +154,32 @@ smtp-sender-pass: {{ email_secrets['noreply_password'] }} # smtp-server-domain: # smtp-server-addr-prefix: +# Web Push support (background notifications for browsers) +# +# If enabled, allows ntfy to receive push notifications, even when the ntfy web app is closed. When enabled, users +# can enable background notifications in the web app. Once enabled, ntfy will forward published messages to the push +# endpoint, which will then forward it to the browser. +# +# You must configure web-push-public/private key, web-push-file, and web-push-email-address below to enable Web Push. +# Run "ntfy webpush keys" to generate the keys. +# +# - web-push-public-key is the generated VAPID public key, e.g. AA1234BBCCddvveekaabcdfqwertyuiopasdfghjklzxcvbnm1234567890 +# - web-push-private-key is the generated VAPID private key, e.g. AA2BB1234567890abcdefzxcvbnm1234567890 +# - web-push-file is a database file to keep track of browser subscription endpoints, e.g. `/var/cache/ntfy/webpush.db` +# - web-push-email-address is the admin email address send to the push provider, e.g. `sysadmin@example.com` +# - web-push-startup-queries is an optional list of queries to run on startup` +# +web-push-public-key: {{ ntfy_secrets['WebPushPublicKey'] }} +web-push-private-key: {{ ntfy_secrets['WebPushPrivateKey'] }} +web-push-file: /var/lib/ntfy/webpush.db +web-push-email-address: {{ ntfy_secrets['WebPushEmail'] }} +web-push-startup-queries: | + pragma journal_mode = WAL; + pragma synchronous = normal; + pragma temp_store = memory; + pragma busy_timeout = 15000; + vacuum; + # If enabled, ntfy can perform voice calls via Twilio via the "X-Call" header. # # - twilio-account is the Twilio account SID, e.g. AC12345beefbeef67890beefbeef122586 -- 2.44.0