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

Matrix delegation not working #1067

Closed
bwachtendorf opened this issue Feb 21, 2024 · 2 comments · Fixed by #1198
Closed

Matrix delegation not working #1067

bwachtendorf opened this issue Feb 21, 2024 · 2 comments · Fixed by #1198
Labels

Comments

@bwachtendorf
Copy link

📣 Notification Service(s) Impacted
Matrix

🐞 Describe the bug
My matrix server is configured with delegation and I cannot create a notification when using the root domain.

💡 Screenshots and Logs
Using root domain with following delegation setting: {"m.server": "matrix.<domain>:443"}

apprise -b "test" matrixs://<username>:<password>@<domain>/!<room_id> -vvv
2024-02-21 21:27:13,559 - DEBUG - Language set to en
2024-02-21 21:27:14,553 - DEBUG - Notification Plugin 100(s) and 141 Schema(s) loaded in 0.9924s
2024-02-21 21:27:14,554 - DEBUG - Loaded Matrix URL: matrixs://<username>:****@<domain>/%21<room_id>?image=no&mode=off&version=3&msgtype=text&format=text&overflow=upstream&rto=4.0&cto=4.0&verify=yes
2024-02-21 21:27:14,554 - DEBUG - Matrix POST URL: https://<domain>/_matrix/client/v3/login (cert_verify=True)
2024-02-21 21:27:14,554 - DEBUG - Matrix Payload: {'type': 'm.login.password', 'identifier': {'type': 'm.id.user', 'user': '<username>'}, 'password': '<password>'}
2024-02-21 21:27:14,577 - DEBUG - Matrix Response: code=200, b''
2024-02-21 21:27:14,577 - WARNING - Invalid response from Matrix server.
2024-02-21 21:27:14,577 - DEBUG - Response Details:
b''
2024-02-21 21:27:14,577 - DEBUG - Matrix POST URL: https://<domain>/_matrix/client/v3/register (cert_verify=True)
2024-02-21 21:27:14,578 - DEBUG - Matrix Payload: {'kind': 'user', 'auth': {'type': 'm.login.dummy'}, 'username': '<username>', 'password': '<password>'}
2024-02-21 21:27:14,595 - DEBUG - Matrix Response: code=200, b''
2024-02-21 21:27:14,595 - WARNING - Invalid response from Matrix server.
2024-02-21 21:27:14,595 - DEBUG - Response Details:
b''

Using the matrix subdomain:

apprise -b "test" matrix://<username>:<password>@matrix.<domain>/!<room_id> -vvv
2024-02-21 21:24:11,263 - DEBUG - Language set to en
2024-02-21 21:24:12,321 - DEBUG - Notification Plugin 100(s) and 141 Schema(s) loaded in 1.0550s
2024-02-21 21:24:12,321 - DEBUG - Loaded Matrix URL: matrix://<username>:****@matrix.<domain>/%21<room_id>?image=no&mode=off&version=3&msgtype=text&format=text&overflow=upstream&rto=4.0&cto=4.0&verify=yes
2024-02-21 21:24:12,321 - DEBUG - Matrix POST URL: http://matrix.<domain>/_matrix/client/v3/login (cert_verify=True)
2024-02-21 21:24:12,321 - DEBUG - Matrix Payload: {'type': 'm.login.password', 'identifier': {'type': 'm.id.user', 'user': '<username>'}, 'password': '<password>'}
2024-02-21 21:24:12,592 - DEBUG - Matrix Response: code=200, b'{"user_id":"@<username>:<domain>","access_token":"<access_token>","home_server":"<domain>","device_id":"SNECNMRPWL"}'
2024-02-21 21:24:12,593 - DEBUG - Authenticated successfully with Matrix server.
2024-02-21 21:24:12,593 - DEBUG - Matrix POST URL: http://matrix.<domain>/_matrix/client/v3/join/%21<room_id>%3A<domain> (cert_verify=True)
2024-02-21 21:24:12,593 - DEBUG - Matrix Payload: {}
2024-02-21 21:24:12,658 - DEBUG - Matrix Response: code=200, b'{"room_id":"!<room_id>:<domain>"}'
2024-02-21 21:24:12,659 - DEBUG - Matrix POST URL: http://matrix.<domain>/_matrix/client/v3/rooms/%21<room_id>%3A<domain>/send/m.room.message/0 (cert_verify=True)
2024-02-21 21:24:12,659 - DEBUG - Matrix Payload: {'msgtype': 'm.text', 'body': 'test'}
2024-02-21 21:24:12,744 - DEBUG - Matrix Response: code=200, b'{"event_id":"$Jgifkj8T4MUelDpxJhWQPum1bDyIWOfi6nPxnKZm4eY"}'
2024-02-21 21:24:12,745 - DEBUG - Matrix POST URL: http://matrix.<domain>/_matrix/client/v3/logout (cert_verify=True)
2024-02-21 21:24:12,745 - DEBUG - Matrix Payload: {}
2024-02-21 21:24:12,797 - DEBUG - Matrix Response: code=200, b'{}'
2024-02-21 21:24:12,797 - DEBUG - Unauthenticated successfully with Matrix server.

💻 Your System Details:

  • OS: Arch Linux
  • Python Version: 3.11.7
  • apprise: 1.7.2

🔮 Additional context
I can live with the subdomain in the URL but finding the problem was annoying and I think this should be supported because it is part of the official matrix specification.

@caronc
Copy link
Owner

caronc commented Aug 30, 2024

Forgive me for taking so long to get to this. For this situation, would you prefer a ?delegate=domain where I'd set the server under the hood to the delegate in all calls, but use the hostname for a connection only?

@bwachtendorf
Copy link
Author

No problem. It has been working for me with this workaround since I created the issue. This was more for other users experiencing the same problem.

The best case scenario would be for apprise to figure out the delegation on it's own, because a user might not know delegation exists at all on the server they want to use. I knew about the delegation and it still took some time to figure out the problem.

Another option could be to update the documentation with steps to figure out if the matrix server uses delegation and add appropriate warnings to the docs and/or logs.

@caronc caronc pinned this issue Sep 1, 2024
@caronc caronc unpinned this issue Sep 1, 2024
@caronc caronc linked a pull request Sep 1, 2024 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants