diff --git a/flake.lock b/flake.lock index ab4a5d1..97f29d2 100644 --- a/flake.lock +++ b/flake.lock @@ -31,16 +31,16 @@ ] }, "locked": { - "lastModified": 1691686916, - "narHash": "sha256-TpNssMHvSKcxJMas5lQNWEbIv09u4/niBN2C27Mp0JY=", + "lastModified": 1694631477, + "narHash": "sha256-35SgWnBkWTyyRwVPyUKoShjzXfX0H1+HDdEEjZ/LsXc=", "owner": "famedly", "repo": "conduit", - "rev": "0c2cfda3ae923d9e922d5edf379e4d8976a52d4e", + "rev": "3bfdae795d4d9ec9aeaac7465e7535ac88e47756", "type": "gitlab" }, "original": { "owner": "famedly", - "ref": "v0.6.0", + "ref": "next", "repo": "conduit", "type": "gitlab" } diff --git a/flake.nix b/flake.nix index cd03dc4..f704f19 100644 --- a/flake.nix +++ b/flake.nix @@ -39,7 +39,7 @@ }; dtth-phanpy.url = "git+ssh://gitea@git.dtth.ch/nki/phanpy"; conduit = { - url = gitlab:famedly/conduit/v0.6.0; + url = gitlab:famedly/conduit/next; inputs.nixpkgs.follows = "nixpkgs-unstable"; }; eza.url = github:eza-community/eza/v0.12.0; diff --git a/modules/cloud/conduit/default.nix b/modules/cloud/conduit/default.nix index 8c69916..ca31124 100644 --- a/modules/cloud/conduit/default.nix +++ b/modules/cloud/conduit/default.nix @@ -138,10 +138,15 @@ with lib; })) ]; }; - # Enable CORS from anywhere since we want all clients to find us out - extraConfig = '' - add_header 'Access-Control-Allow-Origin' "*"; - ''; + extraConfig = + # Enable CORS from anywhere since we want all clients to find us out + '' + add_header 'Access-Control-Allow-Origin' "*"; + '' + + # Force returning values to be JSON data + '' + default_type application/json; + ''; }) cfg.instances; }; diff --git a/overlay.nix b/overlay.nix index 4181785..795f6b4 100644 --- a/overlay.nix +++ b/overlay.nix @@ -29,7 +29,11 @@ let sway = prev.sway.override { sway-unwrapped = final.swayfx-unwrapped; }; deploy-rs = inputs.deploy-rs.packages.default; dtth-phanpy = inputs.dtth-phanpy.packages.${final.system}.default; - matrix-conduit = inputs.conduit.packages.${final.system}.default; + matrix-conduit = inputs.conduit.packages.${final.system}.default.overrideAttrs (attrs: { + patches = (if "patches" ? attrs then attrs.patches else [ ]) ++ [ + ./overlays/conduit-remove-dbg.patch + ]; + }); exa = inputs.eza.packages.${final.system}.default.overrideAttrs (attrs: { postInstall = attrs.postInstall + '' ln -sv $out/bin/eza $out/bin/exa diff --git a/overlays/conduit-remove-dbg.patch b/overlays/conduit-remove-dbg.patch new file mode 100644 index 0000000..1f0b476 --- /dev/null +++ b/overlays/conduit-remove-dbg.patch @@ -0,0 +1,28 @@ +diff --git a/src/api/client_server/sync.rs b/src/api/client_server/sync.rs +index a275b06..ed4e5c6 100644 +--- a/src/api/client_server/sync.rs ++++ b/src/api/client_server/sync.rs +@@ -1172,7 +1172,6 @@ fn share_encrypted_room( + pub async fn sync_events_v4_route( + body: Ruma, + ) -> Result> { +- dbg!(&body.body); + let sender_user = body.sender_user.expect("user is authenticated"); + let sender_device = body.sender_device.expect("user is authenticated"); + let mut body = body.body; +@@ -1689,7 +1688,7 @@ pub async fn sync_events_v4_route( + let _ = tokio::time::timeout(duration, watcher).await; + } + +- Ok(dbg!(sync_events::v4::Response { ++ Ok(sync_events::v4::Response { + initial: globalsince == 0, + txn_id: body.txn_id.clone(), + pos: next_batch.to_string(), +@@ -1744,5 +1743,5 @@ pub async fn sync_events_v4_route( + }, + }, + delta_token: None, +- })) ++ }) + }