libretro / Lakka-LibreELEC

Lakka is a lightweight Linux distribution that transforms a small computer into a full blown game console.
https://www.lakka.tv
1.74k stars 288 forks source link

Possible Enhancement: How difficult woud it be to add Syncthing to Lakka? #2004

Open jdalmanza opened 3 days ago

jdalmanza commented 3 days ago

This is really just a question / discussion:

Ive been trying to get the RetroArch native Cloud Sync feature to work and while i can make it work on my own self-hosted webdav server, i'm looking at all of the cloud storage providers and none of the mainstream vendors with a free option support webdav. Box, Dropbox dropped webdav functionality some time ago. You can kind of hack webdav into Google Drive but it is not permanent (3rd party plugin, files only last for 24 hours). I think this feature in and of itself is great, but I wish it was compatible with the popular cloud storage providers

I spend a lot of time in the RetroArch subreddit and one topic that seems to come up almost daily is how to sync data across multiple devices, rarely do I see people talking about the native Cloud Sync feature in RetroArch but most people are using (or are convinced by the community to use) Syncthing (https://github.com/syncthing/syncthing)

I have been using RetroArch forever and even I did not know that Cloud Sync was added into the 1.19.1 builds until @warmenhoven informed me in the lakka discord.

So, all that said, since Syncthing is open source and seems to run on just about anything, my question is: How Difficult would it be to add a Syncthing client, either as an option (protocol) in the native cloud sync feature, or as a separate menu item unique to lakka?

I think this would be a big win for the community. If I was a skilled programmer, I would try to port / incorporate / etc. myself, but unfortunately I am not.

What do y'all think? (I won't get my feelings hurt if I get shot down ... well maybe, but at least i won't complain about it)

warmenhoven commented 14 hours ago

I wish it was compatible with the popular cloud storage providers

In principle this should be relatively straightforward but in practice the authentication part becomes quite complicated as most of the services require some form or derivative of oauth and RetroArch doesn't have a great way of supporting that in a cross platform way. Any services that don't require oauth (like webdav, or s3) are relatively trivial to implement.

most people are using (or are convinced by the community to use) Syncthing

Syncthing was designed and intended for use cases like this, and has far more configurability and functionality than RetroArch could reasonably be expected to provide. Using RetroArch's native cloud sync feature should be a last resort, for platforms that can't handle something like syncthing (tvOS in particular comes to mind).

How Difficult would it be to add a Syncthing client [...] as an option (protocol) in the native cloud sync feature

I looked into this a bit and it would be very difficult. The native cloud sync assumes that it's operating on a dumb CRUD file system abstraction, and it wants to own and manage all of the logic around what needs to be synchronized. Syncthing wants to own all of that. That's even before getting into the viability of integrating a large library in a language RetroArch's build doesn't already natively support.

... or as a separate menu item unique to lakka

I only looked into this extremely cursorily and I think this is a reasonable direction, though I would caution against integrating syncthing configuration/usage too deeply into RetroArch menus, and instead rely on its own web based configuration tool.