Skip to content

Matterircd ignores server on login when DefaultServer is set in configuration #557

@kot0dama

Description

@kot0dama

Hi,

When using a matterircd instance for connecting to multiple Mattermost servers, if there is a DefaultServer in the configuration, it is impossible to connect to any other server even though they're listed in Restrict.

Is DefaultServer actually a forced server option? Or is it a way to define the default server when the user does not specify a specific server to log into in the mattermost /msg?

Steps to reproduce

  • Set up matterircd config with:
[mattermost]
DefaultServer = "whatever.com"
DefaultTeam = "myteam"
Restrict = ["whatever.com", "chat.charmhub.io"]
  • Connect to matterircd with an IRC client
  • Send /msg mattermost login chat.charmhub.io charmhub username token=....

This yields:

[2023-10-24T01:20:35Z] DEBUG matterircd: flushing buffer: &irc.Message{Prefix:(*irc.Prefix)(nil), Command:"PRIVMSG", Params:[]string{"mattermost"}, Trailing:"login chat.charmhub.io charmhub kotodama token=REDACTED
", EmptyTrailing:false
}
[2023-10-24T01:20:35Z] DEBUG matterircd: Executed &irc.Message{Prefix:(*irc.Prefix)(nil), Command:"PRIVMSG", Params:[]string{"mattermost"}, Trailing:"<redacted>", EmptyTrailing:false} <nil>
[2023-10-24T01:20:35Z] DEBUG matterircd: args_len: 4
[2023-10-24T01:20:35Z] DEBUG matterircd: team: myteam
[2023-10-24T01:20:35Z] DEBUG matterircd: server: .com
[2023-10-24T01:20:35Z] DEBUG matterircd: restrict: [whatever.com chat.charmhub.io]
loggerlevel: debug
[2023-10-24T01:20:36Z]  INFO bridge/mattermost: login as kotodama (team: myteam) on whatever.com
[2023-10-24T01:20:36Z]  INFO matterclient: Found version 7.8.0.7.8.0.1d38ab1b122bcd3de4a230cfc66281cd.true
[2023-10-24T01:20:36Z] DEBUG matterclient: trying login myteam kotodama whatever.com
[2023-10-24T01:20:36Z] DEBUG matterclient: trying login with personal token
[2023-10-24T01:20:36Z] ERROR bridge/mattermost: login failed: Invalid or expired session, please login again., 

Thank you!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions