Request for personal-files confinement for fuzzit CLI

Hi all,

we have a CLI for our product and we need access to the CLIs configuration/cache file which is located at ~/.fuzzit.cache. The CLI is open-source if that helps.

Can you please approve or suggest a different method path to store configuration for our cli?

Thanks,
Yevgeny

@reviewers can someone take a look here?

The personal-files interface is intended to be used for importing data from non-snap installs where the snap is the clear owner of the file/directory. While the fuzzit snap is the clear owner of the ~/.fuzzit.cache path, it isn’t clear why the snap-specific $HOME (ie, ~/snap/fuzzit/<revision>) cannot be used. Can you provide more detail?

Hi @jdstrand thanks for the reply. I’m new to snap so maybe it’s a beginner question. how do I access snap-specific $HOME. In my code I use the standard Golang usr.Home function that returns the HOME directory in a cross-platform way. On linux it return ~/. Is it the wrong way?

@yevgenypats Snap sets $HOME to ~/snap/fuzzit/<revision> inside sandbox.

@Reynolds5 Thanks! I’ll check it out. it didn’t work the first time. Do I need any special permissions for that?

@Reynolds5 I solved this using the following code in go (looks like its ignoring $HOME by default)

home := os.Getenv("HOME")
if home == "" {
	usr, err := user.Current()
	if err != nil {
		return "", err
	}
	home = usr.HomeDir
}
1 Like