Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .agents/skills/installer-tester/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ curl -fsSL https://raw.githubusercontent.com/ventura8/ubuntu-hello/master/uninst
```bash
set -euo pipefail
mkdir -p logs
pytest tests/test_install_download.py tests/test_run_after_install.py tests/test_uh_apt_deps.py tests/test_uninstall_keyring_restore.py -v 2>&1 | tee logs/installer-tests.log
pytest tests/test_install_download.py tests/test_run_after_install.py tests/test_uh_apt_deps.py tests/test_uninstall_keyring_restore.py tests/test_config_ensure.py -v 2>&1 | tee logs/installer-tests.log
```

`tests/test_install_download.py` covers installer config parsing and model download helpers (`TestInstallConfig`, `TestDownloadModels`) without requiring a full privileged system install in CI.

`tests/test_config_ensure.py` covers restoring a missing/empty `/etc/ubuntu-hello/config.ini` from the packaged `/usr/share/ubuntu-hello/config.ini` template, and asserts `debian/ubuntu-hello.postinst` performs that copy (dpkg does not restore a deleted conffile after `apt remove`).

`tests/test_run_after_install.py` covers Wayland/session env detection for the post-install setup-wizard launcher, plus symlink-safe lock/log creation under `/run/ubuntu-hello/`.

