29 lines
1.1 KiB
Python
29 lines
1.1 KiB
Python
import paramiko
|
|
|
|
HOST = "161.97.93.156"
|
|
USER = "carlos"
|
|
PASSWORD = "Innova1978+*?"
|
|
|
|
ssh = paramiko.SSHClient()
|
|
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
|
ssh.connect(HOST, username=USER, password=PASSWORD, timeout=10)
|
|
|
|
# Check labels of coolify container
|
|
stdin, stdout, stderr = ssh.exec_command("docker ps --filter 'name=bfmnoga3' --format '{{.Names}}'")
|
|
coolify_c_name = stdout.read().decode('utf-8').strip()
|
|
print("Coolify container name:", coolify_c_name)
|
|
|
|
if coolify_c_name:
|
|
stdin, stdout, stderr = ssh.exec_command(f"docker inspect {coolify_c_name} --format '{{{{json .Config.Labels}}}}'")
|
|
print("Coolify labels:", stdout.read().decode('utf-8'))
|
|
|
|
# Check dripzone-production labels
|
|
stdin, stdout, stderr = ssh.exec_command("docker inspect dripzone-production --format '{{json .Config.Labels}}'")
|
|
print("\ndripzone-production labels:", stdout.read().decode('utf-8'))
|
|
|
|
# Test curl locally on the VPS
|
|
stdin, stdout, stderr = ssh.exec_command("curl -I -k -H 'Host: drip-zone.online' https://127.0.0.1:443")
|
|
print("\nCurl drip-zone.online via localhost:443:\n", stdout.read().decode('utf-8'))
|
|
|
|
ssh.close()
|