From b9e6754640fb88d38ed8a5ae27f578d82d5f490d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szekeres=20Ba=CC=81lint?= Date: Sun, 18 Nov 2018 10:15:33 +0100 Subject: [PATCH] HSTS includeSubDomains, preload options fixes #26 --- public/assets/js/app.js | 10 ++++++++++ public/index.html | 8 ++++++++ public/templates/conf/nginxconfig.io/general.conf.html | 2 +- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/public/assets/js/app.js b/public/assets/js/app.js index 3154fd7..1a5692e 100644 --- a/public/assets/js/app.js +++ b/public/assets/js/app.js @@ -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; }; diff --git a/public/index.html b/public/index.html index d091285..c884622 100644 --- a/public/index.html +++ b/public/index.html @@ -214,6 +214,14 @@ +
+ + +
+
+ + +
diff --git a/public/templates/conf/nginxconfig.io/general.conf.html b/public/templates/conf/nginxconfig.io/general.conf.html index 88d3ae2..9de045a 100644 --- a/public/templates/conf/nginxconfig.io/general.conf.html +++ b/public/templates/conf/nginxconfig.io/general.conf.html @@ -8,7 +8,7 @@ add_header Referrer-Policy "{{ data.referrer_policy }}" always; -add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always; +add_header Strict-Transport-Security "max-age=31536000{{ isHSTSSubdomains() ? '; includeSubDomains' : '' }}{{ isHSTSPreload() ? '; preload' : '' }}" always; # . files location ~ /\. {