Auto-connection request for gse-app-cli


name: gse-app-cli
version: '5.0.21.3'
title: Cubespace GSE App CLI
contact: support@cubespace.co.za
website: https://www.cubespace.co.za
license: Proprietary
summary: CLI tool for configuration and management of ADCS nodes.


This is a working setup. I would love for the manual connections to auto-connect.

(sofia) flotter@flotter-laptop:~/sofia$ snap connections gse-app-cli
Interface         Plug                          Slot               Notes
can-bus           gse-app-cli:can-bus           :can-bus           manual
desktop           gse-app-cli:desktop           :desktop           -
hardware-observe  gse-app-cli:hardware-observe  :hardware-observe  manual
home              gse-app-cli:home              :home              -
network           gse-app-cli:network           :network           -
network-bind      gse-app-cli:network-bind      :network-bind      -
network-control   gse-app-cli:network-control   :network-control   manual
raw-usb           gse-app-cli:raw-usb           :raw-usb           manual




####------ The CLI tool


apps:
  gse-app-cli:
    command: cubesupportcli
    environment:
      # Use the .NET 10 variable name
      DOTNET_ICU_VERSION_OVERRIDE: "74"
      LD_LIBRARY_PATH: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR:$SNAP/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR:$LD_LIBRARY_PATH
      # A snap client is a daemon client: appd (below) owns the hub's port, runs
      # dfu-util and sets CAN links up; the CLI never does those itself here.
      # Unset or off is direct mode; a value names another daemon - see the
      # GSE App CLI's `daemon` command and GSE_APP_DAEMON.
      GSE_APP_DAEMON: "on"
    plugs:
      - home
      - network           # portal HTTPS (web authenticate/getbundle). Without it the
                          # CLI only reaches the network via network-control, a
                          # manual connect - a fresh install would fail at the portal
      - network-bind      # MSAL binds a loopback listener for the http://localhost
                          # redirect before it opens a browser (listen() is only in
                          # this interface's seccomp policy; appd's plug does not
                          # cover the CLI - plugs are scoped per app)
      - desktop           # the browser pop: /usr/bin/xdg-open in core24 is
                          # `snapctl user-open`, which needs io.snapcraft.Launcher
      - raw-usb           # dfu-util when no daemon is running (a developer's
                          # checkout), and the USB serial ports: snapd's raw-usb
                          # policy grants /dev/tty{USB,ACM}* too, so the
                          # TTL/RS-485 cables the CLI opens itself need no
                          # serial-port plug
      - hardware-observe  # sysfs: which hub is attached, its version and serial
      - can-bus
      - network-control

#### ------------ DAEMON

 # The privileged helper. Root inside the snap, so it holds the interfaces the
  # CLI cannot use as the user: raw-usb for dfu-util against the DFU node
  # (root:root) and for the GSE Hub's tty (root:dialout) - snapd's raw-usb
  # policy covers the USB serial ports, so there is no serial-port plug. Three
  # services and nothing else - see CLI/Serve/Serve.cs.
  appd:
    command: cubesupportcli serve
    daemon: simple
    install-mode: enable
    restart-condition: on-failure
    restart-delay: 5s
    # On `snap stop`, send SIGTERM and wait up to stop-timeout for graceful
    # shutdown before SIGKILL. The daemon hooks IHostApplicationLifetime to
    # close Kestrel cleanly and unlink the pathname socket from $SNAP_COMMON
    # on the way out (see Serve.cs). 15s is plenty — all endpoints are
    # sub-second; the matching .NET HostOptions.ShutdownTimeout is 10s.
    stop-mode: sigterm
    stop-timeout: 15s
    environment:
      DOTNET_ICU_VERSION_OVERRIDE: "74"
      LD_LIBRARY_PATH: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR:$SNAP/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR:$LD_LIBRARY_PATH
    plugs:
      - network-control
      - can-bus
      - network-bind
      - raw-usb
      - hardware-observe
    # No 'sockets:' stanza — snapcraft's schema only accepts /-rooted paths
    # under $SNAP_DATA or $SNAP_COMMON, and snapd-managed socket activation
    # leaves the file root:root 0660 (non-root clients hit EACCES). The
    # daemon instead binds $SNAP_COMMON/appd.sock itself at startup and
    # chmods it to 0666, then unlinks it on graceful shutdown. See
    # Serve.cs / CanServerConfig.DefaultSocketPath / ServeOptions.SocketMode.

This request has been added to the queue for review by the @reviewers team.

Hi @flotter123

To make the review of your request easier, please use the following template to provide all the required details and also include any other information that may be relevant.


name: name of the snap
description: description of the snap
snapcraft: link to snapcraft.yaml if publicly available
upstream: link to the upstream repository if open-source or ‘PRIVATE’ otherwise
upstream-relation: relation of the snap publisher with the upstream
plugs:
  <interface-name>:
    interface: [optional] one of https://snapcraft.io/docs/reference/interfaces/
    attributes: [optional] interface attributes if any
    request-type: installation | manual-connection | auto-connection
    reasoning: why is this interface needed
  ...
slots:
  <interface-name>:
    interface: [optional] one of https://snapcraft.io/docs/reference/interfaces/
    attributes: [optional] interface attributes if any
    request-type: installation | manual-connection | auto-connection
    reasoning: why is this interface needed
  ...

where:

  • : the name of the interface as defined in the snapcraft.yaml .
  • interface: the interface being requested. Only required if different from interface-name
  • attributes: the interface attributes. Only required if attribute are defined in the snapcraft.yaml.
  • request-type: one of installation (ie. permission to upload the snap to the store using this interface), connection (ie. permission to allow the snap interface to be connected) or auto-connection (ie. permission for the snap interface to be automatically connected when the snap is installed).