Files
routstrd/src/utils/config.ts
T
redshift 7dfed2c052 Add daemonUrl config for remote daemon support
- Add optional daemonUrl field to RoutstrdConfig
- Update callDaemon and isDaemonRunning to use configurable base URL
- Disable auto-start when daemonUrl is set (Option A)
- Gate local-only commands: onboard, start, restart, mode, logs, service install
2026-04-28 09:26:50 +05:30

24 lines
747 B
TypeScript

const HOME = process.env.HOME || process.env.USERPROFILE || "";
export const CONFIG_DIR = process.env.ROUTSTRD_DIR || `${HOME}/.routstrd`;
export const SOCKET_PATH = process.env.ROUTSTRD_SOCKET || `${CONFIG_DIR}/routstrd.sock`;
export const PID_FILE = process.env.ROUTSTRD_PID || `${CONFIG_DIR}/routstrd.pid`;
export const DB_PATH = `${CONFIG_DIR}/routstr.db`;
export const CONFIG_FILE = `${CONFIG_DIR}/config.json`;
export const LOGS_DIR = `${CONFIG_DIR}/logs`;
export interface RoutstrdConfig {
port: number;
provider: string | null;
cocodPath: string | null;
mode?: "xcashu" | "apikeys";
daemonUrl?: string;
}
export const DEFAULT_CONFIG: RoutstrdConfig = {
port: 8008,
provider: null,
cocodPath: null,
mode: "apikeys",
};