abextm / keepassxc-runelite

BSD 2-Clause "Simplified" License
5 stars 4 forks source link

Unable to use plugin with Flatpak or AppImage KeePassXC #11

Closed Jademalo closed 2 years ago

Jademalo commented 2 years ago

I'm on a Steam Deck, and trying to solve the problem of difficulty logging in with Runelite. This addon seems to be ideal, however I'm struggling to get it to work.

Since the Steam Deck has a locked filesystem, my only real options that won't get erased with a system update are the Flatpak install and the AppImage.

When using the Flatpak install, the plugin will open the window however will never actually work. Everything is correctly enabled, but it just sits on the Cannot connect screen. If I click retry, it just opens the window to the database again.

The AppImage version does the same thing, simply re-opening the window without any further prompts.

The config is set up correctly and should work. image

Here's the error I'm getting from the log;

2022-08-14 13:03:21 [KeePassXCSocketConnection] WARN  abex.os.keepassxc.KeePassXcPanel - error connecting to KeePassXC
abex.os.keepassxc.proto.IOTimeoutException: Hit deadline
    at abex.os.keepassxc.proto.InterruptableInputStream.check(InterruptableInputStream.java:30)
    at abex.os.keepassxc.proto.InterruptableInputStream.read(InterruptableInputStream.java:46)
    at com.google.common.io.LittleEndianDataInputStream.readAndCheckByte(LittleEndianDataInputStream.java:231)
    at com.google.common.io.LittleEndianDataInputStream.readInt(LittleEndianDataInputStream.java:117)
    at abex.os.keepassxc.proto.KeePassXCSocket.init(KeePassXCSocket.java:109)
    at abex.os.keepassxc.KeePassXcPanel.lambda$load$2(KeePassXcPanel.java:63)
    at java.base/java.lang.Thread.run(Unknown Source)

Any ideas?

Jademalo commented 2 years ago

Good news! Made some progress. I've got a workaround for the appimage version, though feels rather inelegant.

Looking at the launch script for the appimage, it seems like adding "proxy" afterwards when launching the image loads the proxy executable. This means that if I set the following script as the custom proxy location in the advanced browser integration settings of KeePass, it seems to fix things and the plugin works properly;

#!/bin/sh
exec $HOME/Documents/Scripts/KeePassXC-*.AppImage proxy

I don't know how useful this is in terms of fixing it on your end, but it does mean that it should work in theory.


This works fine if Runelite is run directly via the appimage, though if I try to run it through steam with the command "/home/deck/.steam/steam/steamapps/common/Old School RuneScape/bin/win64/RuneLite.AppImage" %command% I get a new error.

2022-08-14 13:59:29 [KeePassXCSocketConnection] WARN  abex.os.keepassxc.KeePassXcPanel - error connecting to KeePassXC
java.io.IOException: Nonce mismatch
    at abex.os.keepassxc.proto.KeePassXCSocket.call(KeePassXCSocket.java:208)
    at abex.os.keepassxc.proto.KeePassXCSocket.ensureAssociate(KeePassXCSocket.java:267)
    at abex.os.keepassxc.proto.KeePassXCSocket.init(KeePassXCSocket.java:132)
    at abex.os.keepassxc.KeePassXcPanel.lambda$load$2(KeePassXcPanel.java:63)
    at java.base/java.lang.Thread.run(Unknown Source)
abextm commented 2 years ago

This should be fixed in 54ac56afa46a11fbdbce47c90c0cd7b5970b5222 and 7c386c59e41c8c120d4dbdf8d87b7ff3101f5a9a which are released as v1.1.2

Jademalo commented 2 years ago

Good news and bad news, this has fixed the issue with the AppImage version, however hasn't fixed it for the Flatpak version. The Flatpak version still has the same issue where it shows the "Cannot connect" error, and when clicking retry simply brings the keepass window to the foreground.

I think the bug is that the keepassxc flatpak wrapper is looking for [[ "$1" =~ "${arg1}" ]] || [[ "$2" =~ "${arg2}" ]], with arg2='keepassxc-browser@keepassxc.org' only matching if it's the second argument, and the fix in 7c386c5 has it as the first argument. This might actually be a bug with the keepassxc flatpak wrapper, I'm not sure.