oxen-io / session-desktop

Session Desktop - Onion routing based messenger
https://getsession.org
GNU General Public License v3.0
1.48k stars 190 forks source link

[Question] Where are all data files of session located at (in linux)? #2889

Open Sp3rick opened 12 months ago

Sp3rick commented 12 months ago

In what folder does session store all data in linux? (in my case Ubuntu 23)

RubenGarcia commented 11 months ago

~/.config/Session

Sp3rick commented 11 months ago

~/.config/Session

thanks

~/.config/Session is commonly used to store configurations files on linux, I advise to change it to ~/.local/share/Session

beantaco commented 11 months ago

~/.config/Session is commonly used to store configurations files on linux, I advise to change it to ~/.local/share/Session

Since your original question has been answered, I suggest closing this issue and opening a new issue, for example, one for your suggestion.

Would you be able to cite references that explain the purposes of ~/.config and ~/.local/share?

Do you think everything should be moved to ~/.local/share/Session, or should config and user be separated?

A complication that I see is ~/.config/Session stores both configuration and user data. Assuming for a moment that configuration should be stored in ~/.config/Session and user data should be stored in ~/.local/share/Session, dividing the two would be a task, and modifying the code to place the user data would be another. Further, I prefer having everything bundled into one place as it currently is, and I think any separation will cause problems.

Bilb commented 11 months ago

https://www.electronjs.org/docs/latest/api/app

userData The directory for storing your app's configuration files, which by default is the appData directory appended with your app's name. By convention files storing user data should be written to this directory, and it is not recommended to write large files here because some environments may backup this directory to cloud storage.

So it looks we should indead avoid storing large files in that folder. Won't have the time to change that anytime soon though, so I'll keep this issue opened for now.

beantaco commented 11 months ago

By convention files storing user data should be written to this directory, and it is not recommended to write large files here because some environments may backup this directory to cloud storage.

So it looks we should indead avoid storing large files in that folder. Won't have the time to change that anytime soon though, so I'll keep this issue opened for now.

The quoted electronjs documentation raises more questions than answers. So, I assume that means user data should be written to ~/.config/Session but it is not recommended to write large files there, but what about large user data? How large is "large"? Does "large files" simply mean individual files that are larger than a certain size, or a group of files that together are larger than a certain size? I guess the answer to most of these questions is "it depends", but what, if anything, should Session do about it?

More importantly, Session doesn't have any control over what files are backed up to cloud storage, which I assume is environment dependent. Some environments back up ~/.config/Session to cloud storage. Some environments back up other directories. Some environments back up everything. I don't see what Session can sensibly do about this.

If there is an alternative location to ~/.config/Session where all config and data can be stored but is a less-likely target of cloud backup then that might work. However, splitting the config and data in any manner (large vs small, config vs data, etc.) is probably a bad idea.

What's the down side of leaving it as it is?

JeromeSchmied commented 8 months ago

By convention files storing user data should be written to this directory, and it is not recommended to write large files here because some environments may backup this directory to cloud storage.

So it looks we should indead avoid storing large files in that folder. Won't have the time to change that anytime soon though, so I'll keep this issue opened for now.

The quoted electronjs documentation raises more questions than answers. So, I assume that means user data should be written to ~/.config/Session but it is not recommended to write large files there, but what about large user data? How large is "large"? Does "large files" simply mean individual files that are larger than a certain size, or a group of files that together are larger than a certain size? I guess the answer to most of these questions is "it depends", but what, if anything, should Session do about it?

More importantly, Session doesn't have any control over what files are backed up to cloud storage, which I assume is environment dependent. Some environments back up ~/.config/Session to cloud storage. Some environments back up other directories. Some environments back up everything. I don't see what Session can sensibly do about this.

If there is an alternative location to ~/.config/Session where all config and data can be stored but is a less-likely target of cloud backup then that might work. However, splitting the config and data in any manner (large vs small, config vs data, etc.) is probably a bad idea.

What's the down side of leaving it as it is?

So, your question is, what is the downside of storing every user data in ~/.config/Session. First of all, there is an other directory for that, as mentioned before: ~/.local/share/Session. As far as I know, ~/.config is a directory, where only config files should be stored, while in ~/.local/share is for storing application data. The first problem with storing everything in ~/.config/Session, is that things get messed up, and also it takes up a lot of space. That's inconvenient for me, because I'm syncing my ~/.config directory to MEGA, in order to have them(only my configs) safely. But when ~/.config/Session takes up 45MB, 75% of my ~/.config directory then I go crazy.