- 14 UI pages: all Select a company empty states use VOCAB.company.toLowerCase() - AgentConfigForm: 3 error throws use VOCAB.company - AgentDetail: additional Select a company upload error replaced - CLI run.ts: Starting/Could not locate/failed to start messages use VOCAB.appName - CLI deployment-auth-check: repairHint uses VOCAB.appName - CLI agent-jwt-secret-check: repairHint uses VOCAB.appName - CLI allowed-hostname: restart message uses VOCAB.appName - Added VOCAB import to all files missing it
41 lines
1.2 KiB
TypeScript
41 lines
1.2 KiB
TypeScript
import {
|
|
ensureAgentJwtSecret,
|
|
readAgentJwtSecretFromEnv,
|
|
readAgentJwtSecretFromEnvFile,
|
|
resolveAgentJwtEnvFile,
|
|
} from "../config/env.js";
|
|
import { VOCAB } from "@paperclipai/branding";
|
|
import type { CheckResult } from "./index.js";
|
|
|
|
export function agentJwtSecretCheck(configPath?: string): CheckResult {
|
|
if (readAgentJwtSecretFromEnv(configPath)) {
|
|
return {
|
|
name: "Agent JWT secret",
|
|
status: "pass",
|
|
message: "PAPERCLIP_AGENT_JWT_SECRET is set in environment",
|
|
};
|
|
}
|
|
|
|
const envPath = resolveAgentJwtEnvFile(configPath);
|
|
const fileSecret = readAgentJwtSecretFromEnvFile(envPath);
|
|
|
|
if (fileSecret) {
|
|
return {
|
|
name: "Agent JWT secret",
|
|
status: "warn",
|
|
message: `PAPERCLIP_AGENT_JWT_SECRET is present in ${envPath} but not loaded into environment`,
|
|
repairHint: `Set the value from ${envPath} in your shell before starting the ${VOCAB.appName} server`,
|
|
};
|
|
}
|
|
|
|
return {
|
|
name: "Agent JWT secret",
|
|
status: "fail",
|
|
message: `PAPERCLIP_AGENT_JWT_SECRET missing from environment and ${envPath}`,
|
|
canRepair: true,
|
|
repair: () => {
|
|
ensureAgentJwtSecret(configPath);
|
|
},
|
|
repairHint: `Run with --repair to create ${envPath} containing PAPERCLIP_AGENT_JWT_SECRET`,
|
|
};
|
|
}
|