Face unlock: Python, OpenCV and numpy from a root-owned pixi environment
CI / test (push) Successful in 2m41s

- face/pixi.toml + pixi.lock (python 3.12, numpy, opencv-python-headless). `just install-face`
  passes the pixi on your PATH; install.py runs `pixi install --frozen` as root into
  /usr/local/lib/chandra/face-env (not the checkout's .pixi: the PAM module runs this Python as
  root, so it must not be user-writable), writes the helper's shebang for it and builds the PAM
  module with it as the default python. No python3-opencv needed; uninstall removes the env.
- The PAM module now also refuses a Python that isn't root's; group-writable is accepted only
  for group root (conda/pixi files are 0775 root:root), in the module and chandra-face's checks.
- Elevation re-runs on the same interpreter (sys.executable). "OpenCV is missing: run just
  install-face" instead of naming the distro package. Dropped a stray __pycache__.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hhiJfJNAYqWzQiuKMf
This commit is contained in:
Claude committed 2026-11-26 01:34:45 +00:00
1 parent fa634956cc
commit b097116ded
10 files changed
+1105 -26

No files matched your search

+1 -1
View File
@@ -120,7 +120,7 @@ uninstall:
# Install face unlock (PAM module + chandra-face + models; docs/face-unlock.md). `just install-face --pam` also turns it on for polkit-1 and sudo. The Settings rows come with the session: `just install` and log in again.
install-face *args:
scripts/as-root python3 "{{justfile_directory()}}/face/install.py" {{args}}
scripts/as-root python3 "{{justfile_directory()}}/face/install.py" --pixi "$(command -v pixi || echo "$HOME/.pixi/bin/pixi")" {{args}}
# Remove face unlock (from every PAM service first). `just uninstall-face --purge` also deletes the enrolled faces.
uninstall-face *args: