Interface autoconnection request for the glances snap

Dear @reviewers, I would like to request the auto-connection of the following interfaces for https://snapcraft.io/glances according to the Process for aliases, auto-connections and tracks.

Interface Name Reasoning
system-files
(for accessing /etc/glances/glances.conf)
This is the system-wide configuration file of the application(source)
personal-files
(for accessing ~/.config/glances/glances.conf and $XDG_CONFIG_HOME/glances/glances.conf)
This is the user-wide configuration file of the application(source)

Hereā€™s the upstream conversation regarding this request:

https://github.com/nicolargo/glances/issues/1403

1 Like

+1 from me as these files are specifically for glances itself, and not shared.

1 Like

The files themselves arenā€™t particularly controversial, but do you need read-only access or read/write? Why isnā€™t SNAP_USER_DATA/.config/glances good enough? Why do you need access to /etc/glances instead of SNAP_DATA/etc/glances (or similar)?

do you need read-only access or read/write

Iā€™m not exactly sure yet, waiting for the upstream to response.

Why isnā€™t SNAP_USER_DATA/.config/glances good enough? Why do you need access to /etc/glances instead of SNAP_DATA/etc/glances (or similar)?

Because theyā€™re simply not the paths users expecting it would be.

I donā€™t have a particular objection to read-only access to these directories, but write access means that your snap can write a non-snapā€™s files and vice versa. How does glances handle different versions of config files (going forward and backward)?

Ping - this needs to be answered before reviewers can have an informed vote.

How does glances handle different versions of config files (going forward and backward)?

I find no information regarding either the forward or backward-compatibility of the configuration in its docs, I would guess thereā€™s none.

I have forwarded the inquiry to the upstream and is waiting for the respond.

Thanks, please report back when you hear something. Perhaps in the meantime readonly access is enough? You can then have your snap import the content into $SNAP_USER_DATA ($HOME within the context of your snap) and be on your way.

1 Like

I still got no response from the upstream yet, read-only access is fine for now.

+1 for readonly access.

2 votes for, 0 against. Granting use and autoconnection of the interface. This is now live.

1 Like

Note that I am implementing a review-tools check that will require that the interface reference be meaningful, but the snap in the store doesnā€™t yet use personal-files or system-files. I suggest for personal-files, using:

plugs:
  home-glances-config:
    interface: personal-files
    read:
    - $HOME/.config/glances/glances.conf
  etc-glances-config:
    interface: system-files
    read:
    - /etc/glances/glances.conf
1 Like

Iā€™ve initiated the PR to adds these plugs: snap: Support canonical config paths, fixes #1403 by Lin-Buo-Ren Ā· Pull Request #1464 Ā· nicolargo/glances