make a self-signed certificate on a non-primary domain a warning rather than an error, fixes #95
This commit is contained in:
parent
8566b78202
commit
0441a2e2e3
|
@ -255,6 +255,8 @@ def system_status():
|
||||||
self.items.append({ "type": "ok", "text": message, "extra": [] })
|
self.items.append({ "type": "ok", "text": message, "extra": [] })
|
||||||
def print_error(self, message):
|
def print_error(self, message):
|
||||||
self.items.append({ "type": "error", "text": message, "extra": [] })
|
self.items.append({ "type": "error", "text": message, "extra": [] })
|
||||||
|
def print_warning(self, message):
|
||||||
|
self.items.append({ "type": "warning", "text": message, "extra": [] })
|
||||||
def print_line(self, message, monospace=False):
|
def print_line(self, message, monospace=False):
|
||||||
self.items[-1]["extra"].append({ "text": message, "monospace": monospace })
|
self.items[-1]["extra"].append({ "text": message, "monospace": monospace })
|
||||||
output = WebOutput()
|
output = WebOutput()
|
||||||
|
|
|
@ -386,7 +386,7 @@ def check_ssl_cert(domain, env):
|
||||||
env['out'].print_line("")
|
env['out'].print_line("")
|
||||||
env['out'].print_line(" " + fingerprint, monospace=True)
|
env['out'].print_line(" " + fingerprint, monospace=True)
|
||||||
else:
|
else:
|
||||||
env['out'].print_error("""The SSL certificate for this domain is currently self-signed. Visitors to a website on
|
env['out'].print_warning("""The SSL certificate for this domain is currently self-signed. Visitors to a website on
|
||||||
this domain will get a security warning. If you are not serving a website on this domain, then it is
|
this domain will get a security warning. If you are not serving a website on this domain, then it is
|
||||||
safe to leave the self-signed certificate in place.""")
|
safe to leave the self-signed certificate in place.""")
|
||||||
env['out'].print_line("")
|
env['out'].print_line("")
|
||||||
|
@ -571,6 +571,9 @@ class ConsoleOutput:
|
||||||
def print_error(self, message):
|
def print_error(self, message):
|
||||||
self.print_block(message, first_line="✖ ")
|
self.print_block(message, first_line="✖ ")
|
||||||
|
|
||||||
|
def print_warning(self, message):
|
||||||
|
self.print_block(message, first_line="? ")
|
||||||
|
|
||||||
def print_block(self, message, first_line=" "):
|
def print_block(self, message, first_line=" "):
|
||||||
print(first_line, end='')
|
print(first_line, end='')
|
||||||
message = re.sub("\n\s*", " ", message)
|
message = re.sub("\n\s*", " ", message)
|
||||||
|
|
|
@ -10,11 +10,14 @@
|
||||||
border-top: none;
|
border-top: none;
|
||||||
padding-top: 0;
|
padding-top: 0;
|
||||||
}
|
}
|
||||||
#system-checks .error td {
|
#system-checks .status-error td {
|
||||||
color: #733;
|
color: #733;
|
||||||
}
|
}
|
||||||
#system-checks .ok td {
|
#system-checks .status-warning td {
|
||||||
color: #030;
|
color: #770;
|
||||||
|
}
|
||||||
|
#system-checks .status-ok td {
|
||||||
|
color: #040;
|
||||||
}
|
}
|
||||||
#system-checks div.extra {
|
#system-checks div.extra {
|
||||||
display: none;
|
display: none;
|
||||||
|
@ -52,9 +55,13 @@ function show_system_status() {
|
||||||
for (var i = 0; i < r.length; i++) {
|
for (var i = 0; i < r.length; i++) {
|
||||||
var n = $("<tr><td class='status'/><td class='message'><p style='margin: 0'/><div class='extra'/><a class='showhide' href='#'/></tr>");
|
var n = $("<tr><td class='status'/><td class='message'><p style='margin: 0'/><div class='extra'/><a class='showhide' href='#'/></tr>");
|
||||||
if (i == 0) n.addClass('first')
|
if (i == 0) n.addClass('first')
|
||||||
n.addClass(r[i].type)
|
if (r[i].type == "heading")
|
||||||
|
n.addClass(r[i].type)
|
||||||
|
else
|
||||||
|
n.addClass("status-" + r[i].type)
|
||||||
if (r[i].type == "ok") n.find('td.status').text("✓")
|
if (r[i].type == "ok") n.find('td.status').text("✓")
|
||||||
if (r[i].type == "error") n.find('td.status').text("✖")
|
if (r[i].type == "error") n.find('td.status').text("✖")
|
||||||
|
if (r[i].type == "warning") n.find('td.status').text("?")
|
||||||
n.find('td.message p').text(r[i].text)
|
n.find('td.message p').text(r[i].text)
|
||||||
$('#system-checks tbody').append(n);
|
$('#system-checks tbody').append(n);
|
||||||
|
|
||||||
|
@ -76,4 +83,4 @@ function show_system_status() {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue