Today I had a had ache, I was trying to upload my photos into photoprism which had been set up. However it failed to load on clearnet with error code 522 on Cloudflare.

My first diagnostic approach, “have you tried to turn it on and off again?” unfortunately this does not help… sight.
Now I need to recall how the whole thing is setup and start the full diagnostic processes… Yikes at this point my worst fear is photoprism failed with partial/all photos gone.

It was a quick relief when I connect to VPN and check that the services is still running on 2342

Of course, the culprit is likely the reverse proxy? or so I though, but the reverse proxy also seem to be working well. That left me with 1 thing left, Cloudflare DDNS.

And right I was, I had never set up proper DDNS auto update for the photoprism subdomain. Whoop.. Hence as a reminder for myself for any future undertaking, I wrote this article to undertake the setup.
DDClient setup
There are multiple solution for DDNS entry automation. However for sake of simplicity, I prefer to use DDClient. In this setup I would be using DDNS directly under the VM. For each setup I would prefer to have each VM to hold their own DDNS rather than having a centralised solution. This give more flexibility me higher flexibility and better availability.
Since I am running on debian, the installation is rather simple and can be done via apt package manager
sudo apt-get install ddclient -y
moving forward is simply trough the setup guide or just directly edit on the config file afterward. Below is the sample config file located at /etc/ddclient.conf
protocol=cloudflare
[email protected]
password='API_Key'
zone=hezaika.moe
photos.hezaika.moe
And we are almost done. Just verify that the setup is working sing
ddclient -daemon=0 -debug -verbose -noquiet -force -file /etc/ddclient.conf
If all is well, proceed to add the comment within crontab to be run on hourly basis or your preference