Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider updating go-xmpp #2119

Open
Hund opened this issue Feb 11, 2024 · 19 comments
Open

Consider updating go-xmpp #2119

Hund opened this issue Feb 11, 2024 · 19 comments
Labels
enhancement New feature or request

Comments

@Hund
Copy link

Hund commented Feb 11, 2024

Is your feature request related to a problem? Please describe.

Snikket (a modern implementation of XMPP that uses Prosody) recently decided to disable less secure mechanisms entirely. Which means that PLAIN authentication doesn't work anymore. It's now using SCRAM, which requires a newer version of go-xmpp in Matterbridge.

It's currently not possible to login to XMPP in Matterbridge.

Describe the solution you'd like

Update go-xmpp to a newer version that supports SCRAM.

@Hund Hund added the enhancement New feature or request label Feb 11, 2024
@mdosch
Copy link

mdosch commented Feb 11, 2024

If you update you should update to current master and not tag 0.0.1 as current master has some scram improvements and also supports xep-0474.

@42wim
Copy link
Owner

42wim commented May 23, 2024

@Hund master now contains updated go-xmpp library, can you test ?

@Hund
Copy link
Author

Hund commented May 24, 2024

Great news! I tried building it myself, but didn't come far with it:

$ go install github.com/42wim/matterbridge@master
go: downloading github.com/42wim/matterbridge v1.26.1-0.20240523232832-65d78e38af39
go: github.com/42wim/matterbridge@master (in github.com/42wim/[email protected]): go.mod:153: invalid go version '1.22.0': must match format 1.23

What's wrong? I know nothing about Go. The latest version seems to be 1.22, which confuses me.

@mdosch
Copy link

mdosch commented May 24, 2024 via email

@42wim
Copy link
Owner

42wim commented May 24, 2024

Yes you need go 1.22 to build

If you have an older go version you can do:
Make sure ~/go/bin is in your PATH

go install golang.org/dl/go1.22.3@latest
go1.22.3 download

Now you can run go1.22.3 install github.com/42wim/matterbridge@master

@mdosch
Copy link

mdosch commented May 24, 2024 via email

@mdosch
Copy link

mdosch commented May 24, 2024

Ah, seems I got it wrong. There is go1.21 in bookworm-backports.

@Hund
Copy link
Author

Hund commented May 24, 2024

I can't get it to work. I'm probably doing something wrong?

time="2024-05-24T12:41:43+02:00" level=fatal msg="Starting gateway failed: Bridge xmpp.linuxkompis failed to start: PLAIN authentication is not an option: [SCRAM-SHA-1 SCRAM-SHA-1-PLUS]" prefix=main
matterbridge --version
version: 1.26.0 6dafebc7

@mdosch
Copy link

mdosch commented May 24, 2024 via email

@Hund
Copy link
Author

Hund commented May 24, 2024

Oh. So go install github.com/42wim/matterbridge@master is not the correct thing to do then? @42wim said that it's in master?

@mdosch
Copy link

mdosch commented May 24, 2024 via email

@Hund
Copy link
Author

Hund commented May 24, 2024

It is, no idea why github censored that in my previous mail. Are you sure you are running the matterbridge from your $GOBIN (if set) or $GOPATH/bin? Usually this is ~/go/bin/.

Yes.

johan at Atlas in ~/go/bin
$ ./matterbridge --version
version: 1.26.1-dev 

@mdosch
Copy link

mdosch commented May 24, 2024 via email

@Hund
Copy link
Author

Hund commented May 24, 2024

Oh.. I didn't even notice the dev at the end. That's fixed now.

It doesn't seem to connect though. The logs says nothing. Is there any way I can debug this?

@42wim
Copy link
Owner

42wim commented May 24, 2024

Run with -debug

@Hund
Copy link
Author

Hund commented May 24, 2024

That didn't say much either. :/

root@linuxkompis:/home/johan# matterbridge -debug -conf /usr/local/bin/matterbridge.toml 
[0000]  INFO main:         [setupLogger:/home/johan/go/pkg/mod/github.com/42wim/[email protected]/matterbridge.go:104] Enabling debug logging.
[0000]  INFO main:         [main:/home/johan/go/pkg/mod/github.com/42wim/[email protected]/matterbridge.go:44] Running version 1.26.1-dev 
[0000]  INFO main:         [main:/home/johan/go/pkg/mod/github.com/42wim/[email protected]/matterbridge.go:46] WARNING: THIS IS A DEVELOPMENT VERSION. Things may break.
[0000]  INFO config:       [NewConfig:/home/johan/go/pkg/mod/github.com/42wim/[email protected]/bridge/config/config.go:275] Opening log file /var/log/matterbridge.log

@Hund
Copy link
Author

Hund commented May 24, 2024

It seems to connect just fine to IRC, but it gets stuck at XMPP:

# tail /var/log/matterbridge.log
[...]
[0007]  INFO router:       Starting bridge: xmpp.linuxkompis 
[0007]  INFO xmpp:         Connecting snikket.linuxkompis.se

It's difficult to debug, since I can't guess the issue.

@mdosch
Copy link

mdosch commented May 26, 2024

Seems to work with my prosody trunk, so it should also work with snikket.

~/build/go/bin/matterbridge -conf ~/matter.toml
[0000]  INFO main:         Running version 1.26.1-dev 
[0000]  INFO main:         WARNING: THIS IS A DEVELOPMENT VERSION. Things may break.
[0000]  INFO router:       Parsing gateway gateway1
[0000]  INFO router:       Starting bridge: xmpp.myxmpp 
[0000]  INFO xmpp:         Connecting mdosch.de:5222
[0000]  INFO xmpp:         Connection succeeded
[0000]  INFO xmpp:         xmpp.myxmpp: joining prtocolchannel (ID: prtocolchannelxmpp.myxmpp)
[0000]  INFO main:         Gateway(s) started successfully. Now relaying messages

Maybe you could have a look whether the current go-sendxmpp works with your snikket server (or gives a useful error if it doesn't) as it is using the same library.

@Hund
Copy link
Author

Hund commented May 26, 2024

@mdosch I just tried with go-sendxmpp, and it works just fine. :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants