fix: styling

This commit is contained in:
Robert 2022-10-02 19:08:02 +03:00 committed by GitHub
parent 5c1e422d7d
commit e0db1ac498
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 121 deletions

View File

@ -32,16 +32,10 @@ export default (domains, global) => {
config.push(['# security headers', '']); config.push(['# security headers', '']);
config.push(['add_header X-XSS-Protection', '"1; mode=block" always']); config.push(['add_header X-XSS-Protection', '"1; mode=block" always']);
config.push(['add_header X-Content-Type-Options', '"nosniff" always']); config.push(['add_header X-Content-Type-Options', '"nosniff" always']);
config.push([ config.push(['add_header Referrer-Policy', `"${global.security.referrerPolicy.computed}" always`]);
'add_header Referrer-Policy',
`"${global.security.referrerPolicy.computed}" always`,
]);
if (global.security.contentSecurityPolicy.computed) if (global.security.contentSecurityPolicy.computed)
config.push([ config.push(['add_header Content-Security-Policy', `"${global.security.contentSecurityPolicy.computed}" always`]);
'add_header Content-Security-Policy',
`"${global.security.contentSecurityPolicy.computed}" always`,
]);
if (global.security.permissionsPolicy.computed) if (global.security.permissionsPolicy.computed)
config.push([ config.push([
@ -51,43 +45,27 @@ export default (domains, global) => {
// Every domain has HSTS enabled, and they all have same hstsSubdomains/hstsPreload settings // Every domain has HSTS enabled, and they all have same hstsSubdomains/hstsPreload settings
if (commonHsts(domains)) { if (commonHsts(domains)) {
const commonHSTSSubdomains = const commonHSTSSubdomains = domains.length && domains[0].https.hstsSubdomains.computed;
domains.length && domains[0].https.hstsSubdomains.computed; const commonHSTSPreload = domains.length && domains[0].https.hstsPreload.computed;
const commonHSTSPreload = config.push(['add_header Strict-Transport-Security', `"max-age=31536000${commonHSTSSubdomains ? '; includeSubDomains' : ''}${commonHSTSPreload ? '; preload' : ''}" always`]);
domains.length && domains[0].https.hstsPreload.computed;
config.push([
'add_header Strict-Transport-Security',
`"max-age=31536000${
commonHSTSSubdomains ? '; includeSubDomains' : ''
}${commonHSTSPreload ? '; preload' : ''}" always`,
]);
} }
config.push(['# . files', '']); config.push(['# . files', '']);
config.push([ config.push(['location ~ /\\.(?!well-known)', {
'location ~ /\\.(?!well-known)',
{
deny: 'all', deny: 'all',
}, }]);
]);
// Security.txt // Security.txt
if (global.security.securityTxt.computed) { if (global.security.securityTxt.computed) {
config.push(['# security.txt', '']); config.push(['# security.txt', '']);
config.push([ config.push(['location /security.txt', {
'location /security.txt',
{
return: '301 /.well-known/security.txt', return: '301 /.well-known/security.txt',
}, }]);
]);
// Custom security.txt path // Custom security.txt path
config.push([ config.push(['location = /.well-known/security.txt', {
'location = /.well-known/security.txt',
{
alias: `${global.security.securityTxtPath.value}`, alias: `${global.security.securityTxtPath.value}`,
}, }]);
]);
} }
if (global.security.blockCommonExploits.computed) { if (global.security.blockCommonExploits.computed) {

View File

@ -32,13 +32,7 @@ THE SOFTWARE.
</div> </div>
<div class="field-body"> <div class="field-body">
<div class="field"> <div class="field">
<div <div :class="`control${referrerPolicyChanged ? ' is-changed' : ''}`">
:class="
`control${
referrerPolicyChanged ? ' is-changed' : ''
}`
"
>
<VueSelect <VueSelect
v-model="referrerPolicy" v-model="referrerPolicy"
:options="$props.data.referrerPolicy.options" :options="$props.data.referrerPolicy.options"
@ -49,48 +43,25 @@ THE SOFTWARE.
</div> </div>
</div> </div>
<div <div :class="`field is-horizontal${hasWordPress && !hasUnsafeEval ? ' is-aligned-top' : ''}`">
:class="
`field is-horizontal${
hasWordPress && !hasUnsafeEval ? ' is-aligned-top' : ''
}`
"
>
<div class="field-label"> <div class="field-label">
<label class="label">Content-Security-Policy</label> <label class="label">Content-Security-Policy</label>
</div> </div>
<div class="field-body"> <div class="field-body">
<div class="field"> <div class="field">
<div <div :class="`control${contentSecurityPolicyChanged ? ' is-changed' : ''}`">
:class="
`control${
contentSecurityPolicyChanged
? ' is-changed'
: ''
}`
"
>
<input <input
v-model="contentSecurityPolicy" v-model="contentSecurityPolicy"
class="input" class="input"
type="text" type="text"
:placeholder=" :placeholder="$props.data.contentSecurityPolicy.default"
$props.data.contentSecurityPolicy.default
"
/> />
</div> </div>
<div <div v-if="hasWordPress && !hasWordPressUnsafeEval" class="control">
v-if="hasWordPress && !hasWordPressUnsafeEval"
class="control"
>
<label class="text message is-warning"> <label class="text message is-warning">
<span <span
class="message-body" class="message-body"
v-html=" v-html="$t('templates.globalSections.security.whenUsingWordPressUnsafeEvalIsOftenRequiredToAllowFunctionality')"
$t(
'templates.globalSections.security.whenUsingWordPressUnsafeEvalIsOftenRequiredToAllowFunctionality'
)
"
></span> ></span>
</label> </label>
</div> </div>
@ -104,13 +75,7 @@ THE SOFTWARE.
</div> </div>
<div class="field-body"> <div class="field-body">
<div class="field"> <div class="field">
<div <div :class="`control${permissionsPolicyChanged ? ' is-changed' : ''}`">
:class="
`control${
permissionsPolicyChanged ? ' is-changed' : ''
}`
"
>
<input <input
v-model="permissionsPolicy" v-model="permissionsPolicy"
class="input" class="input"
@ -128,17 +93,10 @@ THE SOFTWARE.
</div> </div>
<div class="field-body"> <div class="field-body">
<div class="field"> <div class="field">
<div <div :class="`control${serverTokensChanged ? ' is-changed' : ''}`">
:class="
`control${serverTokensChanged ? ' is-changed' : ''}`
"
>
<div class="checkbox"> <div class="checkbox">
<PrettyCheck <PrettyCheck v-model="serverTokens" class="p-default p-curve p-fill p-icon">
v-model="serverTokens" {{ $t('common.enable') }}
class="p-default p-curve p-fill p-icon"
>
{{ $t("common.enable") }}
</PrettyCheck> </PrettyCheck>
</div> </div>
</div> </div>
@ -152,17 +110,10 @@ THE SOFTWARE.
</div> </div>
<div class="field-body"> <div class="field-body">
<div class="field"> <div class="field">
<div <div :class="`control${limitReqChanged ? ' is-changed' : ''}`">
:class="
`control${limitReqChanged ? ' is-changed' : ''}`
"
>
<div class="checkbox"> <div class="checkbox">
<PrettyCheck <PrettyCheck v-model="limitReq" class="p-default p-curve p-fill p-icon">
v-model="limitReq" {{ $t('common.enable') }}
class="p-default p-curve p-fill p-icon"
>
{{ $t("common.enable") }}
</PrettyCheck> </PrettyCheck>
</div> </div>
</div> </div>
@ -178,11 +129,8 @@ THE SOFTWARE.
<div class="field"> <div class="field">
<div :class="`control${securityTxt ? ' is-changed' : ''}`"> <div :class="`control${securityTxt ? ' is-changed' : ''}`">
<div class="checkbox"> <div class="checkbox">
<PrettyCheck <PrettyCheck v-model="securityTxt" class="p-default p-curve p-fill p-icon">
v-model="securityTxt" {{ $t('common.enable') }}
class="p-default p-curve p-fill p-icon"
>
{{ $t("common.enable") }}
</PrettyCheck> </PrettyCheck>
</div> </div>
</div> </div>
@ -190,20 +138,13 @@ THE SOFTWARE.
</div> </div>
</div> </div>
<div <div v-if="$props.data.securityTxt.computed" class="field is-horizontal">
v-if="$props.data.securityTxt.computed"
class="field is-horizontal"
>
<div class="field-label"> <div class="field-label">
<label class="label">security.txt path</label> <label class="label">security.txt path</label>
</div> </div>
<div class="field-body"> <div class="field-body">
<div class="field"> <div class="field">
<div <div :class="`control${securityTxtChanged ? ' is-changed' : ''}`">
:class="
`control${securityTxtChanged ? ' is-changed' : ''}`
"
>
<input <input
v-model="securityTxtPath" v-model="securityTxtPath"
class="input" class="input"
@ -222,15 +163,9 @@ THE SOFTWARE.
<div class="field-body"> <div class="field-body">
<div class="field"> <div class="field">
<div <div
:class=" :class="`control${blockCommonExploits ? ' is-changed' : ''}`">
`control${blockCommonExploits ? ' is-changed' : ''}`
"
>
<div class="checkbox"> <div class="checkbox">
<PrettyCheck <PrettyCheck v-model="blockCommonExploits" class="p-default p-curve p-fill p-icon">
v-model="blockCommonExploits"
class="p-default p-curve p-fill p-icon"
>
{{ $t("common.enable") }} {{ $t("common.enable") }}
</PrettyCheck> </PrettyCheck>
</div> </div>