Announcement

#1 2019-10-28 05:45:52

MrMetaSpx
Member
2019-10-28
2

Piwigo in Docker wth NGINX, does not add symlink pictures in Galleries

Hi there.

I've installed and used https://github.com/linuxserver/docker-piwigo . Which is the linuxserver dockerized version of Piwigo. The docker compose and script installs the latest version of Piwigo. I have also set up mariadb in a separate container which communicates fine with Piwigo when it's running.

The problem I have is that when I place files in the mounted drive for the container that Piwigo looks at for Galleries, it'll only work if it's a hard link and does not work with soft link symlink files to an image.

Adding symlinks on the host to the mounted folder won't get picked up by Piwigo. Linuxserver allows the config folder where the Galleries are to be chmod to the user and group of the logged in user. My host OS is using Ubuntu 18.04 LTS. I'm running Docker version 19.03.4.

Piwigo 2.10.1.

With linuxserver.io, I'm allowed to set the PUID and PGID for the non-root user to be the same for my account on my host box. The folders all are owned by the same PUID and PGID. In the container shell, I checked that uesr abc in the container is set to the same PUID and PGID that owns the permissions on the host drive folder.  On the host OS, I checked that the target file name had valid characters. I also confirmed that the target for the symlink is also the same user and group. Thought maybe it was NGINX not set to follow symlinks, but that appears to be on by default. I still added it explicitly to the NGINX conf in that docker file, but it still didn't work. So I'm lost on why this is.


When I place real files into that host drive that is mounted into the docker container, it get's picked up by Piwigo (running in a container), but when I put a symlink in that folder, the Piwigo container shell can see the file in the location, but Piwigo does not see it or pick it up as a picture.

Any help?

Offline

 

#2 2019-10-28 12:17:08

teekay
Member
2013-06-12
427

Re: Piwigo in Docker wth NGINX, does not add symlink pictures in Galleries

Where exactly is the symlink? From one folder on the host into another folder on the host, and the latter is mounted into the container? This, of course, does not work, because the symlink points to a non-existent folder inside the container.

Code:

# on the host:
➜  ~ mkdir aaa
➜  ~ mkdir bbb
➜  ~ ln -s /Users/tkuther/bbb aaa
➜  ~ ls -l aaa 
total 0
lrwxr-xr-x  1 tkuther  staff  18 28 Okt 12:03 bbb -> /Users/tkuther/bbb

# now let's check inside the container
➜  ~ docker run -ti --rm -v /Users/tkuther/aaa:/aaa alpine:latest ls -l /aaa  
total 0
lrwxr-xr-x    1 root     root            18 Oct 28 11:03 bbb -> /Users/tkuther/bbb
➜  ~ docker run -ti --rm -v /Users/tkuther/aaa:/aaa alpine:latest ls -l /Users/tkuther
ls: /Users/tkuther: No such file or directory

A hard link on the other hand is regarded as a regular file at given location, just sharing the same inodes on the filesystem.

Last edited by teekay (2019-10-28 12:18:06)

Offline

 

#3 2019-10-29 02:44:21

MrMetaSpx
Member
2019-10-28
2

Re: Piwigo in Docker wth NGINX, does not add symlink pictures in Galleries

Thank you, teekay. Really appreciate you typing up that response and sharing that code snip to allow me to process it. It makes perfect sense. The container can't resolve the soft-link if it's a pointer to a file inaccessible to the container.

I was going to experiment with hard links to get by it, but realized that the files are in two separate partitions. So I mounted the volume I needed to in the Piwigo container so that the soft link could dereference correctly. Everything worked as I would have hoped now!

Thank you again!

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2021 · Contact