From: Giorgio Ravera Date: Mon, 26 Jan 2026 20:44:58 +0000 (+0100) Subject: Fixed after CI check X-Git-Tag: v0.0.1~4 X-Git-Url: http://git.giorgioravera.it/?a=commitdiff_plain;h=acdbea7b88e5617828f2c0719cab89e6f1bb4fa0;p=network-manager.git Fixed after CI check --- diff --git a/Dockerfile b/Dockerfile index 2cbe9ff..c46c04c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -45,7 +45,7 @@ COPY --from=builder /app/entrypoint.py entrypoint.py COPY --from=builder /app/log log COPY --from=builder /app/settings settings -# Ensure Python sees the installed packages +# Ensure Python sees the installed packages ENV PYTHONPATH="/usr/local/lib/python3.12/site-packages" ENTRYPOINT ["/app/entrypoint.py"] diff --git a/README.md b/README.md index 87cdba2..ac1c5be 100644 --- a/README.md +++ b/README.md @@ -217,7 +217,7 @@ docker compose up --build -d --force-recreate - Use a reverse proxy with TLS - Do not put passwords in the repository ---- +--- ## 📄 License [MIT](http://opensource.org/licenses/MIT) – see the local [LICENSE](LICENSE) file © Giorgio Ravera diff --git a/backend/routes/about.py b/backend/routes/about.py index 096a7c3..4a154aa 100644 --- a/backend/routes/about.py +++ b/backend/routes/about.py @@ -15,11 +15,11 @@ router = APIRouter() def about(): return { "app": { - "version": settings.APP_VERSION + "version": settings.APP_VERSION, }, "baseimg": { - "name": settings.BASEIMG_NAME, - "version": settings.BASEIMG_VERSION + "name": settings.BASEIMG_NAME, + "version": settings.BASEIMG_VERSION, }, "domain": settings.DOMAIN, "admin_hash_loaded": settings.ADMIN_PASSWORD_HASH is not None, diff --git a/backend/routes/login.py b/backend/routes/login.py index 2b7a224..e752165 100644 --- a/backend/routes/login.py +++ b/backend/routes/login.py @@ -13,7 +13,7 @@ from settings.settings import settings # Create Router router = APIRouter() -# IP -> lista timestamp tentativi +# IP -> lista timestamp tentativi login_attempts = {} def check_rate_limit(ip: str): @@ -59,7 +59,7 @@ def api_login(request: Request, data: dict, response: Response): pwd = data.get("password") if verify_login(user, pwd): - # reset tentativi su IP + # reset tentativi su IP login_attempts.pop(ip, None) apply_session(response, username=user) diff --git a/backend/security.py b/backend/security.py index f0792d5..5974114 100644 --- a/backend/security.py +++ b/backend/security.py @@ -82,7 +82,7 @@ def is_logged_in(request: Request) -> bool: # ----------------------------- def close_session(response): logger = get_logger(__name__) - + response.delete_cookie( key="session", path="/" diff --git a/frontend/hosts.html b/frontend/hosts.html index ca8ff9a..88b7fce 100644 --- a/frontend/hosts.html +++ b/frontend/hosts.html @@ -79,11 +79,11 @@ data-bs-toggle="modal" data-bs-target="#addHostModal"> Add Host - - diff --git a/frontend/js/hosts.js b/frontend/js/hosts.js index 193a040..df9096f 100644 --- a/frontend/js/hosts.js +++ b/frontend/js/hosts.js @@ -130,7 +130,7 @@ async function loadHosts() { data-host-id="${id}"> - { document.addEventListener("keydown", (e) => { // Ignore if focus is in a typing field const tag = (e.target.tagName || "").toLowerCase(); - const isTypingField = + const isTypingField = tag === "input" || tag === "textarea" || tag === "select" || e.target.isContentEditable; if (e.key === "Escape" && !isTypingField) { @@ -733,8 +733,8 @@ document.addEventListener("DOMContentLoaded", async () => { // check Add or Edit mode const idAttr = lastTriggerEl?.getAttribute?.('data-host-id'); const id = idAttr ? Number(idAttr) : null; - - if (Number.isFinite(id)) { + + if (Number.isFinite(id)) { // Edit Mode console.log("Modal in EDIT mode for host ID:", id); try { @@ -789,7 +789,7 @@ document.addEventListener("DOMContentLoaded", async () => { document.addEventListener('click', async (e) => { const el = e.target.closest('[data-action]'); if (!el) return; - + const action = el.dataset.action; const handler = actionHandlers[action]; if (!handler) return; @@ -808,12 +808,12 @@ document.addEventListener("DOMContentLoaded", async () => { const isEnter = e.key === 'Enter'; const isSpace = e.key === ' ' || e.key === 'Spacebar'; if (!isEnter && !isSpace) return; - + const el = e.target.closest('[data-action]'); if (!el) return; // Trigger click event - el.click(); + el.click(); }); } });