-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #259 from freedomofpress/84-sd-export
Add sd-export VMs and basic export flow
- Loading branch information
Showing
20 changed files
with
468 additions
and
13 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
[flake8] | ||
ignore: W605 | ||
max-line-length = 99 |
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: set syntax=yaml ts=2 sw=2 sts=2 et : | ||
|
||
## | ||
# sd-export-files | ||
# ======== | ||
# | ||
# Moves files into place on sd-export | ||
# | ||
## | ||
include: | ||
- fpf-apt-test-repo | ||
|
||
sd-export-template-install-cryptsetup: | ||
pkg.installed: | ||
- pkgs: | ||
- cryptsetup | ||
|
||
sd-export-send-to-usb-script: | ||
file.managed: | ||
- name: /usr/bin/send-to-usb | ||
- source: salt://sd/sd-export/send-to-usb | ||
- user: root | ||
- group: root | ||
- mode: 755 | ||
- makedirs: True | ||
|
||
sd-export-desktop-file: | ||
file.managed: | ||
- name: /usr/share/applications/send-to-usb.desktop | ||
- source: salt://sd/sd-export/send-to-usb.desktop | ||
- user: root | ||
- group: root | ||
- mode: 644 | ||
- makedirs: True | ||
cmd.run: | ||
- name: sudo update-desktop-database /usr/share/applications | ||
- require: | ||
- file: sd-export-desktop-file | ||
|
||
sd-export-file-format: | ||
file.managed: | ||
- name: /usr/share/mime/packages/application-x-sd-export.xml | ||
- source: salt://sd/sd-export/application-x-sd-export.xml | ||
- user: root | ||
- group: root | ||
- mode: 644 | ||
- makedirs: True | ||
cmd.run: | ||
- name: sudo update-mime-database /usr/share/mime | ||
- require: | ||
- file: sd-export-file-format | ||
- file: sd-export-desktop-file |
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,6 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: set syntax=yaml ts=2 sw=2 sts=2 et : | ||
|
||
base: | ||
sd-export-template: | ||
- sd-export-files |
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,81 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: set syntax=yaml ts=2 sw=2 sts=2 et : | ||
|
||
# | ||
# Installs 'sd-export' AppVM, to persistently store SD data | ||
# This VM has no network configured. | ||
## | ||
include: | ||
- sd-workstation-template | ||
|
||
sd-export-template: | ||
qvm.vm: | ||
- name: sd-export-template | ||
- clone: | ||
- source: securedrop-workstation | ||
- label: red | ||
- tags: | ||
- add: | ||
- sd-workstation | ||
- require: | ||
- sls: sd-workstation-template | ||
|
||
sd-export-usb-dvm: | ||
qvm.vm: | ||
- name: sd-export-usb-dvm | ||
- present: | ||
- template: sd-export-template | ||
- label: red | ||
- prefs: | ||
- netvm: "" | ||
- template_for_dispvms: True | ||
- tags: | ||
- add: | ||
- sd-workstation | ||
- require: | ||
- qvm: sd-export-template | ||
|
||
# Ensure the Qubes menu is populated with relevant app entries, | ||
# so that Nautilus/Files can be started via GUI interactions. | ||
sd-export-template-sync-appmenus: | ||
cmd.run: | ||
- name: > | ||
qvm-start --skip-if-running sd-export-template && | ||
qvm-sync-appmenus sd-export-template | ||
- require: | ||
- qvm: sd-export-template | ||
- onchanges: | ||
- qvm: sd-export-template | ||
|
||
# Here we must create as the salt stack does not appear to allow us to create | ||
# VMs with the class DispVM and attach the usb device specified in the config | ||
# permanently to this VM | ||
sd-export-create-named-dispvm: | ||
cmd.run: | ||
- name: > | ||
qvm-check sd-export-usb || | ||
qvm-create --class DispVM --template sd-export-usb-dvm --label red sd-export-usb | ||
- require: | ||
- qvm: sd-export-usb-dvm | ||
|
||
{% import_json "sd/config.json" as d %} | ||
|
||
# Persistent attachments can only be removed when the domain is off, so we must | ||
# kill sd-export-usb before detaching the USB devices from the domain | ||
sd-export-named-dispvm-permanently-attach-usb: | ||
cmd.run: | ||
- name: > | ||
qvm-kill sd-export-usb || true ; | ||
qvm-usb detach sd-export-usb || true ; | ||
qvm-usb attach --persistent sd-export-usb {{ d.usb.device }} || true | ||
- require: | ||
- cmd: sd-export-create-named-dispvm | ||
|
||
sd-export-named-dispvm-add-tags: | ||
qvm.vm: | ||
- name: sd-export-usb | ||
- tags: | ||
- add: | ||
- sd-workstation | ||
- require: | ||
- cmd: sd-export-create-named-dispvm |
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,6 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: set syntax=yaml ts=2 sw=2 sts=2 et : | ||
|
||
base: | ||
dom0: | ||
- sd-export |
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
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,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info"> | ||
<mime-type type="application/x-sd-export"> | ||
<comment>Archive for transfering files from the SecureDrop workstation to an external USB device.</comment> | ||
<glob pattern="*.sd-export"/> | ||
</mime-type> | ||
</mime-info> |
Oops, something went wrong.