EugenMayer / docker-image-rsyncd

A rsyncd image used with docker-sync
3 stars 4 forks source link

Rsynced files owner is nobody #7

Open spras opened 7 years ago

spras commented 7 years ago

docker-sync.yml

syncs:
  sfhmd-sync: #tip: add -sync and you keep consistent names als a convention
    src: './server'
    dest: '/var/www/html'
    sync_strategy: 'rsync'
    sync_host_ip: 'localhost'
    sync_host_port: 10872
    sync_args: '--delete' # delete files on the container if they are deleted on the host
    sync_user: 'www-data'
    sync_group: 'www-data'
    sync_userid: '1000'
    sync_groupid: '1000'
    watch_args: '-v' # make fswatch verbose

In the sync container, the user www-data is well created with userid=1000

The chown on /var/www/html is well done to.

The rsync file is well generated:


/var/www/html #  cat /etc/rsyncd.conf
pid file = /var/run/rsyncd.pid
uid = www-data
gid = www-data
use chroot = no
log file = /dev/stdout
reverse lookup = no
munge symlinks = no
[volume]
    hosts deny = *
    hosts allow = 192.168.0.0/16 172.16.0.0/12
    read only = false
    path = /var/www/html
    comment = docker volume

But the rsynced files belongs to nobody user ...

/var/www/html # ls -la
total 256
drwxr-xr-x    8 www-data www-data      4096 Nov 25 14:48 .
drwxr-xr-x    3 root     root          4096 Dec  8 10:02 ..
-rw-r--r--    1 nobody   nogroup         10 Nov 25 14:48 .gitignore
drwxr-xr-x    4 nobody   nogroup       4096 Nov 25 12:37 app
drwxr-xr-x    2 nobody   nogroup       4096 Nov 25 14:21 bin
-rw-r--r--    1 nobody   nogroup       3508 Nov 25 12:37 composer.json
-rw-r--r--    1 nobody   nogroup     209949 Nov 25 14:21 composer.lock
drwxr-xr-x    2 nobody   nogroup       4096 Nov 25 12:37 src
drwxr-xr-x   47 nobody   nogroup       4096 Nov 25 14:21 vendor
drwxr-xr-x    5 nobody   nogroup       4096 Dec  7 17:32 web
EugenMayer commented 7 years ago

referencing https://github.com/EugenMayer/docker-sync/issues/177

EugenMayer commented 7 years ago

Fix by using this logic https://github.com/mickaelperrin/docker-unison-unox/blob/develop/entrypoint.sh#L18

andrewnester commented 7 years ago

any updates on this?

EugenMayer commented 7 years ago

No, do you have any? :)

skovmand commented 7 years ago

Thanks for your great work. I would really wish there was an easy solution to this problem too.

EugenMayer commented 7 years ago

Its not complicated, as i linked the commit - we basically just need to migrate the unison script to rsync, replace the service starts and thats it. But well there is always a lot work to do, so thats why i am not always to fight on all the fronts - sorry!

skovmand commented 7 years ago

Thanks for your reply. I understand your situation completely. (And hope you have time for the fix at some point :-)

Thanks for your work!

On 18 Jan 2017, 16.46 +0100, Eugen Mayer notifications@github.com, wrote:

Its not complicated, as i linked the commit - we basically just need to migrate the unison script to rsync, replace the service starts and thats it. But well there is always a lot work to do, so thats why i am not always to fight on all the fronts - sorry! — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

skovmand commented 7 years ago

Until then, I'll have to do some docker exec -it docker_php-fpm_1 bash and chown -R www-data ...