HSTS includeSubDomains, preload options

fixes #26
pull/32/head
Szekeres Bálint 2018-11-18 10:15:33 +01:00
parent 0579ab5b84
commit b9e6754640
3 changed files with 19 additions and 1 deletions

View File

@ -47,6 +47,8 @@
cert_type: 'letsencrypt',
ssl_profile: 'intermediate',
hsts: true,
hsts_subdomains: true,
hsts_preload: true,
email: '',
ssl_certificate: '',
ssl_certificate_key:'',
@ -408,6 +410,14 @@
return $scope.isHTTPS() && $scope.data.hsts;
};
$scope.isHSTSSubdomains = function() {
return $scope.isHSTS() && $scope.data.hsts_subdomains;
};
$scope.isHSTSPreload = function() {
return $scope.isHSTSSubdomains() && $scope.data.hsts_preload;
};
$scope.isResolverCloudflare = function() {
return $scope.isHTTPS() && $scope.data.resolver_cloudflare;
};

View File

@ -214,6 +214,14 @@
<input class="form-check-input" type="checkbox" id="hsts" ng-model="data.hsts">
<label class="form-check-label" for="hsts">enabled</label>
</div>
<div class="form-check" ng-if="isHSTS()" ng-class="{ 'input-changed': data.hsts_subdomains !== defaultData.hsts_subdomains }">
<input class="form-check-input" type="checkbox" id="hsts_subdomains" ng-model="data.hsts_subdomains">
<label class="form-check-label" for="hsts_subdomains"><code>includeSubDomains</code></label>
</div>
<div class="form-check" ng-if="isHSTSSubdomains()" ng-class="{ 'input-changed': data.hsts_preload !== defaultData.hsts_preload }">
<input class="form-check-input" type="checkbox" id="hsts_preload" ng-model="data.hsts_preload">
<label class="form-check-label" for="hsts_preload"><code>preload</code></label>
</div>
</div>
</div>
<fieldset class="form-group" ng-if="isHTTPS()">

View File

@ -8,7 +8,7 @@ add_header Referrer-Policy "{{ data.referrer_policy }}" always;<!--
add_header Content-Security-Policy "{{ data.content_security_policy }}" always;</span><!--
✔ HSTS--><span ng-if="isHSTS()">
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;</span>
add_header Strict-Transport-Security "max-age=31536000{{ isHSTSSubdomains() ? '; includeSubDomains' : '' }}{{ isHSTSPreload() ? '; preload' : '' }}" always;</span>
# . files
location ~ /\. {