Opening up the Gramps flatpak sandbox's access to more directories

The first Gramps 5.2 flatpak on user feedback restricted access from the entire home directory down to Documents, Downloads, and Pictures. This cut off access to some data directories. I am testing the addition of some more directories as shown below from the manifest

# for data directories and backwards compatibility  
  - --filesystem=~/.gramps:create
  - --filesystem=xdg-data
  - --filesystem=xdg-config
  - --filesystem=xdg-cache

@Nick-Hall Are there any more directories that Gramps needs access to?

Gramps needs write permission to the directories in your list.

The default backup directory is the home directory, but this can be changed in the preferences. Maybe we should choose a better default path?

The media directory defaults to the special Pictures folder. Gramps only needs read access to this.

I can’t think of anything else at the moment.

Can the default Backup folder be a subfolder in the GRAMPSHOME Directory?

Then the GRAMPSHOME can be an application-set shortcut in the Gramps Gtk File Chooser.

Further, perhaps installing could put the share\doc\gramps\example\ folder inside $GRAMPSHOME\backup\example instead of burying it in the Source. That would allow advanced users a clear way to prune out some excess baggage. Plus it would move those files to somewhere that doesn’t require admin right to update.

Which Gramps would have a consistent interface to the Backup folder and User Directory, regardless of OS.

Or perhaps the XDG Base Directory support is applicable to that goal?

The default filesystem access for flatpaks (when given) is read/write. Options can be restricted to read only or expanded to creating new directories.

Doesn’t the Edit Exif addon require write access to Pictures in order to modify metadata in case a user has their Gramps media directory in Pictures?

My personal preference has always been to put backups into Documents so I can find them easily but without cluttering up my home directory. That is something I usually change right away in Gramps preferences.

Unfortunately, t looks like xdg-data, xdg-config, and xdg-cache access are banned for Flathub. They cause the flathub compiler to fail the manifest, and link to here in the error message Flatpak builder lint | Flathub Documentation

Specifically naming the directories like filesystem=~/.config/gramps causes flatpak builder to fail with the below error
error: Unknown filesystem location ~/.config/gramps, valid locations are: host, host-os, host-etc, home, xdg-*[/…], ~/dir, /dir

Edit: nevermind the rest, I found a workaround

So it will only take adding ~/.gramps which I believe should be ok for now, since Gramps 5.1.6 used ~/.gramps anyway as I understand it. The problem in the future will be from a user switching from a system installed Gramps 5.2 over to a flatpak since Flathub won’t allow access to the xdg data directories for security reasons. In that case, restoring a backup or right-clicking the (filename).gramps file will open the database.

1 Like

The Gramps 5.2.0-1 flatpak should be available on flathub soon. It allows access to default data directories like ~/.gramps ~/.config ~/.local/share ~/.cache so that users can once again get to their 5.1.6 databases and potentially go between Gramps system installs and the Gramps 5.2.0-1 flatpak without difficulty.

2 Likes

Flathub is being difficult. They don’t even want to allow ~/.gramps access, so the Gramps flatpak might have to go back to full home directory access.

Gramps 5.2.0-1 flatpak has gone back to full home directory access for the sake of users’ data, and also for continuity between system installs, prior Gramps flatpaks, and the 5.2 flatpak.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.