almeira-web/scripts/check_status.py

29 lines
1.2 KiB
Python

import paramiko
import urllib.request
import json
import ssl
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect('161.97.93.156', username='carlos', password='Innova1978+*?', timeout=20)
stdin, stdout, stderr = client.exec_command('docker ps --filter name=bfmnoga3 --format "{{.ID}} {{.Names}} {{.Status}}"')
print("Docker container:", stdout.read().decode('utf-8').strip())
stdin, stdout, stderr = client.exec_command('docker exec dripzone-production ls -lh /app/public/DripZone.apk 2>/dev/null || docker exec $(docker ps -q --filter name=bfmnoga3 | head -n1) ls -lh /app/public/DripZone.apk 2>/dev/null')
print("APK in container:", stdout.read().decode('utf-8').strip())
client.close()
# Test live APK URL
try:
req = urllib.request.Request("https://drip-zone.online/DripZone.apk", method="HEAD")
with urllib.request.urlopen(req, context=ctx, timeout=10) as r:
print(f"Live URL https://drip-zone.online/DripZone.apk -> HTTP {r.status}, length: {r.headers.get('Content-Length')}")
except Exception as e:
print("Live URL check error:", e)