cmd-sync-servers - v1.0.0
    Preparing search index...

    Interface TransportContextExperimental

    What a transport for one server needs: the site and server, the host that answers for secrets, host keys and certificates, and the environment.

    The transport layer may change in a minor version; most programs use SyncSession instead.

    interface TransportContext {
        env?: Readonly<Record<string, string | undefined>>;
        expectedCertificate?: string;
        expectedHostKey?: string;
        host: HostAdapter;
        listingLimit?: number;
        logger?: Logger;
        pinHostKey?: (info: HostKeyInfo) => Promise<void>;
        resolver?: NameResolver;
        server: {
            auth?: {
                keyPath?: string;
                method: "password" | "key" | "agent";
                savePassword: boolean;
            };
            host?: string;
            id: string;
            name: string;
            options: {
                allowInsecure?: boolean;
                allowRootDeletes?: boolean;
                hostKey?: { algorithm: string; pinnedAt: string; sha256: string };
                ipFamily?: 4 | 6;
                legacyAlgorithms?: boolean;
                passive: boolean;
                remoteDirMode?: string;
                remoteFileMode?: string;
                timeoutSeconds: number;
                tls?: {
                    caFile?: string;
                    minVersion: "TLSv1.2" | "TLSv1.3";
                    servername?: string;
                    trustedCertificate?: {
                        pinnedAt: string;
                        sha256: string;
                        validTo: string;
                    };
                };
                uploadOnSave: boolean;
            };
            port?: number;
            protocol: "sftp"
            | "ftps"
            | "ftps-implicit"
            | "ftp"
            | "local";
            remoteRoot: string;
            username?: string;
            webUrl?: string;
        };
        site: Pick<Site, "id" | "name">;
        updateServer?: (
            change: (
                server: {
                    auth?: {
                        keyPath?: string;
                        method: "password" | "key" | "agent";
                        savePassword: boolean;
                    };
                    host?: string;
                    id: string;
                    name: string;
                    options: {
                        allowInsecure?: boolean;
                        allowRootDeletes?: boolean;
                        hostKey?: { algorithm: string; pinnedAt: string; sha256: string };
                        ipFamily?: 4 | 6;
                        legacyAlgorithms?: boolean;
                        passive: boolean;
                        remoteDirMode?: string;
                        remoteFileMode?: string;
                        timeoutSeconds: number;
                        tls?: {
                            caFile?: string;
                            minVersion: "TLSv1.2" | "TLSv1.3";
                            servername?: string;
                            trustedCertificate?: {
                                pinnedAt: string;
                                sha256: string;
                                validTo: string;
                            };
                        };
                        uploadOnSave: boolean;
                    };
                    port?: number;
                    protocol: "sftp"
                    | "ftps"
                    | "ftps-implicit"
                    | "ftp"
                    | "local";
                    remoteRoot: string;
                    username?: string;
                    webUrl?: string;
                },
            ) => void,
        ) => Promise<void>;
    }
    Index
    env?: Readonly<Record<string, string | undefined>>

    Where SYNC_SERVERS_PASSWORD and SSH_AUTH_SOCK are read. Default: the process environment.

    expectedCertificate?: string

    A certificate fingerprint given for unattended runs (--trust-certificate).

    expectedHostKey?: string

    A host key fingerprint given for unattended runs (--host-key).

    Credentials, host key and certificate decisions, and prompts.

    listingLimit?: number

    The most entries one folder listing may hold. Default: DEFAULT_LISTING_LIMIT.

    logger?: Logger

    Where protocol traces and warnings go. Default: the host's logger.

    pinHostKey?: (info: HostKeyInfo) => Promise<void>

    Stores a host key the person chose to pin, usually in the server's settings. Default: through updateServer.

    resolver?: NameResolver

    Looks names up to suggest one a certificate covers. Default: the system resolver.

    server: {
        auth?: {
            keyPath?: string;
            method: "password" | "key" | "agent";
            savePassword: boolean;
        };
        host?: string;
        id: string;
        name: string;
        options: {
            allowInsecure?: boolean;
            allowRootDeletes?: boolean;
            hostKey?: { algorithm: string; pinnedAt: string; sha256: string };
            ipFamily?: 4 | 6;
            legacyAlgorithms?: boolean;
            passive: boolean;
            remoteDirMode?: string;
            remoteFileMode?: string;
            timeoutSeconds: number;
            tls?: {
                caFile?: string;
                minVersion: "TLSv1.2" | "TLSv1.3";
                servername?: string;
                trustedCertificate?: {
                    pinnedAt: string;
                    sha256: string;
                    validTo: string;
                };
            };
            uploadOnSave: boolean;
        };
        port?: number;
        protocol: "sftp"
        | "ftps"
        | "ftps-implicit"
        | "ftp"
        | "local";
        remoteRoot: string;
        username?: string;
        webUrl?: string;
    }

    The server to connect to. A decision made while connecting, such as a pinned host key or another host name the certificate covers, is applied to this object, so later connections and the saved-password check see it.

    site: Pick<Site, "id" | "name">

    The site the server belongs to, for secret lookups and messages.

    updateServer?: (
        change: (
            server: {
                auth?: {
                    keyPath?: string;
                    method: "password" | "key" | "agent";
                    savePassword: boolean;
                };
                host?: string;
                id: string;
                name: string;
                options: {
                    allowInsecure?: boolean;
                    allowRootDeletes?: boolean;
                    hostKey?: { algorithm: string; pinnedAt: string; sha256: string };
                    ipFamily?: 4 | 6;
                    legacyAlgorithms?: boolean;
                    passive: boolean;
                    remoteDirMode?: string;
                    remoteFileMode?: string;
                    timeoutSeconds: number;
                    tls?: {
                        caFile?: string;
                        minVersion: "TLSv1.2" | "TLSv1.3";
                        servername?: string;
                        trustedCertificate?: {
                            pinnedAt: string;
                            sha256: string;
                            validTo: string;
                        };
                    };
                    uploadOnSave: boolean;
                };
                port?: number;
                protocol: "sftp"
                | "ftps"
                | "ftps-implicit"
                | "ftp"
                | "local";
                remoteRoot: string;
                username?: string;
                webUrl?: string;
            },
        ) => void,
    ) => Promise<void>

    Saves a change a decision made to the server, usually in sites.json: a pinned host key, a trusted certificate, another host or the name the certificate is checked as. The change is already applied to server.