-
Notifications
You must be signed in to change notification settings - Fork 46
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
Reorganise repository, Salt states and RPM package #837
Comments
I realize that we've talked about most of this ideas @eaon 🙂 In reading order for everything I find straightforward:
Regarding the internal organization of
I'm pretty sure there are other possible approaches, but I didn't find any obviously popular patterns when I looked for them, and this is what I've experimented with, so this is my contribution. 🙂 Edit: One aspect that makes intuitive sense to me is to keep the |
Hi @eaon, thanks for filing this. I'm very in favour of improving organization (clear agreement on moving away from dumping everything in As for the discussion @gonzalo-bulnes raises about how to organize our salt states, and the approach in his split-ssh/split-gpg vs the structure proposed here: I think DRY wins the day and it's better to avoid duplication, especially since that can lead to confusion/maintenance errors, so I'm inclined towards the structure you are proposing here. |
Thanks for your feedback @rocodes and @gonzalo-bulnes! Re: Salt state organisation, so far, I've thought of But I think that may actually be desirable. Thinking about dangerzone integration being a separate RPM package that drops its bits in the |
Note: Let's not forget updating https://github.com/freedomofpress/securedrop-client/wiki/Project-Patterns as we adopt new / spread existing patterns! |
Some of this is already being addressed in #851 |
Regarding salt 🧂 organisation, I did think about this more but never got around to replying: I believe we should keep integrations like Dangerzone separate from SecureDrop Workstation salt files. Dangerzone might want to have it's own I also removed references to migrations with salt as the pattern we decided on for migrations does not involve salt after all. |
Bumping this to reiterate support for at mininum moving salt files to their own sub-directory, both for our own selfish purposes and also to move towards a better setup for users who aren't using their Qubes laptops as a single-purpose SDW access machine. The current RPM post install hook finds and enables all .top files in |
The
securedrop-workstation
repository grew organically over time - thedom0/
folder for example was added with the first commit. Since then the project has become far more complex and navigating the codebase has become surprisingly difficult even if one is familiar with the project already. As I looked into what changes would make it a bit more intuitive, I researched how Salt states are usually organised in Qubes OS settings. As a result it became apparent that reconsidering where RPM packages deploy files would make sense to tackle at the same time.For that reason, I propose to revamp the repo layout to make the what/where/how a bit clearer (and consistent with
securedrop-client
, the approaches of which I'd consider "canon"), as well as adjust where/what gets pulled from or dropped.Repository
New folders:
files/
: assorted files (including binaries) we need to deploy to dom0 as part of the RPM packagescripts/
: scripts only useful in a dev environment, they won't get shipped with the RPM packagesecuredrop_salt/
: a new folder in/srv/
, containing SDW Salt states, jinja and top files, as well as files to be deployed to VMs (an example of jinja living next to sls)requirements/
: likesecuredrop-client
, keep requirements in a separate folderFolders to be removed:
sd-proxy/
,sd-whonix/
,sd-app/
,usb-autoattach/
: only contains (jinja) files which are moving tosecuredrop_salt/
where they live next to the.sls
file that references themsys-firewall/
: as far as I can tell it only contains one script that isn't being used anymoresd-workstation/
: contents move tofiles/
rpm-repo/
: as far as I can tell, not used anymoreSalt states
Currently, we drop everything into the Qubes OS' "system Salt states" location in
/srv/salt
- this has a couple of drawbacks when the rest of the system is used like a normal Qubes OS setup. If a Salt based customisation that was enabled viaqubesctl top.enable
and was attempted to be applied withstate.highstate
, our own setup would be dragged into this operation and take forever to be run due to our complex deployment strategy. Worse, if such user enabled Salt states aren't intended to be run withsudo
, our setup will fail during the attempt to applystate.highstate
to dom0 (the second operation inprovision-all
).Instead, I believe it'd be better if we maintained our own "Salt environment" in
/srv/securedrop_salt
(named to stay consistent with Qubes own/srv/user_salt
). This allows us to avoid issues like the ones above (which would become more ubiquitous as we're looking into making the workstation and client extensible). All that's necessary forqubesctl
to be aware is a.conf
file in/etc/salt/minion.d/
To distinguish between what happens where, I'd propose to create sub-folders along the lines of:
securedrop_salt/dom0/
for everything that targets dom0securedrop_salt/$VM/
for$VM
specific provisioning (sd-app
,sd-log
, etc.)the migration pattern we decided going with is Python based and will live in asecuredrop_salt/migration/
for migration related salt states (pending discussions surrounding Implement versioning for migrations #673)/usr/libexec/
folder. See Support versioned migrations securedrop-updater#2 for details.RPM package content locations
At the moment, some of our file locations are a bit unusual, and the way we copy most files stems from a time in which dev-deployment happened entirely with Salt with no package manager involvement. So there's an opportunity to cut down on some 🧂 and let RPM handle it. In addition, instead of reorganising most package contents on the fly, doing that just with
files/
would be preferable to me. I think this would be nice:/srv/
securedrop_salt/
entirely as is/usr/bin/
files/
(already happens forsdw-admin.py
, but do not change the file extension during packaging, remove the file extension in the repo instead)/usr/libexec/securedrop/
files/
/usr/share/securedrop/
:config.json.example
sd-journalist.sec.example
scripts/
Note on timing / other reorg PRs
This would probably be best to be dealt with after #831 was merged. Both this and the #831 would require dealing with migrations.
The text was updated successfully, but these errors were encountered: