You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
get_ports_from_caddy_config crashes on empty or unexpected Caddy admin config #225
get_ports_from_caddy_config crashes when the Caddy admin API returns a fresh or empty configuration (null or {}). The function assumes a fully populated HTTP config and directly indexes nested keys, leading to runtime errors.
To Reproduce
Start Caddy with no routes loaded (fresh instance).
Ensure GET /config/ returns null or {}.
Run: python3 -m autodeploy.autodeploy config.json
The script crashes while parsing the Caddy config.
Expected behaviour
If no active Caddy HTTP routes exist, the function should return an empty dictionary so the deployment logic can fall back to the default behaviour (use today’s date).
Additional context
Issues in the current implementation:
Does not handle null or empty JSON responses from the Caddy admin API.
Activity
m-appel commentedon Feb 2, 2026
Although this code is not actively used currently, you can fix this if you want.