elementary / elementary/settings-daemon

Include sandboxed apps' temporary folders in housekeeping

Open
#47 0 comments 0 reactions 0 assignees View on GitHub
Priority: Wishlist
Dominant language
Vala
Stars
19
Forks
15
Avg merge
5h 8m
Merged PRs (30d)
2

Description

### Problem

Currently `SettingsDaemon.Backends.Housekeeping` [configures systemd-tmpfiles to clean up users' Downloads folder](https://github.com/elementary/settings-daemon/blob/master/src/Backends/Housekeeping.vala#L77). In addition to old temporary files and trashed files this seemingly covers all locations mentioned in the [Housekeeping pannel](https://github.com/elementary/switchboard-plug-security-privacy/blob/master/src/Views/HouseKeepingPanel.vala).

However, with the migration to flatpak most apps now store temporary files in "sandboxed" locations. These typically include either `$XDG_RUNTIME_DIR/app/$FLATPAK_ID`, which is deleted on app exit, or `$XDG_CACHE_HOME/tmp` which is not cleaned automatically. This can lead to false sense of security for users who have enabled housekeeping options.

### Proposal

The `$XDG_CACHE_HOME/tmp` location (inside flatpak sandbox) is actually located at `~/.var/app/$FLATPAK_ID/cache/tmp` on the host. We could cover these folders with one extra line in the tempfiles config file [already created by the settings daemon](https://github.com/elementary/settings-daemon/blob/master/src/Backends/Housekeeping.vala#L131).

Alternatively, this same feature could be set up by apps that use this particular tmp folder (see [this commit](https://github.com/starfish-app/Starfish/commit/64f423cc19a2758b1881528fa0eab9cfe3653aac) for an example). However, this approach has 2 significant drawbacks (that I can think of):
1. Users would need to trust apps to set up housekeeping for their own tmp directories.
2. Creating the config file from the app side requires the `--filesystem=xdg-config/user-tmpfiles.d` permission.

### Prior Art (Optional)

I think all other temporary directories are already covered.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.