salt-sdk - v0.0.45
    Preparing search index...

    Class RoboHostSetupSealed

    Provisioning for a new robo host, returned by RoboHost.setup: the machine generates the guardians' seed, encrypts it to the owner's public key and uploads the encrypted backup to Salt. The plaintext seed never leaves the machine.

    const host = await salt.createRoboHost({ name: 'My Org Robos', organisationId });
    const setup = host.setup({ publicKey: ownerPublicKey });
    fs.writeFileSync('install-robos.sh', setup.generateScript());

    Hierarchy (View Summary)

    Index
    host: RoboHost

    The host being provisioned. Its OTP authorises the provisioning, and RoboHost.activate consumes it.

    • Build an AWS CloudFormation quick-create console URL that provisions the machine on a new EC2 instance from Salt's launch template. Opening it in a browser signed in to AWS launches the stack, which runs the same provisioning as generateScript.

      Parameters

      • params: { stackName: string }

        The stack name

      Returns string

      The CloudFormation quick-create URL

      ValidationError if the host record no longer carries an OTP, i.e. it was already activated

      const url = provisioning.generateCloudFormationUrl({ stackName: 'my-org-robos' });
      console.log(`Open to launch: ${url}`);
    • Build the script that provisions the machine. Run it as root on an Ubuntu/Debian host: it installs Docker, generates the guardians' seed, uploads its encrypted backup to Salt, and starts the robo container with an automatic updater, reporting progress to RoboHost.listenToSetup as it goes.

      Returns string

      The script contents

      ValidationError if the host record no longer carries an OTP, i.e. it was already activated

      fs.writeFileSync('robos.sh', provisioning.generateScript(), { mode: 0o600 });