From 8935e9098b8f10a7829557ee6d546f29c80d0d16 Mon Sep 17 00:00:00 2001 From: Robert Date: Sun, 2 Oct 2022 19:11:50 +0300 Subject: [PATCH] fix: styling --- .../generators/conf/security.conf.js | 5 +-- .../templates/global_sections/security.vue | 34 ++++++------------- 2 files changed, 12 insertions(+), 27 deletions(-) diff --git a/src/nginxconfig/generators/conf/security.conf.js b/src/nginxconfig/generators/conf/security.conf.js index 524c70a..9db4284 100644 --- a/src/nginxconfig/generators/conf/security.conf.js +++ b/src/nginxconfig/generators/conf/security.conf.js @@ -38,10 +38,7 @@ export default (domains, global) => { config.push(['add_header Content-Security-Policy', `"${global.security.contentSecurityPolicy.computed}" always`]); if (global.security.permissionsPolicy.computed) - config.push([ - 'add_header Permissions-Policy', - `"${global.security.permissionsPolicy.computed}" always`, - ]); + config.push(['add_header Permissions-Policy', `"${global.security.permissionsPolicy.computed}" always`]); // Every domain has HSTS enabled, and they all have same hstsSubdomains/hstsPreload settings if (commonHsts(domains)) { diff --git a/src/nginxconfig/templates/global_sections/security.vue b/src/nginxconfig/templates/global_sections/security.vue index 8215bf6..6f39bee 100644 --- a/src/nginxconfig/templates/global_sections/security.vue +++ b/src/nginxconfig/templates/global_sections/security.vue @@ -181,7 +181,6 @@ THE SOFTWARE. import delegatedFromDefaults from '../../util/delegated_from_defaults'; import computedFromDefaults from '../../util/computed_from_defaults'; import PrettyCheck from '../inputs/checkbox'; - const defaults = { referrerPolicy: { default: 'no-referrer-when-downgrade', @@ -198,8 +197,7 @@ THE SOFTWARE. enabled: true, }, contentSecurityPolicy: { - default: - 'default-src \'self\' http: https: ws: wss: data: blob: \'unsafe-inline\'; frame-ancestors \'self\';', + default: 'default-src \'self\' http: https: ws: wss: data: blob: \'unsafe-inline\'; frame-ancestors \'self\';', enabled: true, }, permissionsPolicy: { @@ -222,37 +220,27 @@ THE SOFTWARE. default: '~/security.txt', enabled: true, }, - blockCommonExploits: { - default: false, - enabled: true, - }, }; - export default { - name: 'GlobalSecurity', // Component name - display: 'templates.globalSections.security.security', // Display name for tab (i18n key) - key: 'security', // Key for data in parent - delegated: delegatedFromDefaults(defaults), // Data the parent will present here + name: 'GlobalSecurity', // Component name + display: 'templates.globalSections.security.security', // Display name for tab (i18n key) + key: 'security', // Key for data in parent + delegated: delegatedFromDefaults(defaults), // Data the parent will present here components: { PrettyCheck, VueSelect, }, props: { - data: Object, // Data delegated back to us from parent + data: Object, // Data delegated back to us from parent }, computed: { - ...computedFromDefaults(defaults, 'security'), // Getters & setters for the delegated data + ...computedFromDefaults(defaults, 'security'), // Getters & setters for the delegated data hasWordPress() { - return this.$parent.$parent.$data.domains.some( - d => d && d.php.wordPressRules.computed, - ); + return this.$parent.$parent.$data.domains.some(d => d && d.php.wordPressRules.computed); }, hasWordPressUnsafeEval() { - return ( - this.$props.data.contentSecurityPolicy.computed.match( - /(default|script)-src[^;]+'self'[^;]+'unsafe-inline'[^;]+'unsafe-eval'[^;]*;/, - ) !== null - ); + return this.$props.data.contentSecurityPolicy.computed + .match(/(default|script)-src[^;]+'self'[^;]+'unsafe-inline'[^;]+'unsafe-eval'[^;]*;/) !== null; }, hasWarnings() { return this.hasWordPress && !this.hasWordPressUnsafeEval; @@ -271,4 +259,4 @@ THE SOFTWARE. }, }, }; - + \ No newline at end of file