Joplin + Syncthing has been great for me. Sync across multiple devices with no third party in between. However the "sharing" in this context is limited to other installations of the entire db. To my knowledge, there's no way to say "sync these notes with my wife, and these others with my phone only" etc.
I guess it's been a while then. Syncthing works perfectly for me, with the official latest version in Arch, the older version in Debian, the flatpak on Ubuntu, and the forked version on Android, syncing all my Joplin data all over the place.
I don't much care for the file format though. The appeal of Git Journal is strong.