2024-08-31 02:15:09 +00:00
|
|
|
{ lib, ... }:
|
2024-08-11 10:13:36 +00:00
|
|
|
{
|
|
|
|
services.ntfy-sh = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
|
|
|
base-url = "https://ntfy.ny4.dev";
|
|
|
|
listen-http = "";
|
|
|
|
listen-unix = "/run/ntfy-sh/ntfy.sock";
|
2024-09-30 15:45:38 +00:00
|
|
|
listen-unix-mode = 432; # 0660
|
2024-08-11 10:13:36 +00:00
|
|
|
behind-proxy = true;
|
2024-11-10 08:48:39 +00:00
|
|
|
# TODO: basic auth this
|
|
|
|
enable-metrics = true;
|
2024-08-11 10:13:36 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-08-25 15:02:35 +00:00
|
|
|
systemd.services.ntfy-sh.serviceConfig.RuntimeDirectory = [ "ntfy-sh" ];
|
2024-08-31 02:15:09 +00:00
|
|
|
|
|
|
|
services.caddy.settings.apps.http.servers.srv0.routes = lib.singleton {
|
2024-09-20 17:38:01 +00:00
|
|
|
match = lib.singleton { host = [ "ntfy.ny4.dev" ]; };
|
2024-08-31 02:15:09 +00:00
|
|
|
handle = lib.singleton {
|
|
|
|
handler = "reverse_proxy";
|
|
|
|
upstreams = [ { dial = "unix//run/ntfy-sh/ntfy.sock"; } ];
|
|
|
|
};
|
|
|
|
};
|
2024-08-11 10:13:36 +00:00
|
|
|
}
|