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

Access KeePassXC installed as a snap or a Flatpak package #5

Closed
1 task done
purejava opened this issue Feb 8, 2022 · 3 comments
Closed
1 task done

Access KeePassXC installed as a snap or a Flatpak package #5

purejava opened this issue Feb 8, 2022 · 3 comments
Labels
feature-request New feature or request

Comments

@purejava
Copy link
Owner

purejava commented Feb 8, 2022

Please agree to the following

Summary

Today, keepassxc-proxy-access cannot access KeePassXC's proxy, as Flatpak and snap use different $XDG_RUNTIME_DIRs

Motivation

KeePassXC can be installed as a snap package and is also available as a Flatpak package.
Both variants use a different $XDG_RUNTIME_DIR, due to the nature of sandboxed applications.

As keepassxc-proxy-access looks up a general Linux $XDG_RUNTIME_DIR at start-up, this needs to be adjusted to work for snap and Flatpak too.

private String getSocketPath() {
if (SystemUtils.IS_OS_LINUX) {
var path = System.getenv("XDG_RUNTIME_DIR");
if (null == path) path = System.getenv("TMPDIR");
return (null == path) ? "/tmp" : path;
}
if (SystemUtils.IS_OS_MAC_OSX) {
return System.getenv("TMPDIR");
} else {
// unknown OS
return "-";
}
}

Considered Alternatives

No response

Anything else?

KeePassXC installed as Flatpak package:
https://github.com/flathub/org.keepassxc.KeePassXC/blob/83d18532ed41779b1cc0c2861807f3a632bd807a/patch/keepassxc/0003-Flatpak-Support-KeePassXC-Browser-integration.patch#L9-L10

KeePassXC installed as snap package:
https://github.com/keepassxreboot/keepassxc/blob/develop/snap/snapcraft.yaml

Hints on how snap handles the $XDG_RUNTIME_DIR:
https://forum.snapcraft.io/t/rethinking-how-we-handle-xdg-runtime-dir/22223/3

@purejava purejava added the feature-request New feature or request label Feb 8, 2022
@purejava
Copy link
Owner Author

Some additional information:

Test, if KeePassXC is installed via Flatpak or not:

flatpak info org.keepassxc.KeePassXC
Fehler: org.keepassxc.KeePassXC/*unspecified*/*unspecified* not installed

Installed or not:

which keepassxc

Test, if KeePassXC is installed via snap or not:

snap list keepassxc
Fehler: keine passenden Snaps installiert

Once installed:

which keepassxc
/snap/bin/keepassxc

If KeePassXC is installed side-by-side via snap and natively, which finds the native installation:

which keepassxc
/usr/bin/keepassxc

@purejava
Copy link
Owner Author

purejava commented Nov 13, 2022

It has to be considered, that KeePassXC recently changed the handling of the socket file, introduced by KeePassXC release 2.7.2 (see Release notes for KeePassXC 2.7.2, keepassxreboot/keepassxc#8030 and keepassxreboot/keepassxc#8634).
The socket file location changed and is symlinked now too.

Unfortunately, KeePassXC misses to delete the socket file, when KeePassXC exists, as this is required for AF_UNIX sockets. The symlink stays on the filesystem too.

This can be illustrated very nicely with the example of Cryptomator. As of today, keepassxc-proxy-access does work with the following combinations:

  KeePassXC < 2.7.2 (repo) KeePassXC 2.7.2+ (repo)
Cryptomator (installed from repo)
Cryptomator (installed from Flathub) ❌ [1]

[1] fails due to cryptomator/cryptomator#2540

  KeePassXC < 2.7.2 (Flathub) KeePassXC 2.7.2+ (Flathub)
Cryptomator (installed from repo)
Cryptomator (installed from Flathub)

 

  KeePassXC < 2.7.2 (Snap) KeePassXC 2.7.2+ (Snap)
Cryptomator (installed from repo)
Cryptomator (installed from Flathub)

@purejava
Copy link
Owner Author

purejava commented Nov 19, 2022

Starting with release 1.2.0 keepassxc-proxy-access connects to KeePassXC installed as a snap or a Flatpak package too. As Cryptomator shows the usage of keepassxc-proxy-access very well, it is chosen as a reference again:

  KeePassXC < 2.7.2 (repo) KeePassXC 2.7.2+ (repo)
Cryptomator (installed from repo)
Cryptomator (installed from Flathub) ❌ [1]

[1] fails due to cryptomator/cryptomator#2540

  KeePassXC < 2.7.2 (Flathub) KeePassXC 2.7.2+ (Flathub)
Cryptomator (installed from repo)
Cryptomator (installed from Flathub)

 

  KeePassXC < 2.7.2 (Snap) KeePassXC 2.7.2+ (Snap)
Cryptomator (installed from repo)
Cryptomator (installed from Flathub) ❌ [2] ❌ [2]

[2] AFAIK there is no way to access the snap sandbox from within a flatpak sandbox

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

No branches or pull requests

1 participant