containers / podman-desktop

Podman Desktop is the best free and open source tool to work with Containers and Kubernetes for developers. Get an intuitive and user-friendly interface to effortlessly build, manage, and deploy containers and Kubernetes — all from your desktop.
https://podman-desktop.io
Apache License 2.0
4.59k stars 293 forks source link

Respect XDG base directory specification #1770

Open baodrate opened 1 year ago

baodrate commented 1 year ago

Is your feature request related to a problem? Please describe

Currently, podman-desktop stores settings in ~/.local/share/containers/podman-desktop

https://github.com/containers/podman-desktop/blob/de1aa71c47570437a44ce99f36b4b22742601e6b/packages/main/src/plugin/configuration-registry.ts#L118

https://github.com/containers/podman-desktop/blob/de1aa71c47570437a44ce99f36b4b22742601e6b/packages/main/src/util.ts#L34-L37

(this is separate from the electron-app config files which are stored at ${XDG_CONFIG_HOME:-$HOME/.config}/Podman Desktop).

Describe the solution you'd like

podman-desktop should respect the XDG Base Directory specification by recognizing the XDG_DATA_HOME variable (if set) and use that instead of ~/.local/share.

Although ideally, since these are settings files, they should be stored in XDG_CONFIG_HOME (falling back to ~/.config)

Describe alternatives you've considered

No response

Additional context

No response

mjfinney commented 11 months ago

Also podman machine start apparently respects XDG_DATA_HOME and puts the API forwarding socket in the right location but podman desktop looks for the API socket in this location ~/.local/share/containers/podman/machine/qemu/podman.sock instead of $XDG_DATA_HOME/containers/podman/machine/qemu/podman.sock.

This causes podman desktop to tell you the machine is running but it isn't able to communicate with it.

lemaral commented 10 months ago

Also podman machine start apparently respects XDG_DATA_HOME and puts the API forwarding socket in the right location but podman desktop looks for the API socket in this location ~/.local/share/containers/podman/machine/qemu/podman.sock instead of $XDG_DATA_HOME/containers/podman/machine/qemu/podman.sock.

This causes podman desktop to tell you the machine is running but it isn't able to communicate with it.

I have just hit this issue on MacOS, is there a recommended work-around (except unsetting XDG_DATA_HOME or linking them together)? I could not find a way to set the path of the socket in Podman Desktop

github-actions[bot] commented 4 months ago

This issue has been automatically marked as stale because it has not had activity in the last 6 months. It will be closed in 30 days if no further activity occurs. Please feel free to leave a comment if you believe the issue is still relevant. Thank you for your contributions!

baodrate commented 4 months ago

Not stale, AFAIK

ariellourenco commented 1 month ago

As neither of the above-mentioned directories, ~/.local/shared and /.config, are Windows-native the final implementation should consider fallback to AppData. The root of the user directory (%USERPROFILE%) is NOT the right place to store application settings. On Windows, the correct location for application settings is %APPDATA% and the correct location for cache/large data is %LOCALAPPDATA% or %PROGRAMDATA% (depending on level of security consciousness).