nginx/security: fix empty webadmin allowlist breaking nginx conf...

This commit is contained in:
Alexandre Aubin 2023-02-26 15:10:54 +01:00
parent 97c0128c22
commit e458d8813e

View file

@ -7,9 +7,11 @@ location /yunohost/admin/ {
index index.html; index index.html;
{% if webadmin_allowlist_enabled == "True" %} {% if webadmin_allowlist_enabled == "True" %}
{% for ip in webadmin_allowlist.split(',') %} {% if webadmin_allowlist.strip() -%}
allow {{ ip }}; {% for ip in webadmin_allowlist.strip().split(',') -%}
{% endfor %} allow {{ ip.strip() }};
{% endfor -%}
{% endif -%}
deny all; deny all;
{% endif %} {% endif %}