Install snap without any auto-connections proposal

Currently, if you want to install a snap without any interfaces connected, you have to first install the snap and then manually disconnect all interfaces that auto-connect such as home, opengl, network, etc. I would like to propose a new option for snap install that explicitly doesn’t connect any interfaces, even if they normally auto-connect:

snap install xyz --pedantic

I chatted with @niemeyer over IRC about this, and we thought that specifically this option should be separate from --jailmode because that option already means to put a non-strictly confined snap in a strictly confined environment, and this is a more subtle difference.

Thoughts?

4 Likes

Yes, yes and thrice yes.

3 Likes

Would also like the ability as a packager to request that an interface like home is not autoconnected by default.

just tell people to install your snaps on Ubuntu Core devices, there it doesnt auto-connect :stuck_out_tongue:

1 Like

I’m not sure that --pedantic is the best argument name, but I like the feature suggestion a lot! :slight_smile:

3 Likes

You can already request this on the forum, the snap assertions from the store support that.

We went back and forth on the name of the option, happy to hear other suggestions :smiley:

/me resists… the… urge… to… bike… shed :wink:

--pedantic is a pretty poor name, but my only idea is --make-kyrofa-happy. --make-kyrofa-happier would be Autoconnection override , but this proposal seems like it has a higher likelihood of happening.

The thinking behind --pedantic is that a user is being pedantic and very detail oriented when choosing to not connect any interfaces…
We want to be careful in choosing any option name that is --safe-mode or similar safety reasoning because that implies that installing without that flag the snap is in “unsafe” mode which is obviously not always true.

The problem with --pedantic is that it says nothing about what the switch does. I’d rather something more explicit, like --disconnected.

1 Like

I agree that --pedantic feels vague unless the plan is to attach not yet defined other semantics to it later. The closest thing we have at the moment is --unaliased which is also quite explicit.

--disconnected makes the most sense to me so far

2 Likes

I initially thought of --no-auto-connect but that itself felt pedantic. :slight_smile:

More seriously, I like --disconnected since it follows @pedronis point about --unaliased, is clear, and not overly verbose.

1 Like

Another +1 for --disconnected.

1 Like

I agree, pedantic does not imply interactive or the possibility of choice.
I would really like to have this, but @kyrofa’s proposal as well.

what’s interactive? I don’t see anything mentioning interactive in the discussion…

Not from what you mentioned, but the reasoning for proposing -pedantic

Perhaps this was a miscommunication on my part, but the only choice I was referring to is that the user is choosing to use the flag, not that they would be presented with a dialog or something like that.

There’s also a question here about knowing which interfaces would have been auto-connected after being installed with this flag but weren’t versus interfaces which wouldn’t have been auto-connected. I think we could show those interfaces as manually disconnected similar to the what we do with current connections that are manually connected by the user with snap connect.

See the current design with manually connection plugs like camera here:

$ snap connections node-red
Interface          Plug                        Slot           Notes
bluetooth-control  node-red:bluetooth-control  -              -
bluez              node-red:bluez              -              -
camera             node-red:camera             :camera        manual
desktop            node-red:desktop            :desktop       -
gpio               node-red:gpio               -              -
home               node-red:home               :home          -
network            node-red:network            :network       -
network-bind       node-red:network-bind       :network-bind  -
network-observe    node-red:network-observe    -              -
pulseaudio         node-red:pulseaudio         :pulseaudio    -
removable-media    node-red:removable-media    -              -
serial-port        node-red:serial-port        -              -

and so if following my proposal, when node-red was installed with this flag, you would see something like:

$ snap connections node-red
Interface          Plug                        Slot  Notes
bluetooth-control  node-red:bluetooth-control  -     manual
bluez              node-red:bluez              -     manual
camera             node-red:camera             -     manual
desktop            node-red:desktop            -     manual
gpio               node-red:gpio               -     manual
home               node-red:home               -     manual
network            node-red:network            -     manual
network-bind       node-red:network-bind       -     manual
network-observe    node-red:network-observe    -     manual
pulseaudio         node-red:pulseaudio         -     manual
removable-media    node-red:removable-media    -     manual
serial-port        node-red:serial-port        -     manual