-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More comprehensive "make clean" action #351
Changes from 5 commits
f4eac01
0f11ac3
e540ea6
63edaed
1fede0e
1b7a901
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,8 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: set syntax=yaml ts=2 sw=2 sts=2 et : | ||
|
||
# Handle misconfigured jessie-backports repo in default debian-9 TemplateVM. | ||
# The Jessie repos aren't maintained anymore, and their inclusion causes | ||
# even apt update to fail. | ||
remove-jessie-backports-repo: | ||
file.line: | ||
- name: /etc/apt/sources.list | ||
# Unclear why "Delete" *must* be capitalized, but that's the case! | ||
- mode: delete | ||
- match: jessie-backports | ||
# quiet param seems to be ignored, so using "onlyif" to test existence | ||
- quiet: True | ||
- onlyif: | ||
- test -f /etc/apt/sources.list | ||
# | ||
include: | ||
- update.qubes-vm | ||
|
||
# That's right, we need to install a package in order to | ||
# configure a repo to install another package | ||
|
@@ -22,22 +11,14 @@ install-python-apt-for-repo-config: | |
- pkgs: | ||
- python-apt | ||
- require: | ||
- file: remove-jessie-backports-repo | ||
# Require that the Qubes update state has run first | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
- sls: update.qubes-vm | ||
|
||
configure apt-test apt repo: | ||
configure-apt-test-apt-repo: | ||
pkgrepo.managed: | ||
- name: "deb [arch=amd64] https://apt-test-qubes.freedom.press stretch main" | ||
- file: /etc/apt/sources.list.d/securedrop_workstation.list | ||
- key_url: "salt://sd/sd-workstation/apt-test-pubkey.asc" | ||
- clean_file: True # squash file to ensure there are no duplicates | ||
- require: | ||
- pkg: install-python-apt-for-repo-config | ||
|
||
# Ensure all apt updates are applied, since the VMs | ||
# will be cloned, duplicating package version drift. | ||
update-all-apt-packages: | ||
pkg.uptodate: | ||
- cache_valid_time: "3600" | ||
- dist_upgrade: True | ||
- require: | ||
- pkg: install-python-apt-for-repo-config |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: set syntax=yaml ts=2 sw=2 sts=2 et : | ||
|
||
set-fedora-as-default-dispvm: | ||
cmd.run: | ||
- name: qubes-prefs default_dispvm fedora-30-dvm | ||
|
||
remove-dom0-sdw-config-files: | ||
file.absent: | ||
- names: | ||
- /opt/securedrop | ||
- /etc/yum.repos.d/securedrop-workstation-dom0.repo | ||
- /usr/bin/securedrop-update | ||
- /etc/pki/rpm-gpg/RPM-GPG-KEY-securedrop-workstation-test | ||
- /etc/cron.daily/securedrop-update-cron | ||
- /usr/share/securedrop/icons | ||
|
||
sd-cleanup-sys-firewall: | ||
cmd.run: | ||
- names: | ||
- qvm-run sys-firewall 'sudo rm -f /rw/config/RPM-GPG-KEY-securedrop-workstation-test' | ||
- qvm-run sys-firewall 'sudo rm -f /rw/config/sd-copy-rpm-repo-pubkey.sh' | ||
- qvm-run sys-firewall 'sudo rm -f /etc/pki/rpm-gpg/RPM-GPG-KEY-securedrop-workstation-test' | ||
- qvm-run sys-firewall 'sudo perl -pi -E "s#^/rw/config/sd-copy-rpm-repo-pubkey.sh##" /rw/config/rc.local' | ||
|
||
sd-cleanup-rpc-mgmt-policy: | ||
file.replace: | ||
- names: | ||
- /etc/qubes-rpc/policy/qubes.VMShell | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these policies do not exist on my machine. How/when are these created? qubesctl? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These policies are created automatically during upgrades via a disp-mgmt VM, and also removed automatically. If someone ctrl+c's the |
||
- /etc/qubes-rpc/policy/qubes.VMRootShell | ||
- repl: '' | ||
- pattern: '^disp-mgmt-sd-\w+\s+sd-\w+\s+allow,user=root' | ||
|
||
{% set sdw_customized_rpc_files = salt['cmd.shell']('grep -rl "BEGIN securedrop-workstation" /etc/qubes-rpc/ | cat').splitlines() %} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Awesome! There's one edge case that we could. When vim or other editor leaves a swap file (like it did on my system), the file is viewed as a binary and the
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, great catch. We can just pass |
||
{% if sdw_customized_rpc_files|length > 0 %} | ||
sd-cleanup-rpc-policy-grants: | ||
file.replace: | ||
- names: {{ sdw_customized_rpc_files }} | ||
- pattern: '### BEGIN securedrop-workstation ###.*### END securedrop-workstation ###' | ||
- flags: | ||
- MULTILINE | ||
- DOTALL | ||
- repl: '' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While running make all/make clean several times, I've observed blank lines in the rpc policy files I think that adding There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting, have not seen that, will get a repro and cleanup as you suggest. |
||
- backup: no | ||
{% endif %} |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: set syntax=yaml ts=2 sw=2 sts=2 et : | ||
## | ||
# sd-svs-config | ||
# ======== | ||
|
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# -*- coding: utf-8 -*- | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a massive improvement |
||
# vim: set syntax=yaml ts=2 sw=2 sts=2 et : | ||
|
||
base: | ||
dom0: | ||
- sd-sys-vms | ||
- sd-dom0-files | ||
- sd-workstation-template | ||
- sd-dom0-qvm-rpc | ||
- sd-export | ||
- sd-gpg | ||
- sd-proxy | ||
- sd-svs-disp | ||
- sd-svs | ||
- sd-whonix | ||
sd-export-template: | ||
- sd-export-files | ||
sd-gpg: | ||
- sd-gpg-files | ||
sd-proxy-template: | ||
- sd-proxy-template-files | ||
sd-svs: | ||
- sd-svs-config | ||
sd-svs-disp-template: | ||
- sd-svs-disp-files | ||
sd-svs-template: | ||
- sd-svs-files | ||
sys-firewall: | ||
- sd-sys-firewall-files | ||
sd-whonix: | ||
- sd-whonix-hidserv-key | ||
securedrop-workstation: | ||
- sd-workstation-template-files | ||
|
||
# "Placeholder" config to trigger TemplateVM boots, | ||
# so upgrades can be applied automatically via cron. | ||
qubes:type:template: | ||
- match: pillar | ||
- topd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this salt file located? Is this provided by qubes' build in salt mgmt commands? Might be worth adding a comment here for future maintainers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for more comments everywhere, will add.