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 remarkable-fs toconvert to local folders #12

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

MoralCode
Copy link

@MoralCode MoralCode commented Feb 3, 2021

In the beginning this pull request was created. This may make a lot of people very angry and may be widely regarded as a bad move.

Somewhat seriously though, here is a pull request that, in a hopefully backwards-compatible way, creates an alternative backend where remarkable files are essentially just read and written in another folder, rather than to the ssh server. This creates a few interesting usecases:

  • Allowing users with a backup of their reMarkable filesystem to be able to open/interact with the files on it locally
  • Allowing users who have more complicated ssh setups (such as mine with many ssh keys etc.) that break the SFTP portion of the app to use their own setup (using existing solutions like autofs or sshfs) to access the files on their remarkable.
  • Pretty much turns remarkable-fs into a file-converting utility where (hopefully, i didn't test this both ways) users can put files in either end and get them back out the other end in the converted format for doing whatever ™️ with. This may be especially useful to build into something like Calibre to allow users to sync their ebooks to their remarkable tablets through the existing interface

The part of this pull request that may make people angry is the way in which it was achieved. Since I figured this would make a useful upstream contribution, there are some lines in __init__ of my alternate DocumentRootDir class (better names welcome). This ugly hack basically is some nested namedtuple's that essentially emulate the structure of the sftp object being passed around, replacing its methods like open(), stat(), .etc with their equivalents for opening regular files, such as python's standard open and various calls to os such as os.stat.

This mainly arose out of some errors I was having with the ssh implementation in this package due to my specific setup not playing super nice with the ssh library used here, so hopefully this also helps other people looking to get something to work on their system.

The one word of warning i have is that I noticed that the ssh connection code in this program intentionally disables, then re-enables xochitl while it is working, which this additional mode does not do, so while your remarkable may not freeze while copying files, that may mean your device is more likely to be bricked (i presume).

Also, I would be happy to update the naming/docs on my fork to turn this into a separate project if it doesn't fit the goal of this project, just figured id make a pull request to give the option.

@MoralCode MoralCode changed the title allow remarkable-fs to interact with files served by existing SSH filesystems allow remarkable-fs toconvert to local folders instead of sftp Feb 3, 2021
@MoralCode MoralCode changed the title allow remarkable-fs toconvert to local folders instead of sftp allow remarkable-fs toconvert to local folders Feb 3, 2021
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

Successfully merging this pull request may close these issues.

1 participant