LiamMorrow / LiftLog

A cross platform app for tracking your lifts in the gym
https://liftlog.online
GNU Affero General Public License v3.0
48 stars 4 forks source link

Automated Backups #243

Closed LiamMorrow closed 6 days ago

LiamMorrow commented 1 month ago

Right now backups are a very manual process.

It would be good to have some sort of automated backup system.

It should:

LiamMorrow commented 1 month ago

Local storage backups seem like it would have to be an android only feature, which I don't love. Not a blocker by any means. Just wondering if there's something we could do there.

In the past I have used apps which automatically backup to icloud and google storage.

I wonder if this could be done in such a way where there is a backup "silo" where a silo is something which depends on the platform:

@bschwehn would this help you somwhat? You mentioned potentially running a feed server of your own which makes me think you'd much rather a fully self hosted solution. Perhaps (and no guarantees), FTP? Or even just a webhook.

LiamMorrow commented 1 month ago

image Just spitballing

bschwehn commented 1 month ago

Local storage backups seem like it would have to be an android only feature, which I don't love. (from 244) especially as this is a feature that I likely wouldn't use.

Then I think the most important aspect is that you keep enjoying to work on this application and that it not starts feeling like work were you have to support other people's requirements (without even getting paid for it) :)

makes me think you'd much rather a fully self hosted solution

Right, I prefer minimizing dependencies on third party dependencies and "always connected" solutions when I reasonably can. And I like to tinker with my own pipelines (like automatic export - syncthing to own server - convert and archive).

But, realistically, only a small fraction of your users will care a lot about automated backups at all. And an even smaller fraction of those users would care about maintaining their own infrastructure to enable this. Maybe it is even just one potential user: I.

Having said that, that webhook backup looks great to me, I'd use it :) I'd also use a Google Drive backup, and the fractions of people that want automated backups and use Android without google is surely very small.

Now, I don't really have a good idea about the amount of implementation and maintenance efforts that would be required to add backup to Google Drive for Android and iCloud for iOS. At the least, it will require testing this in both platforms rather than being able to test it in the web application, so much more hassle. It would be more useful to more people compared to webhook, however.

If you think the webhook backup can be implemented quite easily, maybe it's something to start with and then wait until you have the feeling the automated backup is something that more users would like to use?

Again, I think I might be the only user right now that would want to use this, so thank you for still entertaining this idea! And I totally understand if this is not something you feel is worth to add right now.

LiamMorrow commented 1 month ago

Then I think the most important aspect is that you keep enjoying to work on this application and that it not starts feeling like work were you have to support other people's requirements (without even getting paid for it) :)

Oh don't stress about that! Having people interested in using something I made is greatly motivating. My main point is I'd like to get it right rather than just guessing what you'd like. I myself would actually love an automated backup, having lost data due to me developing the app on my daily driver 😬

Having said that, that webhook backup looks great to me, I'd use it :)

Looking at it, the major issue I see is that a webhook would require HTTPS in later versions of android. Not huge, I think at this stage getting a TLS cert from letsencrypt is pretty easy, but still something to note.

Now, I don't really have a good idea about the amount of implementation and maintenance efforts that would be required to add backup to Google Drive for Android and iCloud for iOS. At the least, it will require testing this in both platforms rather than being able to test it in the web application, so much more hassle. It would be more useful to more people compared to webhook, however.

Yeah I think that it should be fine my main goal is that whatever solution that is done can be adapted to each platform (e.g. local backup wouldn't work on ios, so is unattractive to me, but cloud backup works on ios and and android so is good.). Web is less of an issue , it's kind of there for development purposes and a demo. I'll tinker with the google drive API and see what I can do. My fear is as with anything Apple development, iCloud will be a nightmare to authenticate with.

TLDR I'd like to do the cloud backups as it would have a wider reach, but if it's too complex, the webhook is a good standin which would work on everything

LiamMorrow commented 1 week ago

@bschwehn I've merged #260 which implements the webhook variant of backups. Have a read if you like. I've provided a simple server LiftLog.BackupServer which can accept these backup requests and persist them to disk.

The major thing I see as a potential blocker is that the endpoint is required to be HTTPS. Android (at least, I didn't check iOS) does not support unencrypted connections without a whitelist in the manifest. I might be wrong here, and if this doesn't work for you and you find a workaround I'll be happy to try some things.

It can be tested at https://app.liftlog.online in the meantime before the next release goes out. LMK if this ticks the box for you!

LiamMorrow commented 6 days ago

This has been released in https://github.com/LiamMorrow/LiftLog/releases/tag/2.17.2 🎉

It's a little noisy, I might remove the toast on success.