Coming from the perspective of plugins, the widgets could be pluggable like this. What's left to solve is the translations, so this is like a proof of concept and has to be adjusted.
Screenshot (some domain details have been omitted with text editing):
What this adds:
A small widget called "CaddyDomain.js"
that uses only existing API endpoints of Caddy to show a list of domains+port and their enabled status.
The list in the widget is sorted by enabled status. Links are embedded to quickly get to the Caddy configuration pages.
When Caddy is disabled, a warning will be shown with a link to the page where Caddy can be enabled.
A more complicated widget "CaddyCertificate.js" using a /new/ API endpoint that has not existed before.
The new API endpoint uses openssl to read all certificates of Caddy from the filesystem. It uses "asyncio" for performance and a fast script execution time, even with many certificates
The new "ttl_cache" is used in the actions to cache the result of the script to prevent repeated executions.
The API endpoint is consumed by the CaddyCertificate widget, showing the validity status, hostname and localized datetime when it will expire in a neat list.
Everything is async and fast.
Since this is a WIP and POC it still needs some cleanup that will be done over time.
This PR is for discussion with @swhite2
Coming from the perspective of plugins, the widgets could be pluggable like this. What's left to solve is the translations, so this is like a proof of concept and has to be adjusted.
Screenshot (some domain details have been omitted with text editing):
What this adds:
Since this is a WIP and POC it still needs some cleanup that will be done over time.