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

**URL:** <https://gramps.discourse.group/t/opening-up-the-gramps-flatpak-sandboxs-access-to-more-directories/5081>\
**Category:** Development\
**Tags:** flatpak\
**Created:** [March 9, 2024, 2:16pm UTC](https://gramps.discourse.group/t/opening-up-the-gramps-flatpak-sandboxs-access-to-more-directories/5081 "2024-03-09T14:16:29Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![S.Mackay](https://avatars.discourse-cdn.com/v4/letter/s/b5a626/32.png) [@S.Mackay](https://gramps.discourse.group/u/S.Mackay)\
**Post date:** [March 9, 2024, 2:16pm UTC](https://gramps.discourse.group/t/opening-up-the-gramps-flatpak-sandboxs-access-to-more-directories/5081/1 "2024-03-09T14:16:29Z")

</div>

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

```python
# 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?

---

<div class="post-metadata">

**Author:** ![Nick-Hall](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/nick-hall/32/95_2.png) [@Nick-Hall](https://gramps.discourse.group/u/Nick-Hall)\
**Post date:** [March 9, 2024, 3:51pm UTC](https://gramps.discourse.group/t/opening-up-the-gramps-flatpak-sandboxs-access-to-more-directories/5081/2 "2024-03-09T15:51:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [March 9, 2024, 4:47pm UTC](https://gramps.discourse.group/t/opening-up-the-gramps-flatpak-sandboxs-access-to-more-directories/5081/3 "2024-03-09T16:47:29Z")

</div>

Can the default `Backup` folder be a subfolder in the [`GRAMPSHOME`](https://www.gramps-project.org/wiki/index.php/Gramps_5.2_Wiki_Manual_-_Command_Line#GRAMPSHOME) Directory?

Then the GRAMPSHOME can be an application-set shortcut in the [Gramps Gtk File Chooser](https://www.gramps-project.org/wiki/index.php/Gramps_5.1_Wiki_Manual_-_Settings#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?

---

<div class="post-metadata">

**Author:** ![S.Mackay](https://avatars.discourse-cdn.com/v4/letter/s/b5a626/32.png) [@S.Mackay](https://gramps.discourse.group/u/S.Mackay)\
**Post date:** [March 9, 2024, 6:10pm UTC](https://gramps.discourse.group/t/opening-up-the-gramps-flatpak-sandboxs-access-to-more-directories/5081/4 "2024-03-09T18:10:05Z")

</div>

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](https://www.gramps-project.org/wiki/index.php/Gramps_Glossary#preferences).

---

<div class="post-metadata">

**Author:** ![S.Mackay](https://avatars.discourse-cdn.com/v4/letter/s/b5a626/32.png) [@S.Mackay](https://gramps.discourse.group/u/S.Mackay)\
**Post date:** [March 9, 2024, 7:32pm UTC](https://gramps.discourse.group/t/opening-up-the-gramps-flatpak-sandboxs-access-to-more-directories/5081/5 "2024-03-09T19:32:58Z")

</div>

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](https://docs.flathub.org/docs/for-app-authors/linter/#finish-args-arbitrary-xdg-dir-access)

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.

---

<div class="post-metadata">

**Author:** ![S.Mackay](https://avatars.discourse-cdn.com/v4/letter/s/b5a626/32.png) [@S.Mackay](https://gramps.discourse.group/u/S.Mackay)\
**Post date:** [March 9, 2024, 8:42pm UTC](https://gramps.discourse.group/t/opening-up-the-gramps-flatpak-sandboxs-access-to-more-directories/5081/6 "2024-03-09T20:42:56Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![S.Mackay](https://avatars.discourse-cdn.com/v4/letter/s/b5a626/32.png) [@S.Mackay](https://gramps.discourse.group/u/S.Mackay)\
**Post date:** [March 10, 2024, 1:10am UTC](https://gramps.discourse.group/t/opening-up-the-gramps-flatpak-sandboxs-access-to-more-directories/5081/7 "2024-03-10T01:10:59Z")

</div>

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.

> <https://github.com/flathub/org.gramps_project.Gramps/issues/21>
>
> A change in \[build 88678\](https://buildbot.flathub.org/#/builders/6/builds/10587…1) has been reviewed by the Flathub team, and rejected for the following reason:
> 
> \> These shouldn't be \`filesystem\`. If the problem is that they don't persist then use the \`persist\` option. Ideally this should be fixed upstream to conform the the xdg directories specification.
> \## Changes
> | Field | Old value | New value |
> | --- | --- | --- |
> | filesystems | \['xdg-documents', 'xdg-download', 'xdg-pictures'\] | \['xdg-documents', 'xdg-download', 'xdg-pictures', '~/.cache:create', '~/.config:create', '~/.gramps:create', '~/.local/share:create'\] |

---

<div class="post-metadata">

**Author:** ![S.Mackay](https://avatars.discourse-cdn.com/v4/letter/s/b5a626/32.png) [@S.Mackay](https://gramps.discourse.group/u/S.Mackay)\
**Post date:** [March 12, 2024, 2:13am UTC](https://gramps.discourse.group/t/opening-up-the-gramps-flatpak-sandboxs-access-to-more-directories/5081/8 "2024-03-12T02:13:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/gramps/original/1X/2ac1e712b7adf612e31ca08a55419f4cf37c0158.png) [@system](https://gramps.discourse.group/u/system)\
**Post date:** [April 11, 2024, 2:13am UTC](https://gramps.discourse.group/t/opening-up-the-gramps-flatpak-sandboxs-access-to-more-directories/5081/9 "2024-04-11T02:13:48Z")

</div>

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