Skip to content

setup: one-command install and upgrade, release archives, and a first-day checklist - #89

Merged
TusanHomichi merged 16 commits into
mainfrom
claude/setup-installer
Oct 14, 2026
Merged

TusanHomichi merged 16 commits into
mainfrom
claude/setup-installer

Conversation

@TusanHomichi

@TusanHomichi TusanHomichi commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Primary Issue

Closes #87

Problem And Outcome

Running Consolebook meant installing Rust, Node.js, and npm, building twice, and running cargo run -- serve. There was no service, no upgrade path, and no guide past the setup page. After this PR:

  • One command: curl -fsSL …/install/install.sh | sudo sh installs or upgrades, then prints the address and the setup code.
  • A checklist: the administrator's home walks them from empty to a first finalized evaluation, with an optional guided setup.

Changes

  • install/install.sh (POSIX sh, shellcheck-clean):
    • detects the architecture and downloads the release archive (latest, or --version);
    • refuses a checksum mismatch or a missing checksum on download;
    • installs the executable, the consolebook account, /var/lib/consolebook (mode 0750), /etc/consolebook/consolebook.env (kept on upgrade), and the hardened unit;
    • restarts the service, waits for health, and prints the setup URL and code, or reports the upgrade.
    • Probes use the bound address, or loopback for a wildcard bind. An IPv6 literal is bracketed in the printed URL.
    • Options: --lan, --listen, --version, --from FILE, --no-service.
  • install/consolebook.service: a dedicated user, ProtectSystem=strict with only the data directory writable, NoNewPrivileges, private tmp and devices.
  • scripts/package-release.sh: builds the release binary with the UI embedded and the commit pinned, and writes the archive and its .sha256.
  • .github/workflows/release.yml:
    • builds static musl archives for x86_64 and arm64, and installs and upgrades each one on a real systemd runner. The upgrade moves the bind to 127.0.0.2:7771.
    • Runs on every pull request, so a Rust or dependency change cannot break packaging after a tag.
    • On a v* tag, checks the tag against the Cargo version, then publishes only after both architectures pass.
  • ADR 0023, Linux installation lifecycle:
    • names and locations;
    • which files belong to the operator and which to the product;
    • hardening, install and upgrade, and no downgrade (an older binary refuses a newer schema);
    • how any of this may change later.
  • docs/install.md: the operator guide, linked from the README.
  • Getting started:
    • GET /api/getting-started returns counts only and requires manage_users;
    • a seven-step checklist on the administrator's home;
    • /welcome, an optional guided setup: add people in a batch, print a sign-in sheet, and load an editable invented example program;
    • tests/example_program.rs imports and publishes that example program.

Scope

Verification

  • Local full gates passed on 9c99983, with main merged in and the permission-bypass capabilities dropped:

    • all 7 steps passed;
    • the browser suite reported 59 expected and 0 unexpected;
    • the tree did not change during the run;
    • receipt sha256 fa44d14874eef9ab6fc159d8de4ccd9855f793233ecfae8f43d1d0e35f646cf1.

    The commits since then change only install/install.sh and docs. None of the local gates execute the installer.

  • Hosted on 66285bb:

    • fmt-clippy-test passed;
    • release passed on both architectures: a real systemd install, the setup code, health reporting the build's commit, data-directory ownership, and an upgrade that moves the bind to 127.0.0.2:7771.
  • Installer negative control: a tampered .sha256 fails with checksum mismatch and installs nothing.

  • Automated review: five findings across rounds. Four were fixed with tests or CI coverage: the probe address, the release trigger, the ADR, and the IPv6 URL. The fifth was resolved.

  • Added or updated tests when behavior changed

  • ADR 0023 for the installation lifecycle

  • All fixtures and examples are invented

Review And Merge Notes

🤖 Generated with Claude Code

https://claude.ai/code/session_01TsvZjbz8dTRM8A1NqAP5ts


Generated by Claude Code

install/install.sh installs or upgrades Consolebook on a systemd Linux
host from a checksum-verified release archive and prints the address and
first-run setup code; install/consolebook.service runs it as a hardened
service account. scripts/package-release.sh builds the static release
archive, and .github/workflows/release.yml builds both architectures,
runs the installer end to end on a real systemd runner (fresh install,
setup code, upgrade), and publishes on a version tag. docs/install.md is
the operator guide.

getting_started::progress counts the installation's setup steps for a
manage_users holder (GET /api/getting-started), for the home checklist.

Refs #87

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TsvZjbz8dTRM8A1NqAP5ts
The administrator's home now leads with a "Getting started" checklist:
seven steps from adding people to a first finalized evaluation, each
ticked from GET /api/getting-started and linked to where it happens,
refreshed when a person is added, and gone once all are done. A browser
test covers the start, the people step ticking only once all three roles
exist, and its absence for a trainee.

`setup-code` and the first-run log now say to open the setup page in a
browser instead of naming the API route. The README leads with the
one-command install, releasing.md describes the release workflow, the
development index routes to the installer and checklist, and the 0.1.0
changelog lists the installer, checklist, and interface work.

Refs #87

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TsvZjbz8dTRM8A1NqAP5ts
`Username` also matches the setup page's "Administrator username" until
the redirect lands, so the checklist test filled the wrong form.

Refs #87

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TsvZjbz8dTRM8A1NqAP5ts
svelte-check failed the gates: the checklist derived its steps from
`progress` in a plain $derived expression, where TypeScript narrows the
state to its null initializer and the counts branch becomes never.
Derive in a function, which reads the declared type.

