fix: surface control ui config in daemon status
This commit is contained in:
@@ -14,6 +14,10 @@ import {
|
|||||||
resolveStateDir,
|
resolveStateDir,
|
||||||
} from "../config/config.js";
|
} from "../config/config.js";
|
||||||
import { resolveIsNixMode } from "../config/paths.js";
|
import { resolveIsNixMode } from "../config/paths.js";
|
||||||
|
import type {
|
||||||
|
BridgeBindMode,
|
||||||
|
GatewayControlUiConfig,
|
||||||
|
} from "../config/types.js";
|
||||||
import {
|
import {
|
||||||
GATEWAY_LAUNCH_AGENT_LABEL,
|
GATEWAY_LAUNCH_AGENT_LABEL,
|
||||||
GATEWAY_SYSTEMD_SERVICE_NAME,
|
GATEWAY_SYSTEMD_SERVICE_NAME,
|
||||||
@@ -48,14 +52,11 @@ type ConfigSummary = {
|
|||||||
exists: boolean;
|
exists: boolean;
|
||||||
valid: boolean;
|
valid: boolean;
|
||||||
issues?: Array<{ path: string; message: string }>;
|
issues?: Array<{ path: string; message: string }>;
|
||||||
controlUi?: {
|
controlUi?: GatewayControlUiConfig;
|
||||||
enabled?: boolean;
|
|
||||||
basePath?: string;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
type GatewayStatusSummary = {
|
type GatewayStatusSummary = {
|
||||||
bindMode: "auto" | "lan" | "tailnet" | "loopback";
|
bindMode: BridgeBindMode;
|
||||||
bindHost: string | null;
|
bindHost: string | null;
|
||||||
port: number;
|
port: number;
|
||||||
portSource: "service args" | "env/config";
|
portSource: "service args" | "env/config";
|
||||||
@@ -376,9 +377,7 @@ async function gatherDaemonStatus(opts: {
|
|||||||
exists: cliSnapshot?.exists ?? false,
|
exists: cliSnapshot?.exists ?? false,
|
||||||
valid: cliSnapshot?.valid ?? true,
|
valid: cliSnapshot?.valid ?? true,
|
||||||
...(cliSnapshot?.issues?.length ? { issues: cliSnapshot.issues } : {}),
|
...(cliSnapshot?.issues?.length ? { issues: cliSnapshot.issues } : {}),
|
||||||
...(cliCfg.gateway?.controlUi
|
controlUi: cliCfg.gateway?.controlUi,
|
||||||
? { controlUi: cliCfg.gateway.controlUi }
|
|
||||||
: {}),
|
|
||||||
};
|
};
|
||||||
const daemonConfigSummary: ConfigSummary = {
|
const daemonConfigSummary: ConfigSummary = {
|
||||||
path: daemonSnapshot?.path ?? daemonConfigPath,
|
path: daemonSnapshot?.path ?? daemonConfigPath,
|
||||||
@@ -387,9 +386,7 @@ async function gatherDaemonStatus(opts: {
|
|||||||
...(daemonSnapshot?.issues?.length
|
...(daemonSnapshot?.issues?.length
|
||||||
? { issues: daemonSnapshot.issues }
|
? { issues: daemonSnapshot.issues }
|
||||||
: {}),
|
: {}),
|
||||||
...(daemonCfg.gateway?.controlUi
|
controlUi: daemonCfg.gateway?.controlUi,
|
||||||
? { controlUi: daemonCfg.gateway.controlUi }
|
|
||||||
: {}),
|
|
||||||
};
|
};
|
||||||
const configMismatch = cliConfigSummary.path !== daemonConfigSummary.path;
|
const configMismatch = cliConfigSummary.path !== daemonConfigSummary.path;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user