Skip to content

Pin browser password store to gnome-libsecret#6065

Closed
nt1998 wants to merge 1 commit into
basecamp:devfrom
nt1998:pin-browser-password-store
Closed

Pin browser password store to gnome-libsecret#6065
nt1998 wants to merge 1 commit into
basecamp:devfrom
nt1998:pin-browser-password-store

Conversation

@nt1998

@nt1998 nt1998 commented Jun 10, 2026

Copy link
Copy Markdown

Chromium and Brave auto-detect their os_crypt backend at launch. On Hyprland the xdg-desktop-portal Secret backend has no provider (gnome-keyring.portal is UseIn=gnome; the portal preference is hyprland;gtk), so it fails — observable in ~/.config/chromium/Local State as os_crypt: {"portal":{"prev_desktop":"Hyprland","prev_init_success":false}}. Per the official Chromium docs, it then "will fall back to basic if a requested or autodetected store is not available."

basic uses a hardcoded key (v10). When a launch lands on basic instead of gnome-libsecret (v11), previously encrypted cookies and saved passwords become undecryptable and are silently dropped — the user is logged out of everything, sometimes with a "create new keyring" prompt. This recurs across reboots/updates whenever the fallback target changes.

Fix

Pin --password-store=gnome-libsecret so the backend is deterministic and the flaky portal autodetect is skipped. Omarchy already pins this exact value for VSCode (bin/omarchy-install-vscode writes "password-store":"gnome-libsecret" to argv.json), so this just aligns the browser defaults with existing intent. The Arch chromium/brave launcher reads *-flags.conf, so it also covers web-apps launched via omarchy-launch-webapp.

Changes

  • Add the flag to the shipped default config/chromium-flags.conf.
  • migrations/1781079205.sh: idempotently add the flag to existing chromium-flags.conf and brave-flags.conf, mirroring the precedent in migrations/1771188969.sh.

Notes

  • Electron apps that bundle their own Electron (Slack, Signal, etc.) do not read a *-flags.conf and can still hit a backend swap; out of scope here.
  • gnome-libsecret is correct for the stock omarchy secret service (gnome-keyring).

Refs

Chromium and Brave auto-detect their os_crypt backend at launch. On Hyprland
the xdg-desktop-portal Secret backend has no provider (gnome-keyring.portal is
UseIn=gnome; portal preference is hyprland;gtk), so it fails
(os_crypt.portal.prev_init_success=false in Local State) and the browser falls
back per the Chromium docs to the 'basic' v10 store. When a launch lands on
basic instead of gnome-libsecret (v11), previously encrypted cookies and saved
passwords become undecryptable and are silently dropped, logging the user out
of everything.

Pin --password-store=gnome-libsecret so the backend is deterministic. Omarchy
already pins this exact value for VSCode (omarchy-install-vscode), so this
aligns the browser defaults with existing behavior. A migration adds the flag
to existing chromium-flags.conf and brave-flags.conf, mirroring migration
1771188969.sh.
Copilot AI review requested due to automatic review settings June 10, 2026 08:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a migration and default Chromium flags to pin the browser password store to gnome-libsecret, preventing loss of cookies/saved logins when the auto-detected backend changes (e.g., on Hyprland).

Changes:

  • Introduce a migration that appends --password-store=gnome-libsecret to existing user Chromium/Brave flags configs when not already set.
  • Add --password-store=gnome-libsecret to the repository’s default config/chromium-flags.conf.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
migrations/1781079205.sh Migration to enforce deterministic password-store backend for Chromium/Brave user configs.
config/chromium-flags.conf Default Chromium flags now include --password-store=gnome-libsecret.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread migrations/1781079205.sh
# undecryptable, so the browser silently drops them and the user is logged out of everything.
# Pin gnome-libsecret so the backend is deterministic across reboots and updates.
for conf in ~/.config/chromium-flags.conf ~/.config/brave-flags.conf; do
if [[ -f $conf ]] && ! grep -q -- '--password-store=' "$conf"; then
Comment thread migrations/1781079205.sh
Comment on lines +8 to +12
for conf in ~/.config/chromium-flags.conf ~/.config/brave-flags.conf; do
if [[ -f $conf ]] && ! grep -q -- '--password-store=' "$conf"; then
echo '--password-store=gnome-libsecret' >> "$conf"
fi
done
Comment thread migrations/1781079205.sh
@@ -0,0 +1,12 @@
echo "Pin browser password store to gnome-libsecret (prevents cookie/login loss on Hyprland)"
dhh added a commit that referenced this pull request Jul 20, 2026
Chromium-based browsers auto-detect their os_crypt backend at launch. On
Hyprland the xdg-desktop-portal Secret backend has no provider, so the
autodetect can fall back to the 'basic' (v10) store, making previously
v11-encrypted cookies and saved passwords undecryptable — the user is
silently logged out of everything. Pin gnome-libsecret (the stock
omarchy keyring) so the backend is deterministic, matching what we
already do for VSCode.

Migration covers chromium, brave, chrome, and edge flags confs for
existing installs.

Co-authored-by: Niklas Tscheppe <ntscheppe@drgt.net>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@dhh

dhh commented Jul 20, 2026

Copy link
Copy Markdown
Member

Thanks for the excellent diagnosis and fix! Merged into quattro as a1e0875 with credit (co-authored-by), plus a couple of tweaks from review: the migration now also covers chrome-flags.conf and microsoft-edge-stable-flags.conf, and guards against a missing trailing newline before appending.

@dhh dhh closed this Jul 20, 2026
katrushenkov pushed a commit to katrushenkov/omarchy that referenced this pull request Jul 20, 2026
Chromium-based browsers auto-detect their os_crypt backend at launch. On
Hyprland the xdg-desktop-portal Secret backend has no provider, so the
autodetect can fall back to the 'basic' (v10) store, making previously
v11-encrypted cookies and saved passwords undecryptable — the user is
silently logged out of everything. Pin gnome-libsecret (the stock
omarchy keyring) so the backend is deterministic, matching what we
already do for VSCode.

Migration covers chromium, brave, chrome, and edge flags confs for
existing installs.

Co-authored-by: Niklas Tscheppe <ntscheppe@drgt.net>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

4 participants