Request for `personal-files` (read-only dotfiles): moraine

Snap: moraine — OpenID transaction in progress Upstream: GitHub - TheJonaz/moraine-backup: Snapshot-based backup over SSH/rsync and rclone — CLI + iced desktop client · GitHub · MIT

moraine is a CLI backup tool: it takes hard-linked snapshots of user-selected paths to a NAS/server over SSH (rsync) or to cloud storage via rclone. In that earlier thread I asked for classic confinement; that was declined, and @ogra recommended system-backup plus personal-files instead. I reworked the snap to strict on that advice. Revision 2 was then rejected because personal-files needs its own request, so I published without it — the snap has been live in stable since, currently revision 4 (0.3.1), strict, with home, removable-media, network and ssh-keys. This post is the missing request.

What I’m asking for: permission to use personal-files (read-only). I am not requesting auto-connection — users would run snap connect moraine:dot-files themselves.

Plug requested

plugs:
  dot-files:
    interface: personal-files
    read:
      - $HOME/.ssh
      - $HOME/.gnupg
      - $HOME/.config
      - $HOME/.gitconfig
      - $HOME/.mozilla
      - $HOME/.thunderbird

Why these paths

The home interface excludes every top-level dotfile (owner @{HOME}/[^s.]**), and those dotfiles are precisely what a backup tool exists to preserve. moraine recommend proposes exactly eleven source locations by default on Linux, and the six above are precisely the ones home cannot reach: the other five (~/Documents, ~/Desktop, ~/Pictures, ~/Music, ~/Videos) are re-downloadable media, while these six are configuration, keys and mail profiles. A backup snap that silently skips a user’s ~/.ssh, ~/.gnupg and ~/.config is worse than no backup, because the gap is invisible until a restore.

The list is not an open-ended grab: it is exactly the dotfile half of the tool’s own default source set (src/recommend.rs), fixed, enumerable and shipped in the recipe. Nothing was added to it for this request.

Why read-only

moraine never writes to a source — it only reads sources and writes to the destination (a remote host over SSH/rclone, or removable media). So every path is declared under read:, not write:.

Alternatives considered

  • home alone — excludes all of the above, i.e. the actual problem.
  • classic confinement — declined in thread 52730; strict + interfaces is the route I was pointed to, and I agree it is the better one.
  • system-backup — I plan to use it later for whole-system/arbitrary paths, but it exposes the host read-only under /var/lib/snapd/hostfs, which needs app-side path handling first, and it is a heavier permission than reading a fixed list of the user’s own dotfiles.

Happy to trim the list or answer any questions. Thanks for reviewing!

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

Hello @Jonaz :slight_smile:

Thanks for the follow-up and for flagging the earlier thread!

The “no fixed list” concern raised in the classic thread was resolved there: the arbitrary-path case is the user’s own selection (and is destined for system-backup in a follow-up release per that discussion), while the six dotfiles requested here are exactly the fixed, enumerable default set, precisely the split @ogra recommended when declining classic. This request is therefore consistent with the guidance already given, not a re-run of the open-ended access concern.

One adjustment is needed before this can be granted: the plug name dot-files gives the user no clue as to the access granted. Please rename it to something descriptive, e.g. dot-backup-sources, or split per-path (dot-ssh, dot-config, …) per the interface-reference conventions.

With that rename, this is a +1 from my side, for granting manual-connection of the personal-filesinterface to the moraine snap.

One note on the $HOME/.ssh and $HOME/.gnupg entries: this is sensitive credential material, even read-only, flagging for other reviewers’ consideration rather than objecting.

Hello @yomonokio and thanx for your answer :slight_smile:

This is totally new ground for me, so I really appreciate all feedback and help I get! Again, thank you! Now to business:

The plug is now dot-backup-sources, your suggestion: it names what the access is for rather than what it is, and keeps it to a single snap connect for the user rather than six. Updated in the recipe and the docs:

plugs:
  dot-backup-sources:
    interface: personal-files
    read:
      - $HOME/.ssh
      - $HOME/.gnupg
      - $HOME/.config
      - $HOME/.gitconfig
      - $HOME/.mozilla
      - $HOME/.thunderbird

Users will connect it with:

snap connect moraine:dot-backup-sources

On the $HOME/.ssh and $HOME/.gnupg note — understood, and I agree it is worth flagging. Two things that may help whoever looks at it: the access is read-only, and moraine never writes to a source path, only reads it and writes to the destination. Those two directories are also the ones users most often discover missing after a restore, which is why they are in the tool’s default suggestions at all. Happy to drop either from the list if a reviewer would rather not see credential material here — the remaining four still cover the common case.

Looking forware to hear from you again :slight_smile:

1 Like

Hi @Jonaz

There are specific interfaces for $HOME/.ssh and $HOME/.gnupg. Rather than using personal-files interface for them, please use ssh-keys and gpg-keys interfaces.

dot-backup-sources is not very descriptive and very hard to tell what users are granting access to. So, rather than combining all the directories in a single personal-file interface, please split them as follow and create a separate interface per directory:

  • $HOME/.gitconfig → dot-gitignore
  • $HOME/.thunderbird → dot-thunderbird

I understand users will have to connect to six different interfaces instead of one, but they will exactly know what they are granting access to.

Given the requested changes are made, +1 from me to grant manual-connection to dot-config, dot-gitconfig, dot-mozilla and dot-thunderbird using personal-file interface.