Spaces:
Paused
Paused
| import os | |
| counts = {'py':0,'ts':0,'jsx':0,'html':0} | |
| for root,dirs,files in os.walk('.'): | |
| dirs[:] = [d for d in dirs if d not in ['node_modules','.git','dist','__pycache__']] | |
| for f in files: | |
| ext = f.split('.')[-1] | |
| if ext in counts: | |
| try: | |
| with open(os.path.join(root,f),encoding='utf-8',errors='ignore') as file: | |
| counts[ext] += sum(1 for _ in file) | |
| except: pass | |
| print('Total lines:', sum(counts.values())) | |
| with open('server.py',encoding='utf-8',errors='ignore') as f: py=f.read() | |
| with open('opticparse-js/src/phish-server.ts',encoding='utf-8',errors='ignore') as f: ts=f.read() | |
| with open('dashboard/src/App.jsx',encoding='utf-8',errors='ignore') as f: jsx=f.read() | |
| checks = { | |
| 'AI Gateway removed': 'gateway.ai.cloudflare.com' not in py and 'gateway.ai.cloudflare.com' not in ts, | |
| 'Async scraping': 'vision-scrape/async' in py, | |
| 'Usage history endpoint': '/history' in py, | |
| 'Watch pooler fix': 'direct' in py.lower() or '5432' in py, | |
| 'SSRF protection': 'isSafeUrl' in ts, | |
| 'Rate limiting Python': 'limiter' in py, | |
| 'Rate limiting Node': 'rateLimit' in ts, | |
| 'Webhook HMAC': 'hmac' in py.lower(), | |
| 'CORS': 'CORSMiddleware' in py, | |
| 'Helmet': 'helmet' in ts.lower(), | |
| 'Browser hardening': 'disable-extensions' in ts, | |
| 'Browserless': 'connect_over_cdp' in py or 'BROWSERLESS' in py, | |
| 'Google OAuth': 'signInWithOAuth' in jsx, | |
| 'GitHub OAuth': 'github' in jsx.lower() and 'oauth' in jsx.lower() or 'github' in jsx.lower(), | |
| 'hCaptcha': 'captcha' in jsx.lower(), | |
| 'Forgot password': 'forgot' in jsx.lower() or 'resetPassword' in jsx, | |
| 'Full JSON PhishVision': 'confidence_score_percentage' in ts, | |
| 'Bulk scanner UI': 'Bulk' in jsx or 'bulk' in jsx.lower(), | |
| 'PDF button': 'phish-report' in jsx, | |
| 'Usage graph': 'BarChart' in jsx or 'recharts' in jsx, | |
| 'API docs tab': 'API Docs' in jsx or 'Quick Start' in jsx, | |
| 'WebLLM': 'mlc' in jsx.lower() or 'webllm' in jsx.lower() or 'local' in jsx.lower(), | |
| 'About page': os.path.exists('docs/about.html'), | |
| 'Paras Tejpal in about': 'Paras Tejpal' in open('docs/about.html',encoding='utf-8',errors='ignore').read() if os.path.exists('docs/about.html') else False, | |
| } | |
| passed = sum(1 for v in checks.values() if v) | |
| for k,v in checks.items(): | |
| print(f' {"✅" if v else "❌"} {k}') | |
| print(f'Passing: {passed}/{len(checks)}') | |
| for term in ['GPT-4o','PLACEHOLDER','gateway.ai.cloudflare','parastejpal987.workers']: | |
| found=[] | |
| for root,dirs,files in os.walk('.'): | |
| dirs[:] = [d for d in dirs if d not in ['node_modules','.git','dist','__pycache__']] | |
| for f in files: | |
| if f.endswith(('.html','.jsx','.ts','.py','.yaml')): | |
| try: | |
| with open(os.path.join(root,f),encoding='utf-8',errors='ignore') as file: | |
| if term.lower() in file.read().lower(): | |
| found.append(f) | |
| except: pass | |
| print(f' {"⚠️ " if found else "✅"} {term}: {found if found else "clean"}') | |