mautrix / slack Goto Github PK
View Code? Open in Web Editor NEWA Matrix-Slack puppeting bridge
License: GNU Affero General Public License v3.0
A Matrix-Slack puppeting bridge
License: GNU Affero General Public License v3.0
I am testing slack bridge with dendrite and it takes a lot of attempts to start the chat with slackbot as bot is constantly leaving the chat right after I send "help" or anything.
logs:
Nov 29 14:26:33 syncloud nginx[28103]: syncloud nginx: 1.2.3.4 - - [29/Nov/2023:14:26:33 +0000] "POST /_matrix/client/r0/keys/query HTTP/1.1" 200 134 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/119.0"
Nov 29 14:26:33 syncloud matrix.matrix[7764]: time="2023-11-29T14:26:33.917136351Z" level=info msg="Creating new room" req.id=LHPTvB8v5JxH req.method=POST req.path=/_matrix/client/r0/createRoom roomID="!6tivynKADmyCUXJA:matrix.myserver" roomVersion=10 userID="@boris:matrix.myserver" user_id="@boris:matrix.myserver"
Nov 29 14:26:34 syncloud matrix.matrix[7764]: time="2023-11-29T14:26:34.007757814Z" level=debug msg="Responding to sync after wake-up" currentPos=s145335_6_352893_1430_145305_145333_185336_484802_0 device_id=4mPZH3hy limit=20 req.id=0AVF2NLiPwSR req.method=GET req.path=/_matrix/client/r0/sync since=s145317_6_352893_1430_145305_145333_185336_484802_0 timeout=30s user_id="@boris:matrix.myserver"
Nov 29 14:26:34 syncloud matrix.matrix[7764]: time="2023-11-29T14:26:34.007824568Z" level=debug msg="Responding to sync after wake-up" currentPos=s145335_6_352893_1430_145305_145333_185336_484802_0 device_id=gZTiugbp limit=50 req.id=6KUANZ64nFMJ req.method=GET req.path=/_matrix/client/r0/sync since=s145317_6_352893_1430_145305_145333_185336_484802_0 timeout=30s user_id="@boris:matrix.myserver"
Nov 29 14:26:34 syncloud matrix.matrix[7764]: time="2023-11-29T14:26:34.025223523Z" level=debug msg="Applied history visibility (sync)" after=2 before=2 duration=6.496064ms room_id="!6tivynKADmyCUXJA:matrix.myserver"
Nov 29 14:26:34 syncloud matrix.matrix[7764]: time="2023-11-29T14:26:34.054506885Z" level=debug msg="Applied history visibility (sync)" after=2 before=2 duration=9.909195ms room_id="!6tivynKADmyCUXJA:matrix.myserver"
Nov 29 14:26:34 syncloud matrix.matrix[7764]: time="2023-11-29T14:26:34.153104008Z" level=debug msg="processing invite event" event_id="" invitee="@slackbot:matrix.myserver" inviter="@boris:matrix.myserver" origin_local=true req.id=LHPTvB8v5JxH req.method=POST req.path=/_matrix/client/r0/createRoom room_id="!6tivynKADmyCUXJA:matrix.myserver" room_version=10 target_local=true user_id="@boris:matrix.myserver"
Nov 29 14:26:34 syncloud nginx[28102]: syncloud nginx: 1.2.3.4 - - [29/Nov/2023:14:26:34 +0000] "GET /_matrix/client/r0/sync?filter=1&timeout=30000&since=s145317_6_352893_1430_145305_145333_185336_484802_0 HTTP/1.1" 200 1068 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/119.0"
Nov 29 14:26:34 syncloud matrix.matrix[7764]: time="2023-11-29T14:26:34.179094196Z" level=debug msg="Responding to sync immediately" currentPos=s145339_6_352893_1430_145305_145333_185336_484802_0 device_id=gZTiugbp limit=50 req.id=5nWVHHJiukMm req.method=GET req.path=/_matrix/client/r0/sync since=s145335_6_352893_1430_145305_145333_185336_484802_0 timeout=30s user_id="@boris:matrix.myserver"
Nov 29 14:26:34 syncloud nginx[28104]: syncloud nginx: 1.2.3.4 - - [29/Nov/2023:14:26:34 +0000] "GET /_matrix/client/r0/profile/%40boris%3Amatrix.myserver HTTP/1.1" 200 134 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/119.0"
Nov 29 14:26:34 syncloud matrix.matrix[7764]: time="2023-11-29T14:26:34.195220575Z" level=debug msg="Applied history visibility (sync)" after=4 before=4 duration=7.364815ms room_id="!6tivynKADmyCUXJA:matrix.myserver"
Nov 29 14:26:34 syncloud matrix.matrix[7764]: time="2023-11-29T14:26:34.197467802Z" level=debug msg="Appservice worker sending 1 events(s) from roomserver" appservice=slack
Nov 29 14:26:34 syncloud matrix.slack[8005]: 2023-11-29T14:26:34Z DBG Starting handling of transaction content={"pdu":1} transaction_id=1701267994196112625
Nov 29 14:26:34 syncloud matrix.slack[8005]: 2023-11-29T14:26:34Z DBG Finished dispatching events from transaction transaction_id=1701267994196112625
Nov 29 14:26:34 syncloud matrix.matrix[7764]: time="2023-11-29T14:26:34.204505219Z" level=info msg="User requested to room join" room_id="!6tivynKADmyCUXJA:matrix.myserver" servers="[]" user_id="@slackbot:matrix.myserver"
Nov 29 14:26:34 syncloud nginx[28104]: syncloud nginx: 1.2.3.4 - - [29/Nov/2023:14:26:34 +0000] "POST /_matrix/client/r0/createRoom HTTP/1.1" 200 56 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/119.0"
Nov 29 14:26:34 syncloud matrix.matrix[7764]: time="2023-11-29T14:26:34.215856643Z" level=debug msg="Responding to sync immediately" currentPos=s145339_6_352893_1430_145340_145333_185336_484802_0 device_id=4mPZH3hy limit=20 req.id=oyd2jUMoAKhK req.method=GET req.path=/_matrix/client/r0/sync since=s145335_6_352893_1430_145305_145333_185336_484802_0 timeout=30s user_id="@boris:matrix.myserver"
Nov 29 14:26:34 syncloud nginx[28102]: syncloud nginx: 1.2.3.4 - - [29/Nov/2023:14:26:34 +0000] "POST /_matrix/client/r0/keys/query HTTP/1.1" 200 4612 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/119.0"
Nov 29 14:26:34 syncloud nginx[28103]: syncloud nginx: 1.2.3.4 - - [29/Nov/2023:14:26:34 +0000] "PUT /_matrix/client/r0/user/%40boris%3Amatrix.myserver/account_data/m.direct HTTP/1.1" 200 2 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/119.0"
Nov 29 14:26:34 syncloud matrix.matrix[7764]: time="2023-11-29T14:26:34.234981167Z" level=debug msg="Received data from client API server" room_id="" type=m.direct
Nov 29 14:26:34 syncloud matrix.matrix[7764]: time="2023-11-29T14:26:34.252859169Z" level=debug msg="Responding to sync immediately" currentPos=s145341_6_352893_1430_145340_145343_185336_484805_0 device_id=gZTiugbp limit=50 req.id=eYcx6oE4EcAb req.method=GET req.path=/_matrix/client/r0/sync since=s145339_6_352893_1430_145340_145333_185336_484803_0 timeout=30s user_id="@boris:matrix.myserver"
Nov 29 14:26:34 syncloud matrix.matrix[7764]: time="2023-11-29T14:26:34.256565455Z" level=debug msg="Applied history visibility (sync)" after=4 before=4 duration=7.469894ms room_id="!6tivynKADmyCUXJA:matrix.myserver"
Nov 29 14:26:34 syncloud matrix.matrix[7764]: time="2023-11-29T14:26:34.265451725Z" level=debug msg="Appservice worker sending 1 events(s) from roomserver" appservice=slack
Nov 29 14:26:34 syncloud matrix.slack[8005]: 2023-11-29T14:26:34Z DBG Starting handling of transaction content={"pdu":1} transaction_id=1701267994264261783
Nov 29 14:26:34 syncloud matrix.matrix[7764]: time="2023-11-29T14:26:34.268893014Z" level=info msg="User joined room successfully" room_id="!6tivynKADmyCUXJA:matrix.myserver" servers="[]" user_id="@slackbot:matrix.myserver"
Nov 29 14:26:34 syncloud matrix.slack[8005]: 2023-11-29T14:26:34Z DBG Request completed as_user_id=@slackbot:matrix.myserver duration=66.156591 method=POST req_body={} req_id=48 response_length=56 response_mime=application/json status_code=200 url=http://unix/_matrix/client/v3/rooms/%216tivynKADmyCUXJA:matrix.myserver/join?user_id=%40slackbot%3Amatrix.myserver
Nov 29 14:26:34 syncloud matrix.slack[8005]: 2023-11-29T14:26:34Z DBG Finished dispatching events from transaction transaction_id=1701267994264261783
Nov 29 14:26:34 syncloud matrix.slack[8005]: 2023-11-29T14:26:34Z DBG Request completed as_user_id=@slackbot:matrix.myserver duration=4.829436 method=GET req_id=49 response_length=182 response_mime=application/json status_code=200 url=http://unix/_matrix/client/v3/rooms/%216tivynKADmyCUXJA:matrix.myserver/joined_members?user_id=%40slackbot%3Amatrix.myserver
Nov 29 14:26:34 syncloud matrix.slack[8005]: 2023-11-29T14:26:34Z DBG Leaving empty room after accepting invite room_id=!6tivynKADmyCUXJA:matrix.myserver sender=@boris:matrix.myserver target=@slackbot:matrix.myserver
Nov 29 14:26:34 syncloud matrix.matrix[7764]: time="2023-11-29T14:26:34.285923001Z" level=info msg="User requested to leave join" room_id="!6tivynKADmyCUXJA:matrix.myserver" user_id="@slackbot:matrix.myserver"
Nov 29 14:26:34 syncloud matrix.matrix[7764]: time="2023-11-29T14:26:34.289113714Z" level=debug msg="Applied history visibility (sync)" after=1 before=1 duration=2.686086ms room_id="!6tivynKADmyCUXJA:matrix.myserver"
Nov 29 14:26:34 syncloud nginx[28102]: syncloud nginx: 1.2.3.4 - - [29/Nov/2023:14:26:34 +0000] "GET /_matrix/client/r0/sync?filter=1&timeout=30000&since=s145335_6_352893_1430_145305_145333_185336_484802_0 HTTP/1.1" 200 5662 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/119.0"
Nov 29 14:26:34 syncloud nginx[28104]: syncloud nginx: 1.2.3.4 - - [29/Nov/2023:14:26:34 +0000] "PUT /_matrix/client/r0/user/%40boris%3Amatrix.myserver/account_data/im.vector.setting.breadcrumbs HTTP/1.1" 200 2 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/119.0"
Nov 29 14:26:34 syncloud matrix.matrix[7764]: time="2023-11-29T14:26:34.311257860Z" level=debug msg="Received data from client API server" room_id="" type=im.vector.setting.breadcrumbs
Nov 29 14:26:34 syncloud matrix.matrix[7764]: time="2023-11-29T14:26:34.317263623Z" level=debug msg="Received data from client API server" room_id="!6tivynKADmyCUXJA:matrix.myserver" type=m.fully_read
Nov 29 14:26:34 syncloud nginx[28101]: syncloud nginx: 1.2.3.4 - - [29/Nov/2023:14:26:34 +0000] "POST /_matrix/client/r0/rooms/!6tivynKADmyCUXJA%3Amatrix.myserver/read_markers HTTP/1.1" 200 2 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/119.0"
Nov 29 14:26:34 syncloud matrix.matrix[7764]: time="2023-11-29T14:26:34.321394315Z" level=debug msg="Appservice worker sending 1 events(s) from roomserver" appservice=slack
Nov 29 14:26:34 syncloud matrix.slack[8005]: 2023-11-29T14:26:34Z DBG Starting handling of transaction content={"pdu":1} transaction_id=1701267994320429758
Nov 29 14:26:34 syncloud matrix.matrix[7764]: time="2023-11-29T14:26:34.325141155Z" level=info msg="User left room successfully" room_id="!6tivynKADmyCUXJA:matrix.myserver" user_id="@slackbot:matrix.myserver"
Nov 29 14:26:34 syncloud matrix.slack[8005]: 2023-11-29T14:26:34Z DBG Request completed as_user_id=@slackbot:matrix.myserver duration=40.11183 method=POST req_body={} req_id=50 response_length=2 response_mime=application/json status_code=200 url=http://unix/_matrix/client/v3/rooms/%216tivynKADmyCUXJA:matrix.myserver/leave?user_id=%40slackbot%3Amatrix.myserver
Nov 29 14:26:34 syncloud matrix.slack[8005]: 2023-11-29T14:26:34Z DBG Finished dispatching events from transaction transaction_id=1701267994320429758
When a huddle is started, there is no event in matrix and the logs of the bridge during the time of the huddle are
DBG Starting handling of XXX by USLACKBOT, subtype huddle_thread module=Portal/XXX
WRN Received unknown message subtype huddle_thread module=Portal/XXX
WRN unknown message {unmarshalling_error RTM Error: Received unmapped event "huddle_invite"} module=User/XXX
WRN unknown message {unmarshalling_error RTM Error: Received unmapped event "user_huddle_changed"} module=User/XXX
WRN unknown message {unmarshalling_error RTM Error: Received unmapped event "huddle_invite_cancel"} module=User/XXX
WRN unknown message {unmarshalling_error RTM Error: Received unmapped event "user_huddle_changed"} module=User/XXX
WRN unknown message {unmarshalling_error RTM Error: Received unmapped event "user_huddle_changed"} module=User/XXX
WRN unknown message {unmarshalling_error RTM Error: Received unmapped event "user_huddle_changed"} module=User/XXX
WRN unknown message {unmarshalling_error RTM Error: Received unmapped event "user_huddle_changed"} module=User/XXX
WRN unknown message {unmarshalling_error RTM Error: Received unmapped event "user_huddle_changed"} module=User/XXX
I would have expected to at least see a message that would suggest me to open my slack app not to miss the huddle.
I was setupping the bridge (compiled the git version from 2022-10-04 and tried to use pre-compiled binary as well (from here: https://mau.dev/mautrix/slack/-/pipelines?scope=branches&page=1), and right after the login the bridge crashes and throws the following error in the console where I'm running the mautrix-slack binary (Go version: go1.19.1 linux/amd64):
matrix-synapse@matrix:/opt/mautrix-slack/current$ ./mautrix-slack
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0xa9b405]
goroutine 39 [running]:
main.(*User).updateChatMute(0xc000070000, 0xc0000bc6c0, 0x1)
/builds/mautrix/slack/user.go:747 +0x45
main.(*Portal).CreateMatrixRoom(0xc0000bc6c0, 0xc000070000, 0xc000000320, 0xc0003741e0?, 0x1)
/builds/mautrix/slack/portal.go:370 +0xf7d
main.(*User).SyncPortals(0xc000070000, 0xc000000320, 0x9d?)
/builds/mautrix/slack/user.go:515 +0x735
main.(*User).UpdateTeam(0xc000070000, 0xc000000320, 0x0)
/builds/mautrix/slack/user.go:561 +0x677
main.(*User).connectTeam(0xc000070000, 0xc000000320)
/builds/mautrix/slack/user.go:469 +0x485
main.(*User).Connect(0xc000070000)
/builds/mautrix/slack/user.go:572 +0x345
created by main.(*SlackBridge).startUsers
/builds/mautrix/slack/user.go:194 +0xb1
I think the login was successful, because the bridge created couple of rooms already, but then it keeps crashing.
Is this problem with the bridge itself, or is it maybe problem with my environment (I'm using Synapse on Debian, version: 1.68.0+buster1)?
Hello,
I have trouble with threaded messages. I have varying experience, not sure what may be the cause. I have seen #14 but not sure what is the trigger. I made two tests, the first in a general room with multiple other actors. I generally don't receive messages sent as replies. I sent one from the slack web client as a thread reply, with the "Also send to #channel" not checked. I had the following log entries triggered by the event:
Feb 10 08:41:14 matrix matrix-mautrix-slack[3740744]: [Feb 10, 2023 08:41:14] [User/@gergely:horvath.club/WARN] unknown message {unmarshalling_error RTM Error: Received unmapped event "thread_subscribed"}
Feb 10 08:41:14 matrix matrix-mautrix-slack[3740744]: [Feb 10, 2023 08:41:14] [User/@gergely:horvath.club/WARN] unknown message {pref_change 0xc0005c2740}
Feb 10 08:41:14 matrix matrix-mautrix-slack[3740744]: [Feb 10, 2023 08:41:14] [User/@gergely:horvath.club/WARN] unknown message {unmarshalling_error RTM Error: Received unmapped event "update_thread_state"}
Feb 10 08:41:14 matrix matrix-mautrix-slack[3740744]: [Feb 10, 2023 08:41:14] [User/@gergely:horvath.club/WARN] unknown message {unmarshalling_error RTM Error: Received unmapped event "update_thread_state"}
I also started a chat with myself (called Slack bridge bot on the matrix side). Here the option is called "Also send as direct message". When unticked, threaded messages arrive in threads! However when the option is ticked, messages are lost, with the following log entries:
Feb 10 09:00:56 matrix matrix-mautrix-slack[3740744]: [Feb 10, 2023 09:00:56] [User/@gergely:horvath.club/WARN] unknown message {im_marked 0xc0004795c0}
Feb 10 09:00:56 matrix matrix-mautrix-slack[3740744]: [Feb 10, 2023 09:00:56] [User/@gergely:horvath.club/WARN] unknown message {unmarshalling_error RTM Error: Received unmapped event "thread_marked"}
Feb 10 09:00:56 matrix matrix-mautrix-slack[3740744]: [Feb 10, 2023 09:00:56] [User/@gergely:horvath.club/WARN] unknown message {unmarshalling_error RTM Error: Received unmapped event "update_thread_state"}
Would you be so kind to look into this issue? As replies in Slack arrive in threads, I'm missing on big part of the conversation currently. Thanks in advance!
Everything looks fine when anybody (myself included) reacts to a message in Slack, but when I react to a message in Matrix, I get an "extra" reaction on the Matrix side from the Matrix user that represents my Slack user
I do have double puppeting enabled, in case that's relevant
I'm sure there are higher priority things. :)
Our corporate slack seems to set tokens to expire weekly, necessitating a re-login with token every week. When the token expires, I get messages like
โ Your message may not have been bridged: invalid_auth
from slack channels when I try to send.
But when I go to the bot window and ask it to ping, it says
You are signed in to the following Slack teams:
Indicating the bot thinks the connection is alive and well. The bot should at least use the invalid auth it got from attempting to bridge the message as an indicator the token has expired and, ideally, it should ping the server to check expiry so it can notify me before it actually happens.
I'm unable to active the double puppeting. With all other bridges I'm using the "login-matrix " command works just fine, but with this bridge the bot just throws: "Didn't get a ghost :(" message. I have tried multiple different access tokens (tried to generate couple of new ones as well, so I'm 100% certain those are valid access tokens), but none of them works.
In the debug logs there's nothing interesting: the login-matrix received by the bridge and then it immediately responds with that "Didn't get a ghost :(" message:
[Oct 4, 2022 17:52:35] [CommandProcessor/DEBUG] @foouser:foo.bar sent "login-matrix xxx" in !yyy:foo.bar
[Oct 4, 2022 17:52:35] [Matrix/Bot/DEBUG] req #19: PUT http://localhost:8008/_matrix/client/v3/rooms/%21xxx:foo.bar/send/m.room.message/mautrix-go_123412341234_3?user_id=%40slackbot%3Afoo.bar {"msgtype":"m.notice","body":"Didn't get a ghost :("}
How can I debug this issue, or do you have any idea where the problem could it be? In the Synapse INFO level logs, there are only 200 OK responses to the as-sender-slack when I'm executing the "login-matrix xxx" command, no errors.
I'm following the instructions from here: https://docs.mau.fi/bridges/general/double-puppeting.html
E.g.
https://www.kauppalehti.fi/uutiset/supercell-peraa-asennemuutosta-yrityksiin-osaajat-lahtevat-jos-puoliso-ei-saa-toita/3b0779a2-87fb-4968-b3a4-78b49938543e
was bridged as:
https://www.kauppalehti.fi/uutiset/supercell-peraa-asennemuutosta-yrityksiin-osaajat-l[...]s-puoliso-ei-saa-toita/3b0779a2-87fb-4968-b3a4-78b49938543e
Whenever someone sends a reply to a thread (in native Slack) using the Also send to #channel
option, the message doesn't show up in Matrix. Neither as a reply to a thread or a regular message to a channel.
I've looked into https://github.com/mautrix/slack/blob/main/ROADMAP.md and found no mention of this being not implemented.
As pointed out here, traditional Backfill is not yet supported.
This means backfill is impossible on dendrite servers.
I request that we update the slack bridge, specifically the code here, to be like the others, like the newer WhatsApp code here, and support traditional Backfill so we can bring in our historical messages
For a group DM, the bot created a room with just itself in it, and no puppets. It did not populate the room title so Element showed it as "Slack bridge bot".
The only clue I got that this was a group DM room was by looking at m.bridge
and going to the same URL in the Slack web app. Sent messages do seem to get bridged though.
The following message from Slack doesn't properly render newlines in Element. (Might be an issue with this client and not for other clients but I suppose compatibility is somewhat expected.)
{
"type": "m.room.message",
"sender": "@twouters:matrix.tcpdump.be",
"content": {
"body": "**bold** line 1_italic_ line 2line 3",
"fi.mau.double_puppet_source": "mautrix-slack",
"format": "org.matrix.custom.html",
"formatted_body": "<b>bold</b> line 1\n<i>italic</i> line 2\nline 3",
"msgtype": "m.text"
},
"origin_server_ts": 1681735582179,
"unsigned": {
"age": 133
},
"event_id": "$OYl0mLzdvF5YInrKJlhfm_T3qu-DxwcS_LsmYXXXXXX",
"room_id": "!ftBtKtxVHpQhXXXXXX:matrix.tcpdump.be"
}
My team at work are fond users of slash commands, I'd like to be able to use them with this bridge too.
Something like !slack command <command> [args]
or !slack /<command> [args]
.
2023-10-03T07:59:26+02:00 INF Initializing bridge built_at="Oct 3 2023, 07:57:04" go_version=go1.20.6 name=mautrix-slack version=0.1.0+dev.4530ff39
2023-10-03T07:59:26+02:00 DBG Initializing database connection
2023-10-03T07:59:26+02:00 DBG Initializing state store
2023-10-03T07:59:26+02:00 DBG Initializing Matrix event processor
2023-10-03T07:59:26+02:00 DBG Initializing Matrix event handler
2023-10-03T07:59:26+02:00 DBG Bridge built with end-to-bridge encryption, but disabled in config
2023-10-03T07:59:26+02:00 INF Bridge initialization complete, starting...
2023-10-03T07:59:26+02:00 DBG Running database upgrades
2023-10-03T07:59:26+02:00 FTL Failed to initialize database error="unsupported database schema version: currently on v16 (compatible down to v16), latest known: v15" db_section=main
2023-10-03T07:59:26+02:00 INF Downgrading the bridge is not supported
I updated my bridge to the most recent version from git (2022-10-12 13:00 EET), and after I started the new bridge it immediately renamed all my Slack rooms to names without the original Slack room name:
# Bridge config
bridge:
# Localpart template of MXIDs for Slack users.
# {{.}} is replaced with the internal ID of the Slack user.
username_template: slack_{{.}}
# Displayname template for Slack users.
# TODO: document variables
displayname_template: '{{.RealName}} (Slack)'
bot_displayname_template: '{{.Name}} (Slack bot)'
channel_name_template: 'Slack #{{.Name}}'
portal_message_buffer: 128
It seems that the bridge is not able to update the #{{.Name}} to the real Slack room name anymore?
Like some other nice mautrix bridges do
It would be nice if the rooms in a team (and maybe group chats) had the avatar of the team.
Our corporate slack is divided into a load of sub workspaces. Some channels span all workspaces and some are workspace specific. When, as a member of an existing workspace, I join a new workspace with mautrix-slack, all the common channels get duplicated as do all the DMs. The new rooms end up being the ones the bridge sends new messages in the channels and DMs to, so I lose all the history unless I can find the old room (which isn't easy for DMs).
Slack user's display name / real name is not applied in Matrix. All the users, in all rooms are seen as they raw Matrix user ID, even I've configured the "displayname_template" setting:
I've tried multiple different configuration for the displayname_template, but it does not affect:
bridge:
# Localpart template of MXIDs for Slack users.
# {{.}} is replaced with the internal ID of the Slack user.
username_template: slack_{{.}}
# Displayname template for Slack users.
# TODO: document variables
displayname_template: '{{.Name}}'
bot_displayname_template: '{{.Name}} (Slack bot)'
channel_name_template: '{{.Name}} ({{.TeamName}}, Slack)'
and
bridge:
# Localpart template of MXIDs for Slack users.
# {{.}} is replaced with the internal ID of the Slack user.
username_template: slack_{{.}}
# Displayname template for Slack users.
# TODO: document variables
displayname_template: '{{.Name}} ({{.RealName}}, Slack)'
bot_displayname_template: '{{.Name}} (Slack bot)'
channel_name_template: '{{.Name}} ({{.TeamName}}, Slack)'
I also tried to erase the database mautrix-slack is using and start it "from the scratch", but the issue remains.
The room names' (channel_name_template) setting works just fine, though.
Version I'm using is pulled from the Git on 21st of June 2023.
I have chats with the same people across multiple workspaces, so I need to be able to differentiate which team I am talking to them from. When I added the team name parameter to the displayname_template, it resulted in the following:
displayname_template: '{{.RealName}} ({{.TeamName}}, S)'
-> John Doe (
My configuration, as far as I know, is correct to have matrix display names set to slack names, however they are the full slack user IDs instead.
E.g.
config.yml
appservice:
address: http://matrix-mautrix-slack:8080
as_token: <redacted>
async_transactions: false
bot:
avatar: mxc://maunium.net/pVtzLmChZejGxLqmXtQjFxem
displayname: Slack bridge bot
username: slackbot
database:
max_conn_idle_time: null
max_conn_lifetime: null
max_idle_conns: 2
max_open_conns: 20
type: postgres
uri: postgresql://matrix_mautrix_slack:<redacted>@matrix-postgres:5432/matrix_mautrix_slack?sslmode=disable
ephemeral_events: true
hostname: 0.0.0.0
hs_token: <redacted>
id: slack
port: 8080
bridge:
backfill:
enable: false
immediate_messages: 10
incremental:
max_messages:
channel: -1
dm: -1
group_dm: -1
messages_per_batch: 100
post_batch_delay: 20
unread_hours_threshold: 720
bot_displayname_template: '{{.Name}} (bot)'
channel_name_template: '#{{.Name}}'
command_prefix: '!slack'
delivery_receipts: true
displayname_template: '{{.RealName}} (S)'
double_puppet_allow_discovery: false
double_puppet_server_map:
<redacted>: http://matrix-nginx-proxy:12080
encryption:
allow: false
allow_key_sharing: false
appservice: false
default: false
require: false
rotation:
enable_custom: false
messages: 100
milliseconds: 604800000
verification_levels:
receive: unverified
send: unverified
share: cross-signed-tofu
login_shared_secret_map:
<redacted>: <redacted>
management_room_text:
additional_help: ''
welcome: Hello, I'm a Slack bridge bot.
welcome_connected: Use `help` for help.
welcome_unconnected: Use `help` for help, or `login-token` or `login-password` to log in.
message_error_notices: true
message_handling_timeout:
deadline: 60s
error_after: 10s
message_status_events: false
permissions:
<redacted>: user
portal_message_buffer: 128
provisioning:
prefix: /_matrix/provision
shared_secret: generate
sync_direct_chat_list: false
sync_with_custom_puppets: false
username_template: slack_{{.}}
homeserver:
address: http://matrix-nginx-proxy:12080
async_media: false
domain: <redacted>
message_send_checkpoint_endpoint: null
software: standard
status_endpoint: null
logging:
directory: ./logs
file_date_format: '2006-01-02'
file_json: false
file_mode: 384
file_name_format: ''
print_json: false
print_level: warn
timestamp_format: Jan _2, 2006 15:04:05
registration.yml
as_token: <redacted>
de.sorunome.msc2409.push_ephemeral: true
hs_token: <redacted>
id: slack
namespaces:
users:
- exclusive: true
regex: ^@slack_[a-z-A-Z0-9\-]+:<redacted>$
- exclusive: true
regex: ^@slackbot:<redacted>$
rate_limited: false
sender_localpart: _bot_slackbot
url: http://matrix-mautrix-slack:8080
Attempts to get the slackbot to login fail.
Using login-token
, it returns: "Failed to log in with token: enterprise_is_restricted"
For login-password
, it returns: "teams that use Single Sign On are not currently supported"
In the discussion room Tulir said it, "looks like enterprise_is_restricted might be some recent api change" and cited issue 910 for wee-slack as a reference.
I know this bridge is not actually released yet, but I'd love to be able to use it once it is released.
Will this bridge support XOXC tokens + cookies for authentication? I know the bridge is based on slack-go and it looks like they have a PR open for it: slack-go/slack#1092
Wee-slack's implementation may have further information as well:
wee-slack/wee-slack#857
After setting up the bridge, I've noticed that only some of the bridged Slack users have avatars.
Not sure what the pattern is.
Here is my backfill configuration:
backfill:
# Allow backfilling at all? Requires MSC2716 support on homeserver.
enable: false
# Maximum number of conversations to fetch from Slack when syncing team from Slack.
# Must be 0-999
conversations_count: 0
Yet, the first time the container started up, I had 80 invites from all the channels and private messages of my Slack.
I rejected them one by one to keep a clean UI in Element but each time the mautrix-slack
container restarts, I get those same 80 invites again.
It is the only bridge that does that to me. Does anyone else experiences the same behaviour and knows how to fix it?
Like any other bridge, I'd expect to receive an invite only if a new message has been sent in one of the 80 channels.
๐ฟ
I am in a lot of slack channels, and in most I don't need to pay attention to the general channels, but like to occasionally check them for any good information. Bridging all of the text channels clutters up my inbox too much.
On the other hand, it would be pretty nice if I could get notified and be able to respond to DMs (and maybe DM groups too) in matrix since I get them relatively rarely, and they wouldn't clutter up my inbox so much.
Currently the bridge starts backfilling after connecting to Slack, which doesn't work on synapse (yet).
The bridge should check if backfilling is enabled in the config file before it does this.
I have two rooms with name #
only (well, sometimes), and only getting state events not messages. Apparently these "empty" rooms are a leftover from when I logged out of a Slack session they were initially synced from, and duplicates of newly synced same channels with a different room ID. The rooms keep changing name like this:
Wednesday, 10:40, Slack bridge bot changed the room name from #announce to #.
Wednesday, 10:40, Slack bridge bot changed the topic to "".
Wednesday, 16:02, Slack bridge bot changed the room name from # to #announce.
Wednesday, 16:02, Slack bridge bot changed the topic to "Description: Welcome Channel Updates".
Wednesday, 21:02, Slack bridge bot changed the room name from #announce-global to #.
Wednesday, 21:02, Slack bridge bot changed the topic to "".
Wednesday, 21:42, Slack bridge bot changed the room name from # to #announce.
Wednesday, 21:42, Slack bridge bot changed the topic to "Description: Welcome Channel Updates".
Such room name changes may also happen for the not abandoned but lively synced room if it bridges to the same Slack channel as the abandoned room exposing the behaviour.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.