This commit is contained in:
ari committed 2026-07-17 23:28:34 -04:00
1 parent 6d63780b42
commit f9e7905dfa
7 files changed
+3 -584

No files matched your search

@@ -111,6 +111,6 @@ ingress:
prefix: immich
service: immich-server
port: 2283
middleware: ingress-immich-chain
annotations:
traefik.ingress.kubernetes.io/service.serverstransport: ingress-immich-transport@kubernetescrd
middleware: ingress-https-redirect
# annotations:
# traefik.ingress.kubernetes.io/service.serverstransport: ingress-immich-transport@kubernetescrd
-147
View File
@@ -1,147 +0,0 @@
networks:
lab:
- mac: "3C:7C:3F:1E:B7:A0"
name: "tnas1"
domain: "tnas1.lab.local"
- mac: "00:A0:98:3D:7C:C8"
name: "kubedb"
- mac: "B8:27:EB:F7:44:4E"
name: "pi1"
- mac: "9C:BF:0D:00:56:51"
name: "fws1"
- mac: "74:56:3C:CA:E2:ED"
name: "bigbox1"
domain: compute.internal
- mac: "68:1D:EF:26:B7:6C"
name: "minipc1"
- mac: "7C:83:34:B8:7B:43"
name: "minipc2"
- mac: "6C:BF:B5:01:E9:86"
name: terra1
- mac: "6C:BF:B5:01:E9:87"
name: terra1
- mac: "58:47:CA:71:D8:E6"
name: "minipc3"
- mac: "9C:BF:0D:00:FA:22"
name: "fwdesk"
- mac: "A8:42:A1:5E:21:2C"
name: "bigbox2"
hub:
- mac: "2C:CF:67:FB:C8:1F"
name: "castle"
# domain: castle.home.sosnovsky.ca
- mac: "DC:A6:32:92:B2:79"
name: "basement"
# domain: basement.home.sosnovsky.ca
- mac: "4E:F6:9C:7C:56:33"
name: "flic"
- name: "voice-m5stack-office"
mac: "E8:6B:EA:23:F9:14"
cam:
- name: "korie"
mac: "9C:8E:CD:25:83:1F"
- name: "eddie"
mac: "A0:60:32:03:86:8A"
- name: "doorbell"
mac: "48:9E:9D:4A:32:80"
- name: "livingroom"
mac: "34:60:F9:D7:51:3F"
- name: "living"
mac: "EC:71:DB:0C:5A:6E"
- name: "driveway"
mac: "EC:71:DB:2E:6F:F5"
iot:
- name: "korie-lamp"
mac: "60:74:F4:4D:B8:C5"
- name: "office-strip"
mac: "DC:4F:22:24:0C:E4"
- name: "ecobee"
mac: "44:61:32:FC:10:EC"
- name: "apollo-kitchen"
mac: "30:30:F9:DC:A8:18"
- name: "apollo-office"
mac: "30:30:F9:DA:C7:A4"
- name: "apollo-laundry"
mac: "30:30:F9:DC:BE:7C"
- name: "epl-living-room"
mac: "64:B7:08:28:52:50"
- name: "expired-epl"
mac: "64:B7:08:28:56:F4"
- name: "shelly-basement-living"
mac: "B8:D6:1A:8A:5F:F4"
- name: "shelly-basement-shared"
mac: "B8:D6:1A:8C:4C:DC"
- name: "shelly-laundry-light"
mac: "C8:2B:96:1D:DA:B4"
- name: "shelly-bathroom"
mac: "B0:B2:1C:10:DC:48"
apl:
- name: "hp-print"
mac: "48:9E:BD:CB:07:E3"
- name: "gm-eddie"
mac: "20:DF:B9:71:55:9C"
justMac: true
- name: "myq-garage"
mac: "CC:6A:10:8B:7D:D3"
- name: "pod-korie"
mac: "04:99:B9:86:2D:AE"
justMac: true
- name: "pod-livingroom"
mac: "04:99:B9:88:ED:3B"
justMac: true
- name: "appletv-livingroom"
mac: "48:E1:5C:5B:CB:A3"
- name: "samsuntv-livingroom"
mac: "F0:70:4F:54:F3:F0"
- name: "leviot-humid1"
mac: "3C:E9:0E:62:14:D8"
justMac: true
- name: "leviot-humid2"
mac: "1C:9D:C2:39:61:F8"
justMac: true
- name: "amzn-bedroom"
mac: "D8:BE:65:F2:ED:18"
justMac: true
- name: "lgtv-bedroom"
mac: "A8:A2:37:27:3F:8A"
justMac: true
- name: "pablo"
mac: "B0:4A:39:F7:E5:8E"
justMac: true
- name: "pod-eddie"
mac: "40:ED:CF:9D:C1:01"
justMac: true
- name: "brother-printer"
mac: "00:1B:A9:B9:37:B7"
justMac: true
- name: "ipad-eddie"
mac: "F0:DB:F8:4C:96:B9"
justMac: true
router:
- name: "gl-basement"
mac: "94:83:C4:31:D5:CE"
- name: "velica-main"
mac: "94:83:C4:41:77:BA"
- name: "velica-node1"
mac: "94:83:C4:41:77:29"
- name: "velica-node2"
mac: "94:83:C4:41:77:B0"
- name: "extender"
id: 100
mac: "5C:E9:31:00:65:61"
devices:
- name: "fwlaptop"
mac: "14:AC:60:29:85:4D"
- name: "sumomac"
mac: "F8:E4:3B:36:0F:E4"
- name: "steamdeck"
mac: "34:6F:24:CA:70:57"
- name: "vitapc"
mac: "E0:0A:F6:79:C6:E9"
- name: "vitaphone"
mac: "E0:92:5C:20:F7:21"
- name: "levaphone"
mac: "EC:28:D3:53:30:59"
- name: "koriephone"
mac: "D8:DC:40:DC:D4:A0"
-91
View File
@@ -1,91 +0,0 @@
#!/usr/bin/env python
import shutil
from pathlib import Path
import yaml
BASE_PATH = Path(__file__).parent
CONFIG_FILE = BASE_PATH / "config.yaml"
OUTPUT_FOLDER = BASE_PATH / "output"
DNSMASQ_CONF = OUTPUT_FOLDER / "etc/dnsmasq.conf"
ETHERS = OUTPUT_FOLDER / "etc/ethers"
SUMMARY = OUTPUT_FOLDER / "summary.yaml"
WHITELIST = OUTPUT_FOLDER / "white.list"
shutil.rmtree(OUTPUT_FOLDER)
DNSMASQ_CONF.parent.mkdir(exist_ok=True, parents=True)
ETHERS.parent.mkdir(exist_ok=True, parents=True)
root_domain = "internal"
ip_prefix_map = {
"lab": "10.0.10.",
"k3s": "10.0.11.",
"hub": "10.0.12.",
"cam": "10.0.13.",
"iot": "10.0.14.",
"apl": "10.0.15.",
"router": "10.0.16.",
"devices": "10.0.0.",
}
defaults = {
'devices': {
'justMac': True,
}
}
def cap1_and_join(*args: str) -> str:
out = ""
for a in args:
out += a[0].upper()
out += a[1:].lower()
return out
with CONFIG_FILE.open('r') as fp:
settings = yaml.safe_load(fp)
mac_addrs = set()
with DNSMASQ_CONF.open('w') as dfp, SUMMARY.open('w') as sfp, ETHERS.open('w') as efp:
for sub_domain, configs in settings['networks'].items():
default_values = defaults.get(sub_domain, {})
ip_prefix = ip_prefix_map[sub_domain]
sfp.write(f'\n{cap1_and_join(sub_domain)}:')
efp.write(f'#{cap1_and_join(sub_domain)}\n')
ip_suffix = 0
seen_nets = set()
for dvc in configs:
if dvc.get('id'):
ip_suffix = dvc.get('id')
else:
ip_suffix += 1
for _ in range(254):
if ip_suffix in seen_nets:
ip_suffix += 1
else:
break
seen_nets.add(ip_suffix)
dvc = {**default_values, **dvc}
mac = dvc['mac']
name = dvc['name']
mac_addrs.add(mac)
sfp.write(f'\n {cap1_and_join(name)}:')
ip = f"{ip_prefix}{ip_suffix}"
host = f"{name}.{sub_domain}.{root_domain}"
if not dvc.get('justMac', False):
sfp.write(f'\n ip: "{ip}"')
sfp.write(f'\n host: "{host}"')
if not dvc.get('justMac', False):
efp.write(f'{mac} {ip}\n')
if domains := dvc.get('domain'):
for domain in domains.split(','):
dfp.write(f"address=/{domain}/{ip}\n")
dfp.write(f"address=/.{domain}/{ip}\n")
sfp.write(f'\n domain: "{domains}"')
efp.write(f'{mac} {host}\n')
for config in settings['general_mappings']:
ip = config['ip']
for domain in config['domains']:
dfp.write(f"address=/{domain}/{ip}\n")
dfp.write(f"address=/.{domain}/{ip}\n")
WHITELIST.write_text('\n'.join(mac_addrs))
@@ -1,4 +0,0 @@
address=/tnas1.lab.local/10.0.10.1
address=/.tnas1.lab.local/10.0.10.1
address=/compute.internal/10.0.10.5
address=/.compute.internal/10.0.10.5
-111
View File
@@ -1,111 +0,0 @@
#Lab
3C:7C:3F:1E:B7:A0 10.0.10.1
3C:7C:3F:1E:B7:A0 tnas1.lab.internal
00:A0:98:3D:7C:C8 10.0.10.2
00:A0:98:3D:7C:C8 kubedb.lab.internal
B8:27:EB:F7:44:4E 10.0.10.3
B8:27:EB:F7:44:4E pi1.lab.internal
9C:BF:0D:00:56:51 10.0.10.4
9C:BF:0D:00:56:51 fws1.lab.internal
74:56:3C:CA:E2:ED 10.0.10.5
74:56:3C:CA:E2:ED bigbox1.lab.internal
68:1D:EF:26:B7:6C 10.0.10.6
68:1D:EF:26:B7:6C minipc1.lab.internal
7C:83:34:B8:7B:43 10.0.10.7
7C:83:34:B8:7B:43 minipc2.lab.internal
6C:BF:B5:01:E9:86 10.0.10.8
6C:BF:B5:01:E9:86 terra1.lab.internal
6C:BF:B5:01:E9:87 10.0.10.9
6C:BF:B5:01:E9:87 terra1.lab.internal
58:47:CA:71:D8:E6 10.0.10.10
58:47:CA:71:D8:E6 minipc3.lab.internal
9C:BF:0D:00:FA:22 10.0.10.11
9C:BF:0D:00:FA:22 fwdesk.lab.internal
A8:42:A1:5E:21:2C 10.0.10.12
A8:42:A1:5E:21:2C bigbox2.lab.internal
#Hub
2C:CF:67:FB:C8:1F 10.0.12.1
2C:CF:67:FB:C8:1F castle.hub.internal
DC:A6:32:92:B2:79 10.0.12.2
DC:A6:32:92:B2:79 basement.hub.internal
4E:F6:9C:7C:56:33 10.0.12.3
4E:F6:9C:7C:56:33 flic.hub.internal
E8:6B:EA:23:F9:14 10.0.12.4
E8:6B:EA:23:F9:14 voice-m5stack-office.hub.internal
#Cam
9C:8E:CD:25:83:1F 10.0.13.1
9C:8E:CD:25:83:1F korie.cam.internal
A0:60:32:03:86:8A 10.0.13.2
A0:60:32:03:86:8A eddie.cam.internal
48:9E:9D:4A:32:80 10.0.13.3
48:9E:9D:4A:32:80 doorbell.cam.internal
34:60:F9:D7:51:3F 10.0.13.4
34:60:F9:D7:51:3F livingroom.cam.internal
EC:71:DB:0C:5A:6E 10.0.13.5
EC:71:DB:0C:5A:6E living.cam.internal
EC:71:DB:2E:6F:F5 10.0.13.6
EC:71:DB:2E:6F:F5 driveway.cam.internal
#Iot
60:74:F4:4D:B8:C5 10.0.14.1
60:74:F4:4D:B8:C5 korie-lamp.iot.internal
DC:4F:22:24:0C:E4 10.0.14.2
DC:4F:22:24:0C:E4 office-strip.iot.internal
44:61:32:FC:10:EC 10.0.14.3
44:61:32:FC:10:EC ecobee.iot.internal
30:30:F9:DC:A8:18 10.0.14.4
30:30:F9:DC:A8:18 apollo-kitchen.iot.internal
30:30:F9:DA:C7:A4 10.0.14.5
30:30:F9:DA:C7:A4 apollo-office.iot.internal
30:30:F9:DC:BE:7C 10.0.14.6
30:30:F9:DC:BE:7C apollo-laundry.iot.internal
64:B7:08:28:52:50 10.0.14.7
64:B7:08:28:52:50 epl-living-room.iot.internal
64:B7:08:28:56:F4 10.0.14.8
64:B7:08:28:56:F4 expired-epl.iot.internal
B8:D6:1A:8A:5F:F4 10.0.14.9
B8:D6:1A:8A:5F:F4 shelly-basement-living.iot.internal
B8:D6:1A:8C:4C:DC 10.0.14.10
B8:D6:1A:8C:4C:DC shelly-basement-shared.iot.internal
C8:2B:96:1D:DA:B4 10.0.14.11
C8:2B:96:1D:DA:B4 shelly-laundry-light.iot.internal
B0:B2:1C:10:DC:48 10.0.14.12
B0:B2:1C:10:DC:48 shelly-bathroom.iot.internal
#Apl
48:9E:BD:CB:07:E3 10.0.15.1
48:9E:BD:CB:07:E3 hp-print.apl.internal
20:DF:B9:71:55:9C gm-eddie.apl.internal
CC:6A:10:8B:7D:D3 10.0.15.3
CC:6A:10:8B:7D:D3 myq-garage.apl.internal
04:99:B9:86:2D:AE pod-korie.apl.internal
04:99:B9:88:ED:3B pod-livingroom.apl.internal
48:E1:5C:5B:CB:A3 10.0.15.6
48:E1:5C:5B:CB:A3 appletv-livingroom.apl.internal
F0:70:4F:54:F3:F0 10.0.15.7
F0:70:4F:54:F3:F0 samsuntv-livingroom.apl.internal
3C:E9:0E:62:14:D8 leviot-humid1.apl.internal
1C:9D:C2:39:61:F8 leviot-humid2.apl.internal
D8:BE:65:F2:ED:18 amzn-bedroom.apl.internal
A8:A2:37:27:3F:8A lgtv-bedroom.apl.internal
B0:4A:39:F7:E5:8E pablo.apl.internal
40:ED:CF:9D:C1:01 pod-eddie.apl.internal
00:1B:A9:B9:37:B7 brother-printer.apl.internal
F0:DB:F8:4C:96:B9 ipad-eddie.apl.internal
#Router
94:83:C4:31:D5:CE 10.0.16.1
94:83:C4:31:D5:CE gl-basement.router.internal
94:83:C4:41:77:BA 10.0.16.2
94:83:C4:41:77:BA velica-main.router.internal
94:83:C4:41:77:29 10.0.16.3
94:83:C4:41:77:29 velica-node1.router.internal
94:83:C4:41:77:B0 10.0.16.4
94:83:C4:41:77:B0 velica-node2.router.internal
5C:E9:31:00:65:61 10.0.16.100
5C:E9:31:00:65:61 extender.router.internal
#Devices
14:AC:60:29:85:4D fwlaptop.devices.internal
F8:E4:3B:36:0F:E4 sumomac.devices.internal
34:6F:24:CA:70:57 steamdeck.devices.internal
E0:0A:F6:79:C6:E9 vitapc.devices.internal
E0:92:5C:20:F7:21 vitaphone.devices.internal
EC:28:D3:53:30:59 levaphone.devices.internal
D8:DC:40:DC:D4:A0 koriephone.devices.internal
-175
View File
@@ -1,175 +0,0 @@
Lab:
Tnas1:
ip: "10.0.10.1"
host: "tnas1.lab.internal"
domain: "tnas1.lab.local"
Kubedb:
ip: "10.0.10.2"
host: "kubedb.lab.internal"
Pi1:
ip: "10.0.10.3"
host: "pi1.lab.internal"
Fws1:
ip: "10.0.10.4"
host: "fws1.lab.internal"
Bigbox1:
ip: "10.0.10.5"
host: "bigbox1.lab.internal"
domain: "compute.internal"
Minipc1:
ip: "10.0.10.6"
host: "minipc1.lab.internal"
Minipc2:
ip: "10.0.10.7"
host: "minipc2.lab.internal"
Terra1:
ip: "10.0.10.8"
host: "terra1.lab.internal"
Terra1:
ip: "10.0.10.9"
host: "terra1.lab.internal"
Minipc3:
ip: "10.0.10.10"
host: "minipc3.lab.internal"
Fwdesk:
ip: "10.0.10.11"
host: "fwdesk.lab.internal"
Bigbox2:
ip: "10.0.10.12"
host: "bigbox2.lab.internal"
Hub:
Castle:
ip: "10.0.12.1"
host: "castle.hub.internal"
Basement:
ip: "10.0.12.2"
host: "basement.hub.internal"
Flic:
ip: "10.0.12.3"
host: "flic.hub.internal"
Voice-m5stack-office:
ip: "10.0.12.4"
host: "voice-m5stack-office.hub.internal"
Cam:
Korie:
ip: "10.0.13.1"
host: "korie.cam.internal"
Eddie:
ip: "10.0.13.2"
host: "eddie.cam.internal"
Doorbell:
ip: "10.0.13.3"
host: "doorbell.cam.internal"
Livingroom:
ip: "10.0.13.4"
host: "livingroom.cam.internal"
Living:
ip: "10.0.13.5"
host: "living.cam.internal"
Driveway:
ip: "10.0.13.6"
host: "driveway.cam.internal"
Iot:
Korie-lamp:
ip: "10.0.14.1"
host: "korie-lamp.iot.internal"
Office-strip:
ip: "10.0.14.2"
host: "office-strip.iot.internal"
Ecobee:
ip: "10.0.14.3"
host: "ecobee.iot.internal"
Apollo-kitchen:
ip: "10.0.14.4"
host: "apollo-kitchen.iot.internal"
Apollo-office:
ip: "10.0.14.5"
host: "apollo-office.iot.internal"
Apollo-laundry:
ip: "10.0.14.6"
host: "apollo-laundry.iot.internal"
Epl-living-room:
ip: "10.0.14.7"
host: "epl-living-room.iot.internal"
Expired-epl:
ip: "10.0.14.8"
host: "expired-epl.iot.internal"
Shelly-basement-living:
ip: "10.0.14.9"
host: "shelly-basement-living.iot.internal"
Shelly-basement-shared:
ip: "10.0.14.10"
host: "shelly-basement-shared.iot.internal"
Shelly-laundry-light:
ip: "10.0.14.11"
host: "shelly-laundry-light.iot.internal"
Shelly-bathroom:
ip: "10.0.14.12"
host: "shelly-bathroom.iot.internal"
Apl:
Hp-print:
ip: "10.0.15.1"
host: "hp-print.apl.internal"
Gm-eddie:
host: "gm-eddie.apl.internal"
Myq-garage:
ip: "10.0.15.3"
host: "myq-garage.apl.internal"
Pod-korie:
host: "pod-korie.apl.internal"
Pod-livingroom:
host: "pod-livingroom.apl.internal"
Appletv-livingroom:
ip: "10.0.15.6"
host: "appletv-livingroom.apl.internal"
Samsuntv-livingroom:
ip: "10.0.15.7"
host: "samsuntv-livingroom.apl.internal"
Leviot-humid1:
host: "leviot-humid1.apl.internal"
Leviot-humid2:
host: "leviot-humid2.apl.internal"
Amzn-bedroom:
host: "amzn-bedroom.apl.internal"
Lgtv-bedroom:
host: "lgtv-bedroom.apl.internal"
Pablo:
host: "pablo.apl.internal"
Pod-eddie:
host: "pod-eddie.apl.internal"
Brother-printer:
host: "brother-printer.apl.internal"
Ipad-eddie:
host: "ipad-eddie.apl.internal"
Router:
Gl-basement:
ip: "10.0.16.1"
host: "gl-basement.router.internal"
Velica-main:
ip: "10.0.16.2"
host: "velica-main.router.internal"
Velica-node1:
ip: "10.0.16.3"
host: "velica-node1.router.internal"
Velica-node2:
ip: "10.0.16.4"
host: "velica-node2.router.internal"
Extender:
ip: "10.0.16.100"
host: "extender.router.internal"
Devices:
Fwlaptop:
host: "fwlaptop.devices.internal"
Sumomac:
host: "sumomac.devices.internal"
Steamdeck:
host: "steamdeck.devices.internal"
Vitapc:
host: "vitapc.devices.internal"
Vitaphone:
host: "vitaphone.devices.internal"
Levaphone:
host: "levaphone.devices.internal"
Koriephone:
host: "koriephone.devices.internal"
-53
View File
@@ -1,53 +0,0 @@
#!/usr/bin/env bash
BASE_PATH=$(realpath "${BASH_SOURCE[0]}" | xargs dirname)
ROUTER=${1:-10.0.0.1}
USER=${2:-root}
function ask {
q=${1:-"Are you sure"}
echo
read -p "$q? [Y/N]" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
echo "Continuing..."
else
echo "Stopping!"
exit 1
fi
}
server=$USER@$ROUTER
pushd "$BASE_PATH" || exit 1
echo "using 🤖 $server"
ask "continue update"
echo "Updating conf..."
./gen-mappings.py
git diff
ask "continue update"
scp -O output/etc/dnsmasq.conf "$server:/tmp/dnsmasq.new.conf"
scp -O output/etc/ethers "$server:/etc/ethers"
ssh "$server" << EOF
echo 'Backing up dnsmasq.conf file to /tmp/dnsmasq.old.conf'
cp /etc/dnsmasq.conf /tmp/dnsmasq.old.conf
echo 'Updating dnsmasq.conf 🙇🏼'
cp /tmp/dnsmasq.new.conf /etc/dnsmasq.conf
if dnsmasq --test ; then
/etc/init.d/dnsmasq restart
else
echo "Updated Failed! 🚨"
echo "Attempting to revert back..."
cp /tmp/dnsmasq.old.conf /etc/dnsmasq.conf
dnsmasq --test
echo "Revert successful! 👍"
fi
EOF
git add .
git commit -m "🤖 Updated Router Config at $(date)"
git push