miniflux / v2

Minimalist and opinionated feed reader
https://miniflux.app
Apache License 2.0
6.97k stars 728 forks source link

Matrix Integration does not work #2822

Open APT37 opened 2 months ago

APT37 commented 2 months ago

Hi, I've tried to set up the Matrix Integration, but Miniflux never sends any messages to my Matrix server.

Everything is set up according to the documentation, I also tried different room and user settings.

There are no outgoing requests shown in the -debug log either, nor do the NginX logs show any incoming requests.

bfahrenfort commented 2 months ago

Reproducing on latest docker. No logs suggest an issue. I went into the "bot" account (this should really use an AppService in future) manually and saw that it did sign into the account, but it hadn't even joined the channel. I had it join the channel while I was still logged in but no change.

fguillot commented 2 months ago

This is working for me. I just tested with https://element.io/ and https://matrix.org.

In the Miniflux logs, you should see a message like this one when new entries are created:

time=2024-09-07T15:41:27.336-07:00 level=DEBUG msg="Sending new entries to Matrix" user_id=1 nb_entries=3 feed_id=33

If that doesn't work, you should see an error with the message "Unable to send new entries to Matrix".

If you don't see anything in the logs, then it's most likely a misconfiguration in the integration settings. Note that only new entries are sent to Matrix during feed refreshes.

APT37 commented 2 months ago

I'm not using an integration manager service, since my server is not federated.

This is likely the root cause, but since there are no corresponding error messages from Miniflux, I can't tell for sure. It would be helpful if Miniflux was more verbose here.

I did not see anything like the example messages you provided.

bfahrenfort commented 2 months ago

I'm not using an integration manager service, since my server is not federated.

This is likely the root cause, but since there are no corresponding error messages from Miniflux, I can't tell for sure. It would be helpful if Miniflux was more verbose here.

I did not see anything like the example messages you provided.

I just got notifs from Matrix! I don't think Miniflux is properly using the .well-known file. I had to both log in as the bot manually to make it join the channel and then set "matrix server URL" to the protocol link (ie, https://matrix.mydomain,com).

image

APT37 commented 2 months ago

I've also manually joined the channel as the bot and set everything up as shown in your example, but nothing changed. I use the root of the domain btw, not a subdomain. Reverse proxies are great. :100:

I don't think Miniflux uses the well-known file at all, but to be sure, we'd have to check the source of course.

fguillot commented 2 months ago

The code is very easy to read. It's only 2 files:

Let me know if something is missing in the discovery process:

https://github.com/miniflux/v2/blob/95201fc5cff83938efe32f0bc17f4f333195cf9c/internal/integration/matrixbot/client.go#L28-L60

bfahrenfort commented 2 months ago

I've also manually joined the channel as the bot and set everything up as shown in your example, but nothing changed. I use the root of the domain btw, not a subdomain. Reverse proxies are great. :100:

I don't think Miniflux uses the well-known file at all, but to be sure, we'd have to check the source of course.

Are you certain that you use the root domain for the matrix protocol? If you use a well-known file, that's using the root domain to redirect to a different domain (for me, it's the matrix subdomain, which is why that matrix server address works for me).

For example, my well-known file on my root redirects to the matrix subdomain.

APT37 commented 2 months ago

Unfortunately I do not know Go very well - but I'm not familiar with the details of discovery and authentication processes anyway. My approaches to solving this issue were rather high-level, I'm afraid.

Are you certain that you use the root domain for the matrix protocol?

Yes indeed, but some clients still needed the .well-known file iirc. I set the server up quite a while ago...