fix(desktop): port upstream Linux secret storage backend fix (Hyprland/Niri) - #78
Merged
Merged
Conversation
…#2916) Ported from upstream pingdotgg#2916 (6f04a5c). Chromium only selects a real keyring backend when XDG_CURRENT_DESKTOP matches a known desktop, so on Hyprland/Niri/Sway sessions Electron lands on basic_text and safeStorage reports encryption unavailable — pairing an environment fails with "Desktop secure storage is unavailable in this system context" even when GNOME Keyring is running. Force --password-store=gnome-libsecret pre-ready for sessions Electron would leave unprotected, honor an explicit linuxPasswordStore desktop setting and any user-provided --password-store switch, import session/dbus env from the login shell, and log the selected backend after ready. Fork adaptations: - rebranded identifiers (@t3tools -> @shuv2code, T3CODE_HOME -> SHUV2CODE_HOME, ~/.t3 -> ~/.shuv2code, t3code wm classes/messages) - kept this fork's scheme privileges and moved its existing synchronous registerDesktopSchemesAsPrivileged() call from main.ts into the new pre-ready layer instead of adding upstream's duplicate registration - dropped upstream's linuxApplicationsDir hunk (belongs to pingdotgg#2915, not merged here)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Pairing an environment from the desktop app on this Hyprland host fails with:
Chromium selects the Linux keyring backend from
XDG_CURRENT_DESKTOPand only recognizes a fixed set of desktops. On Hyprland/Niri/Sway it silently falls back tobasic_text, and Electron'ssafeStorage.isEncryptionAvailable()then reportsfalse(plain-text use requires an explicit opt-in) — even though GNOME Keyring is running withorg.freedesktop.secretson the session bus.DesktopConnectionCatalogStore.setcorrectly refuses to persist without encryption, so pairing dies.Verified at runtime on this host with the packaged Electron (41.5.0):
What
Ports upstream pingdotgg#2916 (
6f04a5cff, merged upstream) onto the fork:DesktopPreReadyPlatform+DesktopEarlyElectronStartup+linuxSecretStorage): before Electron emitsready, force--password-store=gnome-libsecretfor sessions Electron would leave on basic text; leave recognized GNOME-family/KDE desktops alone; honor an explicitlinuxPasswordStoredesktop setting (auto|gnome-libsecret|kwallet|kwallet5|kwallet6) and never override a user-provided--password-storeswitch.DesktopShellEnvironment): preferXDG_CURRENT_DESKTOP/XDG_SESSION_*/DBUS_SESSION_BUS_ADDRESSfrom the login shell and derive a/run/user/<uid>/busfallback, so launcher-inherited stale values don't mislead backend selection.ready.resolveLinuxSecretStorageUnavailableMessage): GNOME Keyring vs KWallet wording, exported for the follow-up error surface as upstream wires it.Fork adaptations
@t3tools→@shuv2code,T3CODE_HOME→SHUV2CODE_HOME,~/.t3→~/.shuv2code, wm classes/messages.registerDesktopSchemesAsPrivileged()frommain.tsinto the new pre-ready layer instead of adding upstream's duplicate registration (Electron allows only one call).linuxApplicationsDirhunk (belongs to un-merged fix(desktop): Include standard Linux AppImage icons for Niri/Noctalia pingdotgg/t3code#2915).Verification
linuxSecretStorage,DesktopEarlyElectronStartup,DesktopPreReadyPlatform,DesktopConnectionCatalogStore,ElectronApp,ElectronProtocol,DesktopEnvironment,DesktopAppSettings,DesktopSavedEnvironments,DesktopShellEnvironment, and mock-updated suites)tsgo --noEmitandvp lintclean for the desktop scopebasic_text/unavailable→gnome_libsecret/availablewith an encrypted round-trip