Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow writing to "local source" which is externally synced #18

Open
stevenbell opened this issue Apr 6, 2021 · 8 comments
Open

Allow writing to "local source" which is externally synced #18

stevenbell opened this issue Apr 6, 2021 · 8 comments

Comments

@stevenbell
Copy link

I've been using syncthing on my rM1 to keep a continuous backup of my files on my computer, and I can use reMy to view those files. I'd like to be able to use reMy to upload files to that "backup" directory, which would then get synced over to the tablet.

  1. Is there any reason not to do this? Perhaps the JSON config file should specify that a local source can be written to, to avoid the case of accidentally overwriting a backup?

  2. I'm happy to submit a PR; does this just require changes in the LocalFileSource class?

    class LocalFileSource(FileSource):

@bordaigorl
Copy link
Owner

Hi @stevenbell sorry for the radio silence.
Have you solved this?
It would be pretty easy to do this:

  • add a 'is_read_only' flag in the source options (default to true for local source)
  • implement the store and upload functions (signature as found in LiveFileSourceSSH

@stevenbell
Copy link
Author

Thanks, I'll take a shot at this and send a PR soon!

@bordaigorl
Copy link
Owner

Just a heads up: there's a new devel branch, you probably want to use that one as a base for the PR.

@martin-braun
Copy link

Any update on this? I like the idea a lot.

@stevenbell
Copy link
Author

I hacked on it a bit but didn't get to the point of being ready to submit a PR. From what I recall, it was very easy to set up, but the syncing wasn't working immediately (due to some combination of Remy + Syncthing + reMarkable) and I didn't have time to debug further.

Another catch is that xochitl doesn't recognize that new files have been added in the background, so you have to have some way to restart it before you can see anything you've synced. Rebooting the tablet is a bit tedious and I haven't taken time to install another launcher.

@martin-braun
Copy link

@stevenbell Thanks for the heads-up. It sounds promising so far. I think a good first step was to simply accept the requirement of a restart. A full restart takes too much time, a different launcher is a burden.

Wouldn't it be enough to run systemctl restart xochitl on the device?

@stevenbell
Copy link
Author

Yes, I think that would work. The issue is that if stuff is syncing in the background there's not an obvious mechanism for triggering a systemctl command. If I have to explicitly connect to the tablet, that sort of defeats the point of having the sync happen automatically in the background.

@martin-braun
Copy link

martin-braun commented Sep 26, 2022

@stevenbell You are right. You would need something like a hook that needs to run on the reMarkable. It would need to have a proper time out and it should not restart when a notebook is open.

This is challenging, because the hook must only fire when syncthing is done and the device is idle, or it should at least delay the restart until that point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants