]> git.giorgioravera.it Git - network-manager.git/commitdiff
Added function to get domain with ssl
authorGiorgio Ravera <giorgio.ravera@gmail.com>
Tue, 17 Mar 2026 13:15:38 +0000 (14:15 +0100)
committerGiorgio Ravera <giorgio.ravera@gmail.com>
Tue, 17 Mar 2026 13:15:38 +0000 (14:15 +0100)
backend/app.py
backend/db/aliases.py
backend/db/hosts.py

index 99b4c4a8195d14919a7025719f2ad5ea99d51db0..b32c37fd479f7c204ab55e268a73498f05400bba 100644 (file)
@@ -12,6 +12,7 @@ import os
 # Import Routers
 from backend.routes.about import router as about_router
 from backend.routes.backup import router as backup_router
+from backend.routes.certificates import router as certificates_router
 from backend.routes.health import router as health_router
 from backend.routes.login import router as login_router
 from backend.routes.hosts import router as hosts_router
@@ -200,6 +201,7 @@ def create_app() -> FastAPI:
     # Routers
     app.include_router(about_router)
     app.include_router(backup_router)
+    app.include_router(certificates_router)
     app.include_router(health_router)
     app.include_router(login_router)
     app.include_router(hosts_router)
index 65cc0b75b609a9b1e403893dee57914965c36260..967ae67b90c8d3b70e9ce83c563b328e9b682b69 100644 (file)
@@ -60,6 +60,15 @@ def get_aliases() -> List[Dict[str, Any]]:
     rows = [dict(r) for r in cur.fetchall()]
     return rows
 
+# -----------------------------
+# SELECT ALL ALIASES with SSL Certificate
+# -----------------------------
+def get_aliases_certificates() -> List[Dict[str, Any]]:
+    conn = get_db()
+    cur = conn.execute("SELECT name FROM aliases WHERE ssl_enabled = 1")
+    rows = [dict(r) for r in cur.fetchall()]
+    return rows
+
 # -----------------------------
 # SELECT SINGLE ALIAS
 # -----------------------------
index 7fd71a424986998a4587892de1c071e249bee2d4..952f1920a1086a368525875a68c94f01b2064edd 100644 (file)
@@ -93,6 +93,15 @@ def get_hosts() -> List[Dict[str, Any]]:
     rows.sort(key=ipv4_sort_key)
     return rows
 
+# -----------------------------
+# SELECT ALL HOSTS with SSL Certificate
+# -----------------------------
+def get_hosts_certificates() -> List[Dict[str, Any]]:
+    conn = get_db()
+    cur = conn.execute("SELECT name FROM hosts WHERE ssl_enabled = 1")
+    rows = [dict(r) for r in cur.fetchall()]
+    return rows
+
 # -----------------------------
 # SELECT SINGLE HOST
 # -----------------------------