Web "frontend" for Syncthing

What type of hardware are you using: VPS bought online
What YunoHost version are you running: 12.0.9.1
What app is this about: Syncthing

Describe your issue

I am using exploring the possibility of using Syncthing as a replacement for Nextcloud.
For this, I would need to be able to have a kind of “web frontend” for some of my files (mainly my pictures), such as https://tinyfilemanager.github.io, https://filebrowser.org or https://www.files.gallery.
The default setup for Syncthing puts all files in /home/yunohost.app/syncthing, with ownership to a unix user called syncthing
Therefore, Tinyfilemanager or Filebrowser can’t access to these files
Is there any recommended way to handle my use case within Yunohost ?
Many thanks in advance for your help on the matter

Share relevant logs or error messages

N/A

Hi,

I use Syncthing as backup for a few devices and the way I access my files is just to connect the server over SSH in my files application on my linux laptop, using root user credentials.

I don’t know if the trick of using a root user also works through other frontends, but this has been working for me for quite a while.

You were faster than me. I was thinking about asking the same question but with some differences.
I was thinking about mounting syncthing data folder on a subfolder in yunohost.multimedia/$user/syncthing or symlink it. And have photoprism or immich using it as read-only storage.

You can use ACL to give read access.
First, I must say i don’t use syncthing but i’m pretty sure a command line like the following should do the trick. Before to do that, as i don’t know if there are already any ACL , i recommend to use getfacl to verify. The files/folders have also a sign + at the end with ls -l like this example : drwxrwxr-x +

setfacl -Rdm u:your_user:r-X /home/yunohost.app/syncthing

If you need write, use rwX instead. Replace ‘your_user’ by the user of the app (ex: nextcloud for nextcloud app, etc…)

2 Likes

Apps with multimedia access have ACL group:multimedia in yunohost.multimedia
So you can use ACL too and let data in their original folder /home/yunohost.app/syncthing.

setfacl -Rdm g:multimedia:r-X /home/yunohost.app/syncthing

A second solution is to use setgid. I guess the group folder is also syncthing but you can modify it to give multimedia group. For all new files created, you can use setgid to modify the group :

chgrp -R multimedia /home/yunohost.app/syncthing
chmod -R g+s /home/yunohost.app/syncthing
1 Like

Thanks all for your replies, I will investigate and report here what worked !
In fact I had read already about setfacl here before making this thread :

I wasn’t too sure about that solution and thought it was a kind of messy hack. The fact that Multimedia folder seem to be based on that same approach is reassuring.

1 Like

I use ACL with success and yunohost use it , so i think it is the good solution. Don’t forget the -d option, it is necessary to give the right ACL to new files.
I’m not sure that the command line i gave modify ACL for the older files. If it is not the case, use this before :

setfacl -Rm u:your_user:r-X  /home/yunohost.app/syncthing (or rwX if you want write)

The X (uppercase) is necessary to give execution to folders. If folders don’t have execution rights, the ACL won’t go through. If you use x (lowercase) , it give also execution to the files, and i think it is not necessary here.
But make your tests, you can go back and give others ACL. I suggest you not to give too many rights (X uppercase is better) and modify only if you need more access.

1 Like

I have used setfacl and I confirm it works very very well !
Thanks all for your help.
Once I’ll have finished my transition to Syncthing I may write a small “testimony” post on this forum. It’s day and night, I was so tired of Nextcloud…

3 Likes

What you don’t like with Nextcloud?
(actually, I’m testing Syncthing on Yunohost, and seems everyone can see everything, that I don’t want [But I need read more])

I should start saying that I have been using Nextcloud (and before the fork, Owncloud) since around 10 years now. It is definitely a useful sowftware and almost impossible to fully replace featurewise.

However, over the years I have grown a number of complaints, to the point where I decided I would try to go another route with Syncthing. Funny enough, before using Owncloud I was using Resilio sync, which is essentially… an ancestor of Syncthing. Back to my origins I guess :laughing:

Some of my grumbles are probably associated with some facts or choices about my setup, so here is a bit of context :

  • I use only Apple end-devices, both professionnally and personally
  • My wife doesn’t have a laptop and relies only on her iPad for files manipulation / creation
  • I don’t live in France, but for various reasons want my “cloud” data to be hosted in France
  • For various reasons too I decided I wouldn’t “truly” selfhost and my Yunohost instance is hosted on a VPS (which also means that I get much less CPU/RAM power that what I could have had using my own machine in a closet)

Annoying but not deal-breakers

  • The web browser is (very very very) slow. A little has probably to do with the fact that my VPS is a few thousands km away, but it still feels slow when I access it from France. I have tried everything : tweaking the PHP setup, purchasing a more expensive and powerful VPS, putting my /var/www in a more expensive and faster attached drive, switching to PostgreSQL database, pre-processing the picture thumbnails, cleaning my database, removing all apps except the only ones I use, etc… This software is just bloated. Maybe it feels nice when you are at home with a nice i5 / i7 proc and 8GB of RAM and all files on a modern SSD, but that wasn’t my case. However, let’s be honest, I almost never used the web interface.
  • Mac OS client has become very ugly and often freezes my Macs (even my M2 beast desktop)
  • As a whole, the Nextcloud project seems to be less and less aligned with the community, putting all work and efforts towards things nobody wants such as the ability to manage millions of users… In fact, before I considered Syncthing, I was wondering if coming back to Owncloud wouldn’t be better. It seems that they did a very nice job with their Infinite Scale OCIS full rewrite in go. That’s quite tempting to try, and certainly more aligned to the kind of stuff I was hoping and waiting for from Nextcloud after the fork.

Very annoying

  • MacOS tags aren’t synced. This is very annoying since I want to use and rely on them to organize my files, but never couldn’t
  • Creation time changes aren’t detected by the client (I have filed an issue here : Client fails to detect a creation date change · Issue #2196 · nextcloud/desktop · GitHub). This is very annoying because the photo gallery is relying on creation time, which I have to change after the files have been exported from Lightroom.

Triggered my switch - deal-breakers

  • Very weird and random stuff including loss of information on CardDav contacts
  • Completely broken integration between iOS Files app and iOS Nextcloud app. This is a huge deal and my wife had many cases where she’d save a file through iOS Files app via Nextcloud, only for that file to be completely lost and nowhere to be found. This is not acceptable for something that is supposed to be the core of Nextcloud’s project. Slow sync ? No problem, I don’t need real-time work. Lost files ? I’m out. In fact, I was willing to be out since long, until I finally took the step.

How did I replace Nextcloud ?

First of all, it’s still a bit early to be 100% sure I’ll stick with my current setup, but basically :

  • CardDav and CalDav have been moved to Baïkal app. So far it seems to be much more reliable and quicker
  • Files are synced between devices using Syncthing, with my Yunohost server keeping a copy, together with my backup NAS at home
  • iOS clients are using the (still beta but perfectly working) synctrain app (GitHub - pixelspark/sushitrain: Securely synchronize files with your devices on iOS using Syncthing). No more files lost !
  • Thanks to your help above, I’m using files.gallery as my web viewer when needed (that is very rarely). The speed is truly impressive compared to Nextcloud.

What did I win ?

  • Reliablility and peace of mind for contacts and files on iOS + MacOS client very light and never crashing
  • Speed when at home because when looking for a file on demand from an iOS client, all devices that have that file, including the NAS, will stream it together. I can watch family videos on the fly without any latency
  • Tags are synced (not yet with iOS clients, but between MacOS clients)
  • Creation time changes are synced

What did I lose ?

  • Convenience for not synced files on iOS. Because Nextcloud app is registered as a file provider for iOS, the Files app could show you all your files on your iOS device, including the ones that you didn’t have locally, and would download them on demand when required. Now, I only see on the Files app the files that I have synced, and when I need to look at my un-synced files, I have to open Synctrain app, where I can see them on the fly and/or ask them for them to be downloaded. It’s a minor inconvenience, and the Nextcloud mechanism wasn’t working anyway…
  • Unique link sharing (that I used very rarely anyway). I’m doing a small “hack” using files.gallery for the few cases where I need it.
  • Federation. I had a few cases of folders and files I had on my Nextcloud that were in fact shares from other Nextcloud instances from friends. I think I can live with that, 99.9% of the links I receive are saddly still Google Drive links…

Beware with SyncThing !!! I used to use it to… sync (and backup) my photos between different devices. But at some point, you know, when you need to reinstall things, I forgot to enable the IgnoreDelete (hidden stuff that is not supported anymore) for each synchronized folder. → Disaster !!! All my photos gone !!! Luckily, I had a separate HDD where I back up stuff from time to time. The only recent photos that still haven’t been backed up were still on my Android phone, so I could get them back. But that’s when I realized that SyncThing is really not a backup solution, and decided to remove it. And installed NextCloud. Sure, it’s somewhat heavy, but it does the job. I can sync/backup my photos without risking losing them.

1 Like

Thank you for your warning.

I confirm that I’m not using Syncthing at all as a backup solution.

  • My files are synced to the NAS using Syncthing
  • My servers are backed-up on the NAS using Borg
  • The whole NAS content is daily backed-up on a blackbaze repo using my Synology Hyper Backup app (OK, I have to be fair, this is not yet active, on my todo list for this week)
  • (As a kind of failover, my Mac Mini M2 also has a copy of each and every file, and is backing-up hourly to the NAS using Time Machine)

Since the OVH fire early 2021 that gave me a very hard time by burning both my production server and all my (paid) backups that were on the same building, I have become quite paranoïaque…

I do not understand though how Nextcloud makes you safer from unwanted deletion than Syncthing ? It’s exactly the same : delete stuff, and it will be gone forever ! I hope you aren’t too much relying on the trashbin feature ?

2 Likes

SyncThing can do unwanted deletion, if you forget that IgnoreDelete setting. With NextCloud, AFAIU, it will delete only if I choose to delete something. Anyways, I’m still keeping a copy of important files on an external drive (in my drawer, only connected when needed).

I remember nextcloud android app to be extremely slow and sometimes skips some photos. And nextcloud desktop app has difficulties when syncing a large number of small files.
Do you use alternative apps with nextcloud?

No. My photos are locally (desktop) organized in folders/subfolders year/month, with Digikam. Same organization with Nextcloud. On Android, Nextcloud is set to auto-upload some folders (mainly, photos).
On my desktop PC, I also set a “Dropbox” folder to have the same kind of functionality.