feat: add automation and inspection scripts for Nginx Proxy Manager and Authentik integration
This commit is contained in:
28
scripts/inspect_host21.py
Normal file
28
scripts/inspect_host21.py
Normal file
@@ -0,0 +1,28 @@
|
||||
import paramiko
|
||||
|
||||
c = paramiko.SSHClient()
|
||||
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
c.connect("140.44.4.71", username="root", key_filename=r'C:\Users\Snarf\.ssh\id_ed25519_snarfnet', timeout=10)
|
||||
|
||||
py_script = """import sqlite3
|
||||
|
||||
conn = sqlite3.connect('/var/lib/docker/volumes/nginx-proxy-manager_nginx-data/_data/database.sqlite')
|
||||
cur = conn.cursor()
|
||||
cur.execute('SELECT id, domain_names, forward_host, forward_port, advanced_config FROM proxy_host WHERE id = 21')
|
||||
r = cur.fetchone()
|
||||
print('Host 21:', r[1], '->', r[2], r[3])
|
||||
print('Advanced config length:', len(r[4]) if r[4] else 0)
|
||||
if r[4]:
|
||||
print(r[4])
|
||||
conn.close()
|
||||
"""
|
||||
|
||||
stdin, stdout, stderr = c.exec_command("cat > /tmp/check_h21.py")
|
||||
stdin.write(py_script)
|
||||
stdin.close()
|
||||
stdout.read()
|
||||
|
||||
stdin, stdout, stderr = c.exec_command("python3 /tmp/check_h21.py")
|
||||
print(stdout.read().decode())
|
||||
print(stderr.read().decode())
|
||||
c.close()
|
||||
Reference in New Issue
Block a user