52 lines
1.6 KiB
Python
Executable File
52 lines
1.6 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
import json, subprocess, time, glob
|
|
|
|
print("=" * 60)
|
|
print(f"FULL REGISTRY TEST — {time.strftime('%H:%M')}")
|
|
print("=" * 60)
|
|
|
|
PASS = FAIL = 0
|
|
FAILS = []
|
|
|
|
def check(url):
|
|
global PASS, FAIL
|
|
try:
|
|
r = subprocess.run(['curl','-so','/dev/null','-w','%{http_code}',url,'--max-time','3'], capture_output=True, text=True, timeout=5)
|
|
code = r.stdout.strip()
|
|
if code in ('200','302'):
|
|
PASS += 1
|
|
else:
|
|
FAIL += 1
|
|
FAILS.append(f"{code} {url}")
|
|
except:
|
|
FAIL += 1
|
|
FAILS.append(f"TMO {url}")
|
|
|
|
# All HTML pages
|
|
pages = glob.glob('/var/www/html/*.html') + glob.glob('/var/www/html/products/*.html') + glob.glob('/var/www/html/test-report/*.html')
|
|
print(f"Pages: {len(pages)}")
|
|
for p in pages:
|
|
rel = p.replace('/var/www/html/','')
|
|
check(f"https://weval-consulting.com/{rel}")
|
|
|
|
# Subdomains
|
|
subs = ['paperclip','deerflow','analytics','mm','n8n','auth','crm','monitor','mirofish','wevads']
|
|
print(f"Subdomains: {len(subs)}")
|
|
for s in subs:
|
|
check(f"https://{s}.weval-consulting.com/")
|
|
|
|
# Special paths
|
|
specials = ['/claw-code/','/wevads-ia/','/wevia-ia/droid.html','/arsenal-proxy/menu.html']
|
|
for sp in specials:
|
|
check(f"https://weval-consulting.com{sp}")
|
|
|
|
TOTAL = PASS + FAIL
|
|
print(f"\nRESULT: {PASS}/{TOTAL} PASS ({PASS*100//TOTAL}%)")
|
|
if FAILS:
|
|
print(f"FAILS ({len(FAILS)}):")
|
|
for f in FAILS[:10]:
|
|
print(f" {f}")
|
|
|
|
with open('/var/www/html/api/registry-test.json','w') as fj:
|
|
json.dump({'pass':PASS,'fail':FAIL,'total':TOTAL,'rate':PASS*100//TOTAL,'date':time.strftime('%Y-%m-%dT%H:%M:%S'),'fails':FAILS[:20]},fj)
|