From 583370a024282712231afc0dbc152e7a7931d132 Mon Sep 17 00:00:00 2001 From: Adithya Nair Date: Tue, 17 Sep 2024 23:13:44 +0530 Subject: [PATCH] wynne: enable ntfy.sh --- hosts/wynne/services/apps/default.nix | 1 + hosts/wynne/services/apps/ntfy.nix | 39 +++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 hosts/wynne/services/apps/ntfy.nix diff --git a/hosts/wynne/services/apps/default.nix b/hosts/wynne/services/apps/default.nix index d0b5a39..2874841 100644 --- a/hosts/wynne/services/apps/default.nix +++ b/hosts/wynne/services/apps/default.nix @@ -2,6 +2,7 @@ _: { imports = [ ./dendrite ./acomputer.lol.nix + ./ntfy.nix ./postgresql.nix ../../../shared/prometheus-exporters.nix ../../../shared/promtail.nix diff --git a/hosts/wynne/services/apps/ntfy.nix b/hosts/wynne/services/apps/ntfy.nix new file mode 100644 index 0000000..dd4c936 --- /dev/null +++ b/hosts/wynne/services/apps/ntfy.nix @@ -0,0 +1,39 @@ +_: +let + inherit (import ../../../shared/caddy-helpers.nix) logFormat; + domainName = "ntfy.acomputer.lol"; +in +{ + services = { + caddy.virtualHosts."${domainName}" = { + logFormat = logFormat domainName; + extraConfig = '' + reverse_proxy 127.0.0.1:8080 + ''; + }; + + frp.settings.proxies = [ + { + name = "http.${domainName}"; + type = "http"; + customDomains = [ "${domainName}" ]; + localPort = 80; + transport.useCompression = true; + } + { + name = "https.${domainName}"; + type = "https"; + customDomains = [ "${domainName}" ]; + localPort = 443; + transport.useCompression = true; + } + ]; + ntfy-sh = { + enable = true; + settings = { + base-url = "https://${domainName}"; + listen-http = "127.0.0.1:8080"; + }; + }; + }; +}