Pārlūkot izejas kodu

simplify and fix wg.conf output() macros

tags/v2.1^0
Maximilian Eschenbacher pirms 5 gadiem
vecāks
revīzija
be1f11f32f
1 mainītis faili ar 3 papildinājumiem un 8 dzēšanām
  1. +3
    -8
      wireguard/files/wg.conf

+ 3
- 8
wireguard/files/wg.conf Parādīt failu

@@ -1,17 +1,12 @@
{%- macro output(key, value) -%}
{%- if key in ['Address', 'DNS', 'AllowedIPs'] -%}
{{output_list(key, value)}}
{%- else -%}
{{key}} = {{value}}
{%- endif -%}
{%- endmacro -%}
{%- macro output_list(key, value) -%}
{%- if value is string -%}
{{key}} = {{value}}
{%- else -%}
{%- elif value is iterable -%}
{%- for item in value %}
{{key}} = {{item}}
{%- endfor -%}
{%- else -%}
{{key}} = {{value}}
{%- endif -%}
{%- endmacro -%}
[Interface]

Notiek ielāde…
Atcelt
Saglabāt