feat(deploy): one-step install/update from the Proxmox host (#6)
bootstrap.sh runs on the Proxmox host via bash -c "$(curl -fsSL .../deploy/proxmox/bootstrap.sh)" It unpacks the repository into a temporary directory, runs create-ct.sh and removes everything again; create-ct.sh also removes the installer files it pushed into the CT. Nothing stays on the host. install.sh now installs or updates: an existing checkout is pulled (fast-forward, SHELLBOOK_REF pins are kept), the service is restarted and health-checked, and the summary prints the address, the one-time setup token while setup is pending, the Claude login state and the SSH public key. It also installs a root-owned `shellbook-update` that downloads the installer from the repository and reruns it. Root never executes scripts from /opt/shellbook, which the service user and its terminal panel can modify, so deploy/update.sh is removed. Verified in a Debian 13 container: fresh install, then an update that pulls a new commit while a tampered checkout script is not executed; bootstrap.test.sh checks that host and CT keep no installer files.
This commit is contained in:
@@ -67,4 +67,5 @@ for key in SHELLBOOK_REPO SHELLBOOK_REF SHELLBOOK_HOST SHELLBOOK_PORT SHELLBOOK_
|
||||
if [[ -v $key ]]; then printf 'export %s=%q\n' "$key" "${!key}" >> "$settings"; fi
|
||||
done
|
||||
pct push "$ctid" "$settings" /root/shellbook-install.env --perms 0600
|
||||
pct exec "$ctid" -- bash -c 'trap "rm -f /root/shellbook-install.env" EXIT; source /root/shellbook-install.env; bash /root/shellbook-install.sh'
|
||||
# Leave no installer files behind in the CT either; later updates use `shellbook-update`.
|
||||
pct exec "$ctid" -- bash -c 'trap "rm -f /root/shellbook-install.env /root/shellbook-install.sh" EXIT; source /root/shellbook-install.env; bash /root/shellbook-install.sh'
|
||||
|
||||
Reference in New Issue
Block a user