import json, os, subprocess from datetime import datetime NAS_WEB_ROOT = "/volume1/web/legal/gis" HTML_FILE = "/app/web_index.html" def run(): # Получаем список папок на NAS через SSH cmd = ["ssh", "matrixhasyou@192.168.10.105", f"ls -F {NAS_WEB_ROOT}/raw/"] result = subprocess.run(cmd, capture_output=True, text=True) folders = [f.strip('/') for f in result.stdout.split('\n') if f.strip() and f.endswith('/')] html = f""" Жатва ГИС ЖКХ: LIVE

🚀 ВЕЛИКАЯ ЖАТВА ГИС ЖКХ

Скриншоты-улики и вложения в реальном времени

""" for f in folders: html += f""" """ html += """
""" with open(HTML_FILE, 'w', encoding='utf-8') as f: f.write(html) # Пушим на Synology with open(HTML_FILE, 'rb') as f: subprocess.run(["ssh", "matrixhasyou@192.168.10.105", f"cat > {NAS_WEB_ROOT}/index.html"], stdin=f) print("✅ Сайт /harvest/ успешно обновлен с 10 новыми папками!") if __name__ == '__main__': run()