From a20cb7ffb29ce2b7722e610deecb93c11a643ea1 Mon Sep 17 00:00:00 2001 From: Joel Bennett Date: Sun, 21 Sep 2025 12:57:03 -0400 Subject: [PATCH 1/3] Remove the ARM container It was taking 13 minutes, and I am not using it. --- .github/workflows/docker.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 422d12c01e..15bb992540 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -18,10 +18,11 @@ jobs: - name: Checkout uses: actions/checkout@v5 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: amd64,arm64 + ## The ARM build I don't use was adding 13 minutes to my build time + # - name: Set up QEMU + # uses: docker/setup-qemu-action@v3 + # with: + # platforms: amd64,arm64 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -54,7 +55,7 @@ jobs: uses: docker/build-push-action@v6 with: context: . - platforms: linux/amd64,linux/arm64 + # platforms: linux/amd64,linux/arm64 cache-from: type=gha cache-to: type=gha,mode=max push: ${{ github.event_name != 'pull_request' }} From 4e7c87e6e43270dde2ba41553c8a8853c30d4d58 Mon Sep 17 00:00:00 2001 From: Joel Bennett Date: Sat, 20 Sep 2025 17:55:57 -0400 Subject: [PATCH 2/3] Use channels:join permission to just ... join the channel --- bridge/slack/slack.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bridge/slack/slack.go b/bridge/slack/slack.go index 2381721ffe..96bbaa6090 100644 --- a/bridge/slack/slack.go +++ b/bridge/slack/slack.go @@ -168,20 +168,19 @@ func (b *Bslack) JoinChannel(channel config.ChannelInfo) error { return nil } - b.channels.populateChannels(true) + b.channels.populateChannels(false) channelInfo, err := b.channels.getChannel(channel.Name) if err != nil { return fmt.Errorf("could not find channel: %#v", err) } - // we can't join a channel unless we are using legacy tokens #651 + // we can join a channel if we have `channels:join` scope if !channelInfo.IsMember { - b.Log.Infof("Not currently a member of %s. Trying to join by ID (%s)", channel.Name, channelInfo.ID) // try to join the channel _, _, _, err := b.sc.JoinConversation(channelInfo.ID) if err != nil { - return fmt.Errorf("the slack integration that matterbridge is using is not member of channel '%s' (and cannot join), please add it manually. %s", channelInfo.Name, err) + return fmt.Errorf("the slack integration is not member of channel '%s' (and cannot join by ID: %s), please add it manually. %s", channelInfo.Name, channelInfo.ID, err) } } From 325daa787693889d5e69abfd90ed52ff5bf5eccc Mon Sep 17 00:00:00 2001 From: Joel Bennett Date: Tue, 23 Sep 2025 23:54:21 -0400 Subject: [PATCH 3/3] Apply go fmt ./... --- .golangci.yaml | 146 ++++++++++++---------------- bridge/matrix/matrix.go | 2 +- gateway/bridgemap/api.go | 1 + gateway/bridgemap/bdiscord.go | 1 + gateway/bridgemap/birc.go | 1 + gateway/bridgemap/bkeybase.go | 1 + gateway/bridgemap/bmatrix.go | 1 + gateway/bridgemap/bmattermost.go | 1 + gateway/bridgemap/bmsteams.go | 1 + gateway/bridgemap/bmumble.go | 1 + gateway/bridgemap/bnctalk.go | 1 + gateway/bridgemap/brocketchat.go | 1 + gateway/bridgemap/bslack.go | 1 + gateway/bridgemap/bsshchat.go | 1 + gateway/bridgemap/bsteam.go | 1 + gateway/bridgemap/btelegram.go | 1 + gateway/bridgemap/bvk.go | 1 + gateway/bridgemap/bwhatsapp.go | 4 +- gateway/bridgemap/bwhatsappmulti.go | 1 + gateway/bridgemap/bxmpp.go | 1 + gateway/bridgemap/bzulip.go | 1 + internal/bindata.go | 44 ++++----- 22 files changed, 102 insertions(+), 112 deletions(-) diff --git a/.golangci.yaml b/.golangci.yaml index 76e841006f..d201c1b8da 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -5,42 +5,42 @@ run: linters: default: all disable: - - asasalint - - cyclop - - decorder - - depguard - - err113 - - errname - - errorlint - - exhaustive - - exhaustruct - - forbidigo - - gochecknoglobals - - godot - - godox - - goheader - - gomoddirectives - - grouper - - importas - - ireturn - - lll - - maintidx - - makezero - - mnd - - nlreturn - - noctx - - paralleltest - - prealloc - - promlinter - - revive - - tagliatelle - - testifylint - - testpackage - - thelper - - tparallel - - varnamelen - - wrapcheck - - wsl + - asasalint + - cyclop + - decorder + - depguard + - err113 + - errname + - errorlint + - exhaustive + - exhaustruct + - forbidigo + - gochecknoglobals + - godot + - godox + - goheader + - gomoddirectives + - grouper + - importas + - ireturn + - lll + - maintidx + - makezero + - mnd + - nlreturn + - noctx + - paralleltest + - prealloc + - promlinter + - revive + - tagliatelle + - testifylint + - testpackage + - thelper + - tparallel + - varnamelen + - wrapcheck + - wsl settings: dupl: threshold: 150 @@ -52,40 +52,18 @@ linters: min-occurrences: 3 gocritic: enabled-checks: - - appendAssign - - assignOp - - boolExprSimplify - - builtinShadow - - captLocal - - caseOrder - - commentedOutImport - - defaultCaseOrder - - dupArg - - dupBranchBody - - dupCase - - dupSubExpr - - elseif - - emptyFallthrough - - ifElseChain - - importShadow - - indexAlloc - - methodExprCall - - nestingReduce - - offBy1 - - ptrToRefParam - - regexpMust - - singleCaseSwitch - - sloppyLen - - switchTrue - - typeSwitchVar - - typeUnparen - - underef - - unlambda - - unnecessaryBlock - - unslice - - valSwap - - wrapperFunc - - yodaStyleExpr + - boolExprSimplify + - builtinShadow + - commentedOutImport + - emptyFallthrough + - importShadow + - indexAlloc + - methodExprCall + - nestingReduce + - ptrToRefParam + - typeUnparen + - unnecessaryBlock + - yodaStyleExpr gocyclo: min-complexity: 15 lll: @@ -102,32 +80,32 @@ linters: exclusions: generated: lax presets: - - comments - - common-false-positives - - legacy - - std-error-handling + - comments + - common-false-positives + - legacy + - std-error-handling paths: - - third_party$ - - builtin$ - - examples$ + - third_party$ + - builtin$ + - examples$ issues: max-same-issues: 0 new-from-rev: HEAD~1 new: false formatters: enable: - - gofmt - - gofumpt - - goimports + - gofmt + - gofumpt + - goimports settings: gofmt: simplify: true goimports: local-prefixes: - - github.com + - github.com exclusions: generated: lax paths: - - third_party$ - - builtin$ - - examples$ + - third_party$ + - builtin$ + - examples$ diff --git a/bridge/matrix/matrix.go b/bridge/matrix/matrix.go index 5f8aea6d0d..bd4cf89dd4 100644 --- a/bridge/matrix/matrix.go +++ b/bridge/matrix/matrix.go @@ -10,9 +10,9 @@ import ( "time" "image" + _ "image/gif" _ "image/jpeg" _ "image/png" - _ "image/gif" "github.com/42wim/matterbridge/bridge" "github.com/42wim/matterbridge/bridge/config" diff --git a/gateway/bridgemap/api.go b/gateway/bridgemap/api.go index a8b6e61fdf..b602811a87 100644 --- a/gateway/bridgemap/api.go +++ b/gateway/bridgemap/api.go @@ -1,3 +1,4 @@ +//go:build !noapi // +build !noapi package bridgemap diff --git a/gateway/bridgemap/bdiscord.go b/gateway/bridgemap/bdiscord.go index 92b14ac12a..81c4ff7576 100644 --- a/gateway/bridgemap/bdiscord.go +++ b/gateway/bridgemap/bdiscord.go @@ -1,3 +1,4 @@ +//go:build !nodiscord // +build !nodiscord package bridgemap diff --git a/gateway/bridgemap/birc.go b/gateway/bridgemap/birc.go index 9e2bc33e82..9ce2eba2e8 100644 --- a/gateway/bridgemap/birc.go +++ b/gateway/bridgemap/birc.go @@ -1,3 +1,4 @@ +//go:build !noirc // +build !noirc package bridgemap diff --git a/gateway/bridgemap/bkeybase.go b/gateway/bridgemap/bkeybase.go index 5dcdcda767..92ff8941e5 100644 --- a/gateway/bridgemap/bkeybase.go +++ b/gateway/bridgemap/bkeybase.go @@ -1,3 +1,4 @@ +//go:build !nokeybase // +build !nokeybase package bridgemap diff --git a/gateway/bridgemap/bmatrix.go b/gateway/bridgemap/bmatrix.go index e1d761eb22..9b299f7ec8 100644 --- a/gateway/bridgemap/bmatrix.go +++ b/gateway/bridgemap/bmatrix.go @@ -1,3 +1,4 @@ +//go:build !nomatrix // +build !nomatrix package bridgemap diff --git a/gateway/bridgemap/bmattermost.go b/gateway/bridgemap/bmattermost.go index 3f0f0449d4..8a80e32250 100644 --- a/gateway/bridgemap/bmattermost.go +++ b/gateway/bridgemap/bmattermost.go @@ -1,3 +1,4 @@ +//go:build !nomattermost // +build !nomattermost package bridgemap diff --git a/gateway/bridgemap/bmsteams.go b/gateway/bridgemap/bmsteams.go index 56da2119dc..e43c1d9178 100644 --- a/gateway/bridgemap/bmsteams.go +++ b/gateway/bridgemap/bmsteams.go @@ -1,3 +1,4 @@ +//go:build !nomsteams // +build !nomsteams package bridgemap diff --git a/gateway/bridgemap/bmumble.go b/gateway/bridgemap/bmumble.go index 7b9241fe03..2b9c93b641 100644 --- a/gateway/bridgemap/bmumble.go +++ b/gateway/bridgemap/bmumble.go @@ -1,3 +1,4 @@ +//go:build !nomumble // +build !nomumble package bridgemap diff --git a/gateway/bridgemap/bnctalk.go b/gateway/bridgemap/bnctalk.go index c194392641..b675725b93 100644 --- a/gateway/bridgemap/bnctalk.go +++ b/gateway/bridgemap/bnctalk.go @@ -1,3 +1,4 @@ +//go:build !nonctalk // +build !nonctalk package bridgemap diff --git a/gateway/bridgemap/brocketchat.go b/gateway/bridgemap/brocketchat.go index 6af4e8d317..ad173a4490 100644 --- a/gateway/bridgemap/brocketchat.go +++ b/gateway/bridgemap/brocketchat.go @@ -1,3 +1,4 @@ +//go:build !norocketchat // +build !norocketchat package bridgemap diff --git a/gateway/bridgemap/bslack.go b/gateway/bridgemap/bslack.go index fdea80c835..a4dd6a52a7 100644 --- a/gateway/bridgemap/bslack.go +++ b/gateway/bridgemap/bslack.go @@ -1,3 +1,4 @@ +//go:build !noslack // +build !noslack package bridgemap diff --git a/gateway/bridgemap/bsshchat.go b/gateway/bridgemap/bsshchat.go index 14d422881d..650c2a624d 100644 --- a/gateway/bridgemap/bsshchat.go +++ b/gateway/bridgemap/bsshchat.go @@ -1,3 +1,4 @@ +//go:build !nosshchat // +build !nosshchat package bridgemap diff --git a/gateway/bridgemap/bsteam.go b/gateway/bridgemap/bsteam.go index c2654737d1..706e6260b0 100644 --- a/gateway/bridgemap/bsteam.go +++ b/gateway/bridgemap/bsteam.go @@ -1,3 +1,4 @@ +//go:build !nosteam // +build !nosteam package bridgemap diff --git a/gateway/bridgemap/btelegram.go b/gateway/bridgemap/btelegram.go index ec0bbe6051..dbff2bc6ea 100644 --- a/gateway/bridgemap/btelegram.go +++ b/gateway/bridgemap/btelegram.go @@ -1,3 +1,4 @@ +//go:build !notelegram // +build !notelegram package bridgemap diff --git a/gateway/bridgemap/bvk.go b/gateway/bridgemap/bvk.go index ea3de19eac..f0496220ea 100644 --- a/gateway/bridgemap/bvk.go +++ b/gateway/bridgemap/bvk.go @@ -1,3 +1,4 @@ +//go:build !novk // +build !novk package bridgemap diff --git a/gateway/bridgemap/bwhatsapp.go b/gateway/bridgemap/bwhatsapp.go index e7b72b0fdb..d808c814d8 100644 --- a/gateway/bridgemap/bwhatsapp.go +++ b/gateway/bridgemap/bwhatsapp.go @@ -1,5 +1,5 @@ -// +build !nowhatsapp -// +build !whatsappmulti +//go:build !nowhatsapp && !whatsappmulti +// +build !nowhatsapp,!whatsappmulti package bridgemap diff --git a/gateway/bridgemap/bwhatsappmulti.go b/gateway/bridgemap/bwhatsappmulti.go index 055c6da2ec..2e098e2491 100644 --- a/gateway/bridgemap/bwhatsappmulti.go +++ b/gateway/bridgemap/bwhatsappmulti.go @@ -1,3 +1,4 @@ +//go:build whatsappmulti // +build whatsappmulti package bridgemap diff --git a/gateway/bridgemap/bxmpp.go b/gateway/bridgemap/bxmpp.go index 6988a7d4c9..aa60938c2e 100644 --- a/gateway/bridgemap/bxmpp.go +++ b/gateway/bridgemap/bxmpp.go @@ -1,3 +1,4 @@ +//go:build !noxmpp // +build !noxmpp package bridgemap diff --git a/gateway/bridgemap/bzulip.go b/gateway/bridgemap/bzulip.go index 967f0ddeac..f3105c65d8 100644 --- a/gateway/bridgemap/bzulip.go +++ b/gateway/bridgemap/bzulip.go @@ -1,3 +1,4 @@ +//go:build !nozulip // +build !nozulip package bridgemap diff --git a/internal/bindata.go b/internal/bindata.go index 652957160a..f22f6e9f74 100644 --- a/internal/bindata.go +++ b/internal/bindata.go @@ -4,7 +4,6 @@ package internal - import ( "bytes" "compress/gzip" @@ -37,7 +36,6 @@ func bindataRead(data []byte, name string) ([]byte, error) { return buf.Bytes(), nil } - type asset struct { bytes []byte info fileInfoEx @@ -80,17 +78,17 @@ func (fi bindataFileInfo) Sys() interface{} { var _bindataTengoOutmessagetengo = []byte( "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xc4\x91\x3d\x8f\xda\x40\x10\x86\xfb\xfd\x15\x13\x37\xb1\x2d\x07\xe7\xa3" + - "\xb3\x64\x59\x11\x45\x94\x2e\x8a\x92\x0a\xd0\xb1\xac\x07\x33\xd2\x7a\xc7\x1a\x8f\x31\x88\xe3\xbf\x9f\xcc\x01\x47" + - "\x7f\xc5\x75\xef\xae\x9e\x9d\x77\x1f\x4d\x9e\x9a\xbd\x15\xb2\x1b\x8f\x3d\xd8\xbd\x25\x3f\x45\x30\x82\xb6\xfe\xc2" + - "\xc1\x1f\x0b\x43\xe1\xa7\x73\x3c\x04\xcd\x80\xc2\x1f\x61\x65\xc7\x7e\xca\xf3\x9d\x0d\x01\x2f\xf1\x97\x55\x1c\xed" + - "\xd1\xf0\xa0\x77\x98\x07\x7d\xa3\x79\xd0\x3b\xce\x83\xde\xf8\xd7\x9e\x51\x48\xb1\x30\x6d\xdf\xfc\xc3\x83\x66\xd0" + - "\xf6\xcd\xff\x1e\x25\xd8\x16\x4d\x9a\x1b\xa3\x78\x50\x28\x4a\xa0\xb6\x63\xd1\x38\x9a\xce\x51\x62\x4c\x9e\x43\xaf" + - "\x42\x1d\x90\x38\x70\xec\x59\xfa\xe9\x8e\xb6\x30\xe2\x67\x41\x08\xac\xd0\x63\xa8\x29\x34\xa0\x0c\x36\x5c\xc0\x8d" + - "\x50\xdd\x20\x8c\x78\x7d\xac\x3b\x84\xdf\x7f\xe7\xb7\x01\xb4\x7d\xd0\x84\xb2\x84\x88\xc4\x45\x70\x32\x00\x00\x82" + - "\xd3\x3f\xa6\xfe\x99\xe0\x93\xe3\xb6\x23\x8f\xf1\x7a\x79\xf8\xfa\x23\xae\x8a\x65\x7d\xfa\x96\x7d\x3f\xc7\x55\x91" + - "\x5d\x63\x52\x25\xd5\xf3\x62\x51\xb8\xa0\xe2\x8b\xd5\x6a\x9d\x5c\xc6\x5c\x4d\x4b\xc1\x99\x60\xe7\xad\xc3\xf8\x26" + - "\x1f\x45\x89\x39\x9b\xf7\x6b\xe4\x29\x6d\x1f\x57\x00\x9f\x3e\xc6\x24\xcd\xcd\x4b\x00\x00\x00\xff\xff\x40\xb8\x54" + - "\xb8\x64\x02\x00\x00") + "\xb3\x64\x59\x11\x45\x94\x2e\x8a\x92\x0a\xd0\xb1\xac\x07\x33\xd2\x7a\xc7\x1a\x8f\x31\x88\xe3\xbf\x9f\xcc\x01\x47" + + "\x7f\xc5\x75\xef\xae\x9e\x9d\x77\x1f\x4d\x9e\x9a\xbd\x15\xb2\x1b\x8f\x3d\xd8\xbd\x25\x3f\x45\x30\x82\xb6\xfe\xc2" + + "\xc1\x1f\x0b\x43\xe1\xa7\x73\x3c\x04\xcd\x80\xc2\x1f\x61\x65\xc7\x7e\xca\xf3\x9d\x0d\x01\x2f\xf1\x97\x55\x1c\xed" + + "\xd1\xf0\xa0\x77\x98\x07\x7d\xa3\x79\xd0\x3b\xce\x83\xde\xf8\xd7\x9e\x51\x48\xb1\x30\x6d\xdf\xfc\xc3\x83\x66\xd0" + + "\xf6\xcd\xff\x1e\x25\xd8\x16\x4d\x9a\x1b\xa3\x78\x50\x28\x4a\xa0\xb6\x63\xd1\x38\x9a\xce\x51\x62\x4c\x9e\x43\xaf" + + "\x42\x1d\x90\x38\x70\xec\x59\xfa\xe9\x8e\xb6\x30\xe2\x67\x41\x08\xac\xd0\x63\xa8\x29\x34\xa0\x0c\x36\x5c\xc0\x8d" + + "\x50\xdd\x20\x8c\x78\x7d\xac\x3b\x84\xdf\x7f\xe7\xb7\x01\xb4\x7d\xd0\x84\xb2\x84\x88\xc4\x45\x70\x32\x00\x00\x82" + + "\xd3\x3f\xa6\xfe\x99\xe0\x93\xe3\xb6\x23\x8f\xf1\x7a\x79\xf8\xfa\x23\xae\x8a\x65\x7d\xfa\x96\x7d\x3f\xc7\x55\x91" + + "\x5d\x63\x52\x25\xd5\xf3\x62\x51\xb8\xa0\xe2\x8b\xd5\x6a\x9d\x5c\xc6\x5c\x4d\x4b\xc1\x99\x60\xe7\xad\xc3\xf8\x26" + + "\x1f\x45\x89\x39\x9b\xf7\x6b\xe4\x29\x6d\x1f\x57\x00\x9f\x3e\xc6\x24\xcd\xcd\x4b\x00\x00\x00\xff\xff\x40\xb8\x54" + + "\xb8\x64\x02\x00\x00") func bindataTengoOutmessagetengoBytes() ([]byte, error) { return bindataRead( @@ -99,8 +97,6 @@ func bindataTengoOutmessagetengoBytes() ([]byte, error) { ) } - - func bindataTengoOutmessagetengo() (*asset, error) { bytes, err := bindataTengoOutmessagetengoBytes() if err != nil { @@ -108,11 +104,11 @@ func bindataTengoOutmessagetengo() (*asset, error) { } info := bindataFileInfo{ - name: "tengo/outmessage.tengo", - size: 612, + name: "tengo/outmessage.tengo", + size: 612, md5checksum: "", - mode: os.FileMode(420), - modTime: time.Unix(1555622139, 0), + mode: os.FileMode(420), + modTime: time.Unix(1555622139, 0), } a := &asset{bytes: bytes, info: info} @@ -120,7 +116,6 @@ func bindataTengoOutmessagetengo() (*asset, error) { return a, nil } - // // Asset loads and returns the asset for the given name. // It returns an error if the asset could not be found or @@ -211,18 +206,18 @@ func AssetDir(name string) ([]string, error) { node = node.Children[p] if node == nil { return nil, &os.PathError{ - Op: "open", + Op: "open", Path: name, - Err: os.ErrNotExist, + Err: os.ErrNotExist, } } } } if node.Func != nil { return nil, &os.PathError{ - Op: "open", + Op: "open", Path: name, - Err: os.ErrNotExist, + Err: os.ErrNotExist, } } rv := make([]string, 0, len(node.Children)) @@ -232,7 +227,6 @@ func AssetDir(name string) ([]string, error) { return rv, nil } - type bintree struct { Func func() (*asset, error) Children map[string]*bintree