pi-mono/apps/p2/plugins/envs/schema.ts
Mario Zechner 05dc8d239d feat: add apps/p2 (imported from pi-private at 7dadff697)
p2 (Pi Mobile on Chord v2) moves from pi-private into pi as one commit. Root scripts that loop all workspaces
use --if-present; npm test, ./test.sh and the release script cover packages/* only (p2: cd apps/p2 && npm test);
sync-versions also updates apps' workspace pins.
2026-11-03 13:39:06 +00:00

17 lines
755 B
TypeScript

import { bool, int, obj, opt, type Static, str } from "@earendil-works/pi-schema";
import { literal, record } from "@p2/app/v1";
/** Browser-safe configuration shape. No credentials are kept in envs.json. */
export const ENV_NAME = /^[a-z0-9][a-z0-9_-]{0,31}$/;
export const EnvConfigSchema = obj({
type: literal("ssh"),
host: str({ minLength: 1, maxLength: 255 }),
user: opt(str({ minLength: 1, maxLength: 255 })),
port: opt(int({ minimum: 1, maximum: 65535 })),
identityFile: opt(str({ minLength: 1, maxLength: 4096 })),
shellPath: opt(str({ minLength: 1, maxLength: 4096 })),
loginShell: opt(bool()),
shellEnv: opt(record(str())),
});
export type EnvConfig = Static<typeof EnvConfigSchema>;
export type EnvsConfig = Record<string, EnvConfig>;