isLetsEncrypt() -> isCertLetsEncrypt(), isCustomCert() -> isCertCustom()

pull/12/head
Szekeres Baฬlint 2018-03-10 12:42:05 +01:00
parent 9ab32cc1f7
commit 3396047a5c
5 changed files with 50 additions and 44 deletions

View File

@ -137,6 +137,12 @@ main .options .card .form-subgroup {
padding-left: 0.5rem;
}
main .options .card .form-subgroup .form-subgroup {
margin-left: 0;
border-left: 1px solid #d7e0ea;
padding-left: 0.4rem;
}
main .options .card .form-control[type="text"]:placeholder-shown,
main .options .card .form-control[type="email"]:placeholder-shown {
background-color: #f8f8f8;

View File

@ -112,7 +112,7 @@
};
$scope.sslCertificate = function() {
if ($scope.isLetsEncrypt()) {
if ($scope.isCertLetsEncrypt()) {
return '/etc/letsencrypt/live/' + $scope.domain() + '/fullchain.pem'
}
@ -124,7 +124,7 @@
};
$scope.sslCertificateKey = function() {
if ($scope.isLetsEncrypt()) {
if ($scope.isCertLetsEncrypt()) {
return '/etc/letsencrypt/live/' + $scope.domain() + '/privkey.pem'
}
@ -285,11 +285,11 @@
return $scope.isHTTPS() && $scope.data.force_https;
};
$scope.isLetsEncrypt = function() {
$scope.isCertLetsEncrypt = function() {
return $scope.isHTTPS() && $scope.data.cert_type === 'letsencrypt';
};
$scope.isCustomCert = function() {
$scope.isCertCustom = function() {
return $scope.isHTTPS() && $scope.data.cert_type === 'custom';
};

View File

@ -102,37 +102,37 @@
</div>
<div class="form-subgroup pt-2" ng-if="isHTTPS()" ng-cloak>
Certification type:
</div>
<div class="form-subgroup" ng-if="isHTTPS()" ng-cloak>
<div class="form-check">
<input class="form-check-input" type="radio" id="letsencrypt" ng-model="data.cert_type" value="letsencrypt">
<label class="form-check-label" for="letsencrypt">
<span tooltips tooltip-template="Let's Encrypt based SSl.<br><br><i>free, automated, and open Certificate Authority</i>">Let's Encrypt</span>
</label>
</div>
<div class="form-group" ng-if="isHTTPS() && isLetsEncrypt()">
<label class="form-label small">
<span tooltips tooltip-template="Let's Encrypt expiration notify e-mail.">E-mail</span>
</label>
<input type="text" class="form-control form-control-sm" ng-model="data.email" placeholder="{{ 'hello@' + domain() }}">
</div>
<div class="form-check">
<input class="form-check-input" type="radio" id="custom_cert" ng-model="data.cert_type" value="custom">
<label class="form-check-label" for="custom_cert">
<span tooltips tooltip-template="Custom certificate">Custom certificate</span>
</label>
</div>
<div class="form-group" ng-if="isHTTPS() && isCustomCert()">
<label class="form-label small">
<span tooltips tooltip-template="Path to crt file"><code>ssl_certificate</code></span>
</label>
<input type="text" class="form-control form-control-sm" ng-model="data.ssl_certificate" placeholder="{{ '/etc/nginx/ssl/' + domain() + '.crt' }}">
</div>
<div class="form-group" ng-if="isHTTPS() && isCustomCert()">
<label class="form-label small">
<span tooltips tooltip-template="Path to key file"><code>ssl_certificate_key</code></span>
</label>
<input type="text" class="form-control form-control-sm" ng-model="data.ssl_certificate_key" placeholder="{{ '/etc/nginx/ssl/' + domain() + '.key' }}">
<div class="form-subgroup">
<div class="form-check">
<input class="form-check-input" type="radio" id="letsencrypt" ng-model="data.cert_type" value="letsencrypt">
<label class="form-check-label" for="letsencrypt">
<span tooltips tooltip-template="Let's Encrypt based SSl.<br><br><i>free, automated, and open Certificate Authority</i>">Let's Encrypt</span>
</label>
</div>
<div class="form-group" ng-if="isHTTPS() && isCertLetsEncrypt()">
<label class="form-label small">
<span tooltips tooltip-template="Let's Encrypt expiration notify e-mail.">E-mail</span>
</label>
<input type="text" class="form-control form-control-sm" ng-model="data.email" placeholder="{{ 'hello@' + domain() }}">
</div>
<div class="form-check">
<input class="form-check-input" type="radio" id="custom_cert" ng-model="data.cert_type" value="custom">
<label class="form-check-label" for="custom_cert">
<span tooltips tooltip-template="Custom certificate">Custom certificate</span>
</label>
</div>
<div class="form-group" ng-if="isHTTPS() && isCertCustom()">
<label class="form-label small">
<span tooltips tooltip-template="Path to crt file"><code>ssl_certificate</code></span>
</label>
<input type="text" class="form-control form-control-sm" ng-model="data.ssl_certificate" placeholder="{{ '/etc/nginx/ssl/' + domain() + '.crt' }}">
</div>
<div class="form-group" ng-if="isHTTPS() && isCertCustom()">
<label class="form-label small">
<span tooltips tooltip-template="Path to key file"><code>ssl_certificate_key</code></span>
</label>
<input type="text" class="form-control form-control-sm" ng-model="data.ssl_certificate_key" placeholder="{{ '/etc/nginx/ssl/' + domain() + '.key' }}">
</div>
</div>
</div>
<div class="mt-2">
@ -394,7 +394,7 @@
<pre><code class="nginx" ng-include="'templates/conf/_ssl.conf.html?v=COMMIT_HASH'" onload="refreshHighlighting()"></code></pre>
</div><div id="file-ssl" class="code highlighted"></div>
</div>
<div class="col-xl-6 grid-item file" ng-if="isModularized() && isLetsEncrypt()" ng-cloak>
<div class="col-xl-6 grid-item file" ng-if="isModularized() && isCertLetsEncrypt()" ng-cloak>
<strong>/etc/nginx/_letsencrypt.conf</strong>
<button class="btn btn-light btn-clipboard" ngclipboard data-clipboard-target="#file-letsencrypt" ngclipboard-success="clipboardSuccess('_letsencrypt.conf')">
<img src="assets/img/clipboard-dark.svg" alt="Copy to clipboard">

View File

@ -7,7 +7,7 @@
--></span><!--
โœ” Let's Encrypt --><span ng-if="isLetsEncrypt()">
โœ” Let's Encrypt --><span ng-if="isCertLetsEncrypt()">
<span class="hljs-comment"># <strong>HTTPS</strong>: create ACME-challenge common directory</span>
<span class="hljs-section">sudo</span> <span class="hljs-attribute">-u</span> {{ data.userย }} <span class="hljs-section">sh</span> <span class="hljs-attribute">-c</span> "<span class="hljs-section">mkdir</span> <span class="hljs-attribute">-p</span> /var/www/_letsencrypt"

View File

@ -30,7 +30,7 @@ server {<!--
ssl_certificate {{ sslCertificate() }};
ssl_certificate_key {{ sslCertificateKey() }};<!--
โœ” Let's Encrypt --><span ng-if="isLetsEncrypt()">
โœ” Let's Encrypt --><span ng-if="isCertLetsEncrypt()">
ssl_trusted_certificate /etc/letsencrypt/live/{{ domain() }}/fullchain.pem;</span></span><!--
โœ” unified && โœ” PHP --><span ng-if="isUnified() && isPHP()">
@ -97,7 +97,7 @@ server {
ssl_certificate {{ sslCertificate() }};
ssl_certificate_key {{ sslCertificateKey() }};<!--
โœ” Let's Encrypt --><span ng-if="isLetsEncrypt()">
โœ” Let's Encrypt --><span ng-if="isCertLetsEncrypt()">
ssl_trusted_certificate /etc/letsencrypt/live/{{ domain() }}/fullchain.pem;</span></span>
# disable access_log
@ -145,7 +145,7 @@ server {
ssl_certificate /etc/letsencrypt/live/{{ domain() }}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/{{ domain() }}/privkey.pem;<!--
โœ” Let's Encrypt --><span ng-if="isLetsEncrypt()">
โœ” Let's Encrypt --><span ng-if="isCertLetsEncrypt()">
ssl_trusted_certificate /etc/letsencrypt/live/{{ domain() }}/fullchain.pem;</span></span>
return 301 https://{{ isWWW() ? 'www.' : '' }}{{ domain() }}$request_uri;
@ -164,21 +164,21 @@ server {
server_name .{{ domain() }};<!--
โœ” modularized && โœ” Let's Encrypt --><span ng-if="isModularized() && isLetsEncrypt()">
โœ” modularized && โœ” Let's Encrypt --><span ng-if="isModularized() && isCertLetsEncrypt()">
include _letsencrypt.conf;</span><!--
โœ” unified && โœ” Let's Encrypt --><span ng-if="isUnified() && isLetsEncrypt()">
โœ” unified && โœ” Let's Encrypt --><span ng-if="isUnified() && isCertLetsEncrypt()">
<ng-include ng-include-tabs="2" src="'templates/conf/_letsencrypt.conf.html?v=COMMIT_HASH'" onload="refreshHighlighting()"></ng-include></span><!--
โœ” Let's Encrypt --><span ng-if="isLetsEncrypt()">
โœ” Let's Encrypt --><span ng-if="isCertLetsEncrypt()">
location / {
return 301 https://{{ isWWW() ? 'www.' : '' }}{{ domain() }}$request_uri;
}</span><!--
โœ˜ Let's Encrypt --><span ng-if="!isLetsEncrypt()">
โœ˜ Let's Encrypt --><span ng-if="!isCertLetsEncrypt()">
return 301 https://{{ isWWW() ? 'www.' : '' }}{{ domain() }}$request_uri;</span>
}</span>