Tag Archives: Joplin

Syncing files on Synology using a WebDAV server, with Joplin

My Synology is a bit outdated so the preferred or latest method seems to be with Docker, however I do not have that, so the alternative is the WebDAV method.

The first things you obviously need to do is download Joplin on your clients, installing on the PC and on Android, go to your synchronisation settings and it’ll ask you for a WebDAV URL, username and password.

Next create a location for the WebDAV server, specifically where our Joplin clients will look to when syncing their files.

Before you proceed you should decide on what you require, if this is purely an offline (no access to the internet) kind of syncing solution for yourself then you will not be able to use HTTPS unless you figure out and setup a local self-signed SSL certificate, whether that’s to your IP or an offline hostname.

Install & Setup WebDAV Server

On Synology (6.2), it’s a simple case of heading over to the Package Center and installing the WebDAV Server, once running go to settings and enable HTTPS (5006) and that’s it, at least for me. If you’re going the route where you’d like your notes to be synced via the internet then I wouldn’t turn on the HTTP, just to make it easier on securing the route.

In order for WebDAV to work via the internet, you need to create a DNS to point your dynamic IP or if you’ve got a static IP laying around skip all of that.

Purely HTTPS

FreeDNS, No-IP

Head over to one of the free DNS services/providers below and setup an account.

FreeDNS.com
http://www.freedns.com/

FreeDNS – Free DNS – Dynamic DNS – Static DNS subdomain and domain hosting
https://freedns.afraid.org/

Duck DNS
https://www.duckdns.org/

FreeDNS Alternatives: 25+ Dynamic DNS Services & Similar Apps | AlternativeTo
https://alternativeto.net/software/freedns/

Updating your dynamic IP

If you’ve got an option in your router to automatically update your IP (as it changes) to your dynamic DNS service/provider then you’re all set, simply provide the credentials and details it requires and your router does all the work.

If not you’ll have to either manually update it every time your router resets and changes IP or set up some kind of automation, there are some little apps/programs that keeps track, depending on the DNS service, you can see what’s compatiable.

I used DuckDNS and found that they’ve got a simple vbs script that can be run with Task Scheduler, which you can find out below.

Duck DNS – install
https://www.duckdns.org/install.jsp

I had to use a .bat file to run the command via CMD and get the .vbs script running or it stalled. Be sure to use pause or echo to test.

Add and export your certificate

Via the Synology (6.2) Control Panel, under Security, the Certificate tab, hit add and using the domain (sub domain) you created, fill in the details. Once done you can right click on the certificate and Export.

Install a certificate on Windows 10

Right click on your start menu and hit run, type “mmc” and OK, which should bring up the Microsoft Management Console (MMC), on the top left, under File menu, press Add/Remove Snap In, from the left, add to the right Certificates snap-in for Computer.

On the left, right click “Trusted Root Certification Authorities ” then under All Tasks, choose Import. Go through the process, I personally did automatic also right after.

Setup/add your new domain (sub domain)/hostname on Synology

Via the Synology (6.2) Control Panel, under External Access, press Add on the top and go through the process of adding your dynamic DNS service details. You’ll also have the option to configure your router there, if your router is on the list, if not then the manual way is below.

Install the required certificates to Configure Port Forwarding on your router

You’ll need to point any visitors to your external (public facing) IP that also use the port 5006 to forward to your local IP Synology server. So for example, your public IP address xxx.xxx.xxx.xxx:5006 would come to your router, the router will see that it’s has the port 5006 at the end of it and knows that the traffic for this port all must go to your Synology box at 192.168.0.100:5006, 5006 is being the WebDAV server we turned on earlier.

Install a certificate on Android

  1. Open your device’s Settings app.
    • Tap Security and privacy > Other security settings
  2. Under Credential Storage, Tap Install from device storage CA certificate.
  3. Tap where you saved the certificate.

Configuring Joplin

Once you’ve installed the certificates on your devices (to avoid TLS certificate errors), you should be able to input the URL, username and passwords.

Your URL should look something like this:
https://192.168.0.100:5006/vol1/joplinnotes/
https://yoursub.domain.org:5006/vol1/joplinnotes/

You can create a user specifically for Joplin use, but you’ll need to give it access. You’ll need to tweak the permissions where you only give it full access to the Joplin folder, allow it access to the parent folder so it can enter the directory, but not view anything else, other than what it’s been given, which is the joplin folder.

Links & References

Joplin in NAS Synology (webDAV) – Support – Joplin Forum
https://discourse.joplinapp.org/t/joplin-in-nas-synology-webdav/375/16