keepassxreboot / keepassxc-browser

KeePassXC Browser Extension
GNU General Public License v3.0
1.78k stars 188 forks source link

Troubleshooting wiki seems to be missing flatpak guidance #2252

Closed regtm closed 5 months ago

regtm commented 5 months ago

The troubleshooting guide seems to miss information on how to enable DB access between flatpak keepassxc and native firefox (rpm), as is default on fedora 40. I had to manually create a wrapper script to run the keepassxc-proxy inside flatpak and set a custom proxy path, as described in this comment: https://github.com/keepassxreboot/keepassxc-browser/issues/297#issuecomment-429235866

Wrapper script, running the proxy command:

/var/lib/flatpak/exports/bin/org.keepassxc.KeePassXC.proxy 
#!/bin/sh
exec /usr/bin/flatpak run --command=keepassxc-proxy org.keepassxc.KeePassXC "$@"

Configuring the custom path in keepassxc leads to this json file

.mozilla/native-messaging-hosts/org.keepassxc.keepassxc_browser.json 
{
    "allowed_extensions": [
        "keepassxc-browser@keepassxc.org"
    ],
    "description": "KeePassXC integration with native messaging support",
    "name": "org.keepassxc.keepassxc_browser",
    "path": "/run/user/1000/doc/bce4fc4b/org.keepassxc.KeePassXC.proxy",
    "type": "stdio"
}

instead of the default json pointing to the non-existent proxy

.mozilla/native-messaging-hosts/org.keepassxc.keepassxc_browser.json 
{
    "allowed_extensions": [
        "keepassxc-browser@keepassxc.org"
    ],
    "description": "KeePassXC integration with native messaging support",
    "name": "org.keepassxc.keepassxc_browser",
    "path": "/app/bin/keepassxc-proxy",
    "type": "stdio"
}
droidmonkey commented 5 months ago

I've never had an issue with flatpak keepassxc not working out of the box. #297 is extremely old, before we had official flatpak support.

varjolintu commented 5 months ago

I was thinking about this too. There shouldn't be any need for manual scripts etc. anymore.

regtm commented 4 months ago

I've never had an issue with flatpak keepassxc not working out of the box. #297 is extremely old, before we had official flatpak support.

So the initial json is correct and supposed to work? Is fedora possibly packaging kepassxc for flatpak without adding tweaks necessary for native messaging?

varjolintu commented 4 months ago

I've never had an issue with flatpak keepassxc not working out of the box. #297 is extremely old, before we had official flatpak support.

So the initial json is correct and supposed to work? Is fedora possibly packaging kepassxc for flatpak without adding tweaks necessary for native messaging?

The Flatpak should just work without any script or wrapper modifications. If the Flatpak is started with command line parameters, it will launch the keepassxc-proxy process inside the package. If you mix up the normal proxy with Flatpak KeePassXC, there's no guarantee it will work.

regtm commented 4 months ago

Keepassxc flatpak from registry.fedoraproject.org:

{
    "allowed_extensions": [
        "keepassxc-browser@keepassxc.org"
    ],
    "description": "KeePassXC integration with native messaging support",
    "name": "org.keepassxc.keepassxc_browser",
    "path": "/app/bin/keepassxc-proxy",
    "type": "stdio"
}

=> Does not work out of the box Kepassxc flatpak from dl.flathub.org:

{
    "allowed_extensions": [
        "keepassxc-browser@keepassxc.org"
    ],
    "description": "KeePassXC integration with native messaging support",
    "name": "org.keepassxc.keepassxc_browser",
    "path": "/var/lib/flatpak/exports/bin/org.keepassxc.KeePassXC",
    "type": "stdio"
}

=> Does work out of the box. So this seems to be a packaging issue.

droidmonkey commented 4 months ago

Huh I didn't know fedora was also pushing a flatpak registry with keepassxc in it