chore: flatten HostnameInfo from enum to struct

HostnameInfo only had one variant (Ip) after removing Tor. Flatten it
into a plain struct with fields gateway, public, hostname. Remove all
kind === 'ip' type guards and narrowing across SDK, frontend, and
container runtime. Update DB migration to strip the kind field.
This commit is contained in:
Aiden McClelland
2026-02-10 13:38:12 -07:00
parent 2ee403e7de
commit 8204074bdf
8 changed files with 47 additions and 64 deletions

View File

@@ -93,7 +93,7 @@ export class DockerProcedureContainer extends Drop {
)?.hostnameInfo || {},
)
.flatMap((h) => h)
.flatMap((h) => (h.kind === "onion" ? [h.hostname.value] : [])),
.map((h) => h.hostname.value),
).values(),
]
const certChain = await effects.getSslCertificate({

View File

@@ -1244,12 +1244,8 @@ async function updateConfig(
? ""
: catchFn(
() =>
(specValue.target === "lan-address"
? filled.addressInfo!.filter({ kind: "mdns" }) ||
filled.addressInfo!.onion
: filled.addressInfo!.onion ||
filled.addressInfo!.filter({ kind: "mdns" })
).hostnames[0].hostname.value,
filled.addressInfo!.filter({ kind: "mdns" })!
.hostnames[0].hostname.value,
) || ""
mutConfigValue[key] = url
}