Need personal-files interface usage approval

Hi,

I have created a new app called EncLock which was rejected to be released because of the personal-files interface used.

This is what I am trying to accomplish. It is important that the user data stored in EncLock is persistent unless the user deliberately deletes the data files. To accomplish this I added the following to the snap:

plugs:
dot-enclock:
interface: personal-files
write:
- $HOME/.enclock

If the data is stored in the snap $HOME ( /home//snap/enclock/) it appears that once you remove/uninstall a snap from the computer all the files and directories in it get removed with it. That is not something I want. I need the data that is stored/created with EncLock to be in a permanent location and not removed by anything unless the user chooses to do so. What is the recommended way to accomplish this with a snap so that even if the snap is uninstalled the user still has access to their data? This way if they reinstall the snap they can reuse the previously stored/created data.

Thanks!

You are right that files in $SNAP_USER_DATA (ie. ~/snap/enclock/<revision>/) do get removed when the snap is uninstalled, however, files in $SNAP_USER_COMMONare retained (ie.~/snap/enclock/common`) - so if you store this file there then it will be persistent AND you won’t need special permissions. Could you try this instead? (see https://snapcraft.io/docs/environment-variables for more details)

@alexmurray thanks for the response. I appreciate it.

I tried using the ~/snap/enclock/common directory but upon removal of EncLock (snap remove enclock) that directory got removed as well and I saw a new directory created ~/snap/enclock/.data where my data was transferred to upon removal. So I decided to create my own directory ~/snap/enclock/.enclock instead of using the common dir. I snap removed enclock and the .enclock directory retained. Would this location (~/snap/enclock/.enclock) be acceptable as far as snap ecosystem goes? Is that a good location to store data permanently?

Also, any ideas why ~/snap/enclock/common did not retain in my case upon removing the app?

It appears a release in strict confinement and candidate channel the app does not have permissions to create a dir in ~/snap/enclock/ which I find it to be super odd. The ~/snap/enclock/common does get removed upon snap remove. What is my solution to permanently store data for my app?

Moving discussion re personal-files use to the other thread Request for personal-files for enclock