Skip to content

Commit

Permalink
Use blockreplace for sd-whonix tor config
Browse files Browse the repository at this point in the history
This ensures idempotency
  • Loading branch information
emkll committed Mar 10, 2020
1 parent 28e0424 commit b6b721a
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions dom0/sd-whonix-hidserv-key.sls
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,20 @@
# add hidden service auth key to torrc
{% if d.hidserv.hostname|length == 22 %}
sd-whonix-hidserv-key:
file.append:
file.blockreplace:
- name: /usr/local/etc/torrc.d/50_user.conf
- text: HidServAuth {{ d.hidserv.hostname }} {{ d.hidserv.key }}
- append_if_not_found: True
- marker_start: "### BEGIN securedrop-workstation ###"
- marker_end: "### END securedrop-workstation ###"
- content: HidServAuth {{ d.hidserv.hostname }} {{ d.hidserv.key }}
{% else %}
sd-whonix-hidservv3-directory-path:
file.append:
file.blockreplace:
- name: /usr/local/etc/torrc.d/50_user.conf
- text: ClientOnionAuthDir /var/lib/tor/keys
- append_if_not_found: True
- marker_start: "### BEGIN securedrop-workstation ###"
- marker_end: "### END securedrop-workstation ###"
- content: ClientOnionAuthDir /var/lib/tor/keys

{% set hostname_without_onion = d.hidserv.hostname.split('.')[0] %}
install-sd-whonix-tor-private-key:
Expand Down

0 comments on commit b6b721a

Please sign in to comment.