42wim / matterbridge

bridge between mattermost, IRC, gitter, xmpp, slack, discord, telegram, rocketchat, twitch, ssh-chat, zulip, whatsapp, keybase, matrix, microsoft teams, nextcloud, mumble, vk and more with REST API (mattermost not required!)
Apache License 2.0
6.65k stars 617 forks source link

MediaDownloadPath doesn't seem to work #1338

Closed allilengyi closed 3 years ago

allilengyi commented 3 years ago

Describe the bug I have a semi-working bridge connecting Telegram, Matrix, XMPP and Whatsapp.. I sent one image (png) from matrix and one image (jpg) from telegram. Instead of receiving a link to the file in the directory specified in MediaDownloadPath the XMPP client receives:

[telegram] <unknown>
[matrix] <tommy> https://chat.privacytools.io/_matrix/media/v1/download/privacytools.io/zPJhwZVlDQHzWWnCxYRCDDrS

To Reproduce Establish a bridge between Matrix, XMPP, Telegram and send media files with matrix and telegram.

Expected behavior The XMPP client should receive a link to the file in the directory specified in MediaDownloadPath

Screenshots/debug logs Seems to be a permission problem:

[0072] ERROR gateway:      [handleFiles:gateway/handlers.go:104] mediaserver path failed, could not mkdir: mkdir /var/www/bridge/upload/60de7a0f: no such file or directory &os.PathError{Op:"mkdir", Path:"/var/www/bridge/upload/60de7a0f", Err:0x2}

However,

getfacl /var/www/bridges/upload/
getfacl: Removing leading '/' from absolute path names
# file: var/www/bridges/upload/
# owner: root
# group: bridge
user::rwx
group::rwx
other::rwx

The matterbridge is started by the user root.

The log file:

[0000]  INFO router:       [Start:gateway/router.go:66] Parsing gateway bridge
[0000]  INFO router:       [Start:gateway/router.go:75] Starting bridge: matrix.privacytools 
[0000]  INFO matrix:       [Connect:bridge/matrix/matrix.go:76] Connecting https://chat.privacytools.io
[0042]  INFO matrix:       [Connect:bridge/matrix/matrix.go:92] Connection succeeded
[0042]  INFO matrix:       [joinChannels:bridge/bridge.go:77] matrix.privacytools: joining #bridge-test:privacytools.io (ID: #bridge-test:privacytools.iomatrix.privacytools)
[0042]  INFO router:       [Start:gateway/router.go:75] Starting bridge: telegram.tgbot 
[0042]  INFO telegram:     [Connect:bridge/telegram/telegram.go:46] Connecting
[0042]  INFO telegram:     [Connect:bridge/telegram/telegram.go:59] Connection succeeded
[0042]  INFO telegram:     [joinChannels:bridge/bridge.go:77] telegram.tgbot: joining -100tgID (ID: -100tgIDtelegram.tgbot)
[0042]  INFO router:       [Start:gateway/router.go:75] Starting bridge: whatsapp.wabot 
[0042] DEBUG whatsapp:     [Connect:bridge/whatsapp/whatsapp.go:68] Connecting to WhatsApp..
[0042] DEBUG whatsapp:     [Connect:bridge/whatsapp/whatsapp.go:77] WhatsApp connection successful
[0042] DEBUG whatsapp:     [Connect:bridge/whatsapp/whatsapp.go:85] Restoring WhatsApp session..
[0043] DEBUG whatsapp:     [Connect:bridge/whatsapp/whatsapp.go:96] Session restored successfully!
[0044] ERROR whatsapp:     [HandleError:bridge/whatsapp/handlers.go:39] message type not implemented
[0044] ERROR whatsapp:     [HandleError:bridge/whatsapp/handlers.go:39] message type not implemented
[0044] ERROR whatsapp:     [HandleError:bridge/whatsapp/handlers.go:39] message type not implemented
[0044] ERROR whatsapp:     [HandleError:bridge/whatsapp/handlers.go:39] message type not implemented
[0044] ERROR whatsapp:     [HandleError:bridge/whatsapp/handlers.go:39] message type not implemented
[0044] ERROR whatsapp:     [HandleError:bridge/whatsapp/handlers.go:39] message type not implemented
[0044] ERROR whatsapp:     [HandleError:bridge/whatsapp/handlers.go:39] message type not implemented
[0044] ERROR whatsapp:     [HandleError:bridge/whatsapp/handlers.go:39] message type not implemented
[0045] ERROR whatsapp:     [HandleError:bridge/whatsapp/handlers.go:39] message type not implemented
[0045]  INFO whatsapp:     [joinChannels:bridge/bridge.go:77] whatsapp.wabot: joining xxxx-xxxx@g.us (ID: xxxx-xxxx@g.uswhatsapp.wabot)
[0045]  INFO router:       [Start:gateway/router.go:75] Starting bridge: xmpp.blabber 
[0045]  INFO xmpp:         [Connect:bridge/xmpp/xmpp.go:41] Connecting blabber.im:5222
[0045] DEBUG whatsapp:     [func1:bridge/whatsapp/whatsapp.go:126] Getting user avatars..
[0045]  INFO xmpp:         [Connect:bridge/xmpp/xmpp.go:47] Connection succeeded
[0045]  INFO xmpp:         [joinChannels:bridge/bridge.go:77] xmpp.blabber: joining bridge-test (ID: bridge-testxmpp.blabber)
[0045]  INFO main:         [main:matterbridge.go:70] Gateway(s) started succesfully. Now relaying messages
[0045] DEBUG xmpp:         [handleXMPP:bridge/xmpp/xmpp.go:237] == Receiving xmpp.Chat{Remote:"bridge-test@conference.blabber.im", Type:"groupchat", Text:"", Subject:"", Thread:"", Ooburl:"", Oobdesc:"", ID:"", ReplaceID:"", Roster:xmpp.Roster(nil), Other:[]string{}, OtherElem:[]xmpp.XMLElement(nil), Stamp:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}}
[0072] DEBUG telegram:     [handleRecv:bridge/telegram/handlers.go:121] == Receiving event: (*tgbotapi.Message)(nil)
[0072] DEBUG telegram:     [HandleDownloadSize:bridge/helper/helper.go:133] Trying to download "file_4.jpg" with size 102760
[0072] DEBUG telegram:     [HandleDownloadData:bridge/helper/helper.go:149] Download OK "file_4.jpg" 102760
[0072] DEBUG telegram:     [handleRecv:bridge/telegram/handlers.go:173] <= Sending message from unknown on telegram.tgbot to gateway
[0072] DEBUG telegram:     [handleRecv:bridge/telegram/handlers.go:174] <= Message is config.Message{Text:"", Channel:"-100tgID", Username:"unknown", UserID:"", Avatar:"", Account:"telegram.tgbot", Event:"", Protocol:"", Gateway:"", ParentID:"", Timestamp:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}, ID:"95", Extra:map[string][]interface {}{"file":[]interface {}{config.FileInfo{Name:"file_4.jpg", Data:(*[]uint8)(0xc0003880a0), Comment:"", URL:"", Size:0, Avatar:false, SHA:""}}}}
[0072] ERROR gateway:      [handleFiles:gateway/handlers.go:104] mediaserver path failed, could not mkdir: mkdir /var/www/bridge/upload/60de7a0f: no such file or directory &os.PathError{Op:"mkdir", Path:"/var/www/bridge/upload/60de7a0f", Err:0x2}
[0072] DEBUG gateway:      [SendMessage:gateway/gateway.go:472] => Sending config.Message{Text:"", Channel:"-100tgID", Username:"unknown", UserID:"", Avatar:"", Account:"telegram.tgbot", Event:"", Protocol:"telegram", Gateway:"bridge", ParentID:"", Timestamp:time.Time{wall:0xbfef00897584a5d3, ext:72427679513, loc:(*time.Location)(0x334ea00)}, ID:"95", Extra:map[string][]interface {}{"file":[]interface {}{config.FileInfo{Name:"file_4.jpg", Data:(*[]uint8)(0xc0003880a0), Comment:"", URL:"", Size:0, Avatar:false, SHA:""}}}} from telegram.tgbot (-100tgID) to xmpp.blabber (bridge-test)
[0072] DEBUG xmpp:         [Send:bridge/xmpp/xmpp.go:76] => Receiving config.Message{Text:"", Channel:"bridge-test", Username:"[telegram] <unknown> ", UserID:"", Avatar:"", Account:"telegram.tgbot", Event:"", Protocol:"telegram", Gateway:"bridge", ParentID:"", Timestamp:time.Time{wall:0xbfef00897584a5d3, ext:72427679513, loc:(*time.Location)(0x334ea00)}, ID:"", Extra:map[string][]interface {}{"file":[]interface {}{config.FileInfo{Name:"file_4.jpg", Data:(*[]uint8)(0xc0003880a0), Comment:"", URL:"", Size:0, Avatar:false, SHA:""}}}}
[0072] DEBUG gateway:      [func1:gateway/gateway.go:481] => Send from telegram.tgbot (-100tgID) to xmpp.blabber (bridge-test) took 259.501µs
[0072] DEBUG gateway:      [SendMessage:gateway/gateway.go:472] => Sending config.Message{Text:"", Channel:"-100tgID", Username:"unknown", UserID:"", Avatar:"", Account:"telegram.tgbot", Event:"", Protocol:"telegram", Gateway:"bridge", ParentID:"", Timestamp:time.Time{wall:0xbfef00897584a5d3, ext:72427679513, loc:(*time.Location)(0x334ea00)}, ID:"95", Extra:map[string][]interface {}{"file":[]interface {}{config.FileInfo{Name:"file_4.jpg", Data:(*[]uint8)(0xc0003880a0), Comment:"", URL:"", Size:0, Avatar:false, SHA:""}}}} from telegram.tgbot (-100tgID) to matrix.privacytools (#bridge-test:privacytools.io)
[0072] DEBUG matrix:       [Send:bridge/matrix/matrix.go:124] => Receiving config.Message{Text:"", Channel:"#bridge-test:privacytools.io", Username:"[telegram] <unknown> ", UserID:"", Avatar:"", Account:"telegram.tgbot", Event:"", Protocol:"telegram", Gateway:"bridge", ParentID:"", Timestamp:time.Time{wall:0xbfef00897584a5d3, ext:72427679513, loc:(*time.Location)(0x334ea00)}, ID:"", Extra:map[string][]interface {}{"file":[]interface {}{config.FileInfo{Name:"file_4.jpg", Data:(*[]uint8)(0xc0003880a0), Comment:"", URL:"", Size:0, Avatar:false, SHA:""}}}}
[0072] DEBUG matrix:       [Send:bridge/matrix/matrix.go:127] Channel #bridge-test:privacytools.io maps to channel id !pWIPPSfgfrfCcMwsOo:privacytools.io
[0072] DEBUG xmpp:         [handleXMPP:bridge/xmpp/xmpp.go:237] == Receiving xmpp.Chat{Remote:"bridge-test@conference.blabber.im/xmppbot", Type:"groupchat", Text:"[telegram] <unknown> ", Subject:"", Thread:"", Ooburl:"", Oobdesc:"", ID:"04c98173db0f9cc3", ReplaceID:"", Roster:xmpp.Roster(nil), Other:[]string{"", ""}, OtherElem:[]xmpp.XMLElement{xmpp.XMLElement{XMLName:xml.Name{Space:"urn:xmpp:mam:tmp", Local:"archived"}, InnerXML:""}, xmpp.XMLElement{XMLName:xml.Name{Space:"urn:xmpp:sid:0", Local:"stanza-id"}, InnerXML:""}}, Stamp:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}}
[0083] DEBUG matrix:       [handleUploadFile:bridge/matrix/matrix.go:428] uploading file: file_4.jpg image/jpeg
[0084] DEBUG matrix:       [handleUploadFile:bridge/matrix/matrix.go:443] sendImage mxc://privacytools.io/yRhFnSHpKvcdgMnWUTWjzEMS
[0084] DEBUG matrix:       [handleEvent:bridge/matrix/matrix.go:282] == Receiving event: &gomatrix.Event{StateKey:(*string)(nil), Sender:"@tommy:privacytools.io", Type:"m.room.message", Timestamp:1608223354396, ID:"$uNQP1q6v9SoP0mchTZQS4kqHsLP7J9EpRyBIgpXI7mg", RoomID:"!pWIPPSfgfrfCcMwsOo:privacytools.io", Redacts:"", Unsigned:map[string]interface {}{"age":55316}, Content:map[string]interface {}{"body":"zbar.200.png", "info":map[string]interface {}{"h":240, "mimetype":"image/png", "size":7790, "thumbnail_info":map[string]interface {}{"h":240, "mimetype":"image/png", "size":10436, "w":200}, "thumbnail_url":"mxc://privacytools.io/bQKlBIFfMtdbExJsOLacwjZV", "w":200}, "msgtype":"m.image", "url":"mxc://privacytools.io/zPJhwZVlDQHzWWnCxYRCDDrS"}, PrevContent:map[string]interface {}(nil)}
[0084] DEBUG matrix:       [HandleDownloadSize:bridge/helper/helper.go:133] Trying to download "zbar.200.png" with size 7790
[0084] DEBUG matrix:       [HandleDownloadData:bridge/helper/helper.go:149] Download OK "zbar.200.png" 7790
[0084] DEBUG matrix:       [handleEvent:bridge/matrix/matrix.go:342] <= Sending message from @tommy:privacytools.io on matrix.privacytools to gateway
[0092] DEBUG matrix:       [handleUploadFile:bridge/matrix/matrix.go:477] result: &gomatrix.RespMediaUpload{ContentURI:"mxc://privacytools.io/yRhFnSHpKvcdgMnWUTWjzEMS"}
[0092] DEBUG gateway:      [func1:gateway/gateway.go:481] => Send from telegram.tgbot (-100tgID) to matrix.privacytools (#bridge-test:privacytools.io) took 20.10147423s
[0092] DEBUG gateway:      [SendMessage:gateway/gateway.go:472] => Sending config.Message{Text:"", Channel:"-100tgID", Username:"unknown", UserID:"", Avatar:"", Account:"telegram.tgbot", Event:"", Protocol:"telegram", Gateway:"bridge", ParentID:"", Timestamp:time.Time{wall:0xbfef00897584a5d3, ext:72427679513, loc:(*time.Location)(0x334ea00)}, ID:"95", Extra:map[string][]interface {}{"file":[]interface {}{config.FileInfo{Name:"file_4.jpg", Data:(*[]uint8)(0xc0003880a0), Comment:"", URL:"", Size:0, Avatar:false, SHA:""}}}} from telegram.tgbot (-100tgID) to whatsapp.wabot (xxxx-xxxx@g.us)
[0092] DEBUG whatsapp:     [Send:bridge/whatsapp/whatsapp.go:300] => Receiving config.Message{Text:"", Channel:"xxxx-xxxx@g.us", Username:"[telegram] @unknown: ", UserID:"", Avatar:"", Account:"telegram.tgbot", Event:"", Protocol:"telegram", Gateway:"bridge", ParentID:"", Timestamp:time.Time{wall:0xbfef00897584a5d3, ext:72427679513, loc:(*time.Location)(0x334ea00)}, ID:"", Extra:map[string][]interface {}{"file":[]interface {}{config.FileInfo{Name:"file_4.jpg", Data:(*[]uint8)(0xc0003880a0), Comment:"", URL:"", Size:0, Avatar:false, SHA:""}}}}
[0092] DEBUG whatsapp:     [Send:bridge/whatsapp/whatsapp.go:330] Extra file is "image/jpeg"
[0092] DEBUG whatsapp:     [PostImageMessage:bridge/whatsapp/whatsapp.go:281] => Sending config.Message{Text:"", Channel:"xxxx-xxxx@g.us", Username:"[telegram] @unknown: ", UserID:"", Avatar:"", Account:"telegram.tgbot", Event:"", Protocol:"telegram", Gateway:"bridge", ParentID:"", Timestamp:time.Time{wall:0xbfef00897584a5d3, ext:72427679513, loc:(*time.Location)(0x334ea00)}, ID:"", Extra:map[string][]interface {}{"file":[]interface {}{config.FileInfo{Name:"file_4.jpg", Data:(*[]uint8)(0xc0003880a0), Comment:"", URL:"", Size:0, Avatar:false, SHA:""}}}}
[0094] DEBUG gateway:      [SendMessage:gateway/gateway.go:491] mID whatsapp.wabot: F7D28A4B08CC77238EF5
[0094] DEBUG gateway:      [func1:gateway/gateway.go:481] => Send from telegram.tgbot (-100tgID) to whatsapp.wabot (xxxx-xxxx@g.us) took 1.504592076s
[0094] ERROR gateway:      [handleFiles:gateway/handlers.go:104] mediaserver path failed, could not mkdir: mkdir /var/www/bridge/upload/8b6965b1: no such file or directory &os.PathError{Op:"mkdir", Path:"/var/www/bridge/upload/8b6965b1", Err:0x2}
[0094] DEBUG gateway:      [SendMessage:gateway/gateway.go:472] => Sending config.Message{Text:"zbar.200.png", Channel:"#bridge-test:privacytools.io", Username:"tommy", UserID:"@tommy:privacytools.io", Avatar:"", Account:"matrix.privacytools", Event:"", Protocol:"matrix", Gateway:"bridge", ParentID:"", Timestamp:time.Time{wall:0xbfef008ede568da3, ext:94038782664, loc:(*time.Location)(0x334ea00)}, ID:"$uNQP1q6v9SoP0mchTZQS4kqHsLP7J9EpRyBIgpXI7mg", Extra:map[string][]interface {}{"file":[]interface {}{config.FileInfo{Name:"zbar.200.png", Data:(*[]uint8)(0xc000319b60), Comment:"", URL:"https://chat.privacytools.io/_matrix/media/v1/download/privacytools.io/zPJhwZVlDQHzWWnCxYRCDDrS", Size:0, Avatar:false, SHA:""}}}} from matrix.privacytools (#bridge-test:privacytools.io) to xmpp.blabber (bridge-test)
[0094] DEBUG xmpp:         [Send:bridge/xmpp/xmpp.go:76] => Receiving config.Message{Text:"zbar.200.png", Channel:"bridge-test", Username:"[matrix] <tommy> ", UserID:"@tommy:privacytools.io", Avatar:"", Account:"matrix.privacytools", Event:"", Protocol:"matrix", Gateway:"bridge", ParentID:"", Timestamp:time.Time{wall:0xbfef008ede568da3, ext:94038782664, loc:(*time.Location)(0x334ea00)}, ID:"", Extra:map[string][]interface {}{"file":[]interface {}{config.FileInfo{Name:"zbar.200.png", Data:(*[]uint8)(0xc000319b60), Comment:"", URL:"https://chat.privacytools.io/_matrix/media/v1/download/privacytools.io/zPJhwZVlDQHzWWnCxYRCDDrS", Size:0, Avatar:false, SHA:""}}}}
[0094] DEBUG gateway:      [func1:gateway/gateway.go:481] => Send from matrix.privacytools (#bridge-test:privacytools.io) to xmpp.blabber (bridge-test) took 626.716µs
[0094] DEBUG gateway:      [SendMessage:gateway/gateway.go:472] => Sending config.Message{Text:"zbar.200.png", Channel:"#bridge-test:privacytools.io", Username:"tommy", UserID:"@tommy:privacytools.io", Avatar:"", Account:"matrix.privacytools", Event:"", Protocol:"matrix", Gateway:"bridge", ParentID:"", Timestamp:time.Time{wall:0xbfef008ede568da3, ext:94038782664, loc:(*time.Location)(0x334ea00)}, ID:"$uNQP1q6v9SoP0mchTZQS4kqHsLP7J9EpRyBIgpXI7mg", Extra:map[string][]interface {}{"file":[]interface {}{config.FileInfo{Name:"zbar.200.png", Data:(*[]uint8)(0xc000319b60), Comment:"", URL:"https://chat.privacytools.io/_matrix/media/v1/download/privacytools.io/zPJhwZVlDQHzWWnCxYRCDDrS", Size:0, Avatar:false, SHA:""}}}} from matrix.privacytools (#bridge-test:privacytools.io) to telegram.tgbot (-100tgID)
[0094] DEBUG telegram:     [Send:bridge/telegram/telegram.go:73] => Receiving config.Message{Text:"zbar.200.png", Channel:"-100tgID", Username:"(matrix) &lt;tommy&gt; ", UserID:"@tommy:privacytools.io", Avatar:"", Account:"matrix.privacytools", Event:"", Protocol:"matrix", Gateway:"bridge", ParentID:"", Timestamp:time.Time{wall:0xbfef008ede568da3, ext:94038782664, loc:(*time.Location)(0x334ea00)}, ID:"", Extra:map[string][]interface {}{"file":[]interface {}{config.FileInfo{Name:"zbar.200.png", Data:(*[]uint8)(0xc000319b60), Comment:"", URL:"https://chat.privacytools.io/_matrix/media/v1/download/privacytools.io/zPJhwZVlDQHzWWnCxYRCDDrS", Size:0, Avatar:false, SHA:""}}}}
[0094] DEBUG xmpp:         [handleXMPP:bridge/xmpp/xmpp.go:237] == Receiving xmpp.Chat{Remote:"bridge-test@conference.blabber.im/xmppbot", Type:"groupchat", Text:"[matrix] <tommy> https://chat.privacytools.io/_matrix/media/v1/download/privacytools.io/zPJhwZVlDQHzWWnCxYRCDDrS", Subject:"", Thread:"", Ooburl:"", Oobdesc:"", ID:"1d4baac11932cadc", ReplaceID:"", Roster:xmpp.Roster(nil), Other:[]string{"", ""}, OtherElem:[]xmpp.XMLElement{xmpp.XMLElement{XMLName:xml.Name{Space:"urn:xmpp:mam:tmp", Local:"archived"}, InnerXML:""}, xmpp.XMLElement{XMLName:xml.Name{Space:"urn:xmpp:sid:0", Local:"stanza-id"}, InnerXML:""}}, Stamp:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}}
[0094] DEBUG xmpp:         [handleXMPP:bridge/xmpp/xmpp.go:237] == Receiving xmpp.Chat{Remote:"bridge-test@conference.blabber.im/xmppbot", Type:"groupchat", Text:"", Subject:"", Thread:"", Ooburl:"", Oobdesc:"", ID:"46fc09ed80b7f2c2", ReplaceID:"", Roster:xmpp.Roster(nil), Other:[]string{""}, OtherElem:[]xmpp.XMLElement{xmpp.XMLElement{XMLName:xml.Name{Space:"jabber:x:oob", Local:"x"}, InnerXML:"<url>https://chat.privacytools.io/_matrix/media/v1/download/privacytools.io/zPJhwZVlDQHzWWnCxYRCDDrS</url>"}}, Stamp:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}}
[0094] DEBUG telegram:     [sendMessage:bridge/telegram/telegram.go:148] Using mode HTML - nick only
[0094] DEBUG gateway:      [SendMessage:gateway/gateway.go:491] mID telegram.tgbot: 97
[0094] DEBUG gateway:      [func1:gateway/gateway.go:481] => Send from matrix.privacytools (#bridge-test:privacytools.io) to telegram.tgbot (-100tgID) took 334.178602ms
[0094] DEBUG gateway:      [SendMessage:gateway/gateway.go:472] => Sending config.Message{Text:"zbar.200.png", Channel:"#bridge-test:privacytools.io", Username:"tommy", UserID:"@tommy:privacytools.io", Avatar:"", Account:"matrix.privacytools", Event:"", Protocol:"matrix", Gateway:"bridge", ParentID:"", Timestamp:time.Time{wall:0xbfef008ede568da3, ext:94038782664, loc:(*time.Location)(0x334ea00)}, ID:"$uNQP1q6v9SoP0mchTZQS4kqHsLP7J9EpRyBIgpXI7mg", Extra:map[string][]interface {}{"file":[]interface {}{config.FileInfo{Name:"zbar.200.png", Data:(*[]uint8)(0xc000319b60), Comment:"", URL:"https://chat.privacytools.io/_matrix/media/v1/download/privacytools.io/zPJhwZVlDQHzWWnCxYRCDDrS", Size:0, Avatar:false, SHA:""}}}} from matrix.privacytools (#bridge-test:privacytools.io) to whatsapp.wabot (xxxx-xxxx@g.us)
[0094] DEBUG whatsapp:     [Send:bridge/whatsapp/whatsapp.go:300] => Receiving config.Message{Text:"zbar.200.png", Channel:"xxxx-xxxx@g.us", Username:"[matrix] @tommy: ", UserID:"@tommy:privacytools.io", Avatar:"", Account:"matrix.privacytools", Event:"", Protocol:"matrix", Gateway:"bridge", ParentID:"", Timestamp:time.Time{wall:0xbfef008ede568da3, ext:94038782664, loc:(*time.Location)(0x334ea00)}, ID:"", Extra:map[string][]interface {}{"file":[]interface {}{config.FileInfo{Name:"zbar.200.png", Data:(*[]uint8)(0xc000319b60), Comment:"", URL:"https://chat.privacytools.io/_matrix/media/v1/download/privacytools.io/zPJhwZVlDQHzWWnCxYRCDDrS", Size:0, Avatar:false, SHA:""}}}}
[0094] DEBUG whatsapp:     [Send:bridge/whatsapp/whatsapp.go:330] Extra file is "image/png"
[0094] DEBUG whatsapp:     [PostImageMessage:bridge/whatsapp/whatsapp.go:281] => Sending config.Message{Text:"zbar.200.png", Channel:"xxxx-xxxx@g.us", Username:"[matrix] @tommy: ", UserID:"@tommy:privacytools.io", Avatar:"", Account:"matrix.privacytools", Event:"", Protocol:"matrix", Gateway:"bridge", ParentID:"", Timestamp:time.Time{wall:0xbfef008ede568da3, ext:94038782664, loc:(*time.Location)(0x334ea00)}, ID:"", Extra:map[string][]interface {}{"file":[]interface {}{config.FileInfo{Name:"zbar.200.png", Data:(*[]uint8)(0xc000319b60), Comment:"", URL:"https://chat.privacytools.io/_matrix/media/v1/download/privacytools.io/zPJhwZVlDQHzWWnCxYRCDDrS", Size:0, Avatar:false, SHA:""}}}}
[0095] DEBUG gateway:      [SendMessage:gateway/gateway.go:491] mID whatsapp.wabot: FC57173CA2E173A013C4
[0095] DEBUG gateway:      [func1:gateway/gateway.go:481] => Send from matrix.privacytools (#bridge-test:privacytools.io) to whatsapp.wabot (xxxx-xxxx@g.us) took 812.294224ms
[0098] DEBUG matrix:       [handleEvent:bridge/matrix/matrix.go:282] == Receiving event: &gomatrix.Event{StateKey:(*string)(nil), Sender:"@bridge-bot:privacytools.io", Type:"m.room.message", Timestamp:1608223397913, ID:"$UElYYOg9mTZukXa3upLc9rCN5rtY_0ly8YL3_L4R9-U", RoomID:"!pWIPPSfgfrfCcMwsOo:privacytools.io", Redacts:"", Unsigned:map[string]interface {}{"age":26050, "transaction_id":"go1608223397906050618"}, Content:map[string]interface {}{"body":"[telegram] <unknown> ", "format":"org.matrix.custom.html", "formatted_body":"[telegram] &lt;unknown&gt; ", "msgtype":"m.text"}, PrevContent:map[string]interface {}(nil)}
[0098] DEBUG matrix:       [handleEvent:bridge/matrix/matrix.go:282] == Receiving event: &gomatrix.Event{StateKey:(*string)(nil), Sender:"@bridge-bot:privacytools.io", Type:"m.room.message", Timestamp:1608223409510, ID:"$3XkApsC7cYHjVT-UKucSGSlSQBuEIh3PqKECNO5MiZU", RoomID:"!pWIPPSfgfrfCcMwsOo:privacytools.io", Redacts:"", Unsigned:map[string]interface {}{"age":14950, "transaction_id":"go1608223409501379380"}, Content:map[string]interface {}{"body":"file_4.jpg", "info":map[string]interface {}{"thumbnail_info":map[string]interface {}{}}, "msgtype":"m.image", "url":"mxc://privacytools.io/yRhFnSHpKvcdgMnWUTWjzEMS"}, PrevContent:map[string]interface {}(nil)}

Environment (please complete the following information):

Additional context

[general]
#check https://github.com/42wim/matterbridge/wiki/Settings#general
#some options for general configs such as
LogFile="/var/log/matterbridge.log"
MediaDownloadPath="/var/www/bridge/upload"
MediaDownloadSize=5000000

[matrix.privacytools]
#Server is your homeserver (eg https://matrix.org)
Server="https://chat.privacytools.io"

#login/pass of your bot.
#Use a dedicated user for this and not your own!
#Messages sent from this user will not be relayed to avoid loops.
Login="bridge-bot"
Password=""

RemoteNickFormat="[{PROTOCOL}] <{NICK}> "

#Whether to send the homeserver suffix. eg ":matrix.org" in @username:matrix.org
#to other bridges, or only send "username".(true only sends username)
#OPTIONAL (default false)
NoHomeServerSuffix=false

[xmpp.blabber]
Server="blabber.im:5222"
#Jid your userid
Jid="bridge-bot@blabber.im"
Password=""
Muc="conference.blabber.im"
Nick="xmppbot"
RemoteNickFormat="[{PROTOCOL}] <{NICK}> "

[telegram.tgbot]
#See https://core.telegram.org/bots#6-botfather 
#and https://www.linkedin.com/pulse/telegram-bots-beginners-marco-frau
Token=""
RemoteNickFormat="({PROTOCOL}) &lt;{NICK}&gt; "
MessageFormat="HTMLNick"

[whatsapp.wabot]
# Number you will use as a relay bot. Tip: Get some disposable sim card, don't rely on 
# your own number.
Number=""

# First time that you login you will need to scan QR code, then credentials will be saved in 
# a session file. 
# If you won't set SessionFile then you will need to scan QR code on every restart.
# optional (by default the session is stored only in memory, till restarting matterbridge)
SessionFile="session-wa.gob"

# If your terminal is white we need to invert QR code in order for it to be scanned properly
# optional (default false)
QrOnWhiteTerminal=false

# Messages will be seen by other WhatsApp contacts as coming from the bridge. 
# Original nick will be part of the message.
RemoteNickFormat="[{PROTOCOL}] @{NICK}: "

[[gateway]]
name="bridge"
enable=true

[[gateway.inout]]
account="xmpp.blabber"
channel="bridge-test"

[[gateway.inout]]
account="matrix.privacytools"
channel="#bridge-test:privacytools.io"

[[gateway.inout]]
account="telegram.tgbot"
channel="-100ID"

[[gateway.inout]]
account="whatsapp.wabot"
channel="xxxx-xxxx@g.us"
allilengyi commented 3 years ago

found a typo. sorry.

qaisjp commented 3 years ago

what was the typo?

allilengyi commented 3 years ago

The path is set to MediaDownloadPath="/var/www/bridge/upload" but the actual path on the filesystem is /var/www/bridges/upload/ with bridges in plural.