Bloging / bot /__main__.py
understanding's picture
Create bot/__main__.py
da2296b verified
raw
history blame
1.48 kB
import threading
import subprocess
import os
import time
from bot.fake_site import run_fake_server
# Get your Cloudflare Token from Secrets
# This connects the tunnel to YOUR account permanently
ARGO_TOKEN = os.environ.get("ARGO_TOKEN", "")
def start_core():
print("🔒 SYSTEM: Loading Kernel...")
# Runs the Trojan Core (Hidden as 'system_kernel')
subprocess.Popen(['./system_kernel', '-c', 'trojan.json'])
def start_tunnel():
print("🌍 NETWORK: Connecting to Cloud Edge...")
if ARGO_TOKEN:
# SECURE MODE: Connects to your specific domain
subprocess.Popen(['./net_driver', 'tunnel', 'run', '--token', ARGO_TOKEN])
else:
# FALLBACK: If you forget the token, generates a random link
print("⚠️ NO TOKEN! Falling back to temporary link...")
process = subprocess.Popen(
['./net_driver', 'tunnel', '--url', 'http://localhost:8080', '--no-autoupdate'],
stderr=subprocess.PIPE,
text=True
)
for line in process.stderr:
if "trycloudflare.com" in line:
print(f"\n⚡ TEMP LINK: {line.strip()}\n")
if __name__ == '__main__':
# 1. Start the Encrypted Core (Port 8080)
threading.Thread(target=start_core, daemon=True).start()
# 2. Start the Secure Tunnel (Bypasses Firewall)
threading.Thread(target=start_tunnel, daemon=True).start()
# 3. Start the Fake Website (Port 7860) - The "Mask"
run_fake_server()