User Tools

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
services:photomanagement [2024/03/22 07:52] willyservices:photomanagement [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1
Line 1: Line 1:
-====== Photos Management Server ====== 
- 
-Photos (and videos!) are something very important in our everyday's life. They collect our memories and can bring back the emotions that we all experiences just by reviewing the pictures and videos taken back in time.  
- 
-Photography has greatly changed over the years. For example i have thousands of photos in the last 20+ years with many different cameras and technologies: film SLRs, DSLRs, phones, disppsable cameras... Also the digital management tools have changed greatly. I even have 40+ years old family photos that i have scanned and stored. 
- 
-Today the good old paper albums are just collecting dust in the bookshelves, and tomorrow those will be a faded memory of the past. Today photos are shared over instant messaging apps and given for free to big corps like Google and Apple. 
- 
-The challenge is to make the family album fun again, keep it private and make it last our grandchildren (maybe). 
- 
-====== The concepts ====== 
- 
-the goal is to have the family photos neatly organized, sorted and easily accessible by family members, even (specially) the non tech-savvy ones.  
- 
-There are three steps to the process: 
-  * Collecting pictures and videos from the devices (cameras, phones, scans...) 
-  * Organizing them into albums and collections, adding tags if/when possible 
-  * Display them all for easy fruition, possibly with Machine Learning for face detection and such 
- 
-===== Long term support & availability ===== 
- 
-Tehcnology changes, fast. Applications are created new and dies out. The [[https://en.wikipedia.org/wiki/Bus_factor|bus factor]] is vividly true also for Open Source projects. I have stored photos from 40 years ago, and literally thousands of pictures from 20+ years ago. To be usable they **must** be organized, tagged and properly labelled. Such tagging and organization **must** survive each single app or tool you choose.  
- 
-Using a database is **not** acceptable, since as much as logical it might be organized, you cannot extract and parse the tags&metadata easily after the app that uses it get discontinued, or you die (yes, i am in that time of life where legacy start to be a tought). As an example, i have an extensive database of public photos i did some years ago. The tool itself does not work anymore, but i still retain the photos, whose names have been mangled for "storage reasons" by the tool, and the entire SQL dump of the database. I //could// digets the db and create all the needed queries to sort out again the photos in albums and associate the tags, but i never did it because it is so much pain. Lesson learnt. 
- 
-The only viable option (CHANGE MY MIND) is having the photos organized in folders, where each folder is an album, and the folders themselves named in a clear, obvious, album title way. The tags and metadata should be either embedded in the photo files or stored in sidecar files along the photos themselves. 
- 
-This is non-negotiable for me. If i didn't follow this rule since i started digitalizing my photos, today i would have nothing still readable and organized. and what about in 10 more years? 
- 
-===== Tools & software ===== 
- 
-Let's be clear: there no tool that let you do that all-in-one, and i have tested almost all of them. 
- 
-First of all, i discarded all **local** tools, as i want this done on the server and not on my local laptop. Ideally, every family member should be able to to it's part without //my// intervention. 
-(back in the past i used the great [[https://www.digikam.org/|Digikam]] which still rocks, but it's local-only). 
- 
-On the **web** tools the landscape is a little bit better than for the [[services:notes|Note Taking]] category, but not that much. There are quite a few tools indeed, but each one has it's pros and cons, and none fits the bill perfectly.  
- 
-I have tried (for each one, details in the associated page): 
-  * [[services:immich|Immich]] is the most promising, but doesn't support folder-albums (without a complex and not intuitive usage pattern with templates), and overall i don't like that it cannot write back the ML generated data to the photos or sidecar files. 
-  * [[services:damselfly|Damselfly]] is a Digital Asset Management tool. Very impressive for a single developer, but a bit not user-friendly and limited in what it can do 
-  * [[services:homegallery|HomeGallery]] is fantastic gallery with an innovative and intuitive browsing approach. Unfortunately does not support folder-albums. 
-  * [[services:librephotos|LibrePhotos]] is nice, but extremely slow in indexing and honestly, it seems a bit abandoned. 
-  * [[services:photofield|Photofield]] has some impressive view tricks, but it's way too simple. 
-  * [[services:pigallery2|PiGallery2]] is a great gallery, supports tags and such, but it's not able (by design) to manage/move photos 
-  * [[services:piwigo|Piwigo]] in theory is powerful and can do it all, but in relaity feels old, dated and ugly. It's been around 20+ years, and in this case this is a downpoint. 
- 
-There are many more, which i didn't try because they where either **dead**, **dying** or non really open-source (as i stated many times, i try to steer from projects that are open-source only to generate a revenue). 
- 
-====== The Architecture & Workflow ====== 
- 
-All the photos will be stored on the server RAID array (remember: this is **not** a backup, don't forget to [[selfhost:backup|Backup]] your photos!) on a three levels subfolder main structure located under **/data/Photos**: 
-  * /data/Photos/Staging: here your new photos will be uploaded 
-  * /data/Photods/Gallery: photos here will be visible in the gallery 
-  * /data/Photos/Public: symlinked public visible photos (not mandatory!) 
- 
-These folder shall be netowork-shared inside your home network in case you want to manage your photos via a local tool like Digikam, plus they need to be accessible via Filebrowser so that they can be managed via web too. 
- 
-From a web point of view, you need a few sub-paths. I will assume all this will be accesible via **https://mydomain.com/photos**. So you need: 
-  * https://mydomain.com/photos: main entry point, with links/dashboard to point to the other paths 
-  * https://mydomain.com/photos/organize: where your Filebrowser will be accessible to manage your photos 
-  * https://mydomain.com/photos/gallery: your family accessible photo gallery 
-  * https://photos.mydomain.com: you public facing photo gallery (optional) 
- 
-Here you can see a practical reason of **why** supporting sub-paths and not **only** sub-domains is important for web tools. Imagine having four different subdomains (and requiring separate login for each one every time...). 
- 
-The **Staging** folder will need to have one fubfolder for each user, to keep uploaded photos not overlapping. The **Gallery** folder can be organized in any way you want ot organize your photo collection, and like so the **Public** one. 
- 
-The workflow will be: 
-  * Take photos and upload them to the server (automatically, when possible) 
-  * Organize the photos on the server, via a web interface, into albums/folders 
-  * Have the folder published to a gallery app that ease browsing, tagging and such. 
- 
- 
-=== Step 0: preparing users and folders === 
- 
-For simple but secure management, you will need a dedicated user called **photos**, member of the **photos** group. For added accessiblity, you could want to add all or some of your users to the same group, so that you can mount the photo storage on your computers and use local tools like digikam too: 
-<code bash> 
-groupadd photos 
-useradd -d /data/daemons/photos -m -g photos photos 
-</code> 
- 
-Now you need to create the storage folders: 
-<code bash> 
-mkdir /data/Photos 
-chown photos:photos /data/Photos 
-su - photos 
-echo "umask 0002" >> ~/.bashrc 
-source  ~/.bashrc 
-mkdir /data/Photos/Staging 
-mkdir /data/Photos/Gallery 
-mkdir /data/Photos/Public 
-</code> 
-(the umask setting is to ensure photos are accessible by other photos users, YMMV) 
- 
-Now make all that accessible via NFS by adding to your **/etc/exports**: 
-<code> 
-/data/Photos 10.0.0.0/24(rw,async,no_subtree_check) 
-</code> 
-and run: 
-<code bash> 
-exportfs -a 
-</code> 
- 
-Now make all that accessible via SAMBA (for windows machines) by adding to your **/etc/samba/smb.conf**: 
-<code> 
-[Photos] 
-   comment = Family Photos 
-   path = /data/Photos 
-   valid users = <your users that can access it> 
-   public = yes 
-   guest ok = yes 
-   writable = yes 
-   printable = no 
-</code> 
-and restart the samba service. 
- 
-You might want to locally share only the **Gallery** sub-folder or separate the Gallery and the Staging sunfolders exports with different access criterias. 
- 
-=== Step 1: loading photos into staging area === 
- 
-At first i tried to use //Immich// for this job. The storage templates are somehow mandatory to this end, and it even work just fine for you. But i ended up with a more practical and effective approach since i am already using [[gentoo:syncthing|SyncThing]] on all our phones. Feel free to use either system, or even another one.  
- 
-The advantage of Syncthing is that you can use it not only on mobile phones/tablets but also on laptops and different devices. 
- 
-In order to do so, you need to spin a second copy of Syncthing on a different port just for the photo users, since your main Syncthing copy is running with a different user. There are other ways to do this, but i think they are less secure. 
- 
-The [[gentoo:syncthing|SyncThing]] page will tell you how to run Syncthing in general, but here is a quick summary of what you need to do: 
-  * Copy **/etc/conf.d/syncthing** to **/etc/conf.d/syncthing.photos** 
-  * Symlink **/etc/init.d/syncthing** to **/etc/init.d/syncthing.photos** 
-  * Edit **/etc/conf.d/syncthing.photos** (see below) 
-  * Run //once// "syncthing" as user //photos// to initialize configuration files, then stop it 
-  * Start the service as usual 
- 
-The configuration file should look something like: 
-<file - syncthing.photos> 
-SYNCTHING_USER="photos" 
-SYNCTHING_GROUP="photos" 
-SYNCTHING_HOMEDIR="/data/daemons/photos/.config/syncthing" 
-SYNCTHING_LOGFILE="/data/daemons/photos/syncthing.log" 
-SYNCTHING_GUI_ADDRESS="http://127.0.0.1:8385" 
-</file> 
-(note the //8385// port that must be different from the default //8384// not to clash with the main syncthing installation) 
- 
-To add&start the service: 
-<code bash 
-rc-update add syncthing.photos default 
-/etc/init.d/syncthing.photos start 
-</code> 
- 
-As usual, install Syncthing on your phone too and link them together (see Syncthing documentation) and add one synced folder from your /DCIM/Camera in Android to something like /data/Photos/Staging/Myself-sync. Remeber you want to separate each user in the staging area to avoid mess. 
- 
-If you want to use Immich instead (or in addition to), check [[services:immich|this]] page on how to install it, just make Immich upload photos inside your **/data/Photos/Staging/<username>**. 
- 
- 
-=== Step 2: organizing the staging area into albums/folders === 
- 
-It is not a good idea to directly upload to the gallery because out mobile devices usually take lots of crap photos that you do not want to store. That's why i use a staging folder.  After the photos have been uploaded to the staging area, you will need to access it, sort the photos and move to the Gallery area. You don't need to do it often. I mostly do that after an event or an occasion where i take photos and want to organize them to place in the family photo memories. 
- 
-You can always do so by mounting the photo folders on a local PC and use some photo manangement tools (like Digikam), but the highlight here is that you can as well do that over the web, even while on vacation or from your phone/tablet. 
- 
-To do so, i use Filebrowser, a neat web-browser that you can install following [[services:filebrowser|this]] page. What you need to do now is to run a dedicated copy of it as the user **photos**. Create the following script as **/data/daemons/photos/photobrowser.sh**: 
-<file - photobrowser.sh> 
-#!/bin/bash 
-FILEBROWSER="/data/daemons/filebrowser/bin/filebrowser" 
-APP_PATH="/data/daemons/photos" 
-DATA_PATH="/data/Photos" 
-BASE_URL="/photos/organize" 
-PORT=3006 
-"${FILEBROWSER}" config set --auth.method=noauth -d "${APP_PATH}/filebrowser.db" 2>&1 >> "${APP_PATH}/filebrowser.log" 
-"${FILEBROWSER}" -r "${DATA_PATH}" -p ${PORT} -b "${BASE_URL}" -d "${APP_PATH}/filebrowser.db" -l "${APP_PATH}/filebrowser.log" 2>&1 >> "${APP_PATH}/filebrowser.log" 
-</file> 
-check your port, it needs to be unique of course. 
- 
-As usual, make it start at boot with **/etc/local.d/41-photobrowser.start**: 
-<file - 41-photobworser.start> 
-#!/bin/bash 
-start-stop-daemon -b -m -p /var/run/photobrowser/photobrowser.pid -n photobrowser -u photos /data/daemons/photos/photobrowser.sh 
-</file> 
- 
-Make both executable! 
- 
-You will wrap it up in the reverse proxy later on. 
- 
-=== Step 3: moving albums/folders to the gallery === 
- 
-When photos are organized into albums, the folders will be moved (by a fmaily member, optionally that can be automated TBD) to the **gallery area**. At this point the gallery tool will pick up the new albums, index them and show them on the web gallery app.  
-Good galley tools to this scope are [[services:pigallery2|PiGallery2]], that uspports albums, and [[services:homegallery|HomeGallery]] which doesn't, but has excellent tag management. Both tools could be used at the same time 
- 
-=== Step 4: backup === 
- 
-Backing up your photos is a **must**. Nothing so far is a //backup//, so check [[selfhost:backup|Backup]] and setup the backup of your **gallery** area. You sohuld probably not backup the **staging** area as it might change too frequently. YMMV, decide for yourself. 
- 
-====== Let's put it all together ====== 
- 
- 
-reverse proxy per gallery, browser e syncthing 
- 
  

This website uses technical cookies only. No information is shared with anybody or used in any way but provide the website in your browser.

More information