From e458d8813eeb95063892c3a63fc59bce2f2702a9 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sun, 26 Feb 2023 15:10:54 +0100 Subject: [PATCH] nginx/security: fix empty webadmin allowlist breaking nginx conf... --- conf/nginx/yunohost_admin.conf.inc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/conf/nginx/yunohost_admin.conf.inc b/conf/nginx/yunohost_admin.conf.inc index 84c49d30b..0c4a96fdc 100644 --- a/conf/nginx/yunohost_admin.conf.inc +++ b/conf/nginx/yunohost_admin.conf.inc @@ -7,9 +7,11 @@ location /yunohost/admin/ { index index.html; {% if webadmin_allowlist_enabled == "True" %} - {% for ip in webadmin_allowlist.split(',') %} - allow {{ ip }}; - {% endfor %} + {% if webadmin_allowlist.strip() -%} + {% for ip in webadmin_allowlist.strip().split(',') -%} + allow {{ ip.strip() }}; + {% endfor -%} + {% endif -%} deny all; {% endif %}