Request - Interface Personal-files: read-write

@review-team

  • Hi, I’m the developer for warrensbox.
  • For my tfswitch application, I need access for my application to read and write to $HOME/bin

What is tfswitch?
The tfswitch command line tool lets you switch between different versions of terraform.
If you do not have a particular version of terraform installed, tfswitch will download the version you desire.
The installation is minimal and easy.
Once installed, simply select the version you require from the dropdown and start using terraform.

https://tfswitch.warrensbox.com/ for more info.

Why I need access to $HOME/bin/?

  1. tfswitch downloads the terraform binary into $SNAP_USER_COMMON/.terraform.versions
  2. Next tfswitch created a symlink /usr/local/bin/terraform -> $SNAP_USER_COMMON/.terraform.versions but not all users have access to /usr/local/bin/.
  3. So, tfswitch lets users to pass in their custom bin location. For example - $HOME/bin. User would later add $HOME/bin to their $PATH.
  4. For users that install tswitch with snapcraft, even if users are able to pass their own custom bin location ($HOME/bin), snapcraft does not let you create a symlink.

My solution was to use interface: personal-files to read and write to $HOME/bin . That way tfswitch can still create a symlink for users while not being overly obtrusive.

Here the snippet of what I have:

plugs:
 home-bin:
   interface: personal-files
   read:
   - $HOME/bin
   write:
   - $HOME/bin

I appreciate any suggestions. Thank you!

Hi @emitorino,

I was wondering how the snapcraft review process works. I have submitted my proposal. But when and how will I know if this is looked at?

Any reply would most certainly help.

Thank you.

Hey @warrensbox, thanks for your post!

So there is a process involved in reviewing requests, here you can find the details about this specific one (use/auto-connection of interfaces).

You will hear from us soon! Thanks!

1 Like

Hey @warrensbox,

I see you could achieve your needs by plugging personal-files, but it does not look like the correct approach. The personal-files interface, is typically used to provide read-only access to top-level hidden data directories within a user’s real home directory in order to support importing data from existing applications where the snap is the clear owner of the target directory.

Have you explore the possibility of shipping the desired terraform versions into your snap instead? (i.e., add to stage-packages (if needed you can add apt repositories), or even build from source?)

@warrensbox - ping, can you please provide the requested information?