Replace InstanceConfig with DNSEntry for dnsmasq config generation
InstanceConfig was a ~50-field struct designed for Wild Cloud k8s instances,
but only 3 fields were ever read by dnsmasq (the sole consumer). The
reconciliation bridge constructed fake InstanceConfig objects from registered
domains just to satisfy this interface.
Replace with DNSEntry{Domain, IP} — a 2-field struct purpose-built for
dnsmasq. All domains get local=/ directives to prevent AAAA queries from
leaking to upstream DNS (Happy Eyeballs / RFC 8305 latency on LAN).
Removed dead code: InstanceConfig, NodeConfig, LoadCloudConfig,
SaveCloudConfig, DeepMerge, LoadMergedInstanceConfig, EnsureInstanceConfig,
instance path helpers, instanceLoadBalancerIP, GenerateInstanceConfig,
and all modular per-instance dnsmasq methods.
This commit is contained in:
@@ -5,73 +5,6 @@ export interface Status {
|
||||
timestamp: string;
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// Instance Config Types (Wild Cloud instance level)
|
||||
// Endpoint: /api/v1/instances/{name}/config
|
||||
// File: {dataDir}/instances/{name}/config.yaml
|
||||
// ========================================
|
||||
|
||||
export interface NodeConfig {
|
||||
role: string;
|
||||
interface: string;
|
||||
disk: string;
|
||||
currentIp: string;
|
||||
}
|
||||
|
||||
export interface InstanceConfig {
|
||||
operator?: {
|
||||
email?: string;
|
||||
};
|
||||
cloud?: {
|
||||
baseDomain?: string;
|
||||
domain?: string;
|
||||
internalDomain?: string;
|
||||
dhcpRange?: string;
|
||||
nfs?: {
|
||||
host?: string;
|
||||
mediaPath?: string;
|
||||
storageCapacity?: string;
|
||||
};
|
||||
dockerRegistryHost?: string;
|
||||
};
|
||||
cluster?: {
|
||||
name?: string;
|
||||
loadBalancerIp?: string;
|
||||
ipAddressPool?: string;
|
||||
hostnamePrefix?: string;
|
||||
certManager?: {
|
||||
cloudflare?: {
|
||||
domain?: string;
|
||||
};
|
||||
};
|
||||
externalDns?: {
|
||||
ownerId?: string;
|
||||
};
|
||||
internalDns?: {
|
||||
externalResolver?: string;
|
||||
};
|
||||
dockerRegistry?: {
|
||||
storage?: string;
|
||||
};
|
||||
nodes?: {
|
||||
talos?: {
|
||||
version?: string;
|
||||
schematicId?: string;
|
||||
};
|
||||
control?: {
|
||||
vip?: string;
|
||||
};
|
||||
active?: Record<string, NodeConfig>;
|
||||
};
|
||||
};
|
||||
apps?: Record<string, Record<string, unknown>>; // Each app has its own dynamic config
|
||||
}
|
||||
|
||||
export interface InstanceConfigResponse {
|
||||
config?: InstanceConfig;
|
||||
message?: string;
|
||||
}
|
||||
|
||||
export interface Message {
|
||||
message: string;
|
||||
type: 'info' | 'success' | 'error';
|
||||
@@ -100,7 +33,7 @@ export interface DnsmasqStatus {
|
||||
pid: number;
|
||||
ip: string;
|
||||
config_file: string;
|
||||
instances_configured: number;
|
||||
domains_configured: number;
|
||||
last_restart: string;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user