The installer flow
Flowchart from the Technical Manual.
Text version
- Start
- Linux or macOS?
- Exit with error
- Bash major version 3 or later?
- Exit with error
- x86_64, aarch64, or arm64?
- Exit with error
- curl or wget available?
- Exit with error
- install --stage directory?
- Check the distribution, install its runtime and dependencies
- Exit
- Migrate app and runtime folders to symlinks, if necessary
- Run from a checkout with an executable build script?
- Install runtimeVersion, if necessary (checked against build-templates/runtime-checksums) and point the runtime symlink at it
- --npm passed, no node_modules, or package-lock.json changed?
- Run npm install with Kitten’s npm
- Package file path passed?
- Extract the package into versions/.incoming
- Run ./build and copy dist/ into versions/.incoming
- Download the latest package (or the latest for the API version passed) from kittens.small-web.org
- Extract into versions/.incoming
- Check node-version and version.json
- Runtime in node-version installed and working?
- Download the Node.js archive from nodejs.org, check it against runtime-checksums, extract into runtimes/version
- This version already in versions/?
- Use it and discard versions/.incoming
- Web install with a deployed Kitten service?
- Install dependencies and move into versions/exact version
- Run the new version’s kitten update and exit with its exit code
- End
- Point the app and runtime symlinks, link kitten, kitten-node, and kitten-npm in ~/.local/bin
- Remove all versions and runtimes except the new and previous ones
- Create the data folder, if necessary
- Linux?
- Unprivileged ports start above 80?
- Lower the start to 80 with sudo and persist it in /etc/sysctl.d
- Print the install time or Installed.
- Show platform-specific instructions
- Print Run using: kitten [path to serve]
- End