Spaces:
Paused
Paused
| import http.server, json, os | |
| class H(http.server.BaseHTTPRequestHandler): | |
| def do_GET(self): | |
| html = b"""<!DOCTYPE html> | |
| <html><head><meta charset=utf-8><title>YT Claw</title> | |
| <style>body{font-family:monospace;background:#111;color:#0f0;padding:40px;text-align:center} | |
| a{color:#0ff;font-size:1.2em}h1{color:#0f0}</style></head><body> | |
| <h1>YT Claw - OpenClaw is LIVE</h1> | |
| <p>Model: DeepSeek R1 Distill Qwen 14B (IQ3_XS)</p> | |
| <p>128K context | CoT reasoning | Text mode</p> | |
| """ | |
| try: | |
| config = json.load(open('/root/.openclaw/openclaw.json')) | |
| token = config.get('gateway', {}).get('auth', {}).get('token', '') | |
| if token: | |
| html += '<p><a href="/__openclaw__/canvas/">Open Canvas</a></p>'.encode() | |
| else: | |
| html += b'<p><a href="/__openclaw__/canvas/?token=arshit2025">Open Canvas</a></p>' | |
| except: | |
| html += b'<p><a href="/__openclaw__/canvas/?token=arshit2025">Open Canvas</a></p>' | |
| html += b"</body></html>" | |
| self.send_response(200) | |
| self.send_header('Content-Type', 'text/html; charset=utf-8') | |
| self.end_headers() | |
| self.wfile.write(html) | |
| def do_POST(self): | |
| self.send_response(200) | |
| self.end_headers() | |
| self.wfile.write(b'OK') | |
| def log_message(self, *a): pass | |
| http.server.HTTPServer(('0.0.0.0', 8080), H).serve_forever() | |