#!/usr/bin/env bash # fk installer — Linux/macOS. Self-contained: safe to run piped, e.g. # # curl -fsSL https://install.filiokit.com | bash # # Interactive bootstrap for a fresh org deployment. Downloads the compose stack # + Caddyfile from the install host, generates .env, brings the stack up, # applies migrations, seeds defaults, and registers the first admin user. # # Re-runnable: when an existing $INSTALL_DIR/.env is found you can pick # "refresh" to pull images + migrate while leaving secrets alone. set -euo pipefail INSTALL_DIR="${INSTALL_DIR:-/opt/fk}" # Where to fetch the stack files from. Override for self-hosting/testing. FK_ASSET_BASE="${FK_ASSET_BASE:-https://install.filiokit.com}" bold() { printf "\033[1m%s\033[0m\n" "$*"; } green() { printf "\033[1;32m%s\033[0m\n" "$*"; } red() { printf "\033[1;31m%s\033[0m\n" "$*"; } yel() { printf "\033[1;33m%s\033[0m\n" "$*"; } # When piped through `bash`, stdin is the script — read prompts from the TTY. TTY=/dev/tty ask() { # ask