Switch lan tld from 'box' to 'lan'

This commit is contained in:
Alexander Wainwright 2026-01-15 11:07:36 +10:00
parent bfdd418589
commit 8394616706

View file

@ -15,24 +15,25 @@ let
"ha.figtree.dev" = "http://192.168.1.50:8123"; "ha.figtree.dev" = "http://192.168.1.50:8123";
# "budget.figtree.dev" = "http://192.168.80.1:5006"; # "budget.figtree.dev" = "http://192.168.80.1:5006";
# .box domains now automatically get "tls internal" # .lan domains now automatically get "tls internal"
"home.box" = "http://192.168.1.63:3000"; "home.lan" = "http://192.168.1.63:3000";
"budget.box" = "http://192.168.80.1:5006"; "budget.lan" = "http://192.168.80.1:5006";
"torrent.box" = "http://192.168.1.65:8080"; "torrent.lan" = "http://192.168.1.65:8080";
"books.box" = "http://192.168.80.4:8010"; "books.lan" = "http://192.168.80.4:8010";
"recipes.lan" = "http://192.168.80.4:8222";
}; };
# Normalize sites: # Normalize sites:
# 1. Turn strings into { backend = "..."; }. # 1. Turn strings into { backend = "..."; }.
# 2. Automatically prepend `tls internal` for any domain ending in .box. # 2. Automatically prepend `tls internal` for any domain ending in .lan.
normalizedSites = lib.mapAttrs (domain: siteConfig: normalizedSites = lib.mapAttrs (domain: siteConfig:
let let
# Ensure siteConfig is an attrset. # Ensure siteConfig is an attrset.
baseConfig = if lib.isString siteConfig then { backend = siteConfig; } else siteConfig; baseConfig = if lib.isString siteConfig then { backend = siteConfig; } else siteConfig;
# Check if it's a .box domain. # Check if it's a .lan domain.
isBoxDomain = lib.hasSuffix ".box" domain; isLanDomain = lib.hasSuffix ".lan" domain;
in in
if isBoxDomain then if isLanDomain then
baseConfig // { baseConfig // {
extraBefore = '' extraBefore = ''
tls internal tls internal