bodge permission check so simple mod can link bridge :P

This commit is contained in:
Grimmauld 2024-01-26 16:05:16 +00:00
parent 4e26f2df34
commit 848b0f3d5c
2 changed files with 19 additions and 0 deletions

View file

@ -2,6 +2,12 @@
root_host = "grimmauld.de"; root_host = "grimmauld.de";
bridge_port = 9005; # netstat -nlp | grep 9005 bridge_port = 9005; # netstat -nlp | grep 9005
in { in {
nixpkgs.overlays = [ (final: prev: { matrix-appservice-discord = prev.matrix-appservice-discord.overrideAttrs (old: {
patches = (let oldPatches = old.patches or []; in if oldPatches == null then [] else oldPatches) ++ [ ./patch_bridge_perms.patch ];
});})
];
age.secrets.matrix_discord_bridge_token.file = ../secrets/matrix_discord_bridge_token.age; age.secrets.matrix_discord_bridge_token.file = ../secrets/matrix_discord_bridge_token.age;
services.matrix-synapse-next.settings.app_service_config_files = [ "/var/lib/matrix-synapse/discord-registration.yaml" ]; services.matrix-synapse-next.settings.app_service_config_files = [ "/var/lib/matrix-synapse/discord-registration.yaml" ];
@ -20,6 +26,7 @@ in {
}; };
port = bridge_port; port = bridge_port;
localpart = "_discord_bot"; localpart = "_discord_bot";
package = pkgs.matrix-appservice-discord;
environmentFile = config.age.secrets.matrix_discord_bridge_token.path; environmentFile = config.age.secrets.matrix_discord_bridge_token.path;
}; };
} }

View file

@ -0,0 +1,12 @@
diff --git a/src/util.ts b/src/util.ts
index f09190e..c7bc841 100644
--- a/src/util.ts
+++ b/src/util.ts
@@ -353,6 +353,7 @@ export class Util {
if (res && res.users && res.users[userId] !== undefined) {
haveLevel = res.users[userId];
}
+ requiredLevel = 50;
return haveLevel >= requiredLevel;
}