-
Notifications
You must be signed in to change notification settings - Fork 690
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4718 from freedomofpress/4631-expose-v3-onion-url…
…s-to-app Expose v2/v3 Onion URLs to webapp code
- Loading branch information
Showing
5 changed files
with
73 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
install_files/ansible-base/roles/app/tasks/copy_tor_url_info_to_app_dir.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
- name: Look up Tor v2 URL info | ||
command: cat /var/lib/tor/services/source/hostname | ||
changed_when: false | ||
register: v2_onion_url_lookup_result | ||
# File may not exist, depending on host config | ||
failed_when: false | ||
when: v2_onion_services | ||
|
||
- name: Look up Tor v3 URL info | ||
command: cat /var/lib/tor/services/sourcev3/hostname | ||
changed_when: false | ||
register: v3_onion_url_lookup_result | ||
# File may not exist, depending on host config | ||
failed_when: false | ||
when: v3_onion_services | ||
|
||
- name: Expose Tor v2 Onion URL info to app | ||
copy: | ||
dest: /var/lib/securedrop/source_v2_url | ||
owner: www-data | ||
group: www-data | ||
mode: "0644" | ||
content: | | ||
{{ v2_onion_url_lookup_result.stdout|default('') }} | ||
when: v2_onion_services | ||
|
||
- name: Expose Tor v3 Onion URL info to app | ||
copy: | ||
dest: /var/lib/securedrop/source_v3_url | ||
owner: www-data | ||
group: www-data | ||
mode: "0644" | ||
content: | | ||
{{ v3_onion_url_lookup_result.stdout|default('') }} | ||
when: v3_onion_services |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters