Tor Adjustements (#44)
fix for onion addresses; added header to autodetect onion address on tor browser Co-authored-by: muppeth <muppeth@disroot.org> Reviewed-on: #44
This commit is contained in:
parent
98f9868b75
commit
1487af80da
|
@ -20,5 +20,6 @@
|
|||
|
||||
- name: "[NGINX] - Create Vhosts configuration"
|
||||
include_tasks: vhost.yml
|
||||
loop: '{{ nginx_vhosts }}'
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
---
|
||||
- name: '[ONION] - register onion address'
|
||||
slurp:
|
||||
src: "/var/lib/tor/{{ item.name }}/hostname"
|
||||
register: "onion_address"
|
||||
when: item.onion is defined and item.onion == 'true'
|
||||
|
||||
- name: "[NGINX] - Create vhosts"
|
||||
- name: "[NGINX] - Set fact"
|
||||
set_fact:
|
||||
enable_tor: 'false'
|
||||
|
||||
|
@ -8,7 +13,6 @@
|
|||
template:
|
||||
src: etc/nginx/sites-available/{{ item.template }}.j2
|
||||
dest: "{{ nginx_etc_dir }}/sites-available/{{ item.name }}"
|
||||
with_items: "{{ nginx_vhosts }}"
|
||||
notify:
|
||||
- reload nginx
|
||||
when: item.state is defined and item.state != 'delete'
|
||||
|
@ -17,7 +21,6 @@
|
|||
file:
|
||||
path: "{{ nginx_etc_dir }}/sites-available/{{ item.name }}"
|
||||
state: absent
|
||||
with_items: "{{ nginx_vhosts }}"
|
||||
notify:
|
||||
- reload nginx
|
||||
when: item.state is defined and item.state == 'delete'
|
||||
|
@ -27,7 +30,6 @@
|
|||
src: "{{ nginx_etc_dir }}/sites-available/{{ item.name }}"
|
||||
dest: "{{ nginx_etc_dir }}/sites-enabled/{{ item.name }}"
|
||||
state: link
|
||||
with_items: "{{ nginx_vhosts }}"
|
||||
notify:
|
||||
- reload nginx
|
||||
when: item.state is defined and item.state == 'enable'
|
||||
|
@ -36,7 +38,6 @@
|
|||
file:
|
||||
path: "{{ nginx_etc_dir}}/sites-enabled/{{ item.name }}"
|
||||
state: absent
|
||||
with_items: "{{ nginx_vhosts }}"
|
||||
notify:
|
||||
- reload nginx
|
||||
when: item.state is defined and (item.state == 'disable' or item.state == 'delete')
|
||||
|
@ -53,7 +54,6 @@
|
|||
template:
|
||||
src: etc/nginx/sites-available/maintenance.j2
|
||||
dest: "{{ nginx_etc_dir }}/sites-available/maintenance-{{ item.name }}"
|
||||
with_items: "{{ nginx_vhosts }}"
|
||||
notify:
|
||||
- reload nginx
|
||||
when: (item.state is defined) and (item.state != 'delete') and (item.maintenance is defined) and (item.maintenance == 'true')
|
||||
|
|
|
@ -52,6 +52,9 @@ server {
|
|||
{% endblock %}
|
||||
|
||||
{% block headers %}
|
||||
{% if enable_tor != 'true' and item.onion is defined and onion_address | length > 0 %}
|
||||
add_header Onion-Location http://{{ onion_address.content | b64decode | trim }}$request_uri;
|
||||
{% endif %}
|
||||
{% if item.headers is defined and item.headers == 'none' %}
|
||||
{% else %}
|
||||
## HEADERS
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
{% for item in nginx_vhosts %}
|
||||
{% if item.onion is defined and item.onion == 'true' %}
|
||||
HiddenServiceDir /var/lib/tor/{{ item.name }}/
|
||||
HiddenServicePort {{ item.listen }} unix:/var/run/{{ item.name }}.sock
|
||||
HiddenServicePort {{ item.torlisten }} unix:/var/run/{{ item.name }}.sock
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
|
|
Loading…
Reference in New Issue