keepassxreboot / keepassxc

KeePassXC is a cross-platform community-driven port of the Windows application “Keepass Password Safe”.
https://keepassxc.org/
Other
21.39k stars 1.48k forks source link

flatpak autostart errors #11379

Closed midnight-wonderer closed 1 month ago

midnight-wonderer commented 1 month ago

Overview

Hi there. After https://github.com/keepassxreboot/keepassxc/pull/10563, the .desktop file is now placed at the correct location. 🎉 However, the format is still not right for my setup (Ubuntu), so the application does not start.

Steps to Reproduce

  1. Install the latest version from flatpak
  2. Enable autostart

Expected Behavior

The application should start on reboot.

Actual Behavior

Nothing happened

Context

Content

cat ~/.config/autostart/org.keepassxc.KeePassXC.desktop

shows

[Desktop Entry]
Type=Application
Name=org.keepassxc.KeePassXC
Exec=flatpak run ''\\''org.keepassxc.KeePassXC'\\'''
X-Flatpak=org.keepassxc.KeePassXC

Validation

desktop-file-validate ~/.config/autostart/org.keepassxc.KeePassXC.desktop

shows

~/.config/autostart/org.keepassxc.KeePassXC.desktop: error: value "flatpak run ''\\''org.keepassxc.KeePassXC'\\'''" for key "Exec" in group "Desktop Entry" contains a reserved character ''' outside of a quote

KeePassXC - Version 2.7.9 Revision: 8f6dd13 Distribution: Flatpak

Operating System: Linux Desktop Env: Gnome Windowing System: Wayland

droidmonkey commented 1 month ago

This appears to be a downstream bug with flatpak Portals, not keepassxc

https://github.com/keepassxreboot/keepassxc/blob/develop/src%2Fgui%2Fosutils%2Fnixutils%2FNixUtils.cpp#L184

We don't construct that file we just pass in parameters to dbus. As you can see in our code we don't have any of these slashes or quotes.

droidmonkey commented 1 month ago

Looking at the desktop-portal code, we may need to explicitly set commandline option in the dbus request call to flatpak run org.keepassxc.KeePassXC. Since we don't set that option I can only assume Flatpak runtime sets it when passing the dbus message onto the portal interface. This means the bug may actually be with Flatpak itself?

droidmonkey commented 1 month ago

@midnight-wonderer

I am running Fedora 40 with Gnome 46 and get a proper output from the KeePassXC Flatpak for autostart config:

[Desktop Entry]
Type=Application
Name=org.keepassxc.KeePassXC
Exec=flatpak run org.keepassxc.KeePassXC
X-Flatpak=org.keepassxc.KeePassXC

I am closing this issue because there is either something amiss with your environment or there is a bug external to KeePassXC.