fleet/orbit/changes
Dan Fuhry 981abf5fce
pkg/open: fix launching browser in some scenarios (#30608)
Fleet Desktop may fail to launch a browser, or launch the wrong browser,
in Ubuntu 24.04 LTS under some scenarios, including Wayland sessions
and/or when the browser is installed as a snap or flatpak (by default,
Ubuntu 24.04 LTS installs Firefox as a snap).

The previous approach of searching for an Xwayland process from which to
extract environment variables is incomplete. When the browser is
installed as a snap, `.desktop` files are installed by snapd into a
location which is only discoverable through the `XDG_DATA_DIRS`
environment variable.

To workaround this we need to change the approach in several ways:

- Look for `xdg-desktop-portal` processes, not just `Xwayland`. Both
Firefox and Chrome support native operation under Wayland now, so it's
not correct to rely upon the existence of an Xwayland process alone.
- Copy several more environment varibles: `XDG_CURRENT_DESKTOP`,
`XDG_RUNTIME_DIR`, `XDG_DATA_DIRS`, and `PATH`, in addition to
`XAUTHORITY`.

These variables allow fleet-desktop to honor the user's browser
preference according to the currently running DE.

The list of variables to grab was found through trial-and-error and
seems to be the minimum required for `xdg-open` to function.

Refactored and optimized the code to fetch environment variables from a
running process to match only processes running as the current user and
robustly handle multiple process results.

Fixes #19043, #27209.

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

<!-- Note that API documentation changes are now addressed by the
product design team. -->

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.
- [ ] Manual QA for all new/changed functionality
- For Orbit and Fleet Desktop changes:
- [ ] Manual QA must be performed in all relevant combinations of Linux
desktop environments.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Improved compatibility for launching browsers installed as Flatpak or
Snap under Wayland sessions on Linux, resolving issues where Fleet
Desktop failed to open these browsers.
* Enhanced environment variable handling to better support browser
launches in containerized and Wayland environments.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-09-15 09:53:04 -05:00
..
.keep Add 'orbit/' from commit 'ab3047bb39f1e2be331d1ff18b4eb768619033c4' 2021-08-04 16:58:25 -03:00
19043-ubuntu-wayland-browser-snap pkg/open: fix launching browser in some scenarios (#30608) 2025-09-15 09:53:04 -05:00
32053-linux-setup-experience-agent Patches for Linux Setup Experience agent (#32655) 2025-09-05 12:46:34 -04:00
32112-revert-to-sudo Fix orbit process launch issues that can hit /proc/keys limits (#32309) 2025-08-28 09:20:32 -05:00
32280-duplicate-desktop-osqueryd When building Linux and macOS fleetd packages, removed duplicate copies of osqueryd and fleet-desktop (#32697) 2025-09-09 17:13:30 -05:00
32393-httpsig-go Updated httpsig-go library to 1.2.0 and removed vendored version. (#32426) 2025-08-28 14:28:30 -05:00
32514-orbit-shell-ignores-updates-disabled Orbit shell no longer ignores disable-updates (#32698) 2025-09-09 15:22:21 -04:00
32695-duplicate-macOS-hosts Fixed duplicate enrolled macOS UUIDs/SNs (#32769) 2025-09-12 15:02:24 -05:00
32756-add-opensuse-detection-logic Fix emoji rendering issue in Fleet Desktop on OpenSUSE (#32756) 2025-09-10 13:04:13 -05:00
update-go-1.25.1 Updated go to 1.25.1 (#32833) 2025-09-11 18:31:39 -05:00