diff --git a/src/nginxconfig/generators/conf/security.conf.js b/src/nginxconfig/generators/conf/security.conf.js index f82d1d8..b65d587 100644 --- a/src/nginxconfig/generators/conf/security.conf.js +++ b/src/nginxconfig/generators/conf/security.conf.js @@ -56,10 +56,10 @@ export default (domains, global) => { config.push(['location /security.txt', { return: '301 /.well-known/security.txt', }]); - + // Custom security.txt path config.push(['location = /.well-known/security.txt', { - alias: `${global.security.securityTxtPath.value}`, + alias: `${global.security.securityTxtPath.computed}`, }]); } diff --git a/src/nginxconfig/templates/domain_sections/server.vue b/src/nginxconfig/templates/domain_sections/server.vue index 563cb75..b9762e2 100644 --- a/src/nginxconfig/templates/domain_sections/server.vue +++ b/src/nginxconfig/templates/domain_sections/server.vue @@ -208,7 +208,6 @@ THE SOFTWARE. watch: { '$props.data.domain': { handler(data) { - data.computed = data.computed.replace(/<.+>/, ''); // Ignore www. if given, enable WWW subdomain if (data.computed.startsWith('www.')) { data.computed = data.computed.slice(4); @@ -244,31 +243,12 @@ THE SOFTWARE. // Ensure there is a default path '$props.data.path': { handler(data) { - data.computed = data.computed.replace(/<.+>/, ''); if (!data.computed.trim()) { data.computed = `/var/www/${this.$props.data.domain.computed}`; } }, deep: true, }, - '$props.data.documentRoot': { - handler(data) { - data.computed = data.computed.replace(/<.+>/, ''); - }, - deep: true, - }, - '$props.data.listenIpv4': { - handler(data) { - data.computed = data.computed.replace(/<.+>/, ''); - }, - deep: true, - }, - '$props.data.listenIpv6': { - handler(data) { - data.computed = data.computed.replace(/<.+>/, ''); - }, - deep: true, - }, }, }; diff --git a/src/nginxconfig/templates/global_sections/https.vue b/src/nginxconfig/templates/global_sections/https.vue index 74cc4af..e66fa58 100644 --- a/src/nginxconfig/templates/global_sections/https.vue +++ b/src/nginxconfig/templates/global_sections/https.vue @@ -372,12 +372,6 @@ THE SOFTWARE. }, deep: true, }, - '$props.data.letsEncryptCertRoot': { - handler(data) { - data.computed = data.computed.replace(/<.+>/, ''); - }, - deep: true, - }, }, }; diff --git a/src/nginxconfig/templates/prism/nginx.vue b/src/nginxconfig/templates/prism/nginx.vue index 590ab89..eb2921e 100644 --- a/src/nginxconfig/templates/prism/nginx.vue +++ b/src/nginxconfig/templates/prism/nginx.vue @@ -27,7 +27,7 @@ THE SOFTWARE. @@ -39,6 +39,26 @@ THE SOFTWARE. conf: String, half: Boolean, }, + data() { + return { + htmlEntityConf: '', + }; + }, + computed: { + showConf() { + return this.htmlEntityConf || this.conf; + }, + }, + watch: { + conf: { + handler( value ) { + if( ( /<|>/gm ).test( value ) ) { + this.htmlEntityConf = value.replaceAll(//g, '>'); + } + }, + immediate: true, + }, + }, mounted() { console.info(`Highlighting ${this.$props.name}...`); window.Prism.highlightAllUnder(this.$el);