summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/deployment/ntfysh.nix
diff options
context:
space:
mode:
authorlassulus <git@lassul.us>2023-06-19 03:25:39 +0200
committerlassulus <git@lassul.us>2023-06-19 03:25:39 +0200
commit139799c53cdaf55c362109e01be9dd96cc8700ed (patch)
treeb1ce719ec8f62458bce2d9fe2191b8d004630f2a /makefu/2configs/deployment/ntfysh.nix
parentcb8fbb09127392a17d698d91f78ede7ae46accb8 (diff)
parenta766e88e7c8d87aa6bdbde796d3a454f7b5e546e (diff)
Merge remote-tracking branch 'gum/master'
Diffstat (limited to 'makefu/2configs/deployment/ntfysh.nix')
-rw-r--r--makefu/2configs/deployment/ntfysh.nix41
1 files changed, 41 insertions, 0 deletions
diff --git a/makefu/2configs/deployment/ntfysh.nix b/makefu/2configs/deployment/ntfysh.nix
new file mode 100644
index 000000000..1a3311d9e
--- /dev/null
+++ b/makefu/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;
+ };
+ };
+ };
+}