webssh2-server
Version:
A Websocket to SSH2 gateway using xterm.js, socket.io, ssh2
92 lines (91 loc) • 3.26 kB
TypeScript
import { z } from 'zod';
/**
* Main configuration schema
*/
export declare const ConfigSchema: z.ZodObject<{
listen: z.ZodObject<{
ip: z.ZodString;
port: z.ZodNumber;
}, z.core.$strip>;
http: z.ZodObject<{
origins: z.ZodArray<z.ZodString>;
}, z.core.$strip>;
user: z.ZodObject<{
name: z.ZodNullable<z.ZodString>;
password: z.ZodNullable<z.ZodString>;
privateKey: z.ZodNullable<z.ZodString>;
passphrase: z.ZodNullable<z.ZodString>;
}, z.core.$strip>;
ssh: z.ZodObject<{
host: z.ZodNullable<z.ZodString>;
port: z.ZodNumber;
localAddress: z.ZodOptional<z.ZodString>;
localPort: z.ZodOptional<z.ZodNumber>;
term: z.ZodString;
readyTimeout: z.ZodNumber;
keepaliveInterval: z.ZodNumber;
keepaliveCountMax: z.ZodNumber;
allowedSubnets: z.ZodOptional<z.ZodArray<z.ZodString>>;
alwaysSendKeyboardInteractivePrompts: z.ZodBoolean;
disableInteractiveAuth: z.ZodBoolean;
algorithms: z.ZodObject<{
cipher: z.ZodArray<z.ZodString>;
compress: z.ZodArray<z.ZodString>;
hmac: z.ZodArray<z.ZodString>;
kex: z.ZodArray<z.ZodString>;
serverHostKey: z.ZodArray<z.ZodString>;
}, z.core.$strip>;
envAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
}, z.core.$strip>;
header: z.ZodObject<{
text: z.ZodNullable<z.ZodString>;
background: z.ZodString;
}, z.core.$strip>;
options: z.ZodObject<{
challengeButton: z.ZodBoolean;
autoLog: z.ZodBoolean;
allowReauth: z.ZodBoolean;
allowReconnect: z.ZodBoolean;
allowReplay: z.ZodBoolean;
replayCRLF: z.ZodOptional<z.ZodBoolean>;
}, z.core.$strip>;
session: z.ZodObject<{
secret: z.ZodString;
name: z.ZodString;
sessionTimeout: z.ZodOptional<z.ZodNumber>;
maxHistorySize: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>;
sso: z.ZodObject<{
enabled: z.ZodBoolean;
csrfProtection: z.ZodBoolean;
trustedProxies: z.ZodArray<z.ZodString>;
headerMapping: z.ZodObject<{
username: z.ZodString;
password: z.ZodString;
session: z.ZodString;
sessionId: z.ZodOptional<z.ZodString>;
host: z.ZodOptional<z.ZodString>;
port: z.ZodOptional<z.ZodString>;
algorithm: z.ZodOptional<z.ZodString>;
}, z.core.$strip>;
}, z.core.$strip>;
terminal: z.ZodOptional<z.ZodObject<{
rows: z.ZodOptional<z.ZodNumber>;
cols: z.ZodOptional<z.ZodNumber>;
term: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
logging: z.ZodOptional<z.ZodObject<{
namespace: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
allowedSubnets: z.ZodOptional<z.ZodArray<z.ZodString>>;
safeShutdownDuration: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>;
/**
* Inferred Config type from the schema
* This replaces the need for a separate Config interface
*/
export type ConfigFromSchema = z.infer<typeof ConfigSchema>;
/**
* Partial config for merging with defaults
*/
export type PartialConfig = z.input<typeof ConfigSchema>;