Beaker: Do not use ~/.config to store substantial amounts of data

Created on 31 May 2017  路  9Comments  路  Source: beakerbrowser/beaker

Operation System: Ubuntu 17.04
Beaker Version: 0.7.1

On importing data into sites, it seems as if Beaker caches all the data in the .config folder in the user's home directory. While that's not a big problem, it seems a bit an unexpected use of that folder. It might be better to either use ".local" or the "Sites" folder for those purposes.

In my case, I have limited disk space for my home directory, I moved the "Sites" folder to an external hard drive and expected all the copies of files I host to be saved there; I did not expect the ".config" folder to grow to several GB.

enhancement

All 9 comments

Ah, yes this is actually from the browsing cache for temporary Dat sites. There are two issues at play.

  1. I haven't yet implemented the garbage collector for temporary dats (https://github.com/beakerbrowser/beaker/issues/144). I think now's the time to do that, though, so I'll add that to my 0.7.2 todo list.
  2. There's a difference in platform opinions between osx and linux. I agree, ~/.config is a weird place to keep the cache.

RE point 2, I suppose the system Temp directory would make sense, yeah?

I went for a walk and remembered that it's more than the browsing cache; it's also the internal data structures of the sites you created, and the blobs containing historic versions of each file.

RE point 2, I suppose the system Temp directory would make sense, yeah?

Or perhaps the Sites dir, as you suggest. ~/Sites/.beaker perhaps.

Sounds good to me!

Cool, we'll setup a new path and a bit of code to migrate it.

We're a little concerned that somebody might delete ~/Sites/.beaker without knowing what it is.

There are two paths that are used for Beaker, the user-data path and the sites dir. Both are configurable by environment vars. User-data is where the internal dat data structures are put. In OSX, the user-data path goes under ~/Library/Application Support/Beaker Browser which makes sense. In linux, I'd probably expect it to go to ~/.beaker.

WDYT of that change - keep storing dat internal data inside the user-data path, but default the user-data path to ~/.beaker in Linux instead of under ~/.config ?

This seems to be relevant:
https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

I'd say ~/.cache/beaker for the non-essential stuff and ~/.local/share/applications/beaker for general non-configuration data (but respecting the environment variables as laid out there)

~/.local/share/beaker if you're going there, not applications/, that's for user .desktop files

It turns out that we can't exert fine-grained control over Chromium's data storage until Electron makes an upstream fix. See https://github.com/electron/electron/issues/8124.

We can control where Dat data is stored, and we can control where all Chromium data is stored (caches, local storage, cookies, etc) and that's it. We can't properly separate Chromium's caches and user-data.

Do we want to move the Dat data to ~/.local/share/beaker/dat for now? Is it worth adding that complexity if we can't fully solve the problem?

Closing as outdated

Was this page helpful?
0 / 5 - 0 ratings