- simplex-deadmans-bot: Dead Man's Switch Haskell bot - simplexxx-directory: private SimpleXXX directory bot (fork of simplex-directory-service) - simplex-support-bot: support triage bot with configurable AI backend - --ai-url and --ai-model flags for any OpenAI-compatible provider - works with Grok, Ollama, OpenAI, LM Studio, etc. - AI_API_KEY env var (GROK_API_KEY still accepted as alias) - web: SimpleXXX directory frontend (Groups/Channels tabs, matches simplex.chat/directory style) - manager/: placeholder for Python profile manager (coming soon) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
30 lines
976 B
Python
30 lines
976 B
Python
#!/usr/bin/env python3
|
|
from http.server import BaseHTTPRequestHandler, HTTPServer
|
|
from datetime import datetime
|
|
|
|
PORT = 8080
|
|
|
|
class Handler(BaseHTTPRequestHandler):
|
|
def do_POST(self):
|
|
if self.path == "/deadmanswitch":
|
|
length = int(self.headers.get("Content-Length", 0))
|
|
body = self.rfile.read(length) if length else b""
|
|
print(f"[{datetime.now()}] TRIGGERED — body: {body!r}")
|
|
self.send_response(200)
|
|
self.end_headers()
|
|
self.wfile.write(b"OK")
|
|
else:
|
|
self.send_response(404)
|
|
self.end_headers()
|
|
|
|
def log_message(self, fmt, *args):
|
|
pass # silence default access log; we print our own above
|
|
|
|
if __name__ == "__main__":
|
|
server = HTTPServer(("", PORT), Handler)
|
|
print(f"Mock dead man's switch listening on http://localhost:{PORT}/deadmanswitch")
|
|
try:
|
|
server.serve_forever()
|
|
except KeyboardInterrupt:
|
|
print("\nStopped.")
|