The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(desktop): a missing apparmor_parser is not reported as a rejected profile
Teknium3d16db3a6ef8
diff --git a/hermes_cli/main_desktop_apparmor.py b/hermes_cli/main_desktop_apparmor.pyindex 4067025d881..ba70822bfd4 100644--- a/hermes_cli/main_desktop_apparmor.py+++ b/hermes_cli/main_desktop_apparmor.py@@ -139,7 +139,10 @@ def _profile_parses(parser: str, text: str) -> bool:candidate = Path(scratch) / "hermes-desktop.profile"candidate.write_text(text, encoding="utf-8")completed = _run([parser, "--skip-kernel-load", "--skip-cache", str(candidate)])- if completed is None or completed.returncode != 0:+ if completed is None:+ print("✗ Could not check the generated profile; nothing was written to /etc/apparmor.d.")+ return False+ if completed.returncode != 0:print("✗ apparmor_parser rejected the generated profile; nothing was written to /etc/apparmor.d.")return Falsereturn Truediff --git a/website/docs/user-guide/desktop.md b/website/docs/user-guide/desktop.mdindex 6b3d7a860b7..71e2c9f6290 100644--- a/website/docs/user-guide/desktop.md+++ b/website/docs/user-guide/desktop.md@@ -827,7 +827,7 @@ On Linux, Chromium's own errors go to `HERMES_HOME/logs/desktop-chromium.log`, aOn Ubuntu 23.10 and later, `kernel.apparmor_restrict_unprivileged_userns=1` blocks Chromium's user-namespace sandbox for any program without an AppArmor profile. `hermes desktop` checks this through the Hermes binary itself and then uses Chromium's setuid `chrome-sandbox` helper (root-owned, mode 4755), which asks for `sudo` again after each rebuild. That helper is the recommended route. If the helper cannot be set up either, Desktop starts with `--no-sandbox` and the launcher prints both commands, the helper first.-`hermes desktop --install-apparmor-profile` is the opt-in alternative that survives rebuilds: it installs a profile under `/etc/apparmor.d/` (sudo required) that grants user namespaces to this app's path. Chrome and VS Code get the same grant, but for root-owned binaries. This app's path is usually in a checkout your account can write, so any program running as you could put its own binary there and get the user namespaces the restriction withholds. For your account, that is about the same as turning the restriction off. The command refuses install paths containing AppArmor pattern characters (`? * [ ] { } ^ " \`, see apparmor.d(5) "Globbing"). It checks the profile with `apparmor_parser --skip-kernel-load` before writing anything, and removes the file again if loading it fails.+`hermes desktop --install-apparmor-profile` is the opt-in alternative that survives rebuilds: it installs a profile under `/etc/apparmor.d/` (sudo required) that grants user namespaces to this app's path. Chrome and VS Code get the same grant, but for root-owned binaries. This app's path is usually in a checkout your account can write, so any program running as you could put its own binary there and get the user namespaces the restriction withholds. For your account, that is about the same as turning the restriction off. The command refuses install paths containing AppArmor pattern characters (`? * [ ] { } ^ " \` and non-printable characters; see apparmor.d(5) "Globbing"). It checks the profile with `apparmor_parser --skip-kernel-load` before writing anything, and removes the file again if loading it fails.If Python dependencies are damaged, run the installation's `hermes pm repair`.Then restart Desktop. Do not delete guessed `venv` paths or PM facts. For