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

[request] specify directory to save notes #61

Closed
pcause opened this issue Dec 2, 2017 · 60 comments
Closed

[request] specify directory to save notes #61

pcause opened this issue Dec 2, 2017 · 60 comments
Labels
bug It's a bug

Comments

@pcause
Copy link

pcause commented Dec 2, 2017

There are many different apps/ways to sync files between systems. I'd like the windows/linux/android versions to be able to use a directory I specify as the location for my notes. I use an app on android called foldersync to sync files and freefilesync on windows/linux. this change will allow me to use those and other users to use whatever tools that they choose.

@laurent22
Copy link
Owner

The answer to this might to enable syncing to a local directory - it's a feature that I've implemented for testing, but not enabled in the main apps as I wrongly thought nobody would need it. So please check again in a few days once it's enabled.

@bufferovercat
Copy link

Feature desired. I had to do some research to find out where the data is stored in order to manually sincronize between devices through Nextcloud.

@timwis
Copy link

timwis commented Dec 5, 2017

Yes I'd like to sync via dropbox and I expected to do that by having Joplin save markdown files to my file system, and specifying my dropbox directory as the place to save them. At that point, joplin doesn't really need to know it's syncing; just saving files and detecting changes on the file system.

@closecrowd
Copy link

This. The documentation says that filesystem synchronization is supported, but there doesn't seem to be any way to configure this in either the app or desktop. I use syncthing to share directories among my workstations and mobile devices. It's not going to work to sync the sqlite database file itself... it needs to be supported in the application.

@croulibri
Copy link

Hello,
Your app seems very nice : nice features but simple tu use. Congratulation.
I am also very much interested by filesystem sync on android and desktop. Could you let us know how to activate this function ?
Thanks in advance.

@laurent22
Copy link
Owner

I might be missing something but how can an Android and desktop app sync? File system sync in Joplin allows two applications to share a directory and synchronise with whatever is on it. So you can have the CLI and desktop apps sync to this dir, or if it's a network share, you can also share over the network.

But how does that work with a mobile app? It won't have access to the directory on the desktop anyway, or is there some method to make it work?

@closecrowd
Copy link

Simple - put the sync directory on /sdcard (or whatever external storage is called on your device). And establish a sync directory on the desktop system.

The external sync agent (syncthing in my case) detects changes in the shared directory and makes the contents the same. Just like rsync between 2 unix hosts, for instance.

It needs to be an external sync so Joplin knows to check the files for changes. Otherwise, unless you have the equivalent of an inotify handler, each Joplin instance won't know that the sycn files have changed.

@laurent22
Copy link
Owner

The latest desktop version has support for filesystem sync so for now it works in CLI and desktop. For mobile, a separate driver will have to be written since file access is a bit different.

Actually in case someone wants to try a pull request, I'm putting here the information to create this driver as it's quite straightforward:

  • Copy the file file-api-driver-local.js to something like "file-api-driver-local-mobile.js"
  • Change the calls to use react-native-fs instead of fs. Most calls are wrappers around the native library, and the logic of the delta function can re-used as is (actually it might be better to move it to a separate function so that it can be reused by both drivers).

Once this driver is working it's jut a matter of loading either this one on mobile or the regular one on desktop/cli.

@croulibri
Copy link

I have the same idea with @closecrowd
In my case, I might sync with my Nextcloud server using Foldersync on Android, and the desktop Nextcloud syn app on my laptop.
I have successfully tested the filesystem sync on desktop version, thanks for activating this function.
My skills are far below the requested level for making pull request... so I hope a skilful person will follow your advices and create the driver for Android. I will be much delighted.

@penzoiders
Copy link

+1 for the local sync for Android too.
My scenario (locked now due to absence of local folder sync in Android):

  • Laptop with Appimage --sync-to-local--> in Nextcloud folder
  • Nextcloud takes care of the remote sync
  • Mobile with Nextcloud --sync-folder-to-sdcard(longpress folder + sync in nexcloud client)--> I have the "sync folder from Laptop" in /sdcard/nextcloud/me@mynexcloud.sever/Joplin/

at this point If I could set sync to local to /sdcard/nextcloud/me@mynexcloud.sever/Joplin/ on the Joplin Android app I would be fine

a bit of workaround until the proper Own/Nextcloud driver is done but will work as needed

@prcdslnc13
Copy link

Anymore development on this? I'd like to be able to sync through my Nextcloud server with the mobile app.

@Wholteza
Copy link

I too need to be able to sync it to a local place on my desktop and android, to be able to sync it with my nextcloud.

What is the status on this? I don't see the option of local sync in either of the applications.

@NixSar
Copy link

NixSar commented Feb 10, 2018

A very necessary feature for me as well. I use Dropsync to sync a folder on my Android device with my Dropbox. From there it syncs with my desktop folder where Joplin can pick it up. This way I can also securely sync Joplin through many other file hosting services, even simply USB.

@laurent22 laurent22 mentioned this issue Mar 1, 2018
8 tasks
@false-mirror
Copy link

Would very much appreciate this feature as well, as I have limited internet access and rely mostly on syncthing over a local network.

@danicotillas
Copy link

Congratulations for the app! Love it! I add to this thread a problem I found and it´s that it became impossible for me to set a specific folder on Nextcloud to make de sync. Any ideas? I work on Mac.
Thanks

@jcgerhard
Copy link

@danicotillas: what specific folder do you like to use? Can you post an example, please? May I can help you...

@danicotillas
Copy link

danicotillas commented Mar 14, 2018 via email

@jcgerhard
Copy link

@danicotillas if you want to use a specific destination folder for your joplin files in Nextcloud, you simply have to append its name to the webdav root url.

The standard root url for webdav access is http(s)://yourcloud.tld/remote.php/webdav which points directly to the root path of your Nextcloud files (see screenshots below).


For example, if you want joplin to sync files in a subfolder called "joplin" (beware it's case-sensitive!) that is located straight in your Nextcloud root path like so...

nextcloud-folder

...just append its name (case-sensitive!) to the root url separated with a slash "/".
The resulting path looks like: http(s)://yourcloud.tld/remote.php/webdav/joplin

You can also use sub-sub-folders by just adding their names to the url separated with slashes "/".
E.g. http(s)://yourcloud.tld/remote.php/webdav/backups/joplin would save the files in a subfolder named "joplin" that is in turn located in a folder named "backups"...and so on.


In joplin's configuration settings you simply put the accurate credentials into the respective fields:

joplin-settings

Click on "Check synchronization configuration" and your are done!


Hope I could help you so far?! Kind regards and have a nice day!

@danicotillas
Copy link

Thanks for the detailed explanation. I have tried as you say but I keep getting this notification.
I´m starting to think it has something to do with the place I´m connected (a public library) and maybe there is some sort of limitation.

captura de pantalla 2018-03-15 09 57 08

@jcgerhard
Copy link

You have to create the folder manually in Nextcloud first. Than you can use it. Joplin does not create it automatically if it doesn‘t exist.

@corona6
Copy link

corona6 commented Mar 15, 2018

I need this feature. Please..
+1

@jcgerhard
Copy link

@danicotillas could you solve the directory problem?

@pcause
Copy link
Author

pcause commented Mar 18, 2018

laurent, I am not sure why you've avoided implementing this capability. if you allow us to chose the data directory where joplin stores notes than folks can use whatever they want. it is your project and perhaps the learning about various sync methods is what interests you, but this should be relatively simple to add on all the platforms, even android. if you just aren't going to do this can you close/reject this issue.

thanks for you time and patience. i love the app but can't use because of this one thing.

@corona6
Copy link

corona6 commented Mar 19, 2018

Does someone trying this?
#61 (comment) (react-native-fs)

I love this app and I want to use at Android too.

@corona6
Copy link

corona6 commented May 3, 2018

I could write to the folder, but after relaunch the app, the notes are not shown.
I'm using from Android 8.1.0.

@laurent22
Copy link
Owner

@corona6, what do you mean they aren't shown? Did they get deleted?

@corona6
Copy link

corona6 commented May 3, 2018

@laurent22 Yes, they are deleted from app. But I could find markdown files in synced folder.

@laurent22
Copy link
Owner

Did you sync with a folder, then changed the path to a different (empty) folder? Because the result would indeed be that all data is deleted on the app.

@corona6
Copy link

corona6 commented May 3, 2018

@laurent22 I didn't change path.

@laurent22
Copy link
Owner

@corona6, does it always does it and do you have any steps I can follow to replicate the bug? If I sync with a folder, all the items are there. If I close the app and re-open it and sync again, nothing gets deleted, so not sure what the issue is.

@corona6
Copy link

corona6 commented May 3, 2018

@laurent22 This is the steps that I did.

  1. Install app from Google Play Store.
  2. Create new folder.
  3. Set full path at setting.
  4. Create notebook.
  5. Tap sync button at menu.
  6. Notebook will delete.

I could find markdown files in new folder.

@laurent22 laurent22 reopened this May 4, 2018
@laurent22 laurent22 added the bug It's a bug label May 4, 2018
@laurent22
Copy link
Owner

@corona6, I still cannot replicate this. What path are you using? Is it on the internal or external storage? Do you have access to it with a file explorer?

@laurent22
Copy link
Owner

Out of curiosity, did anyone else try this feature and are you seeing this bug too?

@corona6
Copy link

corona6 commented May 4, 2018

@laurent22

I still cannot replicate this.

Then may be this is my device problem. sorry.

What path are you using?

/storage/emulated/0/joplin/

I create joplin folder and I access to it with a file explorer.

@corona6
Copy link

corona6 commented May 6, 2018

@laurent22 It seems that I'm putting the wrong path.

NG /storage/emulated/0/joplin/
OK /storage/emulated/0/joplin

I though the path was correct because the files are created. But the fetching doesn't works well with the wrong path.
I am so sorry for the inconvenience.

@laurent22
Copy link
Owner

@corona6, thanks that was it. It was treating the path with trailing slash as different when writing and when reading, which was causing all the notes to disappear. This will be fixed in the next release.

@jovandeginste
Copy link

I will simply leave this link here for anyone else after me failing to read the docs and searching through the issues for the correct way to sync the cli ....

https://joplin.cozic.net/terminal/#synchronisation

@seigun23
Copy link

seigun23 commented May 20, 2018

@laurent22

I am also having this problem. At first I tried syncing over network, but found that this was not available. All above solutions for syncing locally also did not work for me. I am using foldersync to get the files from my network.

Without joplin being able to read or find the files locally on the device, the program is useless to me on android.

Please work on a fix? It feels like such an incomplete solution without this feature and will not be useful to me as an evernote replacement otherwise.

@leolivier
Copy link

leolivier commented May 21, 2018

@laurent22
I succeeded synchronizing on my linux desktop application with the url https://nextcloud.levillain.ml/remote.php/webdav/Joplin and my admin user.
When I try the same on my Android app, with the exact same parameters (cut&paste), I get a message saying that the url is not valid :/
I tried to export the debug report and I see an error saying
05-21T12:04:11,20,"""Error: Not a valid URL: https://nextcloud.levillain.ml/remote.php/webdav/Joplin/.sync
The .sync exists in the directory so I'm a bit lost
I'm on a OnePlus 5 with Android 8.1

Edit: my domain has changed a frew weeks ago, and it worked with the old one but I don't know if this is linked as it works on the desktop application...

@laurent22
Copy link
Owner

@leolivier, when I copy the URL from the line 05-21T12:04:11,20,"""Error: Not a valid URL: https://next... there's an extra (initially invisible) space at the beginning of the URL. This could be what's causing the URL to be detected as invalid. Try to manually write it in the input, without copying and pasting, and try again.

@leolivier
Copy link

Woaw, Great, you're right... It works!
Such a stupid thing as it's mostly invisible on a "small" Android screen (maybe you could trim the url to avoid this?)

@leolivier
Copy link

But now, I have another problem! When I sync my Android, all notes are cloned instead of being merged...

@laurent22
Copy link
Owner

@seigun23, filesystem sync on Android should work unless there's some bug I'm not aware of. Did you give permission to the app to access local storage? Also it's probably better not to post here but rather open a new issue with details about the bug.

@vsmysle
Copy link

vsmysle commented Jul 27, 2018

@laurent22 Hello!
I am trying to connect Joplin to Nextcloud and have some issues.
When I am syncing the configuration, "PasswordLoginForbidden" exception raises.
I am pretty sure it is because of me having 2FA on Nextcloud auth.
Can it be solved somehow?

Thanks in advance for answering!

@ghost
Copy link

ghost commented Jul 28, 2018

Yes you can use Nextclouds "App Passwords". You can find them in the settings. But if this does not work you should open a new issue because I think this is not releated to this request.

@luckydays
Copy link

Hey guys!
Thanks for helping Joplin to evolve and making it even better than it already is!

Hopefully, this is the right thread to ask the following question.
So, I've set the synchronization target as Nextcloud WebDAV, everything is working just fine.
At the same time, the attached files are still being saved in c:\Users\_username_\.config\joplin-desktop\ folder, which I definitely need to set to be saved in Nextcloud as well (into a local synced folder).

I've tried already solution mentioned here - #42 (comment) - but doesn't work.

Could you assist me with this, please?

@luckydays
Copy link

@laurent22 Hello sir. Could you assist with my previous message/question (#61 (comment))?

@luks42
Copy link

luks42 commented Mar 15, 2019

Hello,
I configured joplin on my android smartphone and my linux PC and it's work great but now I'm trying to set up on my windows PC and I can't connect. How to do this ?
the error :
request to https://XXXXX/remote.php/webdav/xxxx/ failed, reason: connect ETIMEDOUT 213.186.33.40:443 (Code ETIMEDOUT)
Thank you in advance

@leolivier
Copy link

@weleoka, it's working fine for me with an URL like https://nextcloud.example.com/remote.php/webdav/Joplin

@lock lock bot locked and limited conversation to collaborators Oct 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug It's a bug
Projects
None yet
Development

No branches or pull requests