Skip to content
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

Declare salt dependencies explicitly in provisioning #210

Merged
merged 8 commits into from
Nov 15, 2018

Conversation

conorsch
Copy link
Contributor

Uses proper "include" and "require" syntax in the Salt configs. We had been applying these directives inconsistently, and --show-output reveals complaining about inability to import, causing race conditions when the salt states are ordered (which happens automatically prior to run).

Changes:

  • Drops use of Makefile dependencies for "make all"; uses qubesctl directly, as with the securedrop-update logic
  • Drops use of "clean" as automatic step in "make all"; machines are now configured as expected
  • Removes sd-whonix-template; there were zero configurations of the template, so it's unnecessary. We've always added the HidServAuth line directly to sd-whonix, where it persists due to /usr/local/ persistences in AppVMs.

The rebuild story is now vastly faster: on clean installs, 35m -> 15m. On rebuilds (where VMs already exist), 35m -> 6m.

Testing

Use the normal test plan:

  • make clean
  • make all
  • make test
  • Decrypt and view a document in SecureDrop Client, ensuring it opens in a DispVM.

Try running make all again.

@conorsch conorsch force-pushed the declare-salt-dependencies-explicitly-in-provisioning branch from 6d9d31d to 55ea887 Compare November 13, 2018 01:39
@emkll emkll force-pushed the declare-salt-dependencies-explicitly-in-provisioning branch 5 times, most recently from 6c4d651 to 9d5ad56 Compare November 14, 2018 17:50
Copy link
Contributor

@emkll emkll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the docs and appended to this branch with instructions on completing the f26->28 transition, but still experiencing one error with make test:

test_we_have_the_eu (test_gpg.SD_GPG_Tests)

Confirmed the private key is not present in the gpg keyring of sd-gpg. Investigating

@emkll emkll force-pushed the declare-salt-dependencies-explicitly-in-provisioning branch 2 times, most recently from 9e4f255 to 934ad08 Compare November 14, 2018 20:02
Copy link
Contributor

@emkll emkll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, the securedrop-client shortcut for sd-svs does not appear in the list after the clean install (not sure if it's due to clean install or if it's the new logic, I'm inclined to think the former)

With the changes to the readme appended to this PR, this PR should also close #183
@conorsch please review the changes to the docs and gpg fix and merge.

Conor Schaefer added 4 commits November 14, 2018 15:13
The Salt logic for declaring dependencies was incorrect. In order to use
the `require` state attribute effectively, the state (.sls) file *must*
either:

  1. Contain the referenced state elsewhere in the file; OR
  2. Use `include` to pull in the state file in which the referenced
     state is declared.

Additionally, it's important that the `require` line be an attribute on
a state, not on the unique state id (the human-readable name for the
task).
Using a wrapper script simply to support injecting the VM names via the
"list-vms" target, since we need to join them with commas in the Salt
targeting.

Removes "clean" as an automatic step on the "all" action. It's still
available to be run manually, but is now opt-in.
Since we're running it parallel, we must carefully declare dependencies,
so that requisites are in place before tasks assuming their presence are
run.

Uses a bit of the "onchanged" pragma to trigger commands only when
updates have happened to files on disk.

The syncing appmenus in particular tasks a long time, so it's useful to
run that only when VMs have changed.

Note that we're now copying in the submission key into the homedir of
sd-gpg; we were previously re-copying it to /tmp daily as part of the
update script; the advantage now is that we can skip the import if the
key didn't change.
The only customizations being written to `sd-whonix` are the HidServAuth
token for the Journalist Interface. The Whonix Gateway VM already
supports customizations of such torrc entries via /usr/local/, so the
template isn't buying us anything. Don't bother to provision it.
@emkll emkll force-pushed the declare-salt-dependencies-explicitly-in-provisioning branch from 934ad08 to 2fbba36 Compare November 14, 2018 20:14
The key is no longer copied to /tmp but rather from
/home/user/.gnupg
@emkll emkll force-pushed the declare-salt-dependencies-explicitly-in-provisioning branch from 2fbba36 to 49f4856 Compare November 14, 2018 20:19
qfile-agent : Fatal error: File copy: Disk quota exceeded; Last file: <...> (error type: Disk quota exceeded) '/usr/lib/qubes/qrexec-client-vm dom0 qubes.Receiveupdates /usr/lib/qubes/qfile-agent /var/lib/qubes/dom0-updates/packages/*.rpm' failed with exit code 1!
```

##### Upgrading `sys-net`, `sys-usb` and `sys-firewall` to fedora-28
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we also need to add instructions for updating whonix

emkll and others added 2 commits November 14, 2018 19:05
These steps are only required when using Qubes 4.0. Qubes 4.0.1 (which
is currently at RC status) will no longer require these steps.
Just for readability, also yum -> dnf since it redirects anyway. Not
hardcoding any `qvm-remove` commands because the dependency chain of VM
relations is a bit tricky; an exercise left to the reader, for the
nonce, unfortunately.
@conorsch
Copy link
Contributor Author

Beautiful additions, @emkll. Docs are on point. We still have one small issue, that the securedrop-client icon is missing from the sd-svs appmenu, but @zenmonkeykstop reports that the issue is on master, as well—so merging, and we'll handle that cleanup separately, before cutting alpha tag.

@legoktm legoktm deleted the declare-salt-dependencies-explicitly-in-provisioning branch May 28, 2024 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants