diff --git a/src/nginxconfig/scss/style.scss b/src/nginxconfig/scss/style.scss index 9a1e82c..3b9e2e3 100644 --- a/src/nginxconfig/scss/style.scss +++ b/src/nginxconfig/scss/style.scss @@ -81,10 +81,9 @@ $highlight: #f2c94c; .panel { margin-top: 0; padding: 1.5rem 0 2rem; + text-align: left; &.presets { - text-align: left; - .header-group, .buttons-group { display: flex; @@ -115,21 +114,20 @@ $highlight: #f2c94c; } &.setup { - ol { + p { color: $dark-blue; + overflow-wrap: break-word; + + a { + text-decoration: none; + } + } + + ol { margin: 0 1rem; - text-align: left; li { margin: 0 0 1.5rem; - - p { - overflow-wrap: break-word; - - a { - text-decoration: none; - } - } } } } diff --git a/src/nginxconfig/templates/global_sections/https.vue b/src/nginxconfig/templates/global_sections/https.vue index 3beffd1..dadb0cd 100644 --- a/src/nginxconfig/templates/global_sections/https.vue +++ b/src/nginxconfig/templates/global_sections/https.vue @@ -1,77 +1,94 @@ @@ -139,19 +156,52 @@ }, deep: true, }, - // Enable LE webroot if any site uses LE '$parent.$parent.$data.domains': { handler(data) { + let httpsEnabled = false, leEnabled = false; + for (const domain of data) { + // Enable HTTPS server settings if any site uses HTTPS + if (domain && domain.https && domain.https.https && domain.https.https.computed) { + this.$props.data.sslProfile.enabled = true; + this.$props.data.sslProfile.computed = this.$props.data.sslProfile.value; + this.$props.data.ocspCloudflare.enabled = true; + this.$props.data.ocspCloudflare.computed = this.$props.data.ocspCloudflare.value; + this.$props.data.ocspGoogle.enabled = true; + this.$props.data.ocspGoogle.computed = this.$props.data.ocspGoogle.value; + this.$props.data.ocspOpenDns.enabled = true; + this.$props.data.ocspOpenDns.computed = this.$props.data.ocspOpenDns.value; + this.$props.data.letsEncryptRoot.enabled = true; + this.$props.data.letsEncryptRoot.computed = this.$props.data.letsEncryptRoot.value; + httpsEnabled = true; + } + + // Enable LE webroot if any site uses LE if (domain && domain.https && domain.https.certType && domain.https.certType.computed === 'letsEncrypt') { this.$props.data.letsEncryptRoot.enabled = true; this.$props.data.letsEncryptRoot.computed = this.$props.data.letsEncryptRoot.value; - return; + leEnabled = true; } } - this.$props.data.letsEncryptRoot.enabled = false; - this.$props.data.letsEncryptRoot.computed = ''; + + if (!httpsEnabled) { + this.$props.data.sslProfile.enabled = false; + this.$props.data.sslProfile.computed = ''; + this.$props.data.ocspCloudflare.enabled = false; + this.$props.data.ocspCloudflare.computed = false; + this.$props.data.ocspGoogle.enabled = false; + this.$props.data.ocspGoogle.computed = false; + this.$props.data.ocspOpenDns.enabled = false; + this.$props.data.ocspOpenDns.computed = false; + this.$props.data.letsEncryptRoot.enabled = false; + this.$props.data.letsEncryptRoot.computed = ''; + } + + if (!leEnabled) { + this.$props.data.letsEncryptRoot.enabled = false; + this.$props.data.letsEncryptRoot.computed = ''; + } }, deep: true, }, diff --git a/src/nginxconfig/templates/setup_sections/certbot.vue b/src/nginxconfig/templates/setup_sections/certbot.vue new file mode 100644 index 0000000..f9f86fc --- /dev/null +++ b/src/nginxconfig/templates/setup_sections/certbot.vue @@ -0,0 +1,126 @@ + + + diff --git a/src/nginxconfig/templates/setup_sections/go_live.vue b/src/nginxconfig/templates/setup_sections/go_live.vue new file mode 100644 index 0000000..30c81d5 --- /dev/null +++ b/src/nginxconfig/templates/setup_sections/go_live.vue @@ -0,0 +1,30 @@ + + + diff --git a/src/nginxconfig/templates/setup_sections/index.js b/src/nginxconfig/templates/setup_sections/index.js index ae26dd7..f149966 100644 --- a/src/nginxconfig/templates/setup_sections/index.js +++ b/src/nginxconfig/templates/setup_sections/index.js @@ -1 +1,4 @@ export { default as Download } from './download'; +export { default as SSL } from './ssl'; +export { default as Certbot } from './certbot'; +export { default as GoLive } from './go_live'; diff --git a/src/nginxconfig/templates/setup_sections/ssl.vue b/src/nginxconfig/templates/setup_sections/ssl.vue new file mode 100644 index 0000000..cdd1cde --- /dev/null +++ b/src/nginxconfig/templates/setup_sections/ssl.vue @@ -0,0 +1,83 @@ + + +