-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Consider using XDG_STATE_HOME instead of cache folder for local config #9738
Comments
.local/share is explicitly not the location we want to store these things in. XDG_STATE_HOME is new and might be worth considering. At the time we implemented this, .local/cache was the closest to a semi-persistent location. XDG_CACHE_HOME is not a temporary folder, so IMHO any distribution that deletes it automatically on reboot or puts the contents in a tmpfs does it wrong. |
You're right, XDG_CACHE_HOME is not explicitely described as being volatile, but it is considered "non-essential". There shouldn't be any detrimental effects to deleting it, other than increased delays during app startup and runtime ;) Doing so requires me to e.g. setup my KXC window again tho, which shouldn't be the case. XDG_STATE_HOME is probably the better place for it tho. |
I gave the spec a quick look, i think
Should we consider XDG_CONFIG_HOME? as this looks much like a config file. |
There is a separate keepassxc.ini already in XDG_CONFIG_HOME. I assumed there was a reason for this separation. |
The INI under ~/.local/cache contains non-essential machine-specific state information, such as the window geometry. On Windows, this is under %LocalAppData%. Linux, so far, didn't have a location for it, but now apparently does. |
Keepassxc saves application state at XDG_CACHE_HOME which can be cleared on some systems periodicly. This is not desireable as app state like window size is not consistent when openning the app. To avoid this this commit is switching the path to XDG_STATE_HOME which is more fitting based on the freedesktop basedir spec (https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html), this will allow to prevent state file deletion as well. Solves keepassxreboot#9738
Keepassxc saves application state at XDG_CACHE_HOME which can be cleared on some systems periodicly. This is not desireable as app state like window size is not consistent when openning the app. To avoid this this commit is switching the path to XDG_STATE_HOME which is more fitting based on the freedesktop basedir spec (https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html), this will allow to prevent state file deletion as well. Resolves #9738
Excellent, thanks a lot! |
Keepassxc saves application state at XDG_CACHE_HOME which can be cleared on some systems periodicly. This is not desireable as app state like window size is not consistent when openning the app. To avoid this this commit is switching the path to XDG_STATE_HOME which is more fitting based on the freedesktop basedir spec (https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html), this will allow to prevent state file deletion as well. Resolves keepassxreboot#9738
Overview
Transient data such as last active database, GUI size/settings are stored in
~/.cache/keepassxc/kepassxc.ini
. This means this data is prone to being deleted (as cache directories might be cleared during logout/reboot or reside on volatile storage such as ramdisks to begin with. These settings are not caches, they should go into~/.local/share/
or~/.local/state/
(or rather XDG_DATA_HOME) instead.Steps to Reproduce
~/.cache/
Expected Behavior
Use
~/.local
insteadActual Behavior
Uses
~/.cache
Context
XDG_DATA_HOME is part of the Freedesktop basedir spec.
KeePassXC - Version 2.7.5
Revision: 9d0537b
Qt 5.15.10
Debugging mode is disabled.
Operating system: Gentoo Linux
CPU architecture: x86_64
Kernel: linux 6.1.41-gentoo-HH
Enabled extensions:
Cryptographic libraries:
Operating System: Linux
Desktop Env: XFCE
Windowing System: X11
Thanks!
The text was updated successfully, but these errors were encountered: