Hyperlink Your Heart - fosshttps://blog.hyperlinkyourheart.com/2023-04-08T23:15:00+02:00Until there's nothing left.Syncthing Update2023-04-08T23:15:00+02:002023-04-08T23:15:00+02:00Kevin Houlihantag:blog.hyperlinkyourheart.com,2023-04-08:/syncthing.html<p>Joplin sync didn’t work out long term, but I’m still using Syncthing</p><p>In a <a href="https://blog.hyperlinkyourheart.com/joplin.html" title="Previous Joplin & Syncthing post">previous instalment</a>, I described how I used <a href="https://syncthing.net/" title="Syncthing website">Syncthing</a> to sync my notes in <a href="https://joplinapp.org/" title="Joplin's website">Joplin</a> on my laptop to Joplin on my phone. Unfortunately that arrangement didn’t last long - updates to different versions of Joplin on different devices resulted in incompatible versions of the notes database being synced, and at one point the Android version became unable to export to the filesystem at all. I never got to the bottom of that, but I had moved to using <a href="https://logseq.com/" title="Logseq website">Logseq</a> for most of my notes on the computer anyway, so it didn’t really matter much.</p>
<p>I also mostly fell out of using Syncthing, since I no longer required it for its primary purpose. However I got a Framework laptop recently and had the need to sync my Logseq graphs to it, as well as my music collection, work files, etc. It was such a joy to get it set up and watch files start to zip across to the new machine that I once again had to sing the praises of this amazing piece of software.</p>
<p>Some shares I have set up so far:</p>
<ul>
<li><strong>The camera roll on my phone</strong> - send only so that remote devices can’t add or delete photos. It’s great to have photos zip across to whichever computer I’m using without having to involve Google Photos.</li>
<li><strong>The Default sync folder</strong> - why not? If some random file is needed everywhere it can go in there. It always throws me a bit that these create a common shared folder rather than each device’s folder being it’s own thing, but it’s cool, it’s fine, I’ll get used to it.</li>
<li><strong>My Logseq graph folders</strong> - I set these up to backup any changes just in case, because Syncthing will not perform merges. However I’m not really that worried about it because I will only work on one machine at a time, and if the sync runs regularly it shouldn’t be a problem.</li>
<li><strong>My music collection</strong> - I set this up to ignore <code>*.zip</code> and <code>*.part</code> for uh… reasons. One of the nuisances of a collection of downloaded music is ensuring that every new acquisition gets to every device where you might want to listen to it <em>before</em> you want to listen to it. Well, problem solved! And no more shaming from Spotify for streaming the same album on repeat for several months! (It was Manu Chao)</li>
<li><strong>Several shares specifically between two particular devices</strong> e.g. huge desktop replacement laptop to the Framework, for when I want to share files specifically between those but not my phone.</li>
</ul>
<p>I’m considering syncing some specific work folders as well so I can more easily untether from my desk, but… haven’t decided yet.</p>Joplin & Syncthing2021-08-28T15:32:00+02:002021-08-28T15:32:00+02:00Kevin Houlihantag:blog.hyperlinkyourheart.com,2021-08-28:/joplin.html<p>I recently switched from Evernote to Joplin, using Syncthing to sync my notes between devices.</p><p>I’ve been using Evernote for quite a few years now for keeping work and personal notes, despite never really being happy with it. Aside from the fact of entrusting my data to a private company, most of my issues with it were minor nuisances, and momentum kept me using it because I didn’t see a good alternative that seemed impressive enough to be worth the hassle of migration. I considered writing my own alternative many times, but of course there were even greater barriers to that!</p>
<p>A few weeks ago I decided to finally take the plunge and try out <a href="https://joplinapp.org/" title="Joplin's website">Joplin</a>, a <span class="caps">FOSS</span> note-taking desktop and mobile app.</p>
<h2>Joplin</h2>
<p>Migrating to Joplin was relatively easy, as it can import Evernote’s “<span class="caps">ENEX</span>” export format. Unfortunately Evernote made me <a href="https://help.evernote.com/hc/en-us/articles/209005557-Export-notes-and-notebooks-as-ENEX-or-HTML" title="How to export notes from Evernote">jump through a few hoops</a> to create these files - the web app, which I usually use, wouldn’t do it, and the export had to be done notebook by notebook.</p>
<p>Joplin did a fairly good job of converting the formatting to its native Markdown, but my notes were a mess anyway so it hardly mattered. The main thing that seemed to go wrong was headers being converted to bold text instead of actual header lines. I also had to reorganise the notebook hierarchy since the notebooks were exported and imported individually. With that done I was about where I had been with Evernote, albeit only on my main computer.</p>
<p>Joplin includes both a Markdown editor and a <span class="caps">WYSIWYG</span> editor. I haven’t tried the <span class="caps">WYSIWYG</span> editor because I like writing in Markdown these days, and I’m hoping using it will result in more structured notes than I’ve been keeping in the past. The default layout has the Markdown and rendered output side by side which I do find a little strange - I can never decide which side I should be reading. However, there is a button in the top right corner of the window to switch between dedicated editing, reading and side-by-side modes.</p>
<h2>Sync That Thing</h2>
<p>Joplin can sync between instances using all of the main cloud storage services as well as its own cloud offering. However, the method that appealed to me, because it keeps my notes out of anybody else’s hands, was to use <a href="https://syncthing.net/" title="Syncthing website">Syncthing</a>.</p>
<p>Syncthing is a <span class="caps">P2P</span> file synchronisation protocol and app that supports all the operating systems that I use (not iOS), and doesn’t require any complex network configuration.</p>
<p>Joplin is actually unaware of Syncthing - to use it, you need to select the “File system” sync target and point it to a folder. It will periodically export changes to this folder and import any changes it finds there.</p>
<p><img alt="Joplin sync settings" src="https://blog.hyperlinkyourheart.com/images/joplin/joplinsettings.png" title="Joplin sync settings"></p>
<p>Syncthing is managed via a web interface on localhost port 8384 by default. There are two main tasks to perform here - connecting your devices, and sharing your notes folder.</p>
<p>Devices in Syncthing are identified by quite unwieldy <span class="caps">SHA</span>-256 hashes, but it provides a number of ways to simplify exchanging these. Devices on the <span class="caps">LAN</span> are listed in the add device dialog, and if you’re using it on mobile there is an option to scan a <span class="caps">QR</span> code for the device you’re connecting. Devices have to grant permission to other devices that add them, and once they do you can choose which folders to share.</p>
<p><img alt="Add device" src="https://blog.hyperlinkyourheart.com/images/joplin/adddevice.png" title="Add device"></p>
<p>Adding a folder is just a matter of entering the path to it on the file system, and giving it a name. You can select existing remote devices to sharing with on the “Sharing” tab, or share it later. Devices have to approve shared folders as well, and you will have an opportunity to choose a target location at that point as well.</p>
<p><img alt="Add folder" src="https://blog.hyperlinkyourheart.com/images/joplin/addfolder.png" title="Add folder"></p>
<p>Syncthing on Android actually has two user interfaces, a native one and the same web <span class="caps">UI</span> as is available on desktop, which is a bit confusing. I found I had to drop down to the web <span class="caps">UI</span> to approve remote device and folder connections.</p>
<p>The Joplin configuration should be basically the same on any devices you want to sync - just choose the “File system” target and point to the synced notes folder. On desktop there is an option to clear the local notes and take everything fresh from the sync target, but the Android app seems to be missing this. As such, you might end up with multiple copies of Joplin’s initial documentation notes.</p>
<h2>Snags</h2>
<p>There are a few things to watch out for, and a few things that I personally find a bit confusing.</p>
<p>The first problem I encountered was due to my hesitation about where to have my phone’s photos stored on my laptop. I accepted the share to one location initially, and when I later deleted and recreated the share in another location I somehow orphaned 33 files. My phone is still stuck at 99% synced as a result.</p>
<p>One thing that appears strange to me is that you can share a folder from one device to another, and then share it from the second device to a third without the third device being aware of the first. I’m not sure if there are any consequences to that setup or if i is functionally the same as having all the devices aware of each other.</p>
<p>On the Joplin side, the formats of the sync repository occasionally need to be updated for new versions of the software. It then becomes unusable by older versions. It remains to be seen how much of an issue this will be - my main worry is that I will update one device beyond what is available on one of the others, or that I will be forced to update at an inconvenient time.</p>
<p>I have had one newly created note fail to sync to my phone so far, though it went to another device, and notes created subsequently synced to it no problem. This may have been the result of one of the issues described above, but I haven’t figured it out yet.</p>
<p>The final thing to be aware of is that Syncthing won’t try to resolve conflicts between files, instead choosing and renaming a “loser” when conflicts occur. I’m not sure what Joplin will make of the renamed files, but it’s something to be aware of if you’re moving between devices and possibly updating the same note before it can be synced.</p>
<h2>Beyond Notes</h2>
<p>Syncthing has actually been a revelation for me. As well as my notes I’ve been using it to sync photos from my phone to my laptop (previously I was relying on Google Photos), and for sending miscellaneous files from my laptop to my phone (previously Google Drive’s job). I’ve also been using it to send video files to my phone, something I wasn’t even bothering with before.</p>
<p>It feels great to be able to cut Google out of the loop as well as Evernote, and so far it has been working away well in the background without me having to think much about it after the initial setup.</p>