This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

configs.services.ntfy: add ntfy.lassul.us as UnifiedPush distributor

ntfy.sh's free tier counts every UnifiedPush message against the
subscriber: 250 messages/day shared by all UnifiedPush apps on the phone.
Once used up it answers 429, phonetpm can no longer wake the phone and
every SSH login and deploy fails. Run our own ntfy on neoprism instead,
anonymous like ntfy.sh so app servers publish without accounts.

Rate limits: ntfy 2.29 defaults stay, except for an exemption.
- visitor-message-daily-limit is 0 (unlimited), only the request limiter
applies.
- visitor-subscriber-rate-limiting is off (ntfy.sh turns it on), so
publishes to up* topics are charged to the publisher, not to the phone.
The phone only spends requests on its subscription connections (30
allowed, the app uses one per server).
- The request limit is 60 burst, then one per 5s, per publisher IP.
Synapse on neoprism sends every Matrix push of the phone from one
address; encrypted and bridged rooms notify per message, so bridge
catch-up can exceed that. visitor-request-limit-exempt-hosts exempts
neoprism's own addresses. phonetpm daemons publish one wake per
connection and stay far below the limit.
- behind-proxy: ntfy takes the right-most X-Forwarded-For address, the
one nginx appends, so visitors are not all 127.0.0.1 and a client
cannot spoof its address.

The module enables attachments by default (attachment-cache-dir), set it
empty to keep them off. nginx settings follow ntfy's example config
(buffering off, 3m timeouts against the 45s keepalive, websockets).

No backup: the state dir (/var/lib/private/ntfy-sh) holds the message
cache (12h, disposable) and an auth db without users.

+48
+1
configs/dns/lassul.us.zone
··· 35 35 cgit IN CNAME neoprism 36 36 pad IN CNAME neoprism 37 37 paint IN CNAME neoprism 38 + ntfy IN CNAME neoprism 38 39 go IN CNAME neoprism 39 40 cast IN CNAME neoprism 40 41 matrix IN CNAME neoprism
+1
configs/monitoring/checks.nix
··· 50 50 (https "matrix" "https://matrix.lassul.us/_matrix/client/versions") 51 51 (https "pad" "https://pad.lassul.us/") 52 52 (https "paint" "https://paint.lassul.us/") 53 + (https "ntfy" "https://ntfy.lassul.us/v1/health") 53 54 (https "cache" "https://cache.lassul.us/nix-cache-info") 54 55 (https "niks3" "https://niks3.lassul.us/health") 55 56 (soa "ns1" "95.217.192.59")
+1
machines/neoprism/config.nix
··· 25 25 26 26 ../../configs/services/pad 27 27 ../../configs/services/paint 28 + ../../configs/services/ntfy 28 29 29 30 ../../configs/hass/proxy.nix 30 31 ../../configs/hermes-proxy.nix
+45
configs/services/ntfy/default.nix
··· 1 + let 2 + domain = "ntfy.lassul.us"; 3 + port = 2586; 4 + in 5 + { 6 + # ntfy as UnifiedPush distributor for the phone. Anonymous like ntfy.sh: 7 + # the phone subscribes to its "up…" topics, app servers (Synapse, phonetpm 8 + # daemons) publish to them without an account. 9 + services.ntfy-sh = { 10 + enable = true; 11 + settings = { 12 + base-url = "https://${domain}"; 13 + listen-http = "127.0.0.1:${toString port}"; 14 + # Visitors are identified by the address nginx appends to 15 + # X-Forwarded-For, not by nginx's own address. 16 + behind-proxy = true; 17 + # No attachments (the module enables them by default). 18 + attachment-cache-dir = ""; 19 + # Publishers are rate limited per IP (60 requests burst, then one per 20 + # 5s). Synapse on this host publishes every Matrix push, so exempt 21 + # neoprism's own addresses (machines/neoprism/physical.nix). 22 + visitor-request-limit-exempt-hosts = "95.217.192.59,2a01:4f9:4a:4f1a::2"; 23 + }; 24 + }; 25 + 26 + services.nginx.virtualHosts.${domain} = { 27 + enableACME = true; 28 + forceSSL = true; 29 + locations."/" = { 30 + proxyPass = "http://127.0.0.1:${toString port}"; 31 + recommendedProxySettings = true; 32 + proxyWebsockets = true; 33 + # Subscriptions are long-lived HTTP streams / websockets with a 45s 34 + # keepalive; settings from ntfy's nginx example. 35 + extraConfig = '' 36 + proxy_buffering off; 37 + proxy_request_buffering off; 38 + proxy_connect_timeout 3m; 39 + proxy_send_timeout 3m; 40 + proxy_read_timeout 3m; 41 + client_max_body_size 0; 42 + ''; 43 + }; 44 + }; 45 + }