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

Getting Obsidian to access DroidFS storage? #258

Open
doggorino opened this issue Dec 10, 2023 · 6 comments
Open

Getting Obsidian to access DroidFS storage? #258

doggorino opened this issue Dec 10, 2023 · 6 comments

Comments

@doggorino
Copy link

I'm trying to get Obsidian to work with DroidFS. I want to have my notes encrypted, then when I want to read/edit them with Obsidian I want to be able to mount/decrypt with DroidFS and open the notes in Obsidian. Then I want to be able to close Obsidian and encrypt the notes again by unmounting/locking with DroidFS when I'm done. I have checked the unsafe options keep volume open, expose open volume, and grant write access to hopefully accomplish this. Obsidian is able to see my notes in the file manager (something android apps cryptomator and eds lite couldn't do) but when I try to open them with Obsidian I get "error: this path cannot be resolved." I'm able to do this on desktop using cppcryptfs and Obsidian but I know android is different so maybe I'm going about this wrong. I would appreciate any help. If it isn't possible I probably have to switch to Joplin or something which might be a hassle to transfer everything.

I have attached a screenshot. I'm on android 14 GrapheneOS and running the latest DroidFS 2.1.3. I notice you ask for "log cat" from other people but I don't know how to do that otherwise I would try to attach a log too.

Screenshot_20231209-215219

@hardcore-sushi
Copy link
Owner

Hi, thank you for this bug report. Unfortunately, the bug comes from Obsidian, not DroidFS. According to the error message, it seems that Obsidian tries to retrieve a file path from the encrypted file inside the DroidFS volume. However, this file has no path on disk, as it is stored encrypted and decrypted on-the-fly in memory. As a result, the resolving process fails. Obsidian should instead copy the file into memory from the URI provided by DroidFS and work with this copy instead of a file. This is the standard way of sharing content between applications on Android. You can send a bug report to Obsidian's developers or simply use a more standards-compliant app.

@doggorino
Copy link
Author

Thank you for your help, I'll try a bug report to Obsidian and probably switch to Joplin.

@valuables3327
Copy link

Hi, thank you for this bug report. Unfortunately, the bug comes from Obsidian, not DroidFS. According to the error message, it seems that Obsidian tries to retrieve a file path from the encrypted file inside the DroidFS volume. However, this file has no path on disk, as it is stored encrypted and decrypted on-the-fly in memory. As a result, the resolving process fails. Obsidian should instead copy the file into memory from the URI provided by DroidFS and work with this copy instead of a file. This is the standard way of sharing content between applications on Android. You can send a bug report to Obsidian's developers or simply use a more standards-compliant app.

is it possible to create a symlink from droidfs to a normal directory then try to import that one to obsidian ? or any other way ?

@valuables3327
Copy link

Hi, thank you for this bug report. Unfortunately, the bug comes from Obsidian, not DroidFS. According to the error message, it seems that Obsidian tries to retrieve a file path from the encrypted file inside the DroidFS volume. However, this file has no path on disk, as it is stored encrypted and decrypted on-the-fly in memory. As a result, the resolving process fails. Obsidian should instead copy the file into memory from the URI provided by DroidFS and work with this copy instead of a file. This is the standard way of sharing content between applications on Android. You can send a bug report to Obsidian's developers or simply use a more standards-compliant app.

edit:
i think yours also has bug. can you tell even if obsidian can use this shared-storage as its vault, how it can create its folders ? i tried to add fdroid shared storage with material files and mixplorer, i could read files and folders but i couldnt create folders, is it possible to fix this bug ? or it is an android limition ?
#248

i also reported it in obsidian.
https://forum.obsidian.md/t/error-this-path-can-not-be-resolved-contetn-sushi-hardcore-droidfs-volume-provider-tree/78348/3

@hardcore-sushi
Copy link
Owner

is it possible to create a symlink from droidfs to a normal directory then try to import that one to obsidian ? or any other way ?

No, symlink are just pointers to file. If the file is stored encrypted on disk, a symlink to it won't make it readable. And you can't make a symlink to the decrypted file as it only exists in memory. However, with 1c15f9f, the next DroidFS version will allow you to choose to export files to disk in order to share or open them, which could solve the issue with Obsidian.

Creating folders on exposed volumes is known issue (#248) solved with f4e47c1.

@valuables3327
Copy link

is it possible to create a symlink from droidfs to a normal directory then try to import that one to obsidian ? or any other way ?

No, symlink are just pointers to file. If the file is stored encrypted on disk, a symlink to it won't make it readable. And you can't make a symlink to the decrypted file as it only exists in memory. However, with 1c15f9f, the next DroidFS version will allow you to choose to export files to disk in order to share or open them, which could solve the issue with Obsidian.

Creating folders on exposed volumes is known issue (#248) solved with f4e47c1.

thanks
when new version releases ?

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