Below is the original post requested the classic confinement, although, over the discussion and trials and errors, I found that I actually need personal-files interface instead. So renamed the post as has been suggested by @alexmurray, and the actual request starts from here Use personal-files interface for dynocsv app.
=== below the original post for access the classic confinement ===
Hi, I am trying to build the snap distribution for one of my open-source tool.
It needs access to the user’s $HOME/.aws to use the right credentials and setting for the AWS profile specified by the --profile option.
I’ve tried the strict confinement and set up the personal-files interface/plug as well as home, although if running in the strict mode the home directory with the app is expanded into something like /home/alex/snap/dynocsv/x1, and obviously there is no ./aws to read config and credentials from.
Of course, I would prefer to use the strict confinement, but from what I found in various sources this is by design that snap has its own $HOME which is different from the actual user’s $HOME. And I am using AWS SDK for Go which relies on the existence of $HOME/.aws with the proper config and credentials there.
I might within the app analyze the existence of the snap specific env variables as described here https://snapcraft.io/docs/environment-variables, and reset the home into the actual user’s home directory (have to check whether it is possible), but then the question is also whether it would be possible to read $HOME/.aws with the home: read: all plug? As I’ve tried personal-files plug, i.e.
personal-files:
read:
- $HOME/.aws/config
- $HOME/.aws/credentials
but I understood it also would require to ask for the grant to use this plug? And also requires the user to explicitly connect this plug?
Also what is the implication of the classic confinement apart from using --classic during install? Can I release upgrades to the app without further reviews, or every change and so the release will require the manual approval as well?
Also, I have read the following Keep in mind that making it classic would mean that you can’t use the snap on a core device., what it actually means?