flathub / com.brave.Browser

https://flathub.org/apps/details/com.brave.Browser
Mozilla Public License 2.0
42 stars 16 forks source link

KeePassXC Flatpak Integration Does Not Function #381

Open AManNeedsAMaid opened 1 year ago

AManNeedsAMaid commented 1 year ago

Hello,

I'm experiencing an issue where Flatpak KeepassXC and Flatpak Brave browser will not communicate with each other as expected. I've tried many solutions in other github issues and forum posts, and none work.

Shouldn't the default permissions of both the Brave flatpak and KeePassXC flatpak be altered so that they work together out of the box?

Also, what can I do as a temporary solution?

MrQvest commented 1 year ago

This is an issue with the flatpak browser. See: https://github.com/keepassxreboot/keepassxc/issues/2656

puccaso commented 6 months ago

I have been having this issue for quite some time now. i have run both keepassxc and brave with debug output and i see a Lack of Direct References to KeePassXC's Unix Domain Socket: There is no explicit reference to the KeePassXC's Unix Domain socket (e.g., /run/user/1000/app/org.keepassxc.KeePassXC/org.keepassxc.KeePassXC.BrowserServer). This could be important because Brave needs access to this socket for the KeePassXC extension to work properly. i have attempted to add this, but maybe im doing it wrong, because it still doesnt work.

adding using:

sudo flatpak override --filesystem=/run/user/1000/app/org.keepassxc.KeePassXC com.brave.Browser

also i have seen references to a proxy daemon of sorts that is expected by keepassxc, but i cant find that on my system either.

hope we can think through this and find a solution!

puc

repsac-by commented 1 month ago

@puccaso, When you enable Brave integration, keepassxc puts the native messagine file ~/.config/BraveSoftware/Brave-Browser/NativeMessagingHosts/org.keepassxc.keepassxc_browser.json

This is incorrect for flatpak applications, this file should be placed at path ~/.var/app/com.brave.Browser/config/BraveSoftware/Brave-Browser/NativeMessagingHosts/org.keepassxc.keepassxc_browser.json.

Also in this file you should specify the path to the keepassxc-proxy executable file, and the keepassxc-proxy itself should also be placed in the specified location.

This is what I got in the end:

$ flatpak override --user com.brave.Browser --filesystem=xdg-run/app/org.keepassxc.KeePassXC
$ cat > ~/.var/app/com.brave.Browser/config/BraveSoftware/Brave-Browser/NativeMessagingHosts/org.keepassxc.keepassxc_browser.json <<EOF
{
  "allowed_origins": [
    "chrome-extension://pdffhmdngciaglkoonimfcmckehcpafo/",
    "chrome-extension://oboonakemofpalcgghocfoadofidjkkk/"
  ],
  "description": "KeePassXC integration with native messaging support",
  "name": "org.keepassxc.keepassxc_browser",
  "path": "/var/config/BraveSoftware/Brave-Browser/NativeMessagingHosts/keepassxc-proxy",
  "type": "stdio"
}
EOF
$ git clone https://github.com/varjolintu/keepassxc-proxy-rust.git
$ cd keepassxc-proxy-rust
$ RUSTFLAGS="$RUSTFLAGS -C target-feature=+crt-static" cargo build --release
$ cp target/release/keepassxc-proxy ~/.var/app/com.brave.Browser/config/BraveSoftware/Brave-Browser/NativeMessagingHosts

Good luck