docker-czkawka icon indicating copy to clipboard operation
docker-czkawka copied to clipboard

Guide for Synology

Open Wgsem opened this issue 3 years ago • 21 comments

Could it be possible to provide a step-by-step guide on how to get this running in Docker on Synology.

I downloaded the image but I can't get it to work, because of my habbit of messing this up I've learned to ask now. I've searched the web but I can't find a guide, that's why I'm creating this issue.

Wgsem avatar Dec 27 '21 15:12 Wgsem

It's hard for me to provide a step-by-step guide since I don't have a Synology myself. But it should not be hard to setup. You can share what you have done and I can help to provide what you are missing.

jlesage avatar Jan 01 '22 02:01 jlesage

I can help with this, but first I have an issue.

I tried it on my laptop under macOS machine and it works fine, but on Synology I'm seeing that /storage is owned by root and permissions are set to 700. This means that the app user can't see it. On macOS the permissions are set to 755

/config is setup correctly.

@jlesage would you have any insight into what I could check to debug this?

rubenvarela avatar Jan 25 '22 01:01 rubenvarela

Hello! Same issue for me. My run command is :

sudo docker run -d --name=czkawka -p 5800:5800 -v /volume1/Famille:/storage:rw -v /tmp/pipo:/config:rw --env USER_ID=1026 --env GROUP_ID=100 jlesage/czkawka ($HOME usage cannot solve the problem)

In a bash acces with a root user /storage is ok but app user cannot read it because /storage are set to 700. --env SUP_GROUP_IDS=0 in a command line change nothing.

If i can help to solve the issue it's pleasure.

Thanks

mdovero avatar Feb 18 '22 23:02 mdovero

You probably need to adjust the USER_ID and GROUP_ID environment variables.

You can check ownership on the host side, i.e. on Synology itself.

If we take the example of @mdovero, what ls -ld /volume1/Famille is showing ?

jlesage avatar Feb 23 '22 13:02 jlesage

Hello !

I'm a french speaker from France, I think you are from Quebec ? I already worked and lived in Quebec City, i like this area !

Thanks for your help !

On my NAS Synology : @.***:/volume1$ ls -ld /volume1/Famille/ drwxrwxrwx+ 1 *root root *96 Feb 22 17:09 /volume1/Famille/

User marcd can write :

@.:/volume1/Famille$ touch /volume1/Famille/test @.:/volume1/Famille$ ls -alF /volume1/Famille/ total 0 drwxrwxrwx+ 1 root root 112 Feb 23 22:29 ./ drwxr-xr-x 1 root root 674 Feb 22 18:09 ../ drwxrwxrwx+ 1 marc users 8 Feb 13 17:12 Camera/ drwxrwxrwx+ 1 root root 100 Feb 23 22:29 @.*'/ drwxrwxrwx+ 1 marcd users 96 Feb 2 19:48 Marc/ -rwxrwxrwx+ 1 marcd users 0 Feb 23 22:28 pipo drwxrwxrwx+ 1 root root 18 Feb 21 00:10 '#recycle'/ drwxrwxrwx+ 1 marcd users 0 Feb 20 14:59 Scans/ drwxr-xr-x 1 root root 594 Feb 23 04:00 '#snapshot'/ drwxrwxrwx+ 1 root StorageAnalyzer 56 Feb 23 03:13 synoreport/ -rwxrwxrwx+ 1 marcd users 0 Feb 23 22:29 test

My id for my user marcd : @.***:/volume1$ id uid=1026(marcd) gid=100(users) groups=100(users),101(administrators)

And for my container : @.***:/volume1/Famille$ sudo docker container ls -a | grep jlesage 99e2012975ba jlesage/czkawka "/init" 4 days ago Exited (0) 4 days ago czkawka 723569328f24 jlesage/dupeguru:latest "/init" 9 days ago Exited (0) 9 days ago jlesage-dupeguru1

sudo docker container inspect czkawka [...] "Env": [

"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "LANG=en_US.UTF-8", "S6_BEHAVIOUR_IF_STAGE2_FAILS=3", "S6_SERVICE_DEPS=1",

  •            "USER_ID=1026",                "GROUP_ID=100",*
              "APP_NAME=Czkawka",
              "APP_USER=app",
              "XDG_DATA_HOME=/config/xdg/data",
              "XDG_CONFIG_HOME=/config/xdg/config",
              "XDG_CACHE_HOME=/config/xdg/cache",
              "XDG_RUNTIME_DIR=/tmp/run/user/app",
              "DISPLAY=:0",
              "DISPLAY_WIDTH=1280",
              "DISPLAY_HEIGHT=768",
              "SUP_GROUP_IDS=0"
    

Thanks for your help.

Ps: same issue for your another good container "jlesage/dupeguru:latest" ;)

See you soon.

Le mer. 23 févr. 2022 à 14:55, Jocelyn Le Sage @.***> a écrit :

You probably need to adjust the USER_ID and GROUP_ID environment variables.

You can check ownership on the host side, i.e. on Synology itself.

If we take the example of @mdovero https://github.com/mdovero, what ls -ld /volume1/Famille is showing ?

— Reply to this email directly, view it on GitHub https://github.com/jlesage/docker-czkawka/issues/5#issuecomment-1048805614, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPPNPK2QD6P6FHBBD3GLYTU4TRLNANCNFSM5K2P7OBQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

mdovero avatar Feb 23 '22 21:02 mdovero

@mdovero What ended up working for me was

  1. Not using a share as a volume mount.
  2. Share individual folders in the share.
  3. On DSM, on each folder
    • right click
    • go to Properties
    • under the General tab
    • go to Owner on the bottom
    • Select the user from which you copied the UID and GID from
    • check the option "Apply to this folder, sub-folders and files"

Could you try this?

rubenvarela avatar Feb 23 '22 21:02 rubenvarela

Complementary informations :

From the IHM for app user :

[image: image.png]

And from a bash it's ok for root:

[image: image.png]

Le mer. 23 févr. 2022 à 14:55, Jocelyn Le Sage @.***> a écrit :

You probably need to adjust the USER_ID and GROUP_ID environment variables.

You can check ownership on the host side, i.e. on Synology itself.

If we take the example of @mdovero https://github.com/mdovero, what ls -ld /volume1/Famille is showing ?

— Reply to this email directly, view it on GitHub https://github.com/jlesage/docker-czkawka/issues/5#issuecomment-1048805614, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPPNPK2QD6P6FHBBD3GLYTU4TRLNANCNFSM5K2P7OBQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

mdovero avatar Feb 23 '22 21:02 mdovero

@mdovero screenshots are not coming through

rubenvarela avatar Feb 23 '22 22:02 rubenvarela

@mdovero yes I'm from Quebec, living near Montreal :)

Your USER_ID and GROUP_ID variables looks good. What you didn't mention is how you mapped your folders to the container. As @rubenvarela pointed, you cannot map /volume1 directory to the container. You need to map individual shares.

jlesage avatar Feb 23 '22 22:02 jlesage

Ok I found the solution with your precious help ! It was a mistake on my side.

The problem is with a USER_ID *1026... *indeed this user have read and write acces because this user is in a NAS admin group.... If i use another non privilegied user, it work !!! I see that in a Properties Panel - thanks Ruben ! Like that i can map in a /storage folder a sub directory of a share ou directly a volume folder /volume1, but if i understand correctly it's not a good idea.

I can also not specify the config directory with the -v /tmp/pipo:/config:rw param. I think it's not efficient but it work, so righ now the /storage work !!!

Le mer. 23 févr. 2022 à 23:57, Jocelyn Le Sage @.***> a écrit :

@mdovero https://github.com/mdovero yes I'm from Quebec, living near Montreal :)

Your USER_ID and GROUP_ID variables looks good. What you didn't mention is how you mapped your folders to the container. As @rubenvarela https://github.com/rubenvarela pointed, you cannot map /volume1 directory to the container. You need to map individual shares.

— Reply to this email directly, view it on GitHub https://github.com/jlesage/docker-czkawka/issues/5#issuecomment-1049295940, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPPNPLQNZZS3ZLSWNK7UCDU4VQ35ANCNFSM5K2P7OBQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

mdovero avatar Feb 24 '22 21:02 mdovero

Yeah mapping /storage to /volume1 is not a good idea. It would work at first, but/storage will eventually become empty from the point of view of the container. So you are better to do mappings like that:

/volume1/Famille -> /storage/Famille
...

Or create and edit the container via the Synology UI. This way you are sure to never do anything "illegal".

jlesage avatar Feb 24 '22 23:02 jlesage

Here is the step by step guide for Synology 1- Installed Docker pkg from package center 2- Create a shared folder called docker if its already not there. 3- In the docker folder create a folder called "czkawka" 4- Inside czkawka folder .. create another folder called "config" 5- Make sure all folder names are not in small letters (no CAPS) 6- Go to Control Panel / Task Scheduler / Create / Scheduled Task / User-defined script. 7- General: In the Task field type in “Install czkawka“. Uncheck the “Enabled” option and select your current NAS user from the drop-down menu. 8- Schedule: Select Run on the following date then select “Do not repeat“. 9- Copy paste the code below in the Run command area. After that click OK. (Update the USER_ID, GROUP_ID as per NAS User selected above in step 7 and your photo location accordingly )

docker run -d \
    --name=czkawka \
    -p 5800:5800 \
    -e USER_ID=**1026** \
    -e GROUP_ID=**101** \
    -v /volume1/docker/czkawka/config:/config:rw \
    -v **<relplace here your photos folder location>**:/storage/photos:rw \
    jlesage/czkawka

10- Select your “Install czkawka” Task then click the “Run” tab. You will be asked to run Install czkawka – click Yes. 11- If everything was setup properly you can access it by Open your browser and type in http://Synology-ip-address:5800/

Praneet-Srivastav avatar Feb 22 '23 12:02 Praneet-Srivastav

Hello The issue for me was that the GID provided by id command was wrong.

From https://community.synology.com/enu/forum/1/post/152255

I fixed it by set PGID to 101 rather than 100. 101 means admin and 100 means user.

benoittgt avatar Feb 26 '23 13:02 benoittgt

can you help me in installing czkwaka deduplication in container. I am unable to setup the mount folder even with the wizard as well as with user defined script command. I am missing something. It is asking for permission denied. 

uid=1026(SOM-ADMIN) gid=100(users) groups=100(users),101(administrators) Error is >>> docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/create?name=czkawka": dial unix /var/run/docker.sock: connect: permission denied. See 'docker run --help'.

I want to mount the home photos folder to remove similar iamges with duplicate ones.

docker run -d
--name=czkawka
-p 5800:5800
-e USER_ID=1026
-e GROUP_ID=101
-v /docker/czkawka/config:/config:rw
-v /home/gg:/storage:rw
jlesage/czkawka

somnath427 avatar Oct 12 '23 21:10 somnath427

Looks like you need to run the docker command with sudo: sudo docker run ....

jlesage avatar Oct 12 '23 23:10 jlesage