Closed keethesh closed 1 year ago
This would be cool to have! I'd imagine most backups should be small enough to just put into the local sync folder, but it wouldn't hurt to have the option to go straight to the cloud if you're tight on space (or if that's just your preference).
I'd prefer to stick to pure Rust, though, since it offers a lot of safety checks at compile time. As much as I like Python, it's easy to make a typo and not find out right away. Here are some Rust crates for cloud support:
If you're interested in working on this, I think it breaks down into these main parts:
cloud.rs
with the necessary functions (create/clear the backup folder, list subfolders/files in the backup folder, download/upload file).prelude.rs
to conditionally use the new functions from cloud.rs
. (Or maybe it'd be cleaner to just have equivalent functions in cloud.rs
, but I'd like to share as much of the logic as possible.)Update config.yaml to include:
I don't think there's any good/secure way to remember the cloud account's password, so I'd rather not store that and just ask for it every time.
gui.rs
to add a local vs cloud radio button and an entry for cloud username/password.By the way, one other consideration is that I'd really like to avoid having a dependency on OpenSSL, so I'd want to see if those cloud crates have an option to use rustls instead, If they don't already have that option, perhaps they'd be open to adding it as a crate feature.
Hey there! I'm really sorry, I don't know Rust! But I'll try to learn the basics, and add that myself! Btw, I was more thinking of it as a "safety measure", just in case something goes wrong on the hard drive itself, or if someone needs to transfer his save files to another computer.
No need to apologize \:) It's absolutely up to you if it's something you're interested in or comfortable with, so no worries either way.
Acting as a safety measure is definitely important, although it's actually possible to satisfy that use case today. For example, on my system, if I set C:/Users/mtken/Google Drive/ludusavi-backup
as the backup folder, then the Google Drive service will automatically sync it. That works even without Ludusavi knowing anything about it.
But I can think of some use cases where someone wouldn't/couldn't do that:
Workaround for anyone looking to backup to the cloud with the current version of ludusavi:
Looking at the sheer number of backends that rclone supports, I'm thinking it's probably better for Ludusavi to just integrate with rclone rather than trying to integrate with individual cloud services. That would be fantastic to have support for all those backends out of the box.
Created a playnite plugin that sources save files from ludusavi's --api
and will backup/snapshot the files using restic. Rclone can also be the provider for the restic repository, so that opens up many different backends for game save storage in the cloud.
Though probably slightly off topic, syncthing might be an option. Written in go (thus off topic), it can keep folder structures in sync across devices without the need for a third party cloud.
My personal use case would be to sync saves across different machines I own. I bought many Linux games on GOG and GOG Galaxy does NOT run on Linux natively, so no cloud sync of save games there.
for windows specifically, mountain duck might be worth considering. can mount cloud storage's as a network folder in windows, and you can then point ludusavi to that path
These might be usefull as well: https://docs.rs/dav-server/latest/dav_server/ https://lib.rs/crates/async_ftp
My personal use case would be to sync saves across different machines I own. I bought many Linux games on GOG and GOG Galaxy does NOT run on Linux natively, so no cloud sync of save games there.
It is possible to use the Galaxy features in Linux, see reddit
This is finally complete :D If anyone would like to try it in advance and give feedback, here are some preview builds:
I haven't updated the documentation yet, but I'm happy to answer any questions. You can use the "other" screen to configure it.
You can also double check the other changes so far. You may want to make a copy of your Ludusavi config first in case you'll switch back and forth between the stable and preview versions.
First of all, that's a very good project! Thank you for sharing it! But I think it would be a great thing to be able to backup and restore to and from a cloud, Drive or Dropbox, for example.
If you want, I can write that "module" in Python, as it is possible to run Python code in Rust, using pyo3. Let me know what you think!