#!/usr/bin/env python3 import json import subprocess # Читаем текущий конфиг result = subprocess.run(['sudo', 'cat', '/usr/local/x-ui/bin/config.json'], capture_output=True, text=True) config = json.loads(result.stdout) # Добавляем SOCKS inbound socks_inbound = { "listen": "127.0.0.1", "port": 10808, "protocol": "socks", "settings": { "auth": "noauth", "accounts": [], "udp": True, "ip": "127.0.0.1" }, "streamSettings": { "network": "tcp" }, "tag": "socks-inbound" } config['inbounds'].append(socks_inbound) # Сохраняем временный файл with open('/tmp/new_config.json', 'w') as f: json.dump(config, f, indent=2) print("✅ Новый конфиг создан в /tmp/new_config.json") print(f" Всего inbound: {len(config['inbounds'])}")