www/caddy: Fix wildcard certificate extraction for widget (#4385)

* www/caddy: Fix wildcard certificate extraction for widget

Co-authored-by: Franco Fichtner <franco@lastsummer.de>

---------

Co-authored-by: Franco Fichtner <franco@lastsummer.de>
This commit is contained in:
Monviech
2024-12-05 08:11:11 +01:00
committed by GitHub
co-authored by Franco Fichtner
parent d1a5ee6daa
commit 6d79d32ea8
2 changed files with 3 additions and 0 deletions
+1
View File
@@ -1,5 +1,6 @@
PLUGIN_NAME= caddy
PLUGIN_VERSION= 1.7.5
PLUGIN_REVISION= 1
PLUGIN_DEPENDS= caddy-custom
PLUGIN_COMMENT= Modern Reverse Proxy with Automatic HTTPS, Dynamic DNS and Layer4 Routing
PLUGIN_MAINTAINER= cedrik@pischem.com
@@ -101,6 +101,8 @@ async def extract_certificate_info(cert_path):
# Extract the hostname from the filename
hostname = os.path.basename(cert_path).replace('.crt', '').lower()
if hostname.startswith("wildcard_"):
hostname = hostname.replace("wildcard_", "*", 1)
return {'hostname': hostname, 'expiration_date': expiration_date_str, 'remaining_days': remaining_days}
except asyncio.TimeoutError as e: