From 06c203485f823ca3e96cfd6d193fdd4e3c910fa0 Mon Sep 17 00:00:00 2001 From: Snarf Date: Fri, 6 Nov 2026 09:06:17 -0500 Subject: [PATCH] feat: add scripts to apply pihole manifests and update authentik launch URLs --- scripts/apply_pihole_redirect.py | 26 ++++++++++++++++++++++++++ scripts/update_pihole_launch_urls.py | 1 + 2 files changed, 27 insertions(+) create mode 100644 scripts/apply_pihole_redirect.py diff --git a/scripts/apply_pihole_redirect.py b/scripts/apply_pihole_redirect.py new file mode 100644 index 0000000..4512e56 --- /dev/null +++ b/scripts/apply_pihole_redirect.py @@ -0,0 +1,26 @@ +import paramiko + +def apply_manifest(host, cluster_name, file_path): + print(f"Applying {file_path} to {cluster_name} ({host})...") + with open(file_path, 'r') as f: + manifest_content = f.read() + + ssh = paramiko.SSHClient() + ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) + ssh.connect(host, username='root', key_filename=r'C:\Users\Snarf\.ssh\id_ed25519_snarfnet', timeout=10) + + stdin, stdout, stderr = ssh.exec_command('k3s kubectl apply -f -') + stdin.write(manifest_content) + stdin.channel.shutdown_write() + + out = stdout.read().decode('utf-8') + err = stderr.read().decode('utf-8') + print("Output:") + print(out) + if err: + print("Stderr:", err) + ssh.close() + +apply_manifest('140.44.4.11', 'Aerodrome', r'homelab-gitops-repo/manifests/aerodrome/dns/dns-stack.yaml') +apply_manifest('140.44.4.41', 'Spaceport', r'homelab-gitops-repo/manifests/spaceport/dns/dns-stack.yaml') + diff --git a/scripts/update_pihole_launch_urls.py b/scripts/update_pihole_launch_urls.py index 9b01d26..348dc94 100644 --- a/scripts/update_pihole_launch_urls.py +++ b/scripts/update_pihole_launch_urls.py @@ -51,3 +51,4 @@ for a in sorted(final_apps.get('results', []), key=lambda x: x['name']): if a['slug'] in ['pihole1', 'pihole2', 'dns1', 'dns2']: print(f" [{a['group']}] {a['name']}") print(f" Slug: {a['slug']} | Launch URL: {a['meta_launch_url']}") +