mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
letsencrypt: show more info on cert validity status
This commit is contained in:
1 parent
0d248ea364
commit
57e96b298c
3 files changed
+51
-10
No files matched your search
@@ -51,12 +51,32 @@
|
||||
<tr>
|
||||
<td>{{ domain }}</td>
|
||||
<td>
|
||||
{% if domain_status.certificate_available %}
|
||||
{% if domain_status.certificate_available and domain_status.validity == "valid" %}
|
||||
<span class="label label-success">
|
||||
{% blocktrans trimmed with expiry_date=domain_status.expiry_date %}
|
||||
Expires on {{ expiry_date }}
|
||||
Valid, expires on {{ expiry_date }}
|
||||
{% endblocktrans %}
|
||||
</span>
|
||||
{% elif domain_status.certificate_available and not domain_status.validity == "valid" %}
|
||||
<span class="label label-warning">
|
||||
{% if "revoked" in domain_status.validity %}
|
||||
{% blocktrans trimmed %}
|
||||
Revoked
|
||||
{% endblocktrans %}
|
||||
{% elif "expired" in domain_status.validity %}
|
||||
{% blocktrans trimmed with expiry_date=domain_status.expiry_date %}
|
||||
Expired on {{ expiry_date }}
|
||||
{% endblocktrans %}
|
||||
{% elif "test" in domain_status.validity %}
|
||||
{% blocktrans trimmed %}
|
||||
Invalid test certificate
|
||||
{% endblocktrans %}
|
||||
{% else %}
|
||||
{% blocktrans trimmed with reason=domain_status.validity %}
|
||||
Invalid ({{ reason }})
|
||||
{% endblocktrans %}
|
||||
{% endif %}
|
||||
</span>
|
||||
{% else %}
|
||||
<span class="label label-warning">
|
||||
{% trans "No certificate" %}
|
||||
@@ -72,18 +92,20 @@
|
||||
</td>
|
||||
<td>
|
||||
{% if domain_status.certificate_available %}
|
||||
<form class="form form-inline" method="post"
|
||||
action="{% url 'letsencrypt:revoke' domain %}">
|
||||
{% csrf_token %}
|
||||
<button class="btn btn-sm btn-default" type="submit">
|
||||
{% trans "Revoke" %}</button>
|
||||
</form>
|
||||
<form class="form form-inline" method="post"
|
||||
action="{% url 'letsencrypt:obtain' domain %}">
|
||||
{% csrf_token %}
|
||||
<button class="btn btn-sm btn-default" type="submit">
|
||||
{% trans "Re-obtain" %}</button>
|
||||
</form>
|
||||
{% if "revoked" not in domain_status.validity %}
|
||||
<form class="form form-inline" method="post"
|
||||
action="{% url 'letsencrypt:revoke' domain %}">
|
||||
{% csrf_token %}
|
||||
<button class="btn btn-sm btn-default" type="submit">
|
||||
{% trans "Revoke" %}</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<form class="form form-inline" method="post"
|
||||
action="{% url 'letsencrypt:obtain' domain %}">
|
||||
|
||||
@@ -52,7 +52,8 @@ def revoke(request, domain):
|
||||
try:
|
||||
actions.superuser_run('letsencrypt', ['revoke', '--domain', domain])
|
||||
messages.success(
|
||||
request, _('Certificate successfully revoked for domain {domain}')
|
||||
request, _('Certificate successfully revoked for domain {domain}.'
|
||||
'This may take a few moments to take effect.')
|
||||
.format(domain=domain))
|
||||
except ActionError as exception:
|
||||
messages.error(
|
||||
|
||||
Reference in new issue
Block a user