docs(topology): update AI stack hostnames to snnpud4lnxops01/snnpud4lnxweb01 and prune obsolete shipyardcontrol
This commit is contained in:
22
scripts/remove_shipyardcontrol_npm.py
Normal file
22
scripts/remove_shipyardcontrol_npm.py
Normal file
@@ -0,0 +1,22 @@
|
||||
import paramiko
|
||||
|
||||
client = paramiko.SSHClient()
|
||||
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
client.connect("140.44.4.71", username="root", key_filename=r"C:\Users\Snarf\.ssh\id_ed25519_snarfnet", timeout=10)
|
||||
|
||||
# Disable or delete proxy host 29 in NPM database
|
||||
cmd = 'python3 -c "import sqlite3; conn=sqlite3.connect(\'/var/lib/docker/volumes/nginx-proxy-manager_nginx-data/_data/database.sqlite\'); conn.execute(\'DELETE FROM proxy_host WHERE id=29;\'); conn.commit(); print(\'Deleted proxy_host 29\')"'
|
||||
stdin, stdout, stderr = client.exec_command(cmd)
|
||||
print("NPM DB update:", stdout.read().decode().strip(), stderr.read().decode().strip())
|
||||
|
||||
# Remove generated nginx config file if present
|
||||
cmd = 'rm -f /var/lib/docker/volumes/nginx-proxy-manager_nginx-data/_data/nginx/proxy_host/29.conf'
|
||||
stdin, stdout, stderr = client.exec_command(cmd)
|
||||
print("Removed 29.conf:", stdout.read().decode().strip(), stderr.read().decode().strip())
|
||||
|
||||
# Reload nginx across the containers
|
||||
cmd = 'docker exec $(docker ps -q -f name=nginx-proxy-manager_app) nginx -s reload'
|
||||
stdin, stdout, stderr = client.exec_command(cmd)
|
||||
print("Nginx reload:", stdout.read().decode().strip(), stderr.read().decode().strip())
|
||||
|
||||
client.close()
|
||||
36
scripts/test_storage_isolation.py
Normal file
36
scripts/test_storage_isolation.py
Normal file
@@ -0,0 +1,36 @@
|
||||
import paramiko
|
||||
import socket
|
||||
|
||||
SSH_KEY = r"C:\Users\Snarf\.ssh\id_ed25519_snarfnet"
|
||||
|
||||
def run_ssh_cmd(host, user, cmd, timeout=5):
|
||||
client = paramiko.SSHClient()
|
||||
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
try:
|
||||
client.connect(host, username=user, key_filename=SSH_KEY, timeout=timeout)
|
||||
stdin, stdout, stderr = client.exec_command(cmd, timeout=timeout)
|
||||
out = stdout.read().decode('utf-8', errors='replace')
|
||||
err = stderr.read().decode('utf-8', errors='replace')
|
||||
client.close()
|
||||
return True, out, err
|
||||
except Exception as e:
|
||||
return False, "", str(e)
|
||||
|
||||
print("=== 1. Testing Storage Drop from Smart Home (14.4.4.44 -> 14.10.10.71:5001) ===")
|
||||
ok, out, err = run_ssh_cmd("14.4.4.44", "root", "nc -z -w 3 14.10.10.71 5001; echo ExitCode=$?")
|
||||
print(f"Smart Home to NAS 1: {out.strip() or err.strip()}")
|
||||
|
||||
print("\n=== 2. Testing Storage Drop from Smart Home (14.4.4.44 -> 14.10.10.72:5001) ===")
|
||||
ok, out, err = run_ssh_cmd("14.4.4.44", "root", "nc -z -w 3 14.10.10.72 5001; echo ExitCode=$?")
|
||||
print(f"Smart Home to NAS 2: {out.strip() or err.strip()}")
|
||||
|
||||
print("\n=== 3. Testing Storage Access from LAN (Workstation 14.44.4.108 -> 14.10.10.71:5001) ===")
|
||||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
s.settimeout(3)
|
||||
try:
|
||||
s.connect(("14.10.10.71", 5001))
|
||||
print("Workstation to NAS 1: SUCCESS (Port 5001 open)")
|
||||
s.close()
|
||||
except Exception as e:
|
||||
print(f"Workstation to NAS 1: FAILED ({e})")
|
||||
|
||||
Reference in New Issue
Block a user