-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move MIME handling to systemd services (boot provisioning)
- Loading branch information
Showing
9 changed files
with
87 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
workstation-config/mailcap.default opt/sdw/ | ||
workstation-config/mimeapps.list.sd-viewer opt/sdw/ | ||
workstation-config/mimeapps.list.sd-app opt/sdw/ | ||
workstation-config/mimeapps.list.sd-devices-dvm opt/sdw/ | ||
workstation-config/mimeapps.list.sd-devices opt/sdw/ | ||
workstation-config/open-in-dvm.desktop opt/sdw/ | ||
workstation-config/paxctld.conf opt/sdw/ | ||
workstation-config/securedrop-mime-handling usr/sbin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
debian/securedrop-workstation-config.mime-handling-default.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[Unit] | ||
Description=Securedrop Mimetype Handling Override (default) | ||
ConditionPathExists=/var/run/qubes-service/securedrop-mime-handling-default | ||
OnFailure=systemd-halt.service | ||
|
||
[Service] | ||
User=user | ||
ExecStart=/usr/sbin/securedrop-mime-handling | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
11 changes: 11 additions & 0 deletions
11
debian/securedrop-workstation-config.mime-handling-sd-app.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[Unit] | ||
Description=Securedrop Mimetype Handling Override (sd-app) | ||
ConditionPathExists=/var/run/qubes-service/securedrop-mime-handling-sd-app | ||
OnFailure=systemd-halt.service | ||
|
||
[Service] | ||
User=user | ||
ExecStart=/usr/sbin/securedrop-mime-handling sd-app | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
11 changes: 11 additions & 0 deletions
11
debian/securedrop-workstation-config.mime-handling-sd-devices.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[Unit] | ||
Description=Securedrop Mimetype Handling Override (sd-devices) | ||
ConditionPathExists=/var/run/qubes-service/securedrop-mime-handling-sd-devices | ||
OnFailure=systemd-halt.service | ||
|
||
[Service] | ||
User=user | ||
ExecStart=/usr/sbin/securedrop-mime-handling sd-devices | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
11 changes: 11 additions & 0 deletions
11
debian/securedrop-workstation-config.mime-handling-sd-viewer.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[Unit] | ||
Description=Securedrop Mimetype Handling Override (sd-viewer) | ||
ConditionPathExists=/var/run/qubes-service/securedrop-mime-handling-sd-viewer | ||
OnFailure=systemd-halt.service | ||
|
||
[Service] | ||
User=user | ||
ExecStart=/usr/sbin/securedrop-mime-handling sd-viewer | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/sh | ||
## | ||
# securedrop-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/ | ||
# to be provisioned on boot by systemd. | ||
## | ||
|
||
# Fail early to ensure all the script ran successful | ||
set -e | ||
|
||
ln -sf /opt/sdw/mailcap.default /home/user/.mailcap | ||
|
||
mkdir -p /home/user/.local/share/applications | ||
|
||
# XXX receive qube name (or its template in case of disposable) via arg due to | ||
# qubesdb not being able to obtain template name in case of disposable. | ||
if [ -n "$1" ]; then | ||
mimeapps_override_path="/opt/sdw/mimeapps.list.$1" | ||
else | ||
mimeapps_override_path="/opt/sdw/mimeapps.list.default" | ||
fi | ||
# obtain | ||
|
||
if [ -f "$mimeapps_override_path" ]; then | ||
ln -sf "$mimeapps_override_path" /home/user/.local/share/applications/mimeapps.list | ||
else | ||
ln -sf /opt/sdw/mimeapps.list.default /home/user/.local/share/applications/mimeapps.list | ||
fi | ||
|
||
# Sleep forver to leave the systemd service that started it running | ||
sleep infinity |