[SOLVED]-Syncthing Docker on OMV5 - Permission Problems

  • Hi everybody. I have installed the syncthing/syncthing container on my OMV5 machine by the following procedure:

    -> docker pull syncthing/syncthing:latest
    -> docker create --name=syncthing --network=host \
    -e PUID=1005 -e PGID=100 -e TZ=Europe/Rome \
    -v /srv/dev-disk-by-label-DATA/:/DATA \
    --restart unless-stopped syncthing/syncthing:latest
    -> docker start syncthing

    I use UID and GID of the 'docker' account (an account specifically created to run the syncthing service that have r/w/x permission on all the shared folder to be syncronize in order to use the same service/container to sync the shares of the different users which have the same permission on the respective folders).

    The permission are like this docker user rwx on Folder1 and Folder2 and user1 rwx on Folder1 & no access on Folder2 | user2 no access on Folder1 & rwx on Folder2

    The problem is that every file created by the syncthing service in the shared folder of the specific user (e.g. 'file' on Folder1) it's owned by docker account and it's not anymore editable by the user1 (unless going every time in the omv web gui and restore the permission on every subfolder of Folder1 again).

    To fix this issue i edit the PUID variable setting it at 0 (root account) and everything work fine but the syncthing service tell me that running the container as root shouldn't be done.

    So what I have to do? I have to run a specific syncthing container for every user to avoid permission problems or can I leave the container running as root without issues?

    I hope i have explained the problem correctly.

  • Problem solved. I leave a summary of the procedure followed which can be useful for other novice users like me. Any comments/suggestions or improvement to the following configuration are welcome.

    1) From the OMV-WebUI create a user called 'docker' and give him r/w permissions to each shared folder to be synchronized

    2) Took the UID and GID of the docker user from CLI by executing : id docker

    3) Create and Start the Container by executing the following:

    Pull the image ------> docker pull syncthing/syncthing:latest

    docker create --name=syncthing --network=host \
    -e PUID=1005 -e PGID=100 -e TZ=Europe/Rome \ # Whit PUID and GUID from step 2)
    -v /srv/dev-disk-by-label-DATA/:/DATA \ # mountpoint of the shared folders
    --restart unless-stopped syncthing/syncthing:latest
    docker start syncthing

    4) Browse to Syncthing WebUI at 192.168.1.XXX:8384 and follow the wizard to set username and password.

    5) Connect the Remote Devices and Configure the Shares

    6) To Avoid permission problems go to 'Actions' -> 'Advanced' and check the 'Ignore Permission' box for every shared folder (see the attachments).

    (If 'Ignore Permission' is left unchecked the syncthing service create the file with r/w permission for the docker user but with r-only permission for others user)

  • CarlB

    Changed the title of the thread from “Syncthing Docker on OMV5 - Permission Problems” to “[SOLVED]-Syncthing Docker on OMV5 - Permission Problems”.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!