feat: add exec host routing + node daemon
This commit is contained in:
@@ -52,10 +52,11 @@ export function resolveGatewayLogPaths(env: Record<string, string | undefined>):
|
||||
} {
|
||||
const stateDir = resolveGatewayStateDir(env);
|
||||
const logDir = path.join(stateDir, "logs");
|
||||
const prefix = env.CLAWDBOT_LOG_PREFIX?.trim() || "gateway";
|
||||
return {
|
||||
logDir,
|
||||
stdoutPath: path.join(logDir, "gateway.log"),
|
||||
stderrPath: path.join(logDir, "gateway.err.log"),
|
||||
stdoutPath: path.join(logDir, `${prefix}.log`),
|
||||
stderrPath: path.join(logDir, `${prefix}.err.log`),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -340,12 +341,14 @@ export async function installLaunchAgent({
|
||||
programArguments,
|
||||
workingDirectory,
|
||||
environment,
|
||||
description,
|
||||
}: {
|
||||
env: Record<string, string | undefined>;
|
||||
stdout: NodeJS.WritableStream;
|
||||
programArguments: string[];
|
||||
workingDirectory?: string;
|
||||
environment?: Record<string, string | undefined>;
|
||||
description?: string;
|
||||
}): Promise<{ plistPath: string }> {
|
||||
const { logDir, stdoutPath, stderrPath } = resolveGatewayLogPaths(env);
|
||||
await fs.mkdir(logDir, { recursive: true });
|
||||
@@ -366,13 +369,15 @@ export async function installLaunchAgent({
|
||||
const plistPath = resolveLaunchAgentPlistPathForLabel(env, label);
|
||||
await fs.mkdir(path.dirname(plistPath), { recursive: true });
|
||||
|
||||
const description = formatGatewayServiceDescription({
|
||||
profile: env.CLAWDBOT_PROFILE,
|
||||
version: environment?.CLAWDBOT_SERVICE_VERSION ?? env.CLAWDBOT_SERVICE_VERSION,
|
||||
});
|
||||
const serviceDescription =
|
||||
description ??
|
||||
formatGatewayServiceDescription({
|
||||
profile: env.CLAWDBOT_PROFILE,
|
||||
version: environment?.CLAWDBOT_SERVICE_VERSION ?? env.CLAWDBOT_SERVICE_VERSION,
|
||||
});
|
||||
const plist = buildLaunchAgentPlist({
|
||||
label,
|
||||
comment: description,
|
||||
comment: serviceDescription,
|
||||
programArguments,
|
||||
workingDirectory,
|
||||
stdoutPath,
|
||||
|
||||
Reference in New Issue
Block a user