spantaleev / matrix-docker-ansible-deploy

🐳 Matrix (An open network for secure, decentralized communication) server setup using Ansible and Docker
GNU Affero General Public License v3.0
4.9k stars 1.04k forks source link

/_dendrite/ endpoints are inaccessible #2609

Open array-in-a-matrix opened 1 year ago

array-in-a-matrix commented 1 year ago

Describe the bug: The Dendrite /_dendrite/ endpoints, which includes the admin API and some /_synapse/ endpoints are inaccessible.

To Reproduce: curling any endpoint will prompt nginx to return a 404 error.

For example: curl --header "Authorization: Bearer <TOKEN> -X GET "https://matrix.<DOMAIN>.<TLD>/_dendrite/admin/evacuateRoom/{<ROOMID>}"

returns:

<html>
<head><title>404 Not Found</title></head>
<body>
<center><h1>404 Not Found</h1></center>
<hr><center>nginx</center>
</body>
</html>

Expected behavior: A JSON body should be returned.

Matrix Server:

Ansible: If your problem appears to be with Ansible, tell us:

spantaleev commented 1 year ago

Everything is sent to the Dendrite container, https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/755a32f09cbae8b4093c21351dcd0c267a680a0c/roles/custom/matrix-nginx-proxy/templates/nginx/conf.d/matrix-dendrite.conf.j2#L27-L44

If it's giving you a 404, then it may be that these APIs are disabled in the Dendrite configuration or something.

array-in-a-matrix commented 1 year ago

The endpoint /_matrix/client/v3/admin/whois/{userId} works, which means they are enabled. I also do not see any way to enable these APIs in the config.

pekkalaaksonen commented 1 year ago

The endpoint /_matrix/client/v3/admin/whois/{userId} works which means they are enabled. I also do not see any way to enable these APIs in the config.

I'm having the same issue but even this endpoint is not working. When making this request: curl --location --request GET 'https://matrix.<DOMAIN>.<TLD>/_matrix/client/v3/admin/whois/<USERNAME>' \ --header 'Authorization: Bearer <TOKEN>' \ }'

I'm getting the following error: { "errcode": "M_UNKNOWN", "error": "Internal Server Error" }

I'm trying to update password for a user. Is there some workaround I can use before I figure this is out? E.g. can I update the password manually in userapi_accounts table?

array-in-a-matrix commented 1 year ago

Looks like adding the port to the domain works.

curl --header "Authorization: Bearer <token>" -X POST https://matrix.<domain>.<tld>:8448/_dendrite/admin/purgeRoom/\{\<room_id>\}
curl --header "Authorization: Bearer <token>" -X POST https://matrix.<domain>.<tld>:8448/_dendrite/admin/evacuateUser/\{\<user_mxid>\}