Issue with Syncthing

  • Hello all,


    I've been working on a small NAS setup for my parents recently, my first pass with OMV. So far I'm very impressed, and everything has gone smoothly and according to plan. I've run into one snag though, and I cant seem to work past it. The NAS is intended primarily as a replacement for the now defunct google photos, allowing my mother to automatically back up and view her photos when she's home. I intended to do this with Syncthing, setting her phone to backup to the server once a night when she's home. However, I've hit a wall with what seems to be permission issues.


    I've been following this guide which has been very helpful, but things start to get a little wonky towards the end. In the "installing Syncthing" section, I've been working through method two, as I'm still not comfortable enough with the command line in docker to really use method one (I don't really understand what's going on, but I would be fine to use that if there's a resource explaining everything.) I think I run into an issue around step 20, but I cant really say. When everything is setup, my computer can see the Syncthing instance on the server, and I can sync to it, however, it doesn't seem that the client (in this case my computer) has permission to write to the folder.


    Unfortunately, I'm at work right now, so I cant post more specific details, but I'll be happy to provide as much as necessary once I'm home later today. I wanted to get this out there and see if there was either a guide that I haven't been able to find, or see if I'm on the right track with this being a permissions issue, or if this is a configuration problem instead. I'm new to OMV, but very new to Docker, so any help would be great. This doesn't need to be the fanciest setup, but I need to make sure it's robust, I don't want this giving out unexpectedly, since I wont be able to come and service the NAS very often.


    Please let me know what other information would be helpful to better ask the question of what's going wrong, and I'll get everything together ASAP. Thanks in advance for any help!


    Hardware Info:

    Odroid HC4, two drives in Raid 1

    OMV running on Debian

  • macom

    Hat das Thema freigeschaltet.
    • Offizieller Beitrag

    Here are some threads related to Syncthing:

    https://forum.openmediavault.o…2689/&highlight=syncthing


    I would setup syncthing like this:


    Here is described how to use a docker-compose file in Portainer:

    [How-To] Use docker-compose files in Portainer


    An example for a docker-compose file can be found here:

    https://docs.linuxserver.io/images/docker-syncthing


    Below I took the docker-compose example and adjusted it a bit, so that it better fits with OMV:

    Everything after a # will be ignored when deploying the docker-compose file. After the # you find comments and hints, what to change.

    The folder

    • config_syncthing
    • data1
    • data2

    do not have to exist when deploying the docker compose file. They will be created when deploying the docker-compose file.

    As an alternative you can create the directories as shared folders from the GUI of OMV. But do not create the directories from CLI:


    If you want to access the data1 and data2 directory from your client:

    1. create a shared folder pointing at these directories (if not already done)
    2. give your user privileges to the shared folders
    3. add the shared folders to samba
    4. enable samba
  • Thank you for the response! I appreciate it a lot. I apologize for the delay, but I do have a few questions.


    Everything seems to make sense here, however, I'm stuck on a few aspects.


    1. In line 13, will the "xxxxx" portion of this be the same as for "data1"/"data2"? Or is this path typically moved to the OS disk?
    2. In line 14, 15, I only need to sync one directory, in my case /Photos is the relative path. Do I need to include a second line, or was this included in case I needed to sync multiple folders? If I do need it, what is the purpose of the second location?
    3. Near the bottom of your post, you mention giving your user privileges to the shred folder. I think this may be part of the trouble I've been having. The user I created for my parents has read/write access in the "Photos" folder, is this all that is necessary? To be clear, the folder was accessible from clients beforehand, I just cant get syncing to work. Do I need to give permissions to a Docker user for that folder? Which user is meant by "your user?"

    I think I understand the process of using the docker-compose file, here is what I've cooked up so far, based on your example.


    Assuming that I don't need the second "data2" directory, and assuming I plug the correct location in for the config directory, everything should be adjusted as needed, correct? Once I know I have a good set up for this, it should make it easier for me to figure out what is causing syncing issues if any persist. Thanks again for all the help, I cant tell you how much I appreciate it with being new to this.

    • Offizieller Beitrag

    In line 13, will the "xxxxx" portion of this be the same as for "data1"/"data2"? Or is this path typically moved to the OS disk?

    For the config " - /srv/dev-disk-by-xxxxx/config_syncthing:/config" you need to adjust the xxxx to place the folder on a OS disk or a data disk. If your OS disk is large enough, I would put it there.

    In line 14, 15, I only need to sync one directory, in my case /Photos is the relative path. Do I need to include a second line, or was this included in case I needed to sync multiple folders? If I do need it, what is the purpose of the second location?

    If you only need one folder, you can remove the line 14 or 15 in my example. Or just put a "#" in front.You replace the xxxx part by "uuid-5afa6ae2-2da6-44ab-8296-0248b37e70ed/data1" which seems ok, if your photos are really in a folder called "data1". Maybe it is actually something like


    /srv/dev-disk-by-uuid-5afa6ae2-2da6-44ab-8296-0248b37e70ed/Photos

    Near the bottom of your post, you mention giving your user privileges to the shred folder. I think this may be part of the trouble I've been having. The user I created for my parents has read/write access in the "Photos" folder, is this all that is necessary? To be clear, the folder was accessible from clients beforehand, I just cant get syncing to work. Do I need to give permissions to a Docker user for that folder? Which user is meant by "your user?"

    The user for your parents has access to the folder "Photos". I assume they are using smb to access the Photos. So the samba service is used to control the access to that folder.


    The docker container itself is run by another user. It is the user you specify by PUID and PGID. Actually this can be the same user that your parents are using. In this case you would use the PUID and PGID from your parents. But you can also use another user.


    It is important that this user need to have permissions for this folder on filesystem level (and not samba level).

    If you create this user in the GUI of OMV and if you created the /Photos folder as shared folder in the GUI of OMV, it should just work ;)


    If it is not working, we need to check the ownership and permissions of the Photos folder. For this you can use this command

    ls -l <path_of_the_folder>


    To get the PUID and PGID of a user you can use

    is name_of_user in the CLI (terminal).

  • Sorry for the delay. I was able to get docker up and running, here's the compose that I used:

    Now the only issue seems to be getting docker pointed at the correct folders. When creating a folder in the Docker webgui to share, I'm not sure how to reference the Photos folder I created earlier. I created that folder in the OMV webgui, and I've made sure that my parent's user has access. I also made sure that user is part of the sambashare group, though I dont know if that was necessary.


    The issue now is that I dont know how to tell Syncthing to reference the Photos folder, if that makes sense. As far as I can tell, everything is syncing, I just dont know where the files are going. I added my phone as a remote device, then created a shared folder on the Syncthing server, shared it with the phone. When I add files to the folder that's shared on the phone side, they dont show in the folder I thought I had linked on the server side. I think the issue isn't with permissions now, but with where syncthing or docker is looking for files on the server. I know that's a bit confusing and all, so let me know if you have any questions. Any thoughts on what I need to do to point syncthing/docker at the right folder on the server side?

    • Offizieller Beitrag

    You still don't have a path pointed at Photos... Note line 14 of your compose...



    On your server settings, under the general tab...



    Click Folder Defaults



    So if you're not paying attention when creating the share on your server, it's putting data on your /config folder.


    You need to:


    1. Set a container path for for data in your compose file.

    2. If you want that folder as default, set it as the default folder in the webUI, or when you add it, make sure you change it as the default folder (see at the very bottom of the next pic)



    In my compose file, data is mapped to "data", so I simply changed that path to "/data/Pictures" (note Line 12 below)


    Let it finish and do it's first sync, then I just checked that it went properly...


    (by the way, Born and Raised near Community South Hospital)

    • Offizieller Beitrag

    the_drugs


    There are better solutions for this than Syncthing. If you want them to be able to look at, upload/download photos from a website similar to Google Photos.. Piwigo isn't difficult to set up... Even a local Nextcloud setup would be better, IMO. If they got to the point where they wanted to share them off their network, setting up a reverse proxy of these two is also very simple.

  • You still don't have a path pointed at Photos... Note line 14 of your compose...

    This was the problem! I got this fixed up, and everything is working just fine now. I cant believe I missed that, thank you for the catch!

    There are better solutions for this than Syncthing

    For a full fledged solution, yes. Talking with my parents, they mainly used Google Photos for a backup, then to casually go through and look from time to time. This lets them do that same as before, no extra frills or apps to get used to or work. The only place I can think that they would want to share off the network would be social media, which is as easy as uploading from the computer they access from, I guess. I asked to make sure, both of them said they didn't want an app, just an easy way to get their photos backed up and off their phones. Sometime I'd like to set something similar up with my NAS, though, so I'll have to keep this in mind. It looks like a great project, I'm sure there are plenty of nice alternatives.

    (by the way, Born and Raised near Community South Hospital)

    It's a small world after all! Originally I'm from further south, near Brown County State Park. Living up near Broad Ripple for work now though. Always neat to run into other Hoosiers!


    Thanks to both you and macom for all the help, I wouldn't have gotten this far without you both. I really appreciate it, especially with the patience between responses.

  • the_drugs

    Hat das Label gelöst hinzugefügt.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!