Skip to content

Commit

Permalink
Set menu items for sd-devices and sd-whonix
Browse files Browse the repository at this point in the history
These are the only two VMs that will be visible on production systems
and have specific tools we want users to be able to directly start.

* sd-devices: Files (Nautilus) and Disks
* sd-whonix: Anon Connection Wizard and Tor Control Panel

Ideally we would do all of this in salt, but since we need to run stuff
via dom0 after we do things in the VMs, it would require adjusting the
order of some salt states, which is a bit too intrusive for a fix during
the RC/QA period.

A TODO indicates that this is not an ideal situation, and
<freedomofpress/securedrop-client#2078> tracks
one potential fix.

Fixes #520.
Fixes #1109.
  • Loading branch information
legoktm committed Jun 28, 2024
1 parent c3f4dce commit 0663af8
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 24 deletions.
14 changes: 14 additions & 0 deletions files/provision-all
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,20 @@ echo "..........................................................................
echo "Provision all SecureDrop Workstation VMs with service-specific configs"
sudo qubesctl --show-output --max-concurrency "$max_concurrency" --skip-dom0 --targets "$all_sdw_vms_target" state.highstate

# Sync appmenus now that all packages are installed
# TODO: this should be done by salt or debs, but we do it manually here because it's
# not straightforward to run a dom0 salt state after VMs run.
# n.b. none of the small VMs are shown in the menu on prod, but nice to have it synced
qvm-start --skip-if-running sd-small-bookworm-template && qvm-sync-appmenus sd-small-bookworm-template \
&& qvm-shutdown sd-small-bookworm-template
qvm-start --skip-if-running sd-large-bookworm-template && qvm-sync-appmenus sd-large-bookworm-template \
&& qvm-shutdown sd-large-bookworm-template
qvm-start --skip-if-running whonix-gateway-17 && qvm-sync-appmenus whonix-gateway-17 \
&& qvm-shutdown whonix-gateway-17
# These are the two ones we show in prod VMs, so sync explicitly
qvm-sync-appmenus --regenerate-only sd-devices
qvm-sync-appmenus --regenerate-only sd-whonix

echo ".........................................................................."
echo "Add SecureDrop export device handling to sys-usb"
# If sd-fedora-40-dvm exists it's because salt determined that sys-usb was disposable
Expand Down
12 changes: 0 additions & 12 deletions securedrop_salt/sd-app.sls
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,3 @@ sd-app-private-volume-size:
qvm-volume resize sd-app:private {{ d.vmsizes.sd_app }}GiB
- require:
- qvm: sd-app

# Ensure the Qubes menu is populated with relevant app entries,
# so that Nautilus/Files can be started via GUI interactions.
sd-app-template-sync-appmenus:
cmd.run:
- name: >
qvm-start --skip-if-running sd-small-{{ sdvars.distribution }}-template &&
qvm-sync-appmenus --force-root sd-small-{{ sdvars.distribution }}-template
- require:
- qvm: sd-small-{{ sdvars.distribution }}-template
- onchanges:
- qvm: sd-small-{{ sdvars.distribution }}-template
13 changes: 1 addition & 12 deletions securedrop_salt/sd-devices.sls
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,6 @@ sd-devices-dvm:
- require:
- qvm: sd-large-{{ sdvars.distribution }}-template

# Ensure the Qubes menu is populated with relevant app entries,
# so that Nautilus/Files can be started via GUI interactions.
sd-devices-template-sync-appmenus:
cmd.run:
- name: >
qvm-start --skip-if-running sd-large-{{ sdvars.distribution }}-template &&
qvm-sync-appmenus --force-root sd-large-{{ sdvars.distribution }}-template
- require:
- qvm: sd-large-{{ sdvars.distribution }}-template
- onchanges:
- qvm: sd-large-{{ sdvars.distribution }}-template

sd-devices-create-named-dispvm:
qvm.vm:
- name: sd-devices
Expand All @@ -64,5 +52,6 @@ sd-devices-create-named-dispvm:
- service.securedrop-mime-handling
- set:
- vm-config.SD_MIME_HANDLING: sd-devices
- menu-items: "org.gnome.Nautilus.desktop org.gnome.DiskUtility.desktop"
- require:
- qvm: sd-devices-dvm
1 change: 1 addition & 0 deletions securedrop_salt/sd-whonix.sls
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,4 @@ sd-whonix-config:
- set:
- vm-config.SD_HIDSERV_HOSTNAME: {{ d.hidserv.hostname }}
- vm-config.SD_HIDSERV_KEY: {{ d.hidserv.key }}
- menu-items: "anon_connection_wizard.desktop tor-control-panel.desktop"

0 comments on commit 0663af8

Please sign in to comment.