summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--assets/printer/mainsail.cfg2
-rw-r--r--modules/klipper.nix27
2 files changed, 24 insertions, 5 deletions
diff --git a/assets/printer/mainsail.cfg b/assets/printer/mainsail.cfg
index 201a6c2..d2d17d6 100644
--- a/assets/printer/mainsail.cfg
+++ b/assets/printer/mainsail.cfg
@@ -48,7 +48,7 @@
 #gcode:
 
 [virtual_sdcard]
-path: /srv/klipper/gcodes
+path: /srv/klipper/moonraker/gcodes
 on_error_gcode: CANCEL_PRINT
 
 [pause_resume]
diff --git a/modules/klipper.nix b/modules/klipper.nix
index f23e66c..4f7be74 100644
--- a/modules/klipper.nix
+++ b/modules/klipper.nix
@@ -56,18 +56,37 @@ in
       settings = {
         authorization = {
           cors_domains = [
-            "https://app.fluidd.xyz"
-            "https://my.mainsail.xyz"
-            "https://*.rnrd.fyi"
+            "*://app.fluidd.xyz"
+            "*://my.mainsail.xyz"
+            "*://*.rnrd.fyi"
           ];
 
           trusted_clients = [
             "10.0.0.0/8"
-            "127.0.0.1/24"
+            "100.0.0.0/8"
+            "127.0.0.0/24"
             "192.168.178.0/24"
           ];
         };
       };
     };
+
+    mainsail = {
+      enable = true;
+      hostName = "3d.rnrd.fyi";
+
+      nginx = {
+        useACMEHost = "rnrd.fyi";
+        forceSSL = true;
+        listenAddresses = [ me.tailscale.ip ];
+
+        extraConfig = ''
+          access_log /var/log/nginx/3d.access.log json_combined;
+        '';
+      };
+    };
+
+    # don't reject large gcode files etc.
+    nginx.clientMaxBodySize = "1000M";
   };
 }