`tests/test_uh_apt_deps.py` asserts the shared apt dep lists include Babel, multi-DE theme tools, and wallet PAM packages.
Expand Down
2 changes: 1 addition & 1 deletion .agents/skills/test-runner/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Sources: `tests/pam_aes_gcm_uh1_test.cc`, `tests/pam_face_skip_test.cc` (wired i
| `tests/test_theme_detect.py` | Multi-DE theme probes |
| `tests/test_wallet_backend.py` | Wallet labels |
| `tests/test_i18n_lint.py` | JSON + gettext catalog lint (`scripts/i18n-lint.py`) |
| `tests/test_authsticky_window.py` | Overlay UI |
| `tests/test_config_ensure.py` | Restore missing `config.ini` after apt remove/reinstall |

Always tee long runs to `logs/` (Hello convention), not other log roots.

Expand Down
4 changes: 3 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ Ensure files are modified or added in their appropriate structural directories:
| `ubuntu-hello/src/cli/` | Command line subcommands (`add`, `clear`, `config`, `disable`, `list`, `remove`, `test`, `snapshot`, `keyring`). |
| `ubuntu-hello/src/wallet_backend.py` | Labels session wallet backend (`gnome-keyring`, `kwallet`, or `none`) from desktop env; does not change sealed credential format. |
| `ubuntu-hello/src/keyring_restore.py` | Unseals SUW login passwords and restores the OS wallet master password on uninstall / `ubuntu-hello keyring restore`. |
| `ubuntu-hello/src/install_config.py` | Meson install script: copy default `config.ini` into `/etc/ubuntu-hello` when missing (source installs). |
| `ubuntu-hello/src/config_ensure.py` | Recreate live `config.ini` from `/usr/share/ubuntu-hello/config.ini` when the file is missing (dpkg will not restore a deleted conffile after `apt remove`). |
| `ubuntu-hello/po/` | Core gettext domain `ubuntu-hello` (PAM `S()` + Python `_()`); `.pot`/`.po` committed, `.mo` built. |
| `ubuntu-hello/src/recorders/` | Camera capturing plugins (wrapper, ffmpeg, pyv4l2, cv2). |
| `ubuntu-hello/src/rubberstamps/` | Post-auth liveness check plugins (e.g., nose-tracking nod check). |
Expand All @@ -156,7 +158,7 @@ Ensure files are modified or added in their appropriate structural directories:
| `scripts/i18n-lint.py` | Lint JSON packs + gettext `.po` (UTF-8/JSON, `msgfmt --check`, no empty/fuzzy `msgstr`, placeholder parity). CI lint stage. |
| `scripts/i18n-fill-translations.py` | Apply filled JSON maps under `scripts/i18n_fill_data/` onto committed `.po` files. |
| `scripts/read-version.py` | Print semver from repo-root `VERSION` (used by Meson, PKGBUILD, i18n). |
| `debian/` | Debian packaging control, installation, and post-installation scripts. Build trees (`tmp/`, `.debhelper/`, staged `ubuntu-hello*/`, `*.substvars`) are gitignored. |
| `debian/` | Debian packaging control, installation, and post-installation scripts. `ubuntu-hello.postinst` restores `/etc/ubuntu-hello/config.ini` from `/usr/share/ubuntu-hello/config.ini` when the conffile is missing after `apt remove` / reinstall. Build trees (`tmp/`, `.debhelper/`, staged `ubuntu-hello*/`, `*.substvars`) are gitignored. |
| `artifacts/` | Local/CI `.deb` output from `scripts/ppa-docker.sh` (gitignored; not source). |
| `docker/` | All CI/PPA Dockerfiles (`Dockerfile.ci*`, `Dockerfile.ppa`). Keep new Docker assets here — not at repo root. |
| `scripts/ppa-docker.sh` | PPA signed-source / binary helper inside `ubuntu-hello-ppa:26.04`. Uses `--sign-backend=gpg` + passphrase `gpg` wrapper (dpkg auto/Sequoia args break classic gpg). |
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.1
1.1.2
7 changes: 7 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
ubuntu-hello (1.1.2-1ppa1) resolute; urgency=medium

* Restore /etc/ubuntu-hello/config.ini from /usr/share/ubuntu-hello/config.ini when missing after apt remove/reinstall (config_ensure.py, postinst, CLI/compare).
* Install default config template to share dir; VideoCapture and Settings Video tab tolerate missing [video] section.

-- ventura8 <alexandrescu.sergiu@gmail.com> Tue, 18 Aug 2026 12:10:00 +0300

ubuntu-hello (1.1.1-1ppa1) noble; urgency=medium

* Restore GNOME Keyring / KWallet passwords from sealed credentials on uninstall (timeout 120, restore --all).
Expand Down
19 changes: 19 additions & 0 deletions debian/ubuntu-hello.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,25 @@ case "$1" in
mkdir -p /var/log/ubuntu-hello
chmod 755 /var/log/ubuntu-hello

# dpkg will not restore a deleted conffile on reinstall. prerm removes
# /etc/ubuntu-hello on apt remove, so recreate config.ini from the
# packaged template when it is missing (setup wizard needs [video]).
CONFIG_INI="/etc/ubuntu-hello/config.ini"
CONFIG_TEMPLATE="/usr/share/ubuntu-hello/config.ini"
if [ ! -f "$CONFIG_INI" ]; then
if [ -f "$CONFIG_TEMPLATE" ]; then
if mkdir -p "$(dirname "$CONFIG_INI")" &&
cp "$CONFIG_TEMPLATE" "$CONFIG_INI" &&
chmod 644 "$CONFIG_INI"; then
echo ">>> Restored default config.ini"
else
echo "WARNING: Failed to restore config.ini from $CONFIG_TEMPLATE"
fi
Comment thread
coderabbitai[bot] marked this conversation as resolved.
else
echo "WARNING: $CONFIG_TEMPLATE missing; config.ini was not created"
fi
fi

# ── Configure PAM ─────────────────────────────────────────────
echo ">>> Configuring PAM..."
pam-auth-update --package 2>/dev/null || true
Expand Down
5 changes: 4 additions & 1 deletion docs/INSTRUCTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ Canonical agent rules: [AGENTS.md](../AGENTS.md). Architecture: [architecture/RE
│ │ ├── rubberstamps/ # Post-auth hooks (nod, hotkey)
│ │ ├── cli.py # CLI router
│ │ ├── compare.py # Face verification engine
│ │ ├── config.ini # Default configuration template
│ │ ├── config.ini # Default configuration template (also installed to $datadir)
│ │ ├── config_ensure.py # Restore live config.ini if the dpkg conffile is missing
│ │ ├── keyring_crypto.py # UH1 AES-GCM helpers
│ │ ├── keyring_restore.py # Unseal + restore login wallet password
│ │ ├── wallet_backend.py # gnome-keyring / kwallet / none labels
Expand Down Expand Up @@ -187,6 +188,8 @@ sudo apt install ubuntu-hello

PPA packaging Docker helper: `scripts/ppa-docker.sh` / `docker/Dockerfile.ppa` (`FROM ubuntu:26.04` only). Signed source builds force `--sign-backend=gpg` with a passphrase wrapper — required on dpkg 1.23+ so auto/Sequoia arg style is not passed to classic `gpg`.

`apt remove` (and `debian/ubuntu-hello.prerm`) deletes `/etc/ubuntu-hello`, including the `config.ini` conffile. dpkg will **not** unpack that deleted conffile on the next `apt install`. `ubuntu-hello.postinst` copies `/usr/share/ubuntu-hello/config.ini` back to `/etc/ubuntu-hello/config.ini` when it is missing; the CLI (`config_ensure.py`) does the same before `add` / `set`. Without that restore, the setup wizard fails with `configparser.NoSectionError: No section: 'video'`.

Keep the **repo root clean**: put new CI/Docker assets under `docker/` (see [AGENTS.md](../AGENTS.md) §4.6.1).

---
Expand Down
8 changes: 8 additions & 0 deletions docs/architecture/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ Agent rules: [AGENTS.md](../../AGENTS.md). Contributor setup: [INSTRUCTIONS.md](
│ ├── recorders/ # Camera plugins
│ ├── rubberstamps/ # Liveness plugins
│ ├── compare.py
│ ├── config.ini # default template (also installed to $datadir)
│ ├── config_ensure.py # restore /etc config.ini when the conffile is missing
│ ├── keyring_crypto.py
│ ├── keyring_restore.py
│ └── wallet_backend.py
Expand Down Expand Up @@ -132,6 +134,12 @@ sequenceDiagram
* **HARD RULE (greeter login):** Never force greeter `pam_get_authtok` / custom `PAM_CONV` when `workaround=off`. That breaks GDM user-selection → login (immediate bounce back to the user list). Canonical: `ask_pass = ask_auth_tok && workaround != Off`. See [AGENTS.md](../../AGENTS.md).
* **Desktop notes**: Face authentication through `common-auth` is DE-agnostic (GDM/SDDM/LightDM). Wallet auto-unlock depends on which AUTHTOK consumer is installed in the PAM stack.

### 2.1.1 Live `config.ini`

The live file is `/etc/ubuntu-hello/config.ini`. The packaged default is `/usr/share/ubuntu-hello/config.ini` (Meson `install_data`; source tree `ubuntu-hello/src/config.ini`).

`apt remove` deletes `/etc/ubuntu-hello` in `debian/ubuntu-hello.prerm`. dpkg then treats `config.ini` as a deleted conffile and **does not** restore it on the next install. `debian/ubuntu-hello.postinst` copies the share template back when the live file is missing. CLI/compare (`config_ensure.py`) do the same so the setup wizard can run `ubuntu-hello set` / `add` without `NoSectionError: video`.

### 2.2 Face Matching Engine (`ubuntu-hello/src/compare.py`)

* **Role**: Orchestrates camera feeds and face detection.
Expand Down
74 changes: 74 additions & 0 deletions docs/releases/v1.1.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# 🚀 Ubuntu Hello v1.1.2 Release

Welcome to the **v1.1.2** release of **Ubuntu Hello**! This patch fixes setup-wizard and face-enrollment failures after **`apt remove` followed by `apt install`**: dpkg does not restore a deleted `config.ini` conffile, so `/etc/ubuntu-hello/config.ini` could be missing and `ubuntu-hello add` crashed with `configparser.NoSectionError: No section: 'video'`. The package now restores the default config from `/usr/share/ubuntu-hello/config.ini` on configure and at CLI/compare runtime.

---

## ✨ Key Enhancements in v1.1.2

* **📄 Config restore after apt remove / reinstall**:
* New `config_ensure.py` copies the packaged default into `/etc/ubuntu-hello/config.ini` when the live file is missing or sectionless (never overwrites an existing config with sections).
* `debian/ubuntu-hello.postinst` restores `config.ini` from `/usr/share/ubuntu-hello/config.ini` during `configure`.
* Meson installs the default template to `/usr/share/ubuntu-hello/config.ini` (`install_data` on `config.ini`).
* `ubuntu-hello` CLI and `compare.py` call `ensure_system_config()` before reading config so `add` / `set` work even if postinst was skipped.
* **🛡️ Graceful handling when config is absent**:
* `VideoCapture` no longer raises `NoSectionError` on a missing `[video]` section — exits with code `14` (invalid device) like a bad `device_path`.
* Settings **Video** tab (`tab_video.py`) treats a missing `[video]` section as `device_path = none` instead of crashing.
* **🖥️ Desktop / greeter / wallet coverage (unchanged targets, config-restore-aware)**:
* Face auth via `common-auth` stays desktop-agnostic with **GDM, SDDM, LightDM**.
* Setup wizard and Settings work on every supported desktop after PPA reinstall:

| Desktop | Face auth | Theme follow | Session wallet auto-unlock |
|---------|-----------|--------------|----------------------------|
| **GNOME / Ubuntu** | Yes | Yes | GNOME Keyring (`pam_gnome_keyring`) |
| **KDE Plasma** | Yes | Yes | **KWallet** (`pam_kwallet5`) |
| **XFCE** | Yes | Yes | GNOME Keyring when present |
| **Cinnamon** | Yes | Yes | GNOME Keyring when present |
| **MATE** | Yes | Yes | GNOME Keyring when present |
| **Budgie** | Yes | Yes | GNOME Keyring when present |
| **LXQt** | Yes | Yes | GNOME Keyring when present |

* CI compat cells (still parallel, Ubuntu 26.04): `baseline`, `gnome`, `kde`, `xfce`, `cinnamon`, `mate`, `budgie`, `lxqt`.
* **🧪 Tests**:
* New `tests/test_config_ensure.py` (restore missing/empty config, postinst copy, Meson share template).
* `tests/test_recorders.py` covers missing `[video]` section in `VideoCapture`.
* `tests/test_paths_factory.py` covers `default_config_file_path()`.

---

## 📥 Installation

### Method 1: Quick Install (Recommended)
Open your terminal and run the universal installer:
```bash
curl -fsSL https://raw.githubusercontent.com/ventura8/ubuntu-hello/master/install.sh | sudo bash
```

### Method 2: PPA (Ubuntu / Linux Mint)
```bash
sudo add-apt-repository ppa:ventura8/ubuntu-hello
sudo apt update
sudo apt install ubuntu-hello
```

If you previously removed Ubuntu Hello and `/etc/ubuntu-hello/config.ini` is missing, upgrade to **v1.1.2** or restore only when the live file is absent:
```bash
sudo test ! -e /etc/ubuntu-hello/config.ini && sudo install -D -m 644 /usr/share/ubuntu-hello/config.ini /etc/ubuntu-hello/config.ini
```

### Method 3: Debian / Manual Package
Download the attached `.deb` package for your architecture, then install it using `apt` or `gdebi`:
```bash
sudo apt install ./ubuntu-hello_1.1.2-1ppa1_amd64.deb
```

---

## 📋 Changelog (v1.1.2)

* **Release**: Version is **`1.1.2`** / **`v1.1.2`** from the repo-root **`VERSION`** file (single source of truth); `debian/changelog` top entry added for this release.
* **Config restore**: `config_ensure.py`; postinst copy from `/usr/share/ubuntu-hello/config.ini`; Meson `install_data` for share template; CLI + compare auto-restore.
* **Robustness**: `VideoCapture` and Settings Video tab tolerate missing `[video]` section.
* **Compatibility**: Unchanged multi-DE / greeter / wallet targets (GNOME, KDE Plasma, XFCE, Cinnamon, MATE, Budgie, LXQt; GDM/SDDM/LightDM; GNOME Keyring + KWallet); CI cells `baseline` + all seven DEs.
* **Docs / agents**: `AGENTS.md`, INSTRUCTIONS, architecture README, `installer-tester` / `test-runner` skills.
* **Tests**: `test_config_ensure.py`, recorder missing-section test, paths_factory default template path.
68 changes: 68 additions & 0 deletions docs/releases/v1.1.2_github_description.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Ubuntu Hello v1.1.2 - Config Restore After apt remove / Reinstall

This patch fixes setup-wizard and face-enrollment failures after **`apt remove` followed by `apt install`**. dpkg does not restore a deleted `config.ini` conffile, so `/etc/ubuntu-hello/config.ini` could be missing and `ubuntu-hello add` crashed with `configparser.NoSectionError: No section: 'video'`. The package now restores the default config from `/usr/share/ubuntu-hello/config.ini` on configure and at CLI/compare runtime.

---

## 📄 Config Restore

* New **`config_ensure.py`** copies the packaged default into `/etc/ubuntu-hello/config.ini` when the live file is missing or sectionless (never overwrites an existing config with sections).
* **`debian/ubuntu-hello.postinst`** restores `config.ini` from `/usr/share/ubuntu-hello/config.ini` during `configure`.
* Meson installs the default template to **`/usr/share/ubuntu-hello/config.ini`**.
* **`ubuntu-hello` CLI** and **`compare.py`** call `ensure_system_config()` before reading config.

**Manual workaround** (pre-v1.1.2, only if the live file is absent):
```bash
sudo test ! -e /etc/ubuntu-hello/config.ini && sudo install -D -m 644 /usr/share/ubuntu-hello/config.ini /etc/ubuntu-hello/config.ini
```

---

## 🛡️ Graceful Degradation

* **`VideoCapture`** no longer raises `NoSectionError` on a missing `[video]` section — exits with code `14` (invalid device).
* Settings **Video** tab treats a missing `[video]` section as `device_path = none`.

---

## 🖥️ Desktop, Greeter & Wallet Compatibility

Face authentication via PAM (`common-auth`) remains **desktop-agnostic** and works with **GDM, SDDM, LightDM**:

| Desktop | Face auth | Theme follow | Session wallet auto-unlock |
|---------|-----------|--------------|----------------------------|
| **GNOME / Ubuntu** | Yes | Yes | GNOME Keyring (`pam_gnome_keyring`) |
| **KDE Plasma** | Yes | Yes | **KWallet** (`pam_kwallet5`) |
| **XFCE** | Yes | Yes | GNOME Keyring when present |
| **Cinnamon** | Yes | Yes | GNOME Keyring when present |
| **MATE** | Yes | Yes | GNOME Keyring when present |
| **Budgie** | Yes | Yes | GNOME Keyring when present |
| **LXQt** | Yes | Yes | GNOME Keyring when present |

* **CI compat matrix** (parallel, Ubuntu 26.04): `baseline`, `gnome`, `kde`, `xfce`, `cinnamon`, `mate`, `budgie`, `lxqt`.

---

## 🧪 Tests

* `tests/test_config_ensure.py` — restore missing/empty config, postinst copy, Meson share template.
* `tests/test_recorders.py` — missing `[video]` section in `VideoCapture`.
* `tests/test_paths_factory.py` — `default_config_file_path()`.

---

## 📥 Installation & Upgrade

### Universal Installer (Recommended)
```bash
curl -fsSL https://raw.githubusercontent.com/ventura8/ubuntu-hello/master/install.sh | sudo bash
```

### Ubuntu PPA
```bash
sudo add-apt-repository ppa:ventura8/ubuntu-hello
sudo apt update
sudo apt install ubuntu-hello
```

**Full Changelog**: [v1.1.1...v1.1.2](https://github.com/ventura8/ubuntu-hello/compare/v1.1.1...v1.1.2)
2 changes: 1 addition & 1 deletion skills.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Canonical agent rules: [AGENTS.md](AGENTS.md). Setup guide: [docs/INSTRUCTIONS.m
| [ci-docker-matrix](.agents/skills/ci-docker-matrix/SKILL.md) | Lint / coverage / per-DE compat Docker CI (`docker/` Dockerfiles) |
| [test-runner](.agents/skills/test-runner/SKILL.md) | pytest + PAM C++ tests |
| [pipeline-runner](.agents/skills/pipeline-runner/SKILL.md) | Full gate: lint → coverage → compat matrix; fix until green |
| [release](.agents/skills/release/SKILL.md) | Release notes from **all** branch changes; amend commit title/body |
| [release](.agents/skills/release/SKILL.md) | Release notes from **all** branch changes; amend commit title/body (latest: v1.1.2 config restore) |
| [installer-tester](.agents/skills/installer-tester/SKILL.md) | install.sh / uninstall.sh tests |
| [pam-verifier](.agents/skills/pam-verifier/SKILL.md) | PAM lifecycle / face-skip / UH1 |
| [resolve-pr-comments](.agents/skills/resolve-pr-comments/SKILL.md) | Resolve PR review threads |
Expand Down
Loading