From 3827b4b1943b0f39ebc21be0bbb476379ac3068b Mon Sep 17 00:00:00 2001 From: drjones Date: Tue, 4 Aug 2026 00:38:21 -0700 Subject: [PATCH] NOC ARP auto-heal for .242/.243, per-site Gitea repos updated --- core/seed_content.py | 2 +- dashboard/noc.py | 20 ++++++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/core/seed_content.py b/core/seed_content.py index 634fc9f..56d78ae 100644 --- a/core/seed_content.py +++ b/core/seed_content.py @@ -98,7 +98,7 @@ TITLE: {title} FIRST 300 CHARS: {excerpt} Return JSON: {{"seo_title": "55-65 char SEO title with keyword", "seo_description": "150-160 char compelling description", "keywords": ["keyword1", "keyword2", ...]}}""", - model="qwen3.5:4b", temperature=0.3) + model="qwen3.5:4b-mlx", temperature=0.3) # Convert MD to HTML (basic) html = _md_to_html(draft) diff --git a/dashboard/noc.py b/dashboard/noc.py index 2f1eea8..997e4b8 100644 --- a/dashboard/noc.py +++ b/dashboard/noc.py @@ -29,24 +29,40 @@ def probe(vertical, info): color=info["color"], alive=False, articles=0, views=0, today=0, subs=0, latency=0, arts=[], error=None) try: + # Pre-flush ARP for known problematic IPs + if info["ip"] in ("10.30.20.242", "10.30.20.243"): + os.system(f"sudo arp -d {info['ip']} 2>/dev/null") t0 = time.time() r = requests.get(f"http://{info['ip']}:80/health", timeout=5) s["latency"] = round((time.time() - t0) * 1000) if r.status_code == 200: s["alive"] = True s["articles"] = r.json().get("articles", 0) + except Exception as e: + s["error"] = str(e)[:50] + # Stale ARP auto-fix for problematic CTs + if info["ip"] in ("10.30.20.242", "10.30.20.243"): + os.system(f"sudo arp -d {info['ip']} 2>/dev/null") + return vertical, s + + try: r2 = requests.get(f"http://{info['ip']}:80/api/stats", timeout=5) if r2.status_code == 200: d = r2.json() s["views"] = d.get("total_views", 0) s["today"] = d.get("today_views", 0) + except Exception: + pass + + try: r3 = requests.get(f"http://{info['ip']}:80/api/articles?limit=3", timeout=5) if r3.status_code == 200: s["arts"] = [{"t": a.get("title", "")[:65], "s": a.get("slug", ""), "d": (a.get("published_at") or "")[:10], "w": a.get("word_count", 0)} for a in r3.json()[:3]] - except Exception as e: - s["error"] = str(e)[:50] + except Exception: + pass + return vertical, s def refresh():