-
Notifications
You must be signed in to change notification settings - Fork 687
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
Expose v2/v3 Onion URLs to webapp code #4718
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #4718 +/- ##
========================================
Coverage 81.61% 81.61%
========================================
Files 49 49
Lines 3416 3416
Branches 391 391
========================================
Hits 2788 2788
Misses 535 535
Partials 93 93 Continue to review full report at Codecov.
|
@@ -0,0 +1,121 @@ | |||
let SessionLoad = 1 |
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.
accidentally committed?
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.
Thanks, addressed!
install_files/ansible-base/roles/app/tasks/install_and_harden_apache.yml
Outdated
Show resolved
Hide resolved
d13b873
to
4be11ff
Compare
Rebased to remove the dependency on #4715. Ready for review. |
can you elaborate why you think prod VMs/Tails testing should be done here? (slower to test). it seems like the main thing we might to verify would be that for v2 only things work as expected (since the logic is straightforward I'm inclined to just rely on the testinfra tests passing for v2/v3) |
Good point, I'm fine with staging VMs being used here. Bear in mind that this step:
Requires editing (and generating a diff that should not be committed) |
|
ah that is #4691 |
We write plaintext files to /var/lib/securedrop so that the application can provide user-facing messaging about upcoming v2 -> v3 Onion URL transitions. For example, if a v3 Source Onion URL exists, but a source is browsing via the v2 URL, we can recommend the v3 URL instead.
Since testinfra is based on pytest, the pytest env var for passing additional options works just fine. We can use the `-k` option to perform a substring search on test names, and run only those tests matching the selector.
4be11ff
to
f6b0a69
Compare
Rebased on top of latest develop (d3d3ab7) in an attempt to satisfy CI; as @redshiftzero points out, we've seen this before, so we may need to raise the timeouts here. |
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.
- Configure site-specific vars so that only v2 URLs are enabled, install
- Log into app server (
ssh app
), confirm that/var/lib/securedrop/source_v2_url
exists and matches the contents of/var/lib/tor/services/source/hostname
. - Confirm
/var/lib/securedrop/source_v3_url
does not exist - Re-configure site-specific vars to enable v3 Onions, re-install
- Log into app server (
ssh app
), confirm that/var/lib/securedrop/source_v2_url
exists and matches the contents of/var/lib/tor/services/source/hostname
. - Log into app server (
ssh app
), confirm that/var/lib/securedrop/source_v3_url
exists and matches the contents of/var/lib/tor/services/sourcev3/hostname
.
Status
Ready for review.
Description of Changes
Fixes #4631. Fixes #4674.
Changes proposed in this pull request:
www-data
user, containing Onion URL info. Separate files are used for each URL.Files will exist only if the relevant generation of Onion URLs are configured in site-specific vars. That means that future implementations consuming these files must not assume file existence, and shold also validate the strings inside the files.
Testing
CI will validate that the staging setup works well. Bust out your Tails/prod VM setup.
ssh app
), confirm that/var/lib/securedrop/source_v2_url
exists and matches the contents of/var/lib/tor/services/source/hostname
./var/lib/securedrop/source_v3_url
does not existssh app
), confirm that/var/lib/securedrop/source_v2_url
exists and matches the contents of/var/lib/tor/services/source/hostname
.ssh app
), confirm that/var/lib/securedrop/source_v3_url
exists and matches the contents of/var/lib/tor/services/sourcev3/hostname
.Deployment
These changes are intended to enable future user-facing messaging regarding URL transitions. We aim to ship them in 1.0 to take advantage of the Admin process of enabling v3 URLs, which requires running the playbooks, to create these files.
Checklist
If you made changes to the server application code:
make lint
) and tests (make -C securedrop test
) pass in the development containerIf 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:
If you made changes to documentation:
make docs-lint
) passed locally