#!/bin/sh # intentic connect: a bootstrap shim. It gets Docker onto this device (the one step that may need administrator # rights), finds or downloads the ic CLI, and hands the flow over to `ic sandbox connect`, which does everything else: # the setup-code claim, tunnels, the launch, desktop sync. The flow lives in _sandbox/ic; this file stays the thing a # person can read before piping it into sh. # # Usage (the platform's setup screen hands you a copy-paste one-liner): # curl -fsSL https://intentic.dev/setup/ | sh # curl -fsSL https://intentic.dev/connect | sh -s -- (the older shape, still served) # Headless/scripted: skip the code and pass everything as env vars (CONNECT_TOKEN=… SANDBOX_GRANT=… ./connect.sh). # # The setup code carries the sandbox's reachability grant on intentic's own edge (SANDBOX_GRANT, plus the INGRESS_URL it # dials); the sandbox opens the tunnel outbound with it from inside. CF_TOKEN is only for SELF_HOST, which publishes THIS # device's SSH for the deploy engine; it has nothing to do with reaching the sandbox. # # ELEVATION IS ASKED FOR, NEVER BAKED IN (docs/ops/cli-output-protocol.md). Installing Docker is the one step that # needs root, so it is the one step that asks for it, through sudo, after saying why. Everything else is a docker/curl # call the person can make themselves. A run that already IS root (the older `| sudo sh` one-liners, the desktop app's # pkexec when Docker is missing) installs without asking for sudo, as before. # # The ic binary is downloaded on EVERY run, so re-running the one-liner upgrades an existing install; only a failed # download falls back to what is installed. IC_BIN overrides for local dev (a checkout's own build). A run the desktop # app pins to its release copies the ic the app carries (INTENTIC_IC_PATH) instead, when that one is exactly the # release asked for. # # POSIX sh (this is piped into `sh`, which is dash on Debian/Ubuntu/WSL; no `pipefail`). set -eu # >>> generated from _site/site/scripts-kit/kit.sh: edit it there, then run node _tools/checks/scripts-kit.mjs --fix # The shim kit: the protocol's shapes (docs/ops/cli-output-protocol.md) for the few lines a script prints before it # hands over to ic or intentic-machine, which draw everything after that themselves. POSIX sh: piped into `sh`, which # is dash on Debian, Ubuntu and WSL. # # kit_begin [scope] the header; rich only, and only in a script that draws a whole flow # kit_step