domovoy_bot/add_socks_to_xray.py
Admin e06a3825ba 🧪 Комплексное тестирование + отчёты
 Проведено полное тестирование функционала:
- Меню жильца (11 кнопок)
- Меню админа (17 кнопок)
- База данных (проверка записей)
- Уникальность callback_data
- Сообщения в личку (без спама)

📝 Созданные файлы:
- tests/run_tests.py — автотесты
- tests/TEST_REPORT.md — отчёт о тестировании
- tests/COMPREHENSIVE_TEST_PLAN.md — план тестов
- send_test_report.py — отправка отчёта

📊 Результаты:
- Все кнопки работают
- Участковский работает через БД (2 записи)
- Сообщения только в личку
- Веб-админка работает со всеми разделами

🎯 ВСЁ РАБОТАЕТ!

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-01 20:00:56 +00:00

33 lines
878 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/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'])}")