feat: SRI security toggle

This commit is contained in:
NGPixel
2019-10-12 14:41:45 -04:00
parent 3de0e1499a
commit acb57879dd
10 changed files with 452 additions and 322 deletions

View File

@@ -184,6 +184,16 @@
hint='Should be enabled when using a reverse-proxy like nginx, apache, CloudFlare, etc in front of Wiki.js. Turn off otherwise.'
)
v-divider.mt-3
v-switch(
inset
label='Subresource Integrity'
color='red darken-2'
v-model='config.securitySRI'
persistent-hint
hint='This ensure that resources such as CSS and JS files are not altered during delivery.'
)
v-divider.mt-3
v-switch(
inset
@@ -262,6 +272,7 @@ export default {
securityIframe: true,
securityReferrerPolicy: true,
securityTrustProxy: true,
securitySRI: true,
securityHSTS: false,
securityHSTSDuration: 0,
securityCSP: false,
@@ -309,6 +320,7 @@ export default {
securityIframe: _.get(this.config, 'securityIframe', false),
securityReferrerPolicy: _.get(this.config, 'securityReferrerPolicy', false),
securityTrustProxy: _.get(this.config, 'securityTrustProxy', false),
securitySRI: _.get(this.config, 'securitySRI', false),
securityHSTS: _.get(this.config, 'securityHSTS', false),
securityHSTSDuration: _.get(this.config, 'securityHSTSDuration', 0),
securityCSP: _.get(this.config, 'securityCSP', false),

View File

@@ -17,7 +17,7 @@
v-toolbar(color='grey darken-3', dark, dense, flat)
.body-2 Virtual Folders
v-spacer
v-btn(icon, tile)
v-btn(icon, tile, href='https://docs.requarks.io/', target='_blank')
v-icon mdi-help-box
v-treeview(
:active.sync='currentNode'
@@ -37,8 +37,8 @@
v-toolbar(color='blue darken-2', dark, dense, flat)
.body-2 Pages
v-spacer
v-btn(icon, tile): v-icon mdi-content-save-move-outline
v-btn(icon, tile): v-icon mdi-trash-can-outline
v-btn(icon, tile, disabled): v-icon mdi-content-save-move-outline
v-btn(icon, tile, disabled): v-icon mdi-trash-can-outline
v-list.py-0(dense, v-if='currentPages.length > 0')
v-list-item-group(
v-model='currentPage'
@@ -131,6 +131,7 @@ export default {
children: []
}],
pages: [],
all: [],
namespaces: siteLangs.length ? siteLangs.map(ns => ns.code) : [siteConfig.lang]
}
},
@@ -162,6 +163,20 @@ export default {
this.$nextTick(() => {
this.currentNode = oldValue
})
} else {
if (this.openNodes.indexOf(newValue[0]) < 0) { // auto open and load children
const current = _.find(this.all, ['id', newValue[0]])
if (current) {
if (this.openNodes.indexOf(current.parent) < 0) {
this.$nextTick(() => {
this.openNodes.push(current.parent)
})
}
}
this.$nextTick(() => {
this.openNodes.push(newValue[0])
})
}
}
},
currentPage (newValue, oldValue) {
@@ -204,6 +219,8 @@ export default {
}
this.pages.push(...itemPages)
this.all.push(...items)
this.searchLoading = false
}
}