Enable letsencrypt on project settings

This commit is contained in:
Marc Aymerich 2016-03-11 14:20:28 +00:00
parent ba232ec8f4
commit d39e742809
3 changed files with 11 additions and 3 deletions

View File

@ -435,6 +435,8 @@ mkhomedir_helper or create ssh homes with bash.rc and such
# upgrade to django 1.9 and make margins wider # upgrade to django 1.9 and make margins wider
# lets encrypt: DNS vs HTTP challange # lets encrypt: DNS vs HTTP challange
# lets enctypt: autorenew
# lets encrypt: websites without / content
# Warning websites with ssl options without https protocol # Warning websites with ssl options without https protocol

View File

@ -49,6 +49,7 @@ INSTALLED_APPS = [
'orchestra.contrib.lists', 'orchestra.contrib.lists',
'orchestra.contrib.webapps', 'orchestra.contrib.webapps',
'orchestra.contrib.websites', 'orchestra.contrib.websites',
'orchestra.contrib.letsencrypt',
'orchestra.contrib.databases', 'orchestra.contrib.databases',
'orchestra.contrib.vps', 'orchestra.contrib.vps',
'orchestra.contrib.saas', 'orchestra.contrib.saas',

View File

@ -1,5 +1,6 @@
from django.contrib import messages, admin from django.contrib import messages, admin
from django.template.response import TemplateResponse from django.template.response import TemplateResponse
from django.utils.safestring import mark_safe
from django.utils.translation import ungettext, ugettext_lazy as _ from django.utils.translation import ungettext, ugettext_lazy as _
from orchestra.contrib.orchestration import Operation, helpers from orchestra.contrib.orchestration import Operation, helpers
@ -75,16 +76,20 @@ def letsencrypt(modeladmin, request, queryset):
messages.success(request, msg.format(**context)) messages.success(request, msg.format(**context))
if no_https: if no_https:
msg = ungettext( msg = ungettext(
_("{name} website does not have HTTPS protocol enabled."), _("{name} website does not have <b>HTTPS protocol</b> enabled."),
_("{no_https} websites do not have HTTPS protocol enabled."), _("{no_https} websites do not have <b>HTTPS protocol</b> enabled."),
no_https) no_https)
messages.warning(request, msg.format(**context)) messages.warning(request, mark_safe(msg.format(**context)))
return return
opts = modeladmin.model._meta opts = modeladmin.model._meta
app_label = opts.app_label app_label = opts.app_label
context = { context = {
'title': _("Let's encrypt!"), 'title': _("Let's encrypt!"),
'action_name': _("Encrypt"), 'action_name': _("Encrypt"),
'content_message': _("You are going to request certificates for the following domains.<br>"
"This operation is safe to run multiple times, "
"existing certificates will not be regenerated. "
"Also notice that let's encrypt does not currently support wildcard certificates."),
'action_value': action_value, 'action_value': action_value,
'queryset': queryset, 'queryset': queryset,
'opts': opts, 'opts': opts,