mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 04:01:58 +00:00
feat: add mdns hostname metadata variant and fix vhost routing
- Add HostnameMetadata::Mdns variant to distinguish mDNS from private domains - Mark mDNS addresses as private (public: false) since mDNS is local-only - Fall back to null SNI entry when hostname not found in vhost mapping - Simplify public detection in ProxyTarget filter - Pass hostname to update_addresses for mDNS domain name generation
This commit is contained in:
@@ -5,6 +5,7 @@ import type { PackageId } from './PackageId'
|
||||
export type HostnameMetadata =
|
||||
| { kind: 'ipv4'; gateway: GatewayId }
|
||||
| { kind: 'ipv6'; gateway: GatewayId; scopeId: number }
|
||||
| { kind: 'mdns'; gateways: Array<GatewayId> }
|
||||
| { kind: 'private-domain'; gateways: Array<GatewayId> }
|
||||
| { kind: 'public-domain'; gateway: GatewayId }
|
||||
| { kind: 'plugin'; package: PackageId }
|
||||
|
||||
@@ -49,7 +49,7 @@ type VisibilityFilter<V extends 'public' | 'private'> = V extends 'public'
|
||||
: never
|
||||
type KindFilter<K extends FilterKinds> = K extends 'mdns'
|
||||
?
|
||||
| (HostnameInfo & { metadata: { kind: 'private-domain' } })
|
||||
| (HostnameInfo & { metadata: { kind: 'mdns' } })
|
||||
| KindFilter<Exclude<K, 'mdns'>>
|
||||
: K extends 'domain'
|
||||
?
|
||||
@@ -199,9 +199,7 @@ function filterRec(
|
||||
hostnames = hostnames.filter(
|
||||
(h) =>
|
||||
invert !==
|
||||
((kind.has('mdns') &&
|
||||
h.metadata.kind === 'private-domain' &&
|
||||
h.host.endsWith('.local')) ||
|
||||
((kind.has('mdns') && h.metadata.kind === 'mdns') ||
|
||||
(kind.has('domain') &&
|
||||
(h.metadata.kind === 'private-domain' ||
|
||||
h.metadata.kind === 'public-domain')) ||
|
||||
|
||||
Reference in New Issue
Block a user