I have iCloud Photos and pay for it, but I want to make sure I have a local backup too so I use NextCloud to sync to my NAS (which is running a NextCloud instance). You could also use the Plex app, or there's things like Resilio Sync that can auto-upload photos.
I'm not aware of an open source solution for auto-upload other than NextCloud (and possibly OwnCloud, but I don't use it), but I wouldn't be surprised if there was one somewhere or an app that did auto-backup to SMB/CIFS/WevDAV/whatever
“Lock down” is hyperbole. You can mount Apple filesystems (including the one storing your photo library) from a Linux workstation or server over the network.
I admit that if you’re looking for an open API for photo management, iCloud is not for you. But it works for most people.
I share my Apple Photo albums with android users without issue. I hope this was helpful despite your snark. I’m just trying to help.
Because Drive integration for Photos allowed me to do exactly that. Last I checked iCloud will lock down all my photos onto a platform that's not even accessible on Linux.