-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upstream Flathub patches #7728
Upstream Flathub patches #7728
Conversation
@phoerious @droidmonkey This is patch 1/4 of the patches currently on Flathub. |
Where is ID used? |
@droidmonkey It will be used in the next patches, to change some filenames depending on the build type. |
Are you going to put them all into this PR? I would appreciate that. |
Codecov Report
@@ Coverage Diff @@
## develop #7728 +/- ##
========================================
Coverage 64.29% 64.29%
========================================
Files 339 339
Lines 43429 43429
========================================
+ Hits 27920 27922 +2
+ Misses 15509 15507 -2
Continue to review full report at Codecov.
|
@droidmonkey yeah I can do that |
@varjolintu I added you as a reviewer so that you can have a look at the browser extension stuff 🙏 |
@droidmonkey all the patches from Flathub have been added to this PR. |
@louib Tested this quickly in Linux Mint with Firefox, and everything is working with the browser extension. |
@louib Like I said in IRC/Matrix, only Firefox works and creates script files when Browser Integration support is enabled. Maybe this is because of https://github.com/keepassxreboot/keepassxc/blob/develop/src/browser/NativeMessageInstaller.cpp#L223= ? Firefox has always |
Confirmed that Chromium tries to start the Flatpak instead of Also seeing: The wrapper script starts Could it be possible that the wrapper scripts has some kind of bug concerning non-Firefox browsers? I'm trying to investigate this further. EDIT: The script checks against EDIT 2: That was it! I modified the script locally and it worked nicely with the extra |
Enable support for the CMake option: KEEPASSXC_DIST_TYPE=Flatpak. Pre-requisite for other Flatpak specific changes. It also means Flatpak is properly displayed as the distribution type in the app debug tab.
Flatpak isolates application files from the host, but some files must be exported to the host to serve their purpose (ex. desktop entries, icons mime types, etc...). Filenames must however be prefixed by the app id, in reverse-dns notation (org.keepassxc.KeePassXC). If KEEPASSXC_DIST_TYPE=Flatpak is set CMake can now install files with exportable filenames, without affecting other distribution types.
Flatpak browser integration and near feature parity with non-sandboxed distribution types. This is primarily made possible by: 1. The unix socket instead listens at $XDG_RUNTIME_DIR/app/$FLATPAK_ID/ which is host accessible by default. Using the Flatpak permission: --filesystem=xdg-run isn't possible (nor allowed). 2. Including a wrapper script which acts as a workaround to the Flatpak limitation of a single exportable host command per app. Running org.keepassxc.KeePassXC on the host will run this instead of keepassxc directly. There are also some Flatpak specific UX improvements, such as better sandbox compatibility and automatic proxy path detection. Custom locations are disabled because it requires extensive Flatpak knowledge and even then there's isn't any one reliable and easy workaround. What does work - Browser integration, including all supported browsers. - Automatic proxy path detection and updating of manifests. - This works with different Flatpak installations: system, user and custom ones, as long as the path uses safe POSIX portable file names. Limitations and caveats - The browser cannot be sandboxed or it will be unable execute commands in the host namespace, which is currently required to use native messaging; i.e. web browsers cannot be installed as Flatpaks. Note: The Native Messaging Host API would be a lot more sandbox friendly with the addition of D-Bus support, as an alternative to stdio.
Ensure that xdg portals can open attachment files, while simultaneously removing the only critical need for global /tmp access. The path: $XDG_RUNTIME_DIR/app/$FLATPAK_ID is used for flatpak because it exists, respects XDG standards and is host accessible by default. - Fix attachment opening from a flatpak style sandbox - Respect $XDG_RUNTIME_DIR when available - Remove need for needlessly exposing the host /tmp
Upstream the patches from Flathub to enable packaging the app in Flatpak.
Related PR here
Type of change