Move login state, authentication, discovery, input, rendering, and tests into focused TUI modules. Add detailed CLI error reports with recovery commands, align the build and host-check documentation, and keep the legacy Go tree outside normal builds. Checks: make check; make integration-test; go test ./... (legacy/go).
8.9 KiB
8.9 KiB
Changelog
Unreleased
- TUI module layout —
crates/latchd-tui/src/lib.rsheld state, input, authentication, discovery, rendering, and tests in one file; split those responsibilities intoapp.rs,app/auth.rs,app/discovery.rs,app/input.rs,app/render.rs, andapp/tests.rs, which makes each change surface easier to locate - error reports —
crates/latchd-core/src/error.rs::Error::user_reportnow adds a detail line and recovery commands;rust/main.rsprints the report for CLI failures instead of one short error line - TUI checks — keep the render and state tests beside the new modules;
cargo test --locked --workspace --all-targetscovers the split without changing the login flow - service configuration — document
/etc/latchd/config.tomlas the service file and keep preview, build, and end-to-end instructions aligned with the Makefile
0.5.0 — password and session handoff
- password-change state — before this change, an expired password had no separate screen state;
crates/latchd-tui/src/app/auth.rsnow switches to a new-password prompt forPAM_NEW_AUTHTOK_REQDandPAM_AUTHTOK_EXPIRED, then starts authentication again after the change - password conversation —
crates/latchd-auth/src/lib.rs::conversehandles the current-password and new-password prompts in order; tests cover both prompt sequences incrates/latchd-auth/src/lib.rs - audit events —
crates/latchd-core/src/audit.rsrecords authentication, password-change, and session results with stablePamReasonvalues, so the service log can group failures without copying module text into the event fields - session preferences —
crates/latchd-core/src/preferences.rsstores one bounded entry per account, writes through a private temporary file, and replaces the target atomically; invalid ownership or file mode stops the save - Wayland handoff —
crates/latchd-core/src/session.rs::build_speccarries the selected session type, desktop, seat, VT, runtime directory, session ID, and D-Bus address intolatchd-authbefore the session opens - PAM fixture —
crates/latchd-auth/tests/pam_fixture.rscovers denied authentication, password change, session metadata, and child environment values;scripts/test-pam-fixture.shinstalls the temporary service files for the test run - test coverage —
crates/latchd-core,crates/latchd-auth, andcrates/latchd-tuinow test configuration, account state, session parsing, authentication conversations, preferences, rendering, and background animation
0.4.0 — account and session workflow
- account status —
crates/latchd-core/src/accounts.rs::inspect_accountreads lock markers, password age, account expiry, inactivity, login shell, and shadow availability; the TUI shows the matching state beside the selected account - faillock parsing —
crates/latchd-core/src/accounts.rs::faillock_status_from_outputaccepts legacy counts, username prefixes, and timestamp rows; malformed output or a timeout removes the extra count from the screen - account switching —
crates/latchd-tui/src/app/input.rs::select_account_indexchanges the account, clears the password, resets authentication state, and reapplies the saved session for the new account - session refresh —
crates/latchd-tui/src/app/discovery.rs::start_refreshmoves account and session discovery to a worker; the screen keeps accepting input while the lists refresh - filtering —
crates/latchd-tui/src/app/input.rs::matches_filteradds smart-case filtering for account and session names; uppercase query characters select case-sensitive matching - terminal display —
crates/latchd-tui/src/app/render.rsadds high-contrast styles, footer hints, account status text, notifications, and a minimum terminal size of 60 columns by 16 rows - authentication backoff —
crates/latchd-tui/src/app/auth.rs::auth_backoffdelays repeated failures from one to sixteen seconds and resets the delay when the account changes - host checks —
scripts/test-cli.shandscripts/test-system-e2e.shcover CLI preflight and the available PAM, faillock, VT, X11, Wayland, and systemd-logind capabilities - VM gate —
docs/e2e-testing.mdlists the host requirements for the strict check and the commands for a disposable VM - version — set the workspace package version to
0.4.0inCargo.toml
0.3.0 — Rust workspace release
- Rust service —
rust/main.rsbecame the supported login-manager entry point; the Go prototype stayed underlegacy/go/and is excluded from normal builds - workspace crates — split authentication, configuration, accounts, sessions, and the TUI into
latchd-core,latchd-auth, andlatchd-tui - session commands —
crates/latchd-core/src/session.rs::parse_argvstores a program and argument list instead of sending desktop entries through a shell, which rejects shell operators and desktop field codes - terminal effects —
crates/latchd-tui/src/background.rsadds wallpaper loading, a bounded cellular animation, reduced motion, and the background toggle - release pipeline —
.gitlab-ci.ymlandMakefileadd format, test, Clippy, rustdoc, Docker, version, package, checksum, and release targets - deployment gate —
scripts/test-system-e2e.shanddocs/e2e-testing.mdseparate container checks from live VT, display, and logind checks
Legacy Go history
The entries below describe the first Go prototype. The Rust workspace does not build or ship this code.
0.1.0 — first public prototype
- login screen —
legacy/go/login/login.goadded username and password fields, a session switcher, status messages, and preview mode - session types —
legacy/go/session/scan.goadded X11, Wayland, script, and TTY entries - authentication —
legacy/go/auth/pam.goadded cgo login support with one OS thread per PAM transaction - faillock —
legacy/go/auth/faillock.goadded lockout counts, remaining attempts, and the administrator reset key - terminal effects —
legacy/go/tui/bg/automata.goadded the cellular background, switcher motion, and failed-login shake - terminal details —
legacy/go/login/login.goadded the caps-lock indicator, power keys, clock, and preview mode - configuration —
legacy/go/config/config.goadded configuration parsing, variable replacement, and configurable power programs - accounting —
legacy/go/auth/utmpx.goadded UTMPX records forwho,w, andlaston glibc - X11 startup —
legacy/go/session/x11.goadded Xauthority cookies, theSIGUSR1readiness signal, and a server timeout - privilege drop —
legacy/go/session/exec.gostarted the selected child with the account UID, GID, and supplementary groups - logs —
legacy/go/session/exec.gocapped the client log at 64 MiB
Fixes
- DesktopNames parsing —
legacy/go/session/scan.go::splitDesktopNamespreviously dropped desktop names from the session environment; it now maps the first semicolon-delimited value toXDG_SESSION_DESKTOPand the full list toXDG_CURRENT_DESKTOP, which fixes GNOME and KDE sessions that start without their desktop values - UTMPX time fields —
legacy/go/auth/utmpx.goused fixed C integer types forut_tv;legacy/go/auth/utmpx_time.hnow accepts the platform time fields, which fixes builds whereut_tvusesstruct timeval - cgo pointer storage —
legacy/go/auth/pam.gopassed a Go pointer throughpam_conv;storeHandleandloadHandlekeep the numeric handle in C memory, which fixes the Go 1.22 pointer check - PAM conversation —
legacy/go/auth/pam.go::latchd_pam_convused a pointer-to-pointer as the response slice; it now writes to the allocated response array and answers only prompt messages, which fixes corrupted responses and thepam_unixpassword error - cgo handle lifetime —
legacy/go/auth/pam.go::Credentialsnow owns the handle until session close; the previousValidatecleanup released it beforeOpenSession - session spawning —
legacy/go/session/exec.gostarts the selected desktop directly with dropped credentials; the previous path relaunched latchd with an undefined-userflag - file names — rename the
lemurspolicy and unit files inextra/tolatchd - extra files — add
extra/config.toml,extra/xsetup.sh,extra/latchd.pam, andextra/latchd.service, which letsmake installfind its source files - Make targets — add
deps,enable, andupdatetargets for dependency checks, service enablement, and local updates - terminal rendering — remove the unused background layer and fixed top-bar width from the Go renderer, which fixes garbage characters and narrow-terminal layout errors
- session environment —
legacy/go/session/env.gonow sets display, VT, desktop, seat, XDG, and home values before the desktop starts, which fixes missingDISPLAY,XDG_VTNR, andHOME - session startup — handle
pam_open_sessionerrors as session log entries and remove the obsoletelogininclude from the prototype service file - global session switching — accept
,and.from every screen state while keeping arrow keys for the focused switcher