This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== PiGallery2 ====== **note:** i don't use this service anymore, so this page might be uotdated. [[http://bpatrik.github.io/pigallery2/|PiGallery2]] is a fast and efficient photo viewer for your photo collections. ===== Installing ===== Create a **pigallery2** user belonging to group **photos**: <code bash> groupadd photos useradd -d /data/daemons/pigallery2 -m -g photos pigallery2 </code> Installing on bare-metal on Gentoo is not easy because some dependencies still require Python 2 (!!!) it seems. Going containers is currently the best approach. See [[gentoo:containers|Using Containers on Gentoo]] for more details on containers in Gentoo. Grab the docker-compose file and start it, be sure to grab the one without NGINX: <code bash> su - pigallery2 wget https://github.com/bpatrik/pigallery2/raw/master/docker/docker-compose/pigallery2-only/docker-compose.yml </code> now edit it. Change the port from //80// to **3011** (of course, pick your preferred port!), and setup properly your folders. Also, add the following lines to the end of the docker-compose file: <code> networks: pigallery2-net: {} </code> to segregate Pigallery2 to it's own subnetwork. It's installation time: <code bash> podman compose pull </code> ==== NGINX reverse proxy ==== The following NGINX config: <file - photos.conf> location /photos/ { proxy_pass http://127.0.0.1:3011/; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } </file> You will be able to access your Pigallery2 on **https://mydomain.com/photos**. Add it to your NGINX config and restart it. See [[selfhost:nginx|The Reverse Proxy concept]] page for more details. ==== Starting and autostart on boot ==== Following my [[gentoo:locald|Custom User Services]] approach for containers, you will need the following configuration file: <file - /etc/conf.d/user-containers.pigallery2> USER=pigallery2 DESCRIPTION="Pigallery2 Photo Gallery" </file> and create the link: <code bash> ln -s /etc/init.d/user-containers /etc/init.d/user-containers.pigallery2 rc-update add user-containers.pigallery2 default </code> To start it now: <code bash> rc-service user-containers.pigallery2 start </code> And then want to shut it down manually: <code> rc-service user-containers.pigallery2 stop </code> Remember you need to start it once and after you can edit the configuration file **/data/daemons/pigallery2/pigallery2/config/config.json** and change the following line to look like: <code> "urlBase": "/photos/" </code> to ensure Pigallery2 works with the new subpath.