-
Notifications
You must be signed in to change notification settings - Fork 696
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
Fix onion service version validation in securedrop-admin install #5335
Conversation
This was fallout from introducing non-interactive configuration validation during the install operation. The SiteConfig._config_in_progress attribute was only being populated in user_prompt_config, so the v3 validator would never see v2 enabled during the install validation step, causing a spurious validation complaint if only v2 were enabled. This change copies the loaded config to _config_in_progress before calling clean_config, so validators can check the values of other configuration values.
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.
Fix for #5334 lgtm. There is an unrelated issue as mentioned below but that could be fixed on a more relaxed timescale.
@zenmonkeykstop had a better idea; populating SiteConfig._config_in_progress as we go though clean_config means each validator can trust that other configuration items have been validated.
Build and run the Docker image the same way in local development and CI. Set up admin/Dockerfile with a full copy of the repo to enable more thorough testing of securedrop-admin.
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.
Performed manual testing in Tails VM, changes LGTM.
Really appreciate the attention to the test/CI logic for the admin functionality, it's a lot more straightforward to maintain a single testing workflow that prefers copying and eschews volume mounts.
Status
Ready for review
Description of Changes
Fixes #5334.
This was fallout from introducing non-interactive configuration validation during the install operation.
The
SiteConfig._config_in_progress
attribute was only being populated inuser_prompt_config
, so the v3 validator would never see v2 enabled during the install validation step, causing a spurious validation complaint if only v2 were enabled. This changecopies the loaded config tochanges_config_in_progress
before callingclean_config
clean_config
to add each validated value to_config_in_progress
(thanks @zenmonkeykstop), so validators can check the values of other configuration values.Testing
develop
.securedrop-admin sdconfig
to enable only v2 onion services.securedrop-admin install
. It should abort with this error:fix-5334
branch.securedrop-admin install
. You should not get the error, but be prompted for the sudo password.Checklist
If you made changes to
securedrop-admin
:make -C admin test
) pass in the admin development containerIf you made changes to the system configuration:
If you made non-trivial code changes: