Escape HTML and update drone build

This commit is contained in:
Simon Marsh 2022-07-04 13:44:51 +01:00
parent 60922b120e
commit f98f561b86
No known key found for this signature in database
2 changed files with 64 additions and 1 deletions

View File

@ -1,8 +1,65 @@
---
kind: pipeline
type: exec
type: docker
name: default
steps:
- name: binary build
image: golang
environment:
CGO_ENABLED: 0
commands:
- go vet
- go build
- name: static build
image: alpine
commands:
- tar cvzf staticroot.tar.gz -C StaticRoot .
- name: upload bin
image: plugins/s3
settings:
bucket: artifacts
access_key:
from_secret: MINIO_ACCESS_KEY
secret_key:
from_secret: MINIO_SECRET_KEY
endpoint: https://minio.burble.dn42
region: uk-lon3
path_style: true
source: dn42regsrv
target: /dn42regsrv/${DRONE_BRANCH}
- name: upload site
image: plugins/s3
settings:
bucket: artifacts
access_key:
from_secret: MINIO_ACCESS_KEY
secret_key:
from_secret: MINIO_SECRET_KEY
endpoint: https://minio.burble.dn42
region: uk-lon3
path_style: true
source: staticroot.tar.gz
target: /dn42regsrv/${DRONE_BRANCH}
---
kind: secret
name: MINIO_ACCESS_KEY
get:
path: burble.dn42/kv/data/drone/minio
name: ACCESS_KEY
---
kind: secret
name: MINIO_SECRET_KEY
get:
path: burble.dn42/kv/data/drone/minio
name: SECRET_KEY
steps:
- name: build
environment:

View File

@ -57,7 +57,13 @@ Vue.component('reg-attribute', {
return reg[2]
},
decorated: function() {
// get content, replacing HTML special chars
var c = this.content
.replace(/&/g, "&")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;")
.replace(/'/g, "&#039;")
// an attribute terminated with \n indicates a blank
// trailing line, however a single trailing <br/> will