flatpak / flatpak-docs

Flatpak documentation
https://docs.flatpak.org
Other
79 stars 132 forks source link

Add where to store data #471

Closed niccokunzmann closed 3 months ago

niccokunzmann commented 3 months ago

As a new app developer, I spent an hour figuring out where to store the data really and how. This change says it right at the start of the document.

Hm. /tmp is not mentioned here but the state is: https://docs.flatpak.org/en/latest/conventions.html#xdg-base-directories

bbhtt commented 3 months ago

These directories are basically ~/.var/app/app-id/cache, config etc. and XDG_ directories inside the sandbox.

You just store in XDG cache or config directories like you would without flatpak and it will work out of the box.

hfiguiere commented 3 months ago

Flatpak is for user applications, you shouldn't store anything in /var. As I mentionned on the review you should comply with XDG dir specification.

niccokunzmann commented 3 months ago

I would like to improve the documentation for newcomers. I could create a section on where to store stuff. Right now, the impression is that you need to add parameters for storage. I can also write more but if my attempts are not merged when they are small, I will not make big ones.

razzeee commented 3 months ago

I would like to improve the documentation for newcomers. I could create a section on where to store stuff. Right now, the impression is that you need to add parameters for storage. I can also write more but if my attempts are not merged when they are small, I will not make big ones.

If you're storing according to XDG directory spec (using the ENV vars), you don't need to do anything. Which would be nice to call out, if that's not the case.

bbhtt commented 3 months ago

"where to store stuff" is not Flatpak specific, it doesn't really belong here.

niccokunzmann commented 3 months ago

"where to store stuff" is not Flatpak specific, it doesn't really belong here.

I would say that it does: Flatpak modifies some variables and maps them to other places. Also it documents how to map storage. I my eyes it would help if, the documentation clarifies what is not touched, what is expected and what is modified specifically to be supported. In this case, I would change the documentation to mention the XDG_ variables so that newcomers who wonder about where to store files have a clear path forward: no additional permissions need adding and this is what we expect you to do.

Also, I wonder: If I have problems getting my head around this, then I would say other newcomers also have that problem. Instead of not writing anything, I would suggest the path of writing more and more and then restructure what has been written once it it clear where the documentation belongs.

bbhtt commented 3 months ago

I would change the documentation to mention the XDG_ variables so that newcomers who wonder about where to store files have a clear path forward

That's a general app development issue/guideline.

The only thing to document here is how and what Flatpak modifies which is already documented:

https://docs.flatpak.org/en/latest/conventions.html#xdg-base-directories

niccokunzmann commented 3 months ago

I created #472 as a follow-up of the discussion.