A short guide to teach you how to setup Matrix push notification service using ntfy in air gapped environment. This guide is divided by the programs you should run and configure. There is a assumption that you have already setup an synapse server.
To setup ntfy, you need to create a configuration file named /etc/ntfy/server.yml and place this inside it:
base-url: "https://ntfy.example.com"
behind-proxy: true # only set true if you are behind nginx or caddy
cache-file: "/data/cache.db"Run ntfy with this command:
docker run -d --name ntfy --mount type=volume,src=ntfy-data,dst=/data -v /etc/ntfy/server.yml:/etc/ntfy/server.yml --restart=unless-stopped -p 127.0.0.1:12345:80 -it binwiederhier/ntfy:v2.22 serveIf you are behind Caddy or Nginx, remember to setup a reverse proxy to 127.0.0.1:12345.
If both ntfy and synapse server are on the same private node, I suggest you manually resolve the address of the ntfy server in synapse container. This can be done by adding --add-host "ntfy.example.com:192.168.1.10" to synapse docker run arguments. Additionally, if ntfy is on a private address, you should whitelist the address by adding this to your homeserver configuration file of Synapse:
ip_range_whitelist:
- 192.168.1.10For Android, you need to install Element X and ntfy programs from Google Play or Fdroid. I couldn't get FluffyChat to work. At first, install ntfy and register your home server in the settings (Default server). Next, disable battery optimizations for both Element X and ntfy. In settings of Element X, under Notifications, you should set the notifications provider to ntfy instead of firebase. That should register the service and you'll now be able to receive notifications.