diff --git a/.gitignore b/.gitignore index 8a69236..1190225 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ work/ vm/ archlinux-*.iso +omalocal-arch-*.iso omaterm-arch-*.iso *.ppm *.png diff --git a/omaterm-iso.sh b/omalocal.sh similarity index 95% rename from omaterm-iso.sh rename to omalocal.sh index f31ca4b..3bedef7 100755 --- a/omaterm-iso.sh +++ b/omalocal.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# omaterm-iso.sh — one script: turn a stock Arch ISO into a headless Arch +# omalocal.sh — one script: turn a stock Arch ISO into a headless Arch # server installer ISO that, on first login, offers to bootstrap the OMATERM # toolkit (omaterm.org) + Once. Ready for Ventoy or dd. # @@ -11,8 +11,8 @@ # Usage: # 1. Drop a stock Arch ISO (https://archlinux.org/download/, file starts # with 'archlinux-') into the same folder as this script. -# 2. ./omaterm-iso.sh -# 3. Output: omaterm-arch-YYYYMMDD.iso (Ventoy-compatible, dd-bootable). +# 2. ./omalocal.sh +# 3. Output: omalocal-arch-YYYYMMDD.iso (Ventoy-compatible, dd-bootable). # # Dependencies: xorriso, squashfs-tools, git, sha512sum, sudo. @@ -22,7 +22,7 @@ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" WORK="$SCRIPT_DIR/work" INVOKING_USER="${SUDO_USER:-$(id -un)}" INVOKING_GROUP="$(id -gn "$INVOKING_USER")" -OUT_ISO="$SCRIPT_DIR/omaterm-arch-$(date +%Y%m%d).iso" +OUT_ISO="$SCRIPT_DIR/omalocal-arch-$(date +%Y%m%d).iso" # Clean up the work dir on any exit (success, error, or Ctrl-C). 2>/dev/null # is in case $WORK never got created (e.g. we exited before mkdir). @@ -336,14 +336,14 @@ esac PROFILE_LOCAL_BIN chmod 644 /mnt/etc/profile.d/local-bin.sh -# ---------------------------------------------------- omaterm first-run ------ +# ---------------------------------------------------- omalocal first-run ------ # Offer to install omaterm on the user's first *interactive* login. This box is # headless + key-only SSH, so "first boot" really means "first ssh login" — a # .bash_profile hook is the only place we can take interactive stdin. The hook # is guarded by [ -t 0 ] so non-interactive `ssh host ` runs never consume # it, and it self-removes after running so the user is asked exactly once. -echo "==> Installing omaterm first-login prompt for $USERNAME..." -cat > "/mnt/home/$USERNAME/.omaterm-firstrun.sh" <<'OMATERM_FIRSTRUN' +echo "==> Installing omalocal first-login prompt for $USERNAME..." +cat > "/mnt/home/$USERNAME/.omalocal-firstrun.sh" <<'OMALOCAL_FIRSTRUN' #!/usr/bin/env bash # Shown once, on first interactive login. The .bash_profile hook removes this # file after it runs, so the prompt never appears again. @@ -355,7 +355,7 @@ cat <<'BANNER' === Welcome to OMATERM + Once === ============================================================ - This is a fresh Arch Linux server installed by omaterm-iso. + This is a fresh Arch Linux server installed by omalocal. Setting up the server installs two things: @@ -471,23 +471,23 @@ case "$ans" in echo ;; esac -OMATERM_FIRSTRUN +OMALOCAL_FIRSTRUN # Append the one-shot hook. Only fires on an interactive login shell, and only # while the firstrun script still exists; both conditions clear after first use. -cat >> "/mnt/home/$USERNAME/.bash_profile" <<'OMATERM_PROFILE_HOOK' +cat >> "/mnt/home/$USERNAME/.bash_profile" <<'OMALOCAL_PROFILE_HOOK' -# --- omaterm first-run prompt (self-removing) --- -if [ -t 0 ] && [ -f "$HOME/.omaterm-firstrun.sh" ]; then - bash "$HOME/.omaterm-firstrun.sh" - rm -f "$HOME/.omaterm-firstrun.sh" +# --- omalocal first-run prompt (self-removing) --- +if [ -t 0 ] && [ -f "$HOME/.omalocal-firstrun.sh" ]; then + bash "$HOME/.omalocal-firstrun.sh" + rm -f "$HOME/.omalocal-firstrun.sh" fi -# --- end omaterm first-run prompt --- -OMATERM_PROFILE_HOOK +# --- end omalocal first-run prompt --- +OMALOCAL_PROFILE_HOOK arch-chroot /mnt chown "$USERNAME:$USERNAME" \ - "/home/$USERNAME/.omaterm-firstrun.sh" "/home/$USERNAME/.bash_profile" -arch-chroot /mnt chmod 755 "/home/$USERNAME/.omaterm-firstrun.sh" + "/home/$USERNAME/.omalocal-firstrun.sh" "/home/$USERNAME/.bash_profile" +arch-chroot /mnt chmod 755 "/home/$USERNAME/.omalocal-firstrun.sh" # ------------------------------------------------ once-mdns-sync daemon ------ # Publishes .local on the LAN for each Once app (apps are deployed via @@ -632,17 +632,17 @@ else echo " -o once-add && sudo install -m 755 once-add /usr/local/bin/once-add && rm once-add" fi -echo "==> Pre-installing Claude skill (omaterm-server) for $USERNAME..." -install -d -m 755 "/mnt/home/$USERNAME/.claude/skills/omaterm-server" -cat > "/mnt/home/$USERNAME/.claude/skills/omaterm-server/SKILL.md" <<'SKILL_EOF' +echo "==> Pre-installing Claude skill (omalocal-server) for $USERNAME..." +install -d -m 755 "/mnt/home/$USERNAME/.claude/skills/omalocal-server" +cat > "/mnt/home/$USERNAME/.claude/skills/omalocal-server/SKILL.md" <<'SKILL_EOF' --- -name: omaterm-server -description: Context and shortcuts for an Arch Linux server provisioned by omaterm-iso. Use when working on this host — deploying a web app with Once (especially CHOOSING THE APP'S DOMAIN so it's reachable on the LAN), installing services, managing the firewall (ufw), opening ports, debugging systemd units, checking what's listening, deploying docker, adding SSH keys, or anything that touches the box's baseline config. +name: omalocal-server +description: Context and shortcuts for an Arch Linux server provisioned by omalocal. Use when working on this host — deploying a web app with Once (especially CHOOSING THE APP'S DOMAIN so it's reachable on the LAN), installing services, managing the firewall (ufw), opening ports, debugging systemd units, checking what's listening, deploying docker, adding SSH keys, or anything that touches the box's baseline config. --- # About this host -Installed by `omaterm-iso.sh`, a single-script patcher that takes a stock Arch ISO and produces a headless install. The host was provisioned with: +Installed by `omalocal.sh`, a single-script patcher that takes a stock Arch ISO and produces a headless install. The host was provisioned with: - **Base packages**: `base linux linux-firmware intel-ucode amd-ucode networkmanager openssh sudo git curl vim less base-devel ufw avahi nss-mdns kitty-terminfo foot-terminfo ghostty-terminfo rxvt-unicode-terminfo` - **SSH**: enabled, **key-only** (`/etc/ssh/sshd_config.d/10-key-only.conf` sets `PasswordAuthentication no`, `KbdInteractiveAuthentication no`, `PermitRootLogin no`). The master machine's public key was baked into `~/.ssh/authorized_keys` at install time. @@ -816,10 +816,10 @@ journalctl -b -p warning # warnings since last boot # Provenance -The build script that produced this image lives at `~/Projects/omaterm-iso/omaterm-iso.sh` on the master machine (not on this host). To rebuild and reinstall: run that script there, `dd` the output ISO to a USB, boot from it. The build is reproducible — same inputs (stock Arch ISO + master's SSH key) give the same output. +The build script that produced this image lives at `~/Projects/omalocal/omalocal.sh` on the master machine (not on this host). To rebuild and reinstall: run that script there, `dd` the output ISO to a USB, boot from it. The build is reproducible — same inputs (stock Arch ISO + master's SSH key) give the same output. SKILL_EOF -cat > "/mnt/home/$USERNAME/.claude/skills/omaterm-server/AGENTS.md" <<'AGENTS_EOF' +cat > "/mnt/home/$USERNAME/.claude/skills/omalocal-server/AGENTS.md" <<'AGENTS_EOF' # Project Overview Once is a CLI/TUI tool for installing and managing web applications from Docker images. It's designed to make self-hosting as easy as possible. @@ -886,7 +886,7 @@ AGENTS_EOF # convention, so an agent that deploys an app picks a LAN-reachable hostname. echo "==> Writing host conventions to $USERNAME's ~/.claude/CLAUDE.md..." cat > "/mnt/home/$USERNAME/.claude/CLAUDE.md" <<'CLAUDE_MD' -# This host (Arch server provisioned by omaterm-iso) +# This host (Arch server provisioned by omalocal) Headless Arch Linux box on a LAN. Rules to respect in every session: @@ -951,7 +951,7 @@ curl -fsSL https://raw.githubusercontent.com/28allday/omarchy-send/main/install. - Firewall is **ufw**, default-deny inbound; open ports with `sudo ufw allow`. Already open: 22, 80, 443, 5353/udp (mDNS), 53317 (LocalSend). - Full host playbook, recipes (Once / once-add / omarchy-send / mDNS / journald) - are in the `omaterm-server` skill at `~/.claude/skills/omaterm-server/`. + are in the `omalocal-server` skill at `~/.claude/skills/omalocal-server/`. CLAUDE_MD arch-chroot /mnt chown -R "$USERNAME:$USERNAME" "/home/$USERNAME/.claude" @@ -1039,7 +1039,7 @@ __INSTALLER_PAYLOAD__ } # =========================================================================== -# Host-side workflow: locate stock ISO, refresh omaterm, unsquash, inject, +# Host-side workflow: locate stock ISO, unsquash, inject, # re-squash, repack, output. # =========================================================================== @@ -1049,7 +1049,7 @@ CANDIDATES=("$SCRIPT_DIR"/archlinux-*.iso) shopt -u nullglob STOCK_ISO="" for iso in "${CANDIDATES[@]}"; do - [[ "$(basename "$iso")" == *omaterm* ]] && continue + [[ "$(basename "$iso")" == *omalocal* ]] && continue STOCK_ISO="$iso" break done @@ -1076,7 +1076,7 @@ for cmd in xorriso unsquashfs mksquashfs git sha512sum; do done # ---- locate the master SSH public key ----------------------------------- -# Override default with: SSH_PUBKEY=/path/to/key.pub ./omaterm-iso.sh +# Override default with: SSH_PUBKEY=/path/to/key.pub ./omalocal.sh SSH_PUBKEY="${SSH_PUBKEY:-$HOME/.ssh/id_ed25519.pub}" if [ ! -f "$SSH_PUBKEY" ]; then # Fall back to id_rsa.pub if ed25519 isn't there @@ -1086,7 +1086,7 @@ if [ ! -f "$SSH_PUBKEY" ]; then echo "ERROR: no SSH public key found." >&2 echo " The output ISO is key-only — without a key it'd be unreachable." >&2 echo " Generate one with: ssh-keygen -t ed25519" >&2 - echo " or pass SSH_PUBKEY=/path/to/key.pub ./omaterm-iso.sh" >&2 + echo " or pass SSH_PUBKEY=/path/to/key.pub ./omalocal.sh" >&2 exit 1 fi fi