From 690efa4ffc23e374209c25b703b9ac1427e76284 Mon Sep 17 00:00:00 2001 From: mickael e Date: Thu, 27 Aug 2020 13:28:53 -0400 Subject: [PATCH] Handle mimetypes for sd-app, sd-viewer and sd-devices in private volume --- dom0/sd-mime-handling.sls | 23 +++++++++++++++++++++++ dom0/sd-workstation.top | 5 +++++ 2 files changed, 28 insertions(+) create mode 100644 dom0/sd-mime-handling.sls diff --git a/dom0/sd-mime-handling.sls b/dom0/sd-mime-handling.sls new file mode 100644 index 00000000..e0ca2808 --- /dev/null +++ b/dom0/sd-mime-handling.sls @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +# vim: set syntax=yaml ts=2 sw=2 sts=2 et : + +## +# sd-mime-handling +# ===================== +# +# Overrides mimetype handling for certain VMs. Instead of relying on the +# /usr/share/applications (system volume), we instead use /home/user/.local/share/ +# (private volume). The various mimeapps.list files linked are provided by the +# securedrop-workstation-config package in /opt/, and are symlinked here in their +# respective AppVMs. +## + +{% if grains['id'] in ["sd-viewer", "sd-app", "sd-devices-dvm"] %} + +sd-private-volume-mimeapps-handling: + file.symlink: + - name: /home/user/.local/share/applications/mimeapps.list + - target: /opt/sdw/mimeapps.list.{{ grains['id'] }} + - makedirs: True + +{% endif %} diff --git a/dom0/sd-workstation.top b/dom0/sd-workstation.top index 3acf2040..b8c6d2ac 100644 --- a/dom0/sd-workstation.top +++ b/dom0/sd-workstation.top @@ -31,6 +31,7 @@ base: - sd-proxy-template-files sd-app: - sd-app-config + - sd-mime-handling sd-viewer-buster-template: - sd-viewer-files sd-app-buster-template: @@ -49,6 +50,10 @@ base: - sd-logging-setup sd-log: - sd-logging-setup + sd-viewer: + - sd-mime-handling + sd-devices-dvm: + - sd-mime-handling # "Placeholder" config to trigger TemplateVM boots, # so upgrades can be applied automatically via cron.