-
-
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
Move local config from ~/.cache to ~/.local/share on Linux #5325
Conversation
Some users have ~/.cache mounted on tmpfs which meant that the 'Recent Databases' were lost after every reboot. Move that config to ~/.local/share which is meant for this kind of data.
Cache is just the wrong place to have on a tmpfs. |
You should move a config file currently in cache to the new location. |
I am actually again merging this. Putting .cache on a tmpfs is like deleting your cookies when you close the browser and then complaining about having to re-login on every website. |
I can't disagree with that, but others have rightly stated there are no other config files being stored in .cache. perhaps at the very least we can detect if .cache is on tmpfs and use .local instead. |
On a side note, the migration from 2.5.4 to (e.g.) 2.6.1 didn't work either (excerpt from
I'll see what I can do so at least the stable versions don't get their state reset. |
The things we store there are technically not config options. |
I've looked into this a bit but I'm not sure how to properly do that. Is it okay if I just move the config file at the start of the |
Bumping the config version and putting it in migrate is a good idea. |
|
Well then how about keepassxc_local.ini on Linux. |
@phoerious What's wrong with ~/.local/share ? That's the location for non-config user-specific application data. |
Let me reply to @phoerious . I don't want to fight you but only share my perspective.
IMHO it's wrong assumption that
Web browsers have own cache also so I would say that deleting .cache is the same as deleting web browsers' cache. That triggers redownload of all images and open tabs but does not delete open tabs or cookies. |
.cache is for "non-essential" (i.e. disposable) user data and it is supposed to store a lot of it such as image thumbnails. Putting that on a tmpfs is the wrong thing to do for several reasons, even though the Debian project may see that differently. The XDG spec says nothing about it being "volatile", contrary to XDG_RUNTIME_DIR. In fact, I would even argue that losing your KeePassXC local config when deleting the contents of .cache is exactly desired behaviour. Similar to Windows's disk cleanup feature, you would want things like your KeePassXC file history to be deleted when you decide to clear .cache. |
It looks like XDG spec says almost nothing about $XDG_CACHE_HOME which is kind of sad. So assuming that it will be purged rarely/frequently is wrong. But it can be purged at some point. Interesting... I guess my last question would be: is file history in kepassxc really "non-essential"? |
I see it very much like cookies. Yes, it is essential for most in most circumstances, but it is disposable and for certain users it is absolutely crucial that it is so. |
Cookies aren't stored in cache - they are still there when you delete the cache. I consider cache as something e.g. when you have a big complicated file where you need to extract certain information which takes long - then you put the result into the cache and you read from cache next time so it's faster. If the cache is deleted it doesn't matter at all because it will just read the original file again and regenerate the cache. |
Not true. When you use the disk cleanup feature on Windows, you can select to clean up cookies as well next to any other disposable, temporary, or volatile data. |
I don't think we will get anywhere with this discussion. But as 6 people (including me) have complained in either #4911 or #5313 that having the list on ~/.cache clears the list when they don't want to I hope you reconsider and allow the list to be put into ~/.local/share (or anywhere away from ~/.cache). |
I'm in favor of an ENV VAR solution... |
Source: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html "There is a single base directory relative to which user-specific non-essential (cached) data should be written. This directory is defined by the environment variable $XDG_CACHE_HOME." |
Iit is safe. You di not lose any essential settings. And only because the format is ini doesn't make it a config file. Ini is just a generic key-value format. |
I will only merge this if it uses the env var solution i mentioned above. No need to move the config file in that case. Documentation needs to be updated to point out the env var as well. |
Sorry, I'm not willing to implement a solution which uses environment variables to achieve this. In my opinion (and I've talked with a couple of other people about this) the list of recently used files definitely doesn't belong into ~/.cache but into ~/.local/share (I agree that ~/.config was incorrect but ~/.cache is way worse). If you're not willing to accept the PR in its current form please close it. |
Suit yourself, I'll do it myself |
Some users have ~/.cache mounted on tmpfs which meant that the
'Recent Databases' were lost after every reboot. Move that config to
~/.local/share which is meant for this kind of data.
Fixes #4911
Fixes #5313
Testing strategy
~/.local/share/keepassxc/keepassxc.ini
gets created now and not~/.cache/keepassxc/keepassxc.ini
Type of change
I wasn't sure which branch to target with this PR, it's currently targeting develop, #5313 has the milestone v2.6.2