jlesage / docker-czkawka

Docker container for Czkawka
MIT License
134 stars 10 forks source link

Guide for Synology #5

Open Wgsem opened 2 years ago

Wgsem commented 2 years ago

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.

jlesage commented 2 years ago

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.

rubenvarela commented 2 years ago

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?

mdovero commented 2 years ago

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

jlesage commented 2 years ago

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 ?

mdovero commented 2 years ago

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",

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: @.***>

rubenvarela commented 2 years ago

@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?

mdovero commented 2 years ago

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: @.***>

rubenvarela commented 2 years ago

@mdovero screenshots are not coming through

jlesage commented 2 years ago

@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.

mdovero commented 2 years ago

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: @.***>

jlesage commented 2 years ago

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".

Praneet-Srivastav commented 1 year ago

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/

benoittgt commented 1 year ago

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.

somnath427 commented 11 months ago
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

jlesage commented 11 months ago

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

Pinki0529 commented 3 months ago

Docker Compose for Portainer

version: '3.9'
services:
    czkawka:
        image: jlesage/czkawka
        volumes:
            - "/volume1/photo:/storage/photos"
            - "/volume1/docker/czkawka:/config:rw"
        ports:
            - 5800:5800
        container_name: czkawka
        environment:
            LANG: pl_PL # or fr_FR or en_US
            USER_ID: 1026
            GROUP_ID: 101
            TZ: Europ/Warsaw
            DARK_MODE: 1
        restart: on-failure:5

Make sure to adjust according to your needs.

vixius commented 2 months ago

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/

Hi there,

I'm trying to make it work following your step but no way. Installed docker in registry (container manager) following your step

docker run -d \ --name=czkawka \ -p 5800:5800 \ -e USER_ID=1026 \ -e GROUP_ID=101 \ -v /volume1/docker/czkawka/config:/config:rw \ -v </volume1/homes/Vix/Photos>:/storage/photos:rw \ jlesage/czkawka

no idea where I make a mistake.

Could you help me

jlesage commented 2 months ago

Make sure to use /volume1/homes/Vix/Photos, not </volume1/homes/Vix/Photos> (invalid path).

somnath427 commented 2 months ago

Hi All,

I have shared the solution in this video.As it is already so many days even I don't remember.

https://youtu.be/wBpk5EF26ew?si=aWzbFIrks4ucu7eT

Thanks and Regards,

Somanath Behera

On Tue, 25 Jun 2024 at 7:18 AM, Jocelyn Le Sage @.***> wrote:

Make sure to use /volume1/homes/Vix/Photos, not </volume1/homes/Vix/Photos> (invalid path).

— Reply to this email directly, view it on GitHub https://github.com/jlesage/docker-czkawka/issues/5#issuecomment-2187772101, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE2O3LMKOTT6PKMOCI2OUFDZJDD6RAVCNFSM5K2P7OB2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMJYG43TOMRRGAYQ . You are receiving this because you commented.Message ID: @.***>

Pinki0529 commented 2 months ago

https://github.com/jlesage/docker-czkawka/issues/5#issuecomment-2184095912

Pinki0529 commented 2 months ago

https://mariushosting.com/synology-find-uid-userid-and-gid-groupid-in-5-seconds/