The current implementation auto generated an order for the handlers.
Populated "HandlePath" (e.g., /opnsense/docs/*) would be rendered in the order they appeared in the config.xml
Empty "HandlePath" would be rendered last
This has a lot of drawbacks, because everything is implicit and when a domain has multiple handlers that would need to be in a certain order to match, it was painful to clone/delete them and rearrange them with tricks in the GUI.
This PR here solves that issue once and for all by introducing a sequence number and a migration.
The migration will migrate all:
Populated "HandlePath" to a sequence of 1+, so 1,2,3,4,5...
All empty "HandlePath" to a sequence of 99999-, so 99999,99998,99997...
There is a failsafe if somebody would happens to have more than 100k handles (lol I want to see that), which would leave the sequence empty. An empty sequence will default to 0 in the Caddyfile template, rendering these first come first serve style.
This migration will make the old implicit default behavior explicit.
The PR also includes:
Style fix in PHP file
Fix too strict validation that can trigger on first installation of os-caddy, leaving config.xml section at v0.0.0.
The current implementation auto generated an order for the handlers.
This has a lot of drawbacks, because everything is implicit and when a domain has multiple handlers that would need to be in a certain order to match, it was painful to clone/delete them and rearrange them with tricks in the GUI.
This PR here solves that issue once and for all by introducing a sequence number and a migration.
The migration will migrate all:
The PR also includes: