diff --git a/CHANGELOG.md b/CHANGELOG.md index 79495d52..5a947da5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ In Development * SMTP Submission (port 587) began offering the insecure SSLv3 protocol due to a misconfiguration in the previous version. * Users and aliases weren't working if they were entered with any uppercase letters. Now only lowercase is allowed. * Fix broken install on OVH VPS's. +* After installing an SSL certificate from the control panel, the page wasn't being refreshed. v0.09 (May 8, 2015) ------------------- diff --git a/management/templates/ssl.html b/management/templates/ssl.html index 46b4df0b..c60c22f6 100644 --- a/management/templates/ssl.html +++ b/management/templates/ssl.html @@ -110,7 +110,8 @@ function install_cert() { chain: $('#ssl_paste_chain').val() }, function(status) { - if (status == "") { + if (/^OK($|\n)/.test(status)) { + console.log(status) show_modal_error("SSL Certificate Installation", "Certificate has been installed. Check that you have no connection problems to the domain.", function() { show_ssl(); $('#csr_info').slideUp(); }); } else { show_modal_error("SSL Certificate Installation", status); diff --git a/management/web_update.py b/management/web_update.py index 9d7ac44f..b70378c3 100644 --- a/management/web_update.py +++ b/management/web_update.py @@ -35,7 +35,7 @@ def get_web_domains(env): return domains -def do_web_update(env, ok_status="web updated\n"): +def do_web_update(env): # Build an nginx configuration file. nginx_conf = open(os.path.join(os.path.dirname(__file__), "../conf/nginx-top.conf")).read() @@ -62,7 +62,7 @@ def do_web_update(env, ok_status="web updated\n"): # enough and doesn't break any open connections. shell('check_call', ["/usr/sbin/service", "nginx", "reload"]) - return ok_status + return "web updated\n" def make_domain_config(domain, template, template_for_primaryhost, env): # How will we configure this domain. @@ -238,7 +238,7 @@ def install_cert(domain, ssl_cert, ssl_chain, env): os.makedirs(os.path.dirname(ssl_certificate), exist_ok=True) shutil.move(fn, ssl_certificate) - ret = [] + ret = ["OK"] # When updating the cert for PRIMARY_HOSTNAME, also update DNS because it is # used in the DANE TLSA record and restart postfix and dovecot which use @@ -251,8 +251,8 @@ def install_cert(domain, ssl_cert, ssl_chain, env): ret.append("mail services restarted") # Kick nginx so it sees the cert. - ret.append( do_web_update(env, ok_status="") ) - return "\n".join(r for r in ret if r.strip() != "") + ret.append( do_web_update(env) ) + return "\n".join(ret) def get_web_domains_info(env): # load custom settings so we can tell what domains have a redirect or proxy set up on '/',