matrix-org / matrix-appservice-irc

Node.js IRC bridge for Matrix
Apache License 2.0
460 stars 149 forks source link

Limit usage to only user on specified matrix server #1786

Closed maximushugus closed 3 months ago

maximushugus commented 6 months ago

I'm hosting a personal Matrix Synapse server using docker. I managed to set up matrix-appservice-irc with docker and make it work with my Synapse server. However I didn't find any option in config.yaml to limit the usage of this matrix-IRC bridge to only users on my server.

I tried to set : permissions: 'myserver.com': admin

But it didn't work.

Does someone know if there is a way to do this ?

Thanks

Half-Shot commented 6 months ago

You can use https://github.com/matrix-org/matrix-appservice-irc/blob/develop/config.sample.yaml#L235-L237 to exclude users following a Regex pattern. For instance:

      excludedUsers:
        - regex: "^@.*:(?!half-shot.uk).*$"
          kickReason: "Sorry, only half-shot.uk users allowed."
maximushugus commented 6 months ago

Thanks a lot for your super quick answer ! I didn't see this option when I was searching the config file. I will give it a try in the next few days ! Thanks

maximushugus commented 6 months ago

This option does not seem to work unfortunatly. I tried your regex (with my domain but I was still able to contact the bridge from my matrix.org account. I tried :

      excludedUsers:
        - regex: "(matrix.org)*"
          kickReason: "Sorry, not for you"

But I can still contact the bridge.

Maybe that's why there is no comment in config.sample.yaml to explain the signification of this option.

Half-Shot commented 5 months ago

By contact, what can you do. You can probably talk to the bot but you certainly can't interact with IRC?