Skip to content
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

How to connect to recent keepassxc source build? #3

Closed
duk3luk3 opened this issue Jan 20, 2018 · 16 comments
Closed

How to connect to recent keepassxc source build? #3

duk3luk3 opened this issue Jan 20, 2018 · 16 comments

Comments

@duk3luk3
Copy link

I am working on keepassxreboot/keepassxc#850 and want to integrate all my work into the native messaging server.

However, I can't seem to connect to it using firefox from either the keepassxc-browser or keepassxc-browser-fork extension.

My KeepassXC build is based off of keepassxreboot/keepassxc@92dd4c0 right now. I built with -DWITH_TESTS=OFF -DWITH_XC_HTTP=ON -DWITH_XC_BROWSER=ON and enabled all the options in "Browser extension with native messaging" in KeepassXC.

The extensions, both keepassxc-browser-fork 0.4.5.1 and and keepassxc-browser 0.4.8, are stuck at "Timeout or not connected to KeePassXC" and I don't see any way to fix it.

I'm using Firefox 57.0.4 on archlinux.

@TheZ3ro
Copy link

TheZ3ro commented Jan 20, 2018

ping @varjolintu

@phoerious
Copy link
Member

It should work with 0.4.8 and the latest KeePassXC develop branch. If your branch is not updated, you will have the wrong browser extension ID.

@duk3luk3
Copy link
Author

Nope, can't get it to work...

KeePassXC version information:

KeePassXC - Version 2.2.4
Revision: 6667b79

Libraries:
- Qt 5.10.0
- libgcrypt 1.8.2

Operating system: Arch Linux
CPU architecture: x86_64
Kernel: linux 4.9.76-1-lts

Enabled extensions:
- Auto-Type
- Browser Integration
- Legacy Browser Integration (KeePassHTTP)

keepassxc.ini [browser] section:

[Browser]
AlwaysAllowAccess=false
AlwaysAllowUpdate=false
BestMatchOnly=false
CustomProxyLocation=
Enabled=true
MatchUrlScheme=true
SearchInAllDatabases=false
ShowNotification=true
SortByUsername=false
SupportBrowserProxy=true
SupportKphFields=true
UnlockDatabase=true
UpdateBinaryPath=false
UseCustomProxy=false

@phoerious
Copy link
Member

phoerious commented Jan 20, 2018

Check your native messaging manifest file if the ID of your browser extension is listed there. If not, you can add it manually.

@duk3luk3
Copy link
Author

What file is that?

@phoerious
Copy link
Member

phoerious commented Jan 20, 2018

For Chrome its

$HOME/.config/google-chrome/NativeMessagingHosts/org.keepassxc.keepassxc_browser.json

Other browsers have similar paths. You can find them in src/browser/HostInstaller.cpp.

@varjolintu
Copy link
Member

@duk3luk3 Have you enabled the browser extension support from KeePassXC settings and added the support (checkbox) for your browser? If so Firefox should use the host file from location .mozilla/native-messaging-hosts/. Open it and check that the path is correct.

If you are using KeePassXC from the build path make sure that the host file path points to the keepassxc-proxy binary location under the build path (/src/proxy/keepassxc-proxy). If it doesn't, you can set the path using the Custom Proxy Location under the Settings.

@phoerious
Copy link
Member

phoerious commented Jan 20, 2018

On Windows, the proxy also only works from its install location, not from the build folder. This is because Windows EXEs have not rpath concept and require their libs to be in the same folder. On Linux, you should be able to start it from the build folder.

@duk3luk3
Copy link
Author

Okay, this is very weird. I confirmed that I had this file in the correct location, and then saw that it refers to the proxy application. It also has the correct path to the proxy application.

After setting the path to the proxy explicitly in the browser-integration options (bug: filename filter *.* means keepassxc-proxy won't show up in the file open dialog, probably an oversight due to not testing on linux) and restarting keepassxc, I got the "accept connection?" dialog to show up once.

I cancelled this dialog, but it created the "keepassxc-browser settings" entry in the database anyway (!)

After that, trying to connect made a dialog box flash on my screen very briefly, and keepassxc then froze. This kept happening through several restarts of keepassxc and firefox, but it has now vanished.

I now seem to have a working connection between keepassxc-browser and keepassxc, but again, this only works if I manually set the proxy path in the keepassxc browser integration options.

@varjolintu
Copy link
Member

It's possible that the accept popup disappeared behind the main window (the fix was merged yesterday) so KeePassXC might have appeared as frozen. Just a wild guess.

Did I understood correctly: now the proxy path points to the keepassxc-proxy under the build folder?

@phoerious
Copy link
Member

phoerious commented Jan 20, 2018

Damn. I fixed the *.* problem days ago. Must have reappeared during a merge. I pushed a fix a @varjolintu's branch which I'm about to merge anyway.

EDIT: wait, that branch was merged yesterday. I'll push it to the translation branch then.

@duk3luk3
Copy link
Author

Any merged fixes I should already have, I'm on revision 6667b79.

It's possible that the accept popup disappeared behind the main window (the fix was merged yesterday) so KeePassXC might have appeared as frozen. Just a wild guess.

It's possible something weird was happening that pushed the popup away to somewhere (I use i3, so floating windows shouldn't disappear, but since i3 isn't that popular it's quite possible some edge condition got hit)

@phoerious
Copy link
Member

Any merged fixes I should already have, I'm on revision 6667b79.

That's the develop branch, which is fine. The filter fix is on keepassxreboot/keepassxc#1407 and not merged yet.

@varjolintu
Copy link
Member

varjolintu commented Jan 20, 2018

@duk3luk3 I also use i3 in Linux so I'll give it a try and see that everything works.

EDIT: Worked just fine and I received all notifications to another desktop where Firefox was running. Also using arch.

@apiraino
Copy link

apiraino commented Jan 23, 2018

Tested with:

I confirm that both components talk to each other after having enabled "Browser integration", I didn't need to add any special keepassxc-proxy param.

However everytime I reload a page with a login form that KeePassXC-Browser 'knows" how to fill, the extension keeps showing me the popup asking for confirmation to retrieve the password; I can only mute that forever ticking the "Remember this decision" checkbox (maybe this is the intended behaviour).

Thanks for making this tool!

@varjolintu
Copy link
Member

@apiraino Yes this in the intended behaviour. If you don't remember the decision the confirmation is asked every time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants