Open kolsys opened 2 months ago
Code Climate has analyzed commit 5b86262f and detected 4 issues on this pull request.
Here's the issue category breakdown:
Category | Count |
---|---|
Complexity | 4 |
View more on Code Climate.
FROM golang:1.22.0-alpine3.19 AS builder
COPY matterbridge /go/src/matterbridge
RUN apk --no-cache add git \
&& go version \
&& cd /go/src/matterbridge \
&& CGO_ENABLED=0 go build -mod vendor -o /bin/matterbridge
FROM alpine:3.19
RUN apk --no-cache add ca-certificates mailcap
COPY --from=builder /bin/matterbridge /bin/matterbridge
RUN mkdir /etc/matterbridge \
&& touch /etc/matterbridge/matterbridge.toml \
&& ln -sf /matterbridge.toml /etc/matterbridge/matterbridge.toml
ENTRYPOINT ["/bin/matterbridge", "-conf", "/etc/matterbridge/matterbridge.toml"]
@kolsys Could you please update the Dockerfile? The current version in the master branch doesn’t work correctly.
FROM golang:1.22.0-alpine3.19 AS builder COPY matterbridge /go/src/matterbridge RUN apk --no-cache add git \ && go version \ && cd /go/src/matterbridge \ && CGO_ENABLED=0 go build -mod vendor -o /bin/matterbridge FROM alpine:3.19 RUN apk --no-cache add ca-certificates mailcap COPY --from=builder /bin/matterbridge /bin/matterbridge RUN mkdir /etc/matterbridge \ && touch /etc/matterbridge/matterbridge.toml \ && ln -sf /matterbridge.toml /etc/matterbridge/matterbridge.toml ENTRYPOINT ["/bin/matterbridge", "-conf", "/etc/matterbridge/matterbridge.toml"]
@kolsys Could you please update the Dockerfile? The current version in the master branch doesn’t work correctly.
Whats wrong with the master version? I've build and run it.
Hi. We experiencing errors downloading images. Look like the file URL is empty. Bot configured according your recommendations.
config
[api.api]
BindAddress="0.0.0.0:4242"
Buffer=1000
RemoteNickFormat="{NICK}"
[general]
MediaDownloadPath="/var/www/matterbridge"
MediaServerDownload="http://matterbridge.matterbridge-namespace/matterbridge"
[slack]
[slack.one]
Token="xoxb-*****"
AppToken="xapp-********"
PrefixMessagesWithNick=true
Debug=true
RemoteNickFormat="[{PROTOCOL}] <{NICK}> "
PreserveThreading=true
UseFullName=true
[mattermost]
[mattermost.two]
Server="company.com:443"
Team="team1"
Token="*****************"
RemoteNickFormat="[{PROTOCOL}] <{NICK}> "
PrefixMessagesWithNick=true
PreserveThreading=true
UseUserName=true
Debug=true
[[gateway]]
name="api"
enable=true
[[gateway.inout]]
account="api.api"
channel="api"
[[gateway]]
name="client"
enable=true
[[gateway.inout]]
account="mattermost.two"
channel="channel2"
[[gateway.inout]]
account="slack.one"
channel="channel1"
Also tried without MediaDownloadPath/MediaServerDownload options - result is the same.
logs
time="2024-07-12T11:23:12Z" level=debug msg="Message event: {"client_msg_id":"3c60172b-85be-20cb-bed3-1b041bdd51af","type":"message","user":"U05******","text":"test40","thread_ts":"1720779786.805609","ts":"1720783391.651979","channel":"C061W7QFYPM","channel_type":"channel","event_ts":"1720783391.651979","subtype":"file_share","upload":false,"files":[{"id":"F07BZLYLJ6A","created":0,"timestamp":0,"name":"","title":"","mimetype":"","filetype":"png","pretty_type":"","user":"","editable":false,"size":0,"mode":"","is_external":false,"external_type":"","is_public":false,"public_url_shared":false,"display_as_bot":false,"username":"","url_private":"","url_private_download":"","thumb_64":"","thumb_80":"","thumb_360":"","thumb_360_w":0,"thumb_360_h":0,"thumb_480":"","thumb_480_w":0,"thumb_480_h":0,"thumb_160":"","thumb_720":"","thumb_720_w":0,"thumb_720_h":0,"thumb_800":"","thumb_800_w":0,"thumb_800_h":0,"thumb_960":"","thumb_960_w":0,"thumb_960_h":0,"thumb_1024":"","thumb_1024_w":0,"thumb_1024_h":0,"image_exif_rotation":0,"original_w":0,"original_h":0,"permalink":"","permalink_public":""}],"blocks":[{"type":"rich_text","block_id":"o6CuE","elements":[{"type":"rich_text_section","elements":[{"type":"text","text":"test40"}]}]}],"root":null}" func=handleSlackClientSocketMode file="bridge/slack/handlers.go:99" prefix=slack
time="2024-07-12T11:23:12Z" level=debug msg="Trying to download "" with size 0" func=HandleDownloadSize file="bridge/helper/helper.go:162" prefix=slack
time="2024-07-12T11:23:12Z" level=error msg="Could not download incoming file: &errors.errorString{s:"download failed &url.Error{Op:\"Get\", URL:\"\", Err:(*errors.errorString)(0xc0009131e0)}"}" func=handleAttachments file="bridge/slack/handlers.go:460" prefix=slack
we are running bridge in k8s (without nat) but webockets seems to be work, pings look fine
slack-go/slack/socketmode2024/07/12 12:56:36 socket_mode_managed_conn.go:627: WebSocket ping message received: Ping from applink-13
slack-go/slack/socketmode2024/07/12 12:56:46 socket_mode_managed_conn.go:627: WebSocket ping message received: Ping from applink-13
time="2024-07-12T12:56:52Z" level=debug msg="WsReceiver response: &model.WebSocketResponse{Status:"OK", SeqReply:127, Data:map[string]interface {}{"node_id":"", "server_time":1.720789012475e+12, "text":"pong", "version":"9.2.2"}, Error:(*model.AppError)(nil)}" prefix=matterclient
time="2024-07-12T12:56:52Z" level=debug msg="getting response: &model.WebSocketResponse{Status:"OK", SeqReply:127, Data:map[string]interface {}{"node_id":"", "server_time":1.720789012475e+12, "text":"pong", "version":"9.2.2"}, Error:(*model.AppError)(nil)}" prefix=matterclient
@xeonic-ant Hi. Looks like the RTM attachment message format is not fully compatible with Event API and it's required to write more complex converter for message than my workaround: https://github.com/42wim/matterbridge/pull/2161/files#diff-014f29c022fd23b8c7f870b5cfa1cb6905ca8a8eb1c83d0209d77d279f4962b9R97
Just confirming, is there any ability within this using the new slack app to post in a channel within slack using a nickname that isn't the same name as the bot (so as to preserve / bridge the nickname and avatar?)
This is beta version for modern Slack applications. Changes implement Slack Events API in socket mode, see #964.
Fixes #2159 It also fixes files upload to Slack for modern Apps.
To activate Ecvents API in SocketMode you must: