CoolFace
Datasetpublic

SafeVixAI/SafeVixAI-Dataset-Hub

SafeVixAI Dataset Hub πŸ›‘οΈ The Intelligence Layer for the SafeVixAI platform β€” IIT Madras Road Safety Hackathon 2026 This repository hosts all datasets, pre-trained models, notebooks, and reproducible data acquisition scripts that power the SafeVixAI application. It is designed to be cloned directly into Google Colab or any research environment. Main Application Repo: SafeVixAI/SafeVixAI ⚑ Quickstart (Google Colab) # Clone the entire intelligence layer !git… See the full description on the dataset page: https://huggingface.co/datasets/SafeVixAI/SafeVixAI-Dataset-Hub.

sourceHugging Faceapache-2.0updated 4mo agoView on Hugging Face
1likes147downloads
audit_env.py129 linesDownload Raw Back to data
1"""Full audit of all .env files vs what the configs actually expect."""2import re3from pathlib import Path4 5ROOT = Path(".")6 7# ── 1. Read all actual .env files ────────────────────────────────────────────8print("=" * 70)9print("  ALL ENV FILES β€” CURRENT STATE")10print("=" * 70)11env_files = {}12for f in sorted(ROOT.rglob(".env*")):13    if any(x in f.parts for x in [".git", "node_modules", ".venv", "__pycache__"]):14        continue15    if f.suffix in (".example", ".local", ".bak"):16        continue17    lines = f.read_text(encoding="utf-8", errors="ignore").splitlines()18    keys = {}19    for line in lines:20        line = line.strip()21        if line and not line.startswith("#") and "=" in line:22            k, _, v = line.partition("=")23            keys[k.strip()] = v.strip()24    env_files[str(f)] = keys25    print(f"\n[{f}]")26    for k, v in keys.items():27        masked = v[:6] + "..." if len(v) > 10 and any(c in k.upper() for c in ["KEY", "TOKEN", "SECRET", "PASSWORD"]) else v28        status = "OK" if v and not v.startswith("YOUR_") else "MISSING/PLACEHOLDER"29        print(f"  [{status:^19}]  {k} = {masked}")30 31# ── 2. What does chatbot_service/config.py expect? ────────────────────────────32print("\n" + "=" * 70)33print("  CHATBOT CONFIG β€” EXPECTED KEYS")34print("=" * 70)35cs_config = Path("chatbot_service/config.py").read_text(encoding="utf-8")36 37# Extract field names and env aliases from pydantic Settings38field_pattern = re.compile(r'(\w+)\s*:\s*[\w\|\[\]]+[^\n]*=\s*Field\(')39alias_pattern = re.compile(r'validation_alias\s*=\s*["\']([A-Z_]+)["\']')40 41chatbot_keys = set(re.findall(r'["\']([A-Z_][A-Z0-9_]+)["\']', cs_config))42chatbot_keys.update(re.findall(r'os\.(?:environ|getenv)\(["\']([A-Z_]+)', cs_config))43 44chatbot_env = env_files.get("chatbot_service\\.env", env_files.get("chatbot_service/.env", {}))45if not chatbot_env:46    for k in env_files:47        if "chatbot_service" in k and ".example" not in k:48            chatbot_env = env_files[k]49            break50 51missing_chatbot = []52for key in sorted(chatbot_keys):53    if len(key) < 4:54        continue55    in_env = key in chatbot_env56    val = chatbot_env.get(key, "")57    is_placeholder = val.startswith("YOUR_") or not val58    if not in_env or is_placeholder:59        missing_chatbot.append((key, "MISSING" if not in_env else "PLACEHOLDER"))60 61if missing_chatbot:62    for k, status in missing_chatbot:63        print(f"  [!] {k}: {status}")64else:65    print("  All expected keys present.")66 67# ── 3. What does backend/core/config.py expect? ────────────────────────────────68print("\n" + "=" * 70)69print("  BACKEND CONFIG β€” EXPECTED KEYS")70print("=" * 70)71be_config = Path("backend/core/config.py").read_text(encoding="utf-8")72backend_keys = set(re.findall(r'["\']([A-Z_][A-Z0-9_]+)["\']', be_config))73backend_keys.update(re.findall(r'os\.(?:environ|getenv)\(["\']([A-Z_]+)', be_config))74 75backend_env = {}76for k in env_files:77    if "backend" in k and "chatbot" not in k and ".example" not in k:78        backend_env = env_files[k]79        break80 81missing_backend = []82for key in sorted(backend_keys):83    if len(key) < 4:84        continue85    in_env = key in backend_env86    val = backend_env.get(key, "")87    is_placeholder = val.startswith("YOUR_") or not val88    if not in_env or is_placeholder:89        missing_backend.append((key, "MISSING" if not in_env else "PLACEHOLDER"))90 91if missing_backend:92    for k, status in missing_backend:93        print(f"  [!] {k}: {status}")94else:95    print("  All expected keys present.")96 97# ── 4. Frontend env check ────────────────────────────────────────────────────98print("\n" + "=" * 70)99print("  FRONTEND .env β€” EXPECTED KEYS")100print("=" * 70)101# Scan all .ts/.tsx files for process.env or NEXT_PUBLIC_ usage102fe_keys = set()103for f in Path("frontend").rglob("*.ts"):104    if "node_modules" in f.parts:105        continue106    txt = f.read_text(encoding="utf-8", errors="ignore")107    fe_keys.update(re.findall(r'process\.env\.([A-Z_][A-Z0-9_]+)', txt))108    fe_keys.update(re.findall(r'process\.env\[["\']([A-Z_][A-Z0-9_]+)', txt))109 110fe_env = {}111for k in env_files:112    if "frontend" in k and ".example" not in k:113        fe_env = env_files[k]114        break115 116if fe_keys:117    for key in sorted(fe_keys):118        val = fe_env.get(key, "")119        status = "OK" if val and not val.startswith("YOUR_") else "MISSING"120        print(f"  [{status}]  {key} = {val or '(not set)'}")121else:122    print("  No process.env usage found in frontend TypeScript files.")123 124print("\n" + "=" * 70)125print("  SUMMARY")126print("=" * 70)127print(f"  Chatbot missing/placeholder: {len(missing_chatbot)} keys")128print(f"  Backend missing/placeholder: {len(missing_backend)} keys")129