Refs #87

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TsvZjbz8dTRM8A1NqAP5ts
/welcome, linked from the Getting started checklist, adds people in a
batch (usernames suggested from names, a refused row keeps its text and
reason while the rest are created) and ends in a printable sign-in sheet
that states the codes' 15-minute expiry and how to reissue one. Its
program step imports a bundled, invented example program as an editable
draft through the ordinary import API, or sends the administrator to
Programs to start from scratch.

tests/example_program.rs imports the bundled template and publishes it,
so a format or publishing-rule change that would break the example fails
the build instead of an administrator; a one-letter reference typo makes
both tests fail with the exact refusal. welcome.spec.ts drives the whole
wizard in a browser.

Refs #87

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TsvZjbz8dTRM8A1NqAP5ts
`Name, row 1` is a substring of `Username, row 1`, so the unscoped label
matched both inputs.

Refs #87

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TsvZjbz8dTRM8A1NqAP5ts

Copy link
Copy Markdown
Member Author

Added to this PR: optional guided setup (5e7e443, d91cafc)

At the maintainer's request, /welcome (linked from the Getting started checklist as "Guided setup") is now part of this PR.

  • People in a batch. Usernames are suggested from names. A refused row keeps its text and reason while the rest are created. It ends in a printable sign-in sheet that states the codes' 15-minute expiry (ADR 0004, unchanged) and how to reissue one.
  • An editable example program. A bundled, invented template is loaded through the ordinary import API. tests/example_program.rs imports and publishes it, so a format or publishing-rule change that would break the example fails the build instead of an administrator. A one-letter reference typo makes both tests fail with the exact refusal.
  • welcome.spec.ts drives the whole flow: a batch with a deliberately duplicate username, the sheet, the example opened in the editor, the checklist advancing, and a second import refused by name.

Also fixed in ae24aa6: svelte-check failed the local gates on the checklist's type narrowing. Full local gates then passed on ae24aa6: all 7 steps and 58 browser tests, tree 9ee7e2cc52b9946d172f3ea88f9a2e1804b2907f, receipt sha256 40ee95dc0ed75777665b1e4470fd22e115276a50d89c74e8f12830a5e949dabc. The release workflow passed on ae24aa6 for both architectures: real systemd install, setup code, health reporting the build's commit, and upgrade in place.

Backups off the server are a separate change with an ADR, in #91 (stacked on this one).


Generated by Claude Code

@TusanHomichi
TusanHomichi marked this pull request as ready for review October 14, 2026 18:01
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-14T18:52:20.386730Z c3e75d0 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 265186957f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread install/install.sh Resolved
The installer's health and setup probes always used 127.0.0.1, so a
service bound to a specific address (--listen 192.0.2.10:7770, or
[::1]:7770) came up healthy while every probe failed, and the installer
reported failure without setup instructions. Probes now use the bound
address, or loopback when it listens on every interface.

The release workflow's upgrade step now moves the service to
127.0.0.2:7771, which the previous probe could not reach.

Refs #87

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TsvZjbz8dTRM8A1NqAP5ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8854fa2b87

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/release.yml Resolved
The release workflow ran on pull requests only when installer files
changed, while pr-gate builds the host target, not the musl archives.
A Rust, dependency, or web change could merge green and fail only once
the immutable version tag ran packaging. It now runs on every pull
request to main; CONTRIBUTING.md names it with pr-gate.

Refs #87

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TsvZjbz8dTRM8A1NqAP5ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9c99983bf1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread install/install.sh Resolved
The installer fixes operator-facing names and behavior: the executable
path, the consolebook service account, the data and settings
locations, the hardened unit, the default listen address, and how
install, upgrade, and (refused) downgrade behave. ADR 0023 records
them as a contract, says which files are the operator's and which the
product's, and requires a versioned migration path to change any of
them. It also names what stays open: HTTPS and the Secure cookie, a
backup before upgrade, and pinning or signing the installer.

The install guide and the development index link it.

Refs #87

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TsvZjbz8dTRM8A1NqAP5ts
TusanHomichi pushed a commit that referenced this pull request Oct 14, 2026
Brings #89's latest state (probe follows the bind, release workflow on
every pull request, ADR 0023 for the installation lifecycle, and main
through #92) into this branch.

- release.yml: the upgrade step keeps both the backup warning check and
  the move to 127.0.0.2:7771.
- The backup ADR becomes ADR 0024, since the installer ADR took 0023;
  every reference is renumbered, and ADR 0024 cites ADR 0023 for the
  unit's writable paths.
- ADR 0023 now records --data-dir, --backup-dir, and the paths.conf
  drop-in this branch adds.

Refs #90

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TsvZjbz8dTRM8A1NqAP5ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c3e75d0d92

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread install/install.sh Resolved
With a wildcard bind on an IPv6-only host, the first address from
`hostname -I` is an IPv6 literal, and the installer printed
http://2001:db8::1:7770/, which a browser cannot parse. A discovered
address containing a colon is now bracketed.

Refs #87

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TsvZjbz8dTRM8A1NqAP5ts
@TusanHomichi
TusanHomichi merged commit 0a458b0 into main Oct 14, 2026
4 checks passed
@TusanHomichi
TusanHomichi deleted the claude/setup-installer branch October 14, 2026 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

setup: brain-dead-simple install, upgrade, and first-day walkthrough

2 participants