Add security.txt (#181)

* Add security.txt

* Add security.txt

* Update website.conf

* Update security label

* Add eslint linebreak for windows

* Removed backwards compability security.txt encryption

* Update .eslintrc.js

* Update security component

* Change location redirect on security.txt to absolute path

* Moved security.txt config into security.conf
pull/189/head
William Chang 2020-10-22 22:45:11 +07:00 committed by GitHub
parent b48162a3e2
commit 8bc06372a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 56 additions and 0 deletions

View File

@ -50,6 +50,19 @@ export default (domains, global) => {
deny: 'all',
}]);
// Security.txt
if (global.security.securityTxt.computed) {
config.push(['# security.txt', '']);
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}`,
}]);
}
// Done!
return config;
};

View File

@ -102,6 +102,41 @@ THE SOFTWARE.
</div>
</div>
</div>
<div class="field is-horizontal">
<div class="field-label">
<label class="label">security.txt</label>
</div>
<div class="field-body">
<div class="field">
<div :class="`control${securityTxt ? ' is-changed' : ''}`">
<div class="checkbox">
<PrettyCheck v-model="securityTxt" class="p-default p-curve p-fill p-icon">
<i slot="extra" class="icon fas fa-check"></i>
{{ i18n.common.enable }}
</PrettyCheck>
</div>
</div>
</div>
</div>
</div>
<div v-if="$props.data.securityTxt.computed" class="field is-horizontal">
<div class="field-label">
<label class="label">security.txt path</label>
</div>
<div class="field-body">
<div class="field">
<div :class="`control${securityTxtChanged ? ' is-changed' : ''}`">
<input v-model="securityTxtPath"
class="input"
type="text"
:placeholder="$props.data.securityTxtPath.default"
/>
</div>
</div>
</div>
</div>
</div>
</template>
@ -139,6 +174,14 @@ THE SOFTWARE.
default: false,
enabled: true,
},
securityTxt: {
default: false,
enabled: true,
},
securityTxtPath: {
default: '~/security.txt',
enabled: true,
},
};
export default {