about summary refs log tree commit diff
path: root/modules/nixos/ipfs.nix
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2023-04-14 02:51:09 +0300
committerAzat Bahawi <azat@bahawi.net>2023-04-14 02:51:09 +0300
commit39ed30937ec29217820583e07ff1f447d08b9898 (patch)
tree96dc9d1a62e320c89510cd910add2ce8fb819850 /modules/nixos/ipfs.nix
parent2023-04-12 (diff)
2023-04-14
Diffstat (limited to '')
-rw-r--r--modules/nixos/ipfs.nix21
1 files changed, 5 insertions, 16 deletions
diff --git a/modules/nixos/ipfs.nix b/modules/nixos/ipfs.nix
index 68075ff..6d32ec6 100644
--- a/modules/nixos/ipfs.nix
+++ b/modules/nixos/ipfs.nix
@@ -60,6 +60,7 @@ in {
         emptyRepo = true;
         enableGC = true;
 
+        # https://github.com/ipfs/kubo/blob/master/docs/config.md
         settings = mkMerge [
           (
             let
@@ -94,30 +95,18 @@ in {
                   "/ip4/0.0.0.0/tcp/${port}"
                   "/ip6/::/tcp/${port}"
                   "/ip4/0.0.0.0/udp/${port}/quic"
+                  "/ip4/0.0.0.0/udp/${port}/quic-v1"
+                  "/ip4/0.0.0.0/udp/${port}/quic-v1/webtransport"
                   "/ip6/::/udp/${port}/quic"
+                  "/ip6/::/udp/${port}/quic-v1"
+                  "/ip6/::/udp/${port}/quic-v1/webtransport"
                 ];
 
                 NoAnnounce = filterAddresses;
               };
               Swarm.AddrFilters = filterAddresses;
-              API.HTTPHeaders.Access-Control-Allow-Methods = [
-                "GET"
-                "POST"
-                "PUT"
-              ];
             }
           )
-          (mkIf this.isHeadful {
-            API.HTTPHeaders.Access-Control-Allow-Origin = ["*"];
-          })
-          (mkIf this.isHeadless {
-            API.HTTPHeaders.Access-Control-Allow-Origin = map (v: "http${
-              optionalString config.nixfiles.modules.acme.enable "s"
-            }://${v}") (with cfg; [
-              domain
-              "api.${domain}"
-            ]);
-          })
         ];
       };
 

Consider giving Nix/NixOS a try! <3