I’m adding a new reply as the prior, with multiple edits, was getting long. My updated compose is relocating the previews directory on the local VM of Ubuntu hard drive, and all preview folders/files are being owned by my adam user, but I’m still seeing all of the thumbnails not rendering on the page. I’m wondering if there are possibly other files/services that may be owned by root on the NFS share within the .photostructure folder that are causing this, or if there are other things to check.
I’m going to separately move a subset of my photos to the local VM disk and run a fresh instance again just to verify that works normally as expected. If it doesn’t, well at least we can cross NFS/permissions off the list.
Edit 1: Moving the entire library folder structure to the VM local disk, and setting one specific subfolder of the NAS library as a bind mount, did not work - still some broken thumbnails out of my 170 test photos. Next up I’ll set the ‘copy’ option to yes instead of no. Here are the volumes and variables for these test iterations.
Edit 2: Testing the same as above with everything local, but now having the /myphotos path be copied in instead of not copied. Same behavior.
Edit 3: Testing the same as above, but removing the /myphotos mount and manually copying in those 170 files to /ps/library is the same result. I’ve got to conclude at this point it isn’t a permissions issue but something going on with docker, my OS, compose, etc.
@mrm Okay! Major breakthrough here. I was looking at one page of thumbnails that wasn’t loading and I kept hitting refresh. Suddenly, I’d see new thumbnails work and others fail to load. Then I decided to check the browser console: tons of 429 errors - rate limit.
On a hunch, I went to the IP address of Photostructure instead of my reverse proxy. Everything loads without issue. As it turns out, all of the thumbnails, however they are loading, are triggering the rate limit middleware of Traefik (my reverse proxy) whose configuration is as such:
I don’t think I’ve experienced this type of issue before with lots of content loading on a page. I’m wondering if it is how the thumbnails are embedded and called that’s causing the rate limit issue, and if those calls could theoretically be changed to not all be separate GET calls?
You can actually configure both: the originals directory, library directory, and previews directory are all configurable. Check the system and library settings.
Switching to an http/2 server engine would conceivably help, by I’ve not looked into that.
Good job finding the issue!
Update: http/2 support for Express has been waiting for 2.5 years, and http/2 support in fastify (which would require a non-trivial code migration) is experimental. .
I’m trying to understand how I could keep rate limiting enabled but also use Traefik. Is that something I’d want to use PS_TRUST_PROXY for?
Also, if I use PS_ORIGINALS_DIR, can I somehow leverage that and copy assets to library, but not copy my existing iCloud photo downloader library? (Trying to avoid duplicating this as it is 450GB)
IE: I have my library config/db/etc. in the docker folder on SSD, but I want the originals on the NAS. My iCloud downloaded photos are already on the NAS. If I set the originals to live at /mnt/storage/media/photos and my iCloud repo is at /mnt/storage/media/photos/icloud, will they be copied or left in place? I wasn’t sure how that functionality worked since files in the library aren’t moved, but technically now my library is on the SSD, and only the originals are on the NAS, if that makes sense.
My iCloud downloaded photos are in a subfolder within $MEDIADIR/photos.
Edit: I’ve also simply disabled rate limiting on this one container by using a different combination of Traefik middlewares. I’m putting it behind Authelia SSO so likely no problems here.