From dc731c3af56736e97e4713456f5239aeba66ed40 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 22 Nov 2016 20:13:39 -0500 Subject: [PATCH] Using a single generic skipped regex for acme challenge in ssowat conf --- src/yunohost/app.py | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/src/yunohost/app.py b/src/yunohost/app.py index 83fc8614..a658a0c3 100644 --- a/src/yunohost/app.py +++ b/src/yunohost/app.py @@ -1031,22 +1031,8 @@ def app_ssowatconf(auth): for domain in domains: skipped_urls.extend([domain + '/yunohost/admin', domain + '/yunohost/api']) - # Authorize ACME challenge url if a domain seems configured for it... - for domain in domains: - - # Check ACME challenge file is present in nginx conf - nginx_acme_challenge_conf_file = "/etc/nginx/conf.d/%s.d/000-acmechallenge.conf" % domain - - if not os.path.isfile(nginx_acme_challenge_conf_file): - continue - - # Check the file contains the ACME challenge uri - if not '/.well-known/acme-challenge' in open(nginx_acme_challenge_conf_file).read(): - continue - - # If so, then authorize the ACME challenge uri to unprotected regex - unprotected_regex.append(domain + "/%.well%-known/acme%-challenge/.*$") - + # Authorize ACME challenge url + skipped_regex.append("^[^/]*/%.well%-known/acme%-challenge/.*$") conf_dict = { 'portal_domain': main_domain,