tor-formula/tor/files/ini.jinja
Georg Pfuetzenreuter bffaf777b5
Manage hidden services
Add support for managing hidden services using pillar data.

Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
2023-02-06 22:58:11 +01:00

36 lines
819 B
Django/Jinja

{%- set exclude = [] -%}
{%- macro set_config(config, spacer=' ') -%}
{% for parameter in config | sort -%}
{% if parameter not in exclude -%}
{% set value = config.get(parameter) -%}
{% if value is mapping -%}
{{ set_config(value) }}
{%- elif value is sequence and value is not string -%}
{% for item in value -%}
{{ parameter }}{{ spacer }}{{ item }}
{% endfor -%}
{%- elif value is not none -%}
{{ parameter }}{{ spacer }}{{ value }}
{% endif -%}
{% endif -%}
{% endfor -%}
{% endmacro -%}
#
# **** DO NOT EDIT THIS FILE ****
#
# This file is managed by Salt
#
{% if config -%}
{{ set_config(config) }}
{% endif -%}
{%- if hsmap | length %}
{%- for hs, config in hsmap.items() %}
HiddenServiceDir {{ hsdir }}/{{ hs }}
HiddenServicePort {{ config['virtport'] }} {{ config['target'] }}
{%- endfor %}
{%- endif %}