Failure to disable keytar in FreeBSD prevents joplin terminal client from starting in headless setup

  • joplin version 1.0.67
  • Client: terminal application
  • OS: FreeBSD, headless.


I am running the terminal Joplin application in a headless FreeNAS (FreeBSD-based) server. Since the last two updates (reproducible in version 1.0.67), I have been hitting problems with joplin not being able to start without an X11 server.

Doing a bit of digging, I pinpointed the problem to the use of the keytar library, which apparently uses libsecret internally. This library, in turn, depends on X11. However, I found in KeychainServiceDriver.node.js that there is an intended switch off for this that should have disabled the use of keytar and avoided the issue.

The problem and the main point of this report, is that the shim.isLinux() test is not being triggered in FreeBSD. The shim library does add a similar isFreeBSD check, which I confirmed to work in my setup and fixes the problem:

keytar = shim.isLinux() || shim.isFreeBSD() || shim.isPortable() ? null : require('keytar');

The reason I did not submit a pull request in Git however because I cannot test with other clients (Mac, specifically). So I’m not entirely sure whether the intended logic is “is not Windows”, rather than “is Linux/FreeBSD”.

I hope this helps. Thank you once more for Joplin — it’s an invaluable tool.


PS: FWIW, while I was delving into the issue I stumbled upon an alternative version of keytar that replaces libsecret by pass keytar-pass. This is not directly related to the problem above but thought I’d mention it as it might be one way to add support on headless systems.

Hmm, yes to be safe I guess the check should be that it’s enabled on Windows (but not portable app) and macOS and disabled on all other operating systems.

Thanks for confirming, Laurent. I will make the change and submit the PR.