bubelov / news

Feed Reader and Podcast Player for Android
https://f-droid.org/packages/co.appreactor.news/
GNU General Public License v3.0
406 stars 25 forks source link

Support Miniflux backend #76

Open coxde opened 3 years ago

coxde commented 3 years ago

Thank you for developing this app, its design is really nice. Although I know this app mainly focuses on Nextcloud news, if it is possible in the future, can it also support RSS API such as Miniflux ? There is a lack of a foss RSS reader with a modern interface on the market. Just a little thought, thank you!

bubelov commented 3 years ago

@coxde hard Nextcloud dependency is a temporary measure. My current priority is "standalone" mode, which doesn't need a server. Once the app has both NC and standalone backends, adding more backends would become pretty trivial.

Never heard of Miniflux before, is it mature enough to be a stable advertised backend? Actually, I even planned to create my own FOSS backend because the options I tried were both slow and hard to deploy. It looks like Miniflux ships as a single binary, which suggests it might be the Holy Grail I was looking for =)

coxde commented 3 years ago

As you said, Miniflux is a minimalist feed reader that is easy to deploy and has a clean Web UI, and you can actually get a good reading experience on mobile via PWA. After trying feed readers like Tiny Tiny RSS, Nextcloud news, etc., I found Miniflux to be stable and easy enough for me. So you can try it, it may meets your needs :)

bubelov commented 3 years ago

@coxde it looks pretty good so far. I'll add this backend in the next release. I can also send you a dev build as soon as it will be ready, if you want to start using it before next release arrives, which might take quite some time

coxde commented 3 years ago

Thank you for your hard work, I'm happy to help you test this build and I'll wait patiently.

bubelov commented 3 years ago

@coxde here is the latest dev build, if you'd like to use Miniflux backend now: http://bubelov.com/news-0.2.9-debug.apk

Known issues:

Everything else seems to work, I'm already using this backend as my primary news source

coxde commented 3 years ago

It looks really great, but I also noticed that there are some unread entries not showing up that seem to be not fetched. Besides, is it possible to login with API Keys instead of using username and password?

If there's any help: https://miniflux.app/docs/api.html#authentication

bubelov commented 3 years ago

@coxde the app will miss some items, as well as any changes in read/starred flags made from the web interface, I don't really see a way around it yet. You can look at the doc:

https://miniflux.app/docs/api.html#endpoint-get-entries

In order to enable "flawless" sync, I need a way to ask Miniflux to give me all entries that have been added or changed. I don't really see how it's possible.

While it's not mentioned in the documentation, there is a field called changed_at which is returned for every entry. Filtering by this field would solve this issue, because it would allow client apps to query the "delta" since the last state sync. Unfortunately, this filter isn't supported by the API. Here is the list of supported fields:

“id”, “status”, “published_at”, “category_title”, “category_id”

The only options are syncing by published_at + after or by after_entry_id, both of which have serious flaws.

I asked the maintainer for advice with that, but he seems to be busy now. Let's wait for a bit and then we can come back to this issue. It's a bit annoying but it doesn't block the app from going forward with integrating other parts of Miniflux API.

bubelov commented 3 years ago

@coxde regarding API keys, I have two issues with them:

  1. It requires new UI, the first iteration just re-used NC login flow. Supporting tokens is doable but not high-prio
  2. People are terrible at typing long strings of gibberish on mobile. Password managers are optimized for login + password too, so I don't see much added value or usability (quite the opposite, actually)

Tokens are revocable though, so it might be better for security, but the app is open source which offers decent proofs of the fact that it doesn't leak credentials to third parties. To summarize, I just don't see much value in switching to tokens, but I'm not against this option either

coxde commented 3 years ago

Sorry I can't help much, but if it's useful, maybe you can take a look at the code of this app, they seem to be "flawless" in terms of syncing entries. (From my personal experience)

Regarding the API key, I think mobile use is a one-time experience, also API keys can be created on the mobile with web and then copying it to this app. So it's maybe not too difficult. In addition to being revocable, API keys also prevent users from having to login again after each password change. (Although not everyone changes their passwords often) Also if Miniflux adds 2FA, the API key will seem more useful.

However it‘s true that this is not necessary at this stage and you can consider it in the future :)

bubelov commented 3 years ago

Sorry I can't help much, but if it's useful, maybe you can take a look at the code of this app, they seem to be "flawless" in terms of syncing entries. (From my personal experience)

How it will behave if you sync entries on mobile and then go to web and mark some of them as read? After that, will they also be marked as read on mobile? Syncing just the new entries is possible but it won't solve the problem of two-way sync. I suspect this app passes the id of the latest entry it has, so it can query newer entries. There is still no way to sync back the changes made to existing entries on web, at least that's how I see it

coxde commented 3 years ago

I just tried on Microflux and after I synced it with the app and marked it as read on the web, the app will also mark the entry as read.

bubelov commented 3 years ago

@coxde it might just re-fetch everything, this option isn't compatible with incremental sync. I don't see any ways of getting only changes and not re-fetching old entries

bubelov commented 3 years ago

FYI: It looks like we're blocked by those issues: https://github.com/miniflux/v2/issues/1059, https://github.com/miniflux/v2/issues/358

I also opened an issue regarding categories, so let's wait for feedback here: https://github.com/miniflux/v2/issues/1240. For now, I implemented a workaround which tries to find a category named "All" or simply uses the first category it finds. If there are no categories, adding feed will fail. I'm hesitant of adding a separate app-managed category for feeds added via app, but we might have to go this way, depending on the issue resolution status

Here is the latest dev version, it has an improved support for sync and it allows to manage feeds:

https://github.com/bubelov/news/releases/tag/preview

It's recommended to delete the old dev build before installing a new one

c64bob commented 2 years ago

Hi there, do you plan to release a version with official support for miniflux? Thanks for the great app!

bubelov commented 2 years ago

@c64bob full Miniflux support it blocked by a few things on Miniflux side, you can read about them above. That said, it still works pretty well, at least for me. If you want Miniflux support now, just grab an auto-built APK from "preview" release, which always corresponds to the latest commit. As of the official release, no ETA on that yet

emersion commented 2 years ago

In order to enable "flawless" sync, I need a way to ask Miniflux to give me all entries that have been added or changed. I don't really see how it's possible.

I've opened https://github.com/miniflux/v2/issues/1319 for this.

emersion commented 12 months ago

miniflux now supports filtering by changed_at: https://github.com/miniflux/v2/pull/2108

bubelov commented 5 months ago

Cool, I'm going to test it now