diff options
author | makefu <github@syntax-fehler.de> | 2023-06-03 15:39:22 +0200 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2023-06-03 15:39:22 +0200 |
commit | e584943bfd1042b729fbf94b60c585d4cc969b80 (patch) | |
tree | 2b9f9b7738f008a4dd356c9eaeef631664483d2a | |
parent | 37378321839ff57aa8288c123daa229ece4a2987 (diff) |
ma ntfy: init
-rw-r--r-- | 2configs/deployment/ntfysh.nix | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/2configs/deployment/ntfysh.nix b/2configs/deployment/ntfysh.nix new file mode 100644 index 000000000..1a3311d9e --- /dev/null +++ b/2configs/deployment/ntfysh.nix @@ -0,0 +1,41 @@ +{ lib, config, ... }: +let + web-port = 19455; + hostn = "ntfy.euer.krebsco.de"; + internal-ip = config.krebs.build.host.nets.retiolum.ip4.addr; +in +{ + services.ntfy-sh = { + enable = true; + settings = { + listen-http = "127.0.0.1:${toString web-port}"; + auth-file = "/var/lib/ntfy-sh/user.db"; + auth-default-access = "deny-all"; + behind-proxy = true; + attachment-cache-dir = "/media/cloud/ntfy-sh/attachments"; + attachment-file-size-limit = "500m"; + attachment-total-size-limit = "100g"; + base-url = "https://ntfy.euer.krebsco.de"; + attachment-expiry-duration = "48h"; + }; + }; + + systemd.services.ntfy-sh.serviceConfig = { + StateDirectory = "ntfy-sh"; + SupplementaryGroups = [ "download" ]; + }; + + services.nginx = { + enable = lib.mkDefault true; + virtualHosts."${hostn}" = { + forceSSL = true; + enableACME = true; + + locations."/" = { + proxyPass = "http://localhost:${toString web-port}/"; + proxyWebsockets = true; + recommendedProxySettings = true; + }; + }; + }; +} |