summary refs log tree commit diff stats
path: root/system/services/etebase/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'system/services/etebase/default.nix')
-rw-r--r--system/services/etebase/default.nix33
1 files changed, 33 insertions, 0 deletions
diff --git a/system/services/etebase/default.nix b/system/services/etebase/default.nix
new file mode 100644
index 0000000..58d8b4b
--- /dev/null
+++ b/system/services/etebase/default.nix
@@ -0,0 +1,33 @@
+{config, ...}: {
+  services.etebase-server = {
+    enable = true;
+    port = 8001;
+    settings = {
+      global.secret_file = "${config.age.secrets.etebase-server.path}";
+      allowed_hosts.allowed_host1 = "localhost";
+    };
+  };
+
+  services.nginx = {
+    enable = true;
+    recommendedTlsSettings = true;
+    recommendedOptimisation = true;
+    recommendedGzipSettings = true;
+    recommendedProxySettings = true;
+    virtualHosts = {
+      "dav.vhack.eu" = {
+        enableACME = true;
+        forceSSL = true;
+        locations."/" = {
+          proxyPass = "http://127.0.0.1:8001";
+          extraConfig = ''
+            proxy_set_header Host $host;
+            proxy_set_header X-Real-IP $remote_addr;
+            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+            proxy_set_header X-Forwarded-Host $server_name;
+          '';
+        };
+      };
+    };
+  };
+}