signal icon indicating copy to clipboard operation
signal copied to clipboard

possible to bridge a existing room?

Open luxus opened this issue 5 years ago • 22 comments

sorry if its maybe a dumb question, but can I bridge a existing room to a existing or new group in signal?

luxus avatar Jan 15 '21 02:01 luxus

I'd like to know this as well.

tacerus avatar Jan 22 '21 15:01 tacerus

I made some progress, after joining the Signal bridge bot to an existing Matrix room, creating a new Signal group, and restarting the bridge to create a respective Matrix room for it, I entered the portal table in the database and replaced the mxid of the new "dummy" room with the ID of an existing room. My own messages are now synced between the new Signal group and the existing Matrix room, however messages of other users are not. I have a feeling Signal puppets are not a thing, and a workaround by just relaying all messages to through your own Signal user and putting a "matrixname" prefix is not implemented in this bridge.

tacerus avatar Jan 22 '21 16:01 tacerus

It's probably a limitation by the fact signald is just imitating a Signal desktop client, it's not actually spawning an independent bot to Signal.

tacerus avatar Jan 22 '21 16:01 tacerus

okay, maybe as a workaround.. if I create a room on signal it got briged.. can I somehow get admin on matrix in that room that the signal bot created?

luxus avatar Jan 22 '21 16:01 luxus

In your Signal management room (as your bot admin user) you can use set-pl <level> [mxid] - try set-pl 100 !roomid:server.domain.com (the mxid of the room you want to become admin in - as long as the Signal bridge bot is admin in it already).

tacerus avatar Jan 22 '21 17:01 tacerus

did you tried it? it didn't work for me .. I got a error that I should check the logs.. im using https://github.com/spantaleev/matrix-docker-ansible-deploy and wasn't be able to find the logs of the signal docker :(

luxus avatar Jan 22 '21 17:01 luxus

I am using Synapse. You can find the logs by checking docker ps for the container ID and then executing docker logs <container ID>. Probably the mautrix-signal container will contain the relevant errors, else the signald one.

tacerus avatar Jan 22 '21 18:01 tacerus

the right way to peek into the logs is journalctl -fu matrix-mautrix-signal set-pl 100 didn't work it ask for a mxid (userid?) channels are not working :( Not a valid user_id

using !signal set-pl 100 @luxus:domain worked in the channel I want to get admin

luxus avatar Jan 26 '21 01:01 luxus

I made some progress, after joining the Signal bridge bot to an existing Matrix room, creating a new Signal group, and restarting the bridge to create a respective Matrix room for it, I entered the portal table in the database and replaced the mxid of the new "dummy" room with the ID of an existing room. My own messages are now synced between the new Signal group and the existing Matrix room, however messages of other users are not. I have a feeling Signal puppets are not a thing, and a workaround by just relaying all messages to through your own Signal user and putting a "matrixname" prefix is not implemented in this bridge.

Thanks @tacerus seems to work for me!

ruifm avatar Feb 07 '21 18:02 ruifm

I made some progress, after joining the Signal bridge bot to an existing Matrix room, creating a new Signal group, and restarting the bridge to create a respective Matrix room for it, I entered the portal table in the database and replaced the mxid of the new "dummy" room with the ID of an existing room. My own messages are now synced between the new Signal group and the existing Matrix room, however messages of other users are not. I have a feeling Signal puppets are not a thing, and a workaround by just relaying all messages to through your own Signal user and putting a "matrixname" prefix is not implemented in this bridge.

Did this work? And can you create a simple tutorial on it?

HansJK avatar Mar 06 '22 00:03 HansJK

Sorry, I can only vaguely remember what I did last year in regards to this. However based on reading my comment from last year it seems to have only been a one way solution anyways, hence I doubt it would be of much interest.

tacerus avatar Mar 06 '22 03:03 tacerus

Shame, this is such a essential feature... :(

HansJK avatar Mar 06 '22 17:03 HansJK

I made some progress, after joining the Signal bridge bot to an existing Matrix room, creating a new Signal group, and restarting the bridge to create a respective Matrix room for it, I entered the portal table in the database and replaced the mxid of the new "dummy" room with the ID of an existing room. My own messages are now synced between the new Signal group and the existing Matrix room, however messages of other users are not. I have a feeling Signal puppets are not a thing, and a workaround by just relaying all messages to through your own Signal user and putting a "matrixname" prefix is not implemented in this bridge.

Did this work? And can you create a simple tutorial on it?

Are you still in need of help for this? Just confirmed that the process still works.

notreal069 avatar Mar 21 '22 07:03 notreal069

Yes I would love to bridge existing rooms.

HansJK avatar Mar 25 '22 19:03 HansJK

Did some research on it.

In the docs, it says:

If you want to bridge existing rooms, you'll have to manually update the mxid column in the portal table to point to the room you want bridged.

How am I suppose to modify my config like what the docs says? I guess it's referring to this section:

permissions:
'*':relay
example.com: user
signal:example.com: admin

HansJK avatar Mar 25 '22 20:03 HansJK

@HansJK It's talking about the portal table in the SQL database. not the configuration file. But see my comment earlier in this thread for the pitfalls with this route.

tacerus avatar Mar 25 '22 20:03 tacerus

@tacerus Thanks.

My own messages are now synced between the new Signal group and the existing Matrix room, however messages of other users are not.

You are talking about other relay Matrix users not sending from Matrix to Signal?

I have a feeling Signal puppets are not a thing, and a workaround by just relaying all messages to through your own Signal user and putting a "matrixname" prefix is not implemented in this bridge.

Isn't this how it is today already? Sending a message from Matrix to signal using the bot Looks like this: Screenshot 2022-03-25 at 21 18 06

Sorry if I miss intrepid your reply.

HansJK avatar Mar 25 '22 20:03 HansJK

Very approximate guide to inserting this portal row in PostgreSQL:

  • Back up your database

  • Select the database: USE <name of relevant database

  • Find some example rows to use as guidance: SELECT * FROM portal LIMIT 10

  • Now either create a new row, following this this schema: https://github.com/mautrix/signal/blob/ca3169c4ab8c67dabc6b0d6bf73771bb53df11c7/mautrix_signal/db/portal.py#L74

  • or, in my opinion better and safer, create a "dummy" room (non-existing group) first, then find it in the table and only replace the mxid field:

UPDATE portal SET mxid = '<your new mxid>' WHERE <column you want to filter by> = <value you want to filter by>

I forgot what values are handy to use for filtering, but I'm sure the SELECT call will give some ideas.

tacerus avatar Mar 25 '22 20:03 tacerus

Sorry if I miss intrepid your reply.

I'm sorry too, wish I could help further, but I did not find my old installation from back when I still used this and don't currently have a need for it anymore. :-(

tacerus avatar Mar 25 '22 20:03 tacerus

Thanks for the help! Have to spend som time on this one. First just wrapping my head around it.

This should really become a feature of the bridge! So you can bridge communities from different platforms together.

HansJK avatar Mar 25 '22 20:03 HansJK

Someone who knows more about Matrix databases than myself - would there be any issues in adjusting the mxid's in the portal programmatically?

I'm thinking of having a crack writing a little bot with https://github.com/turt2live/matrix-bot-sdk to list out the portals database and modify if needed - hopefully in a user friendly way.

The only big issue I see is designing a good security model.

jakecoppinger avatar Mar 26 '22 01:03 jakecoppinger

Very approximate guide to inserting this portal row in PostgreSQL: ...

i just want to double-confirm that yes, this works. moreover, if you have double-puppeting set up per instructions (method #1) below, then you do get intelligible differentiation among different users on the signal side (via <name>: <msg>), and pretty seamless puppeting on the matrix side:

https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/docs/configuring-playbook-bridge-mautrix-signal.md

brush avatar May 14 '22 08:05 brush