1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-19 05:09:42 +02:00

Fingerprint during Ember build

This commit is contained in:
HarveyKandola 2021-09-07 20:18:30 -04:00
parent e19c4ad18a
commit eea8db9288
6 changed files with 47 additions and 36 deletions

View file

@ -43,6 +43,7 @@ import (
"github.com/documize/community/model/space"
"github.com/documize/community/model/user"
"github.com/documize/community/model/workflow"
"github.com/microcosm-cc/bluemonday"
)
// Handler contains the runtime information such as logging and database.
@ -270,6 +271,9 @@ func (h *Handler) Update(w http.ResponseWriter, r *http.Request) {
}
}
d.Name = bluemonday.StrictPolicy().Sanitize(d.Name)
d.Excerpt = bluemonday.StrictPolicy().Sanitize(d.Excerpt)
err = h.Store.Document.Update(ctx, d)
if err != nil {
h.Runtime.Rollback(ctx.Transaction)

View file

@ -54,5 +54,6 @@ func (*Provider) Refresh(ctx *provider.Context, config, data string) string {
}
func embed(config, data string) string {
// return bluemonday.UGCPolicy().Sanitize(data)
return data
}

View file

@ -47,6 +47,7 @@ func (*Provider) Command(ctx *provider.Context, w http.ResponseWriter, r *http.R
}
// Render converts markdown data into HTML suitable for browser rendering.
// See also https://github.com/yuin/goldmark
func (*Provider) Render(ctx *provider.Context, config, data string) string {
unsafe := blackfriday.Run([]byte(data))

View file

@ -44,6 +44,7 @@ import (
"github.com/documize/community/model/space"
"github.com/documize/community/model/user"
wf "github.com/documize/community/model/workflow"
"github.com/microcosm-cc/bluemonday"
uuid "github.com/nu7hatch/gouuid"
)
@ -99,7 +100,8 @@ func (h *Handler) Add(w http.ResponseWriter, r *http.Request) {
var sp space.Space
sp.Name = model.Name
sp.Description = model.Description
sp.Description = bluemonday.StrictPolicy().Sanitize(model.Description)
sp.Icon = model.Icon
sp.LabelID = model.LabelID
sp.RefID = uniqueid.Generate()

View file

@ -41,7 +41,7 @@ func main() {
rt.Product.Major = "4"
rt.Product.Minor = "0"
rt.Product.Patch = "0"
rt.Product.Revision = "210817183831"
rt.Product.Revision = "210907143905"
rt.Product.Version = fmt.Sprintf("%s.%s.%s", rt.Product.Major, rt.Product.Minor, rt.Product.Patch)
rt.Product.Edition = domain.CommunityEdition
rt.Product.Title = fmt.Sprintf("%s Edition", rt.Product.Edition)

View file

@ -7,28 +7,15 @@ let isDevelopment = EmberApp.env() === 'development';
module.exports = function(defaults) {
let app = new EmberApp(defaults, {
'ember-cli-terser': {
enabled: !isDevelopment,
exclude: ['tinymce/**', 'codemirror/**', 'prism/**', 'pdfjs/**'],
hiddenSourceMap: true,
fingerprint: {
enabled: true,
generateAssetMap: true,
fingerprintAssetMap: true,
fingerprintAssetMap: false,
prepend: '/',
extensions: ['js', 'css'],
exclude: ['tinymce/**', 'codemirror/**', 'prism/**', 'pdfjs/**']
},
minifyJS: {
enabled: !isDevelopment,
options: {
exclude: ['tinymce/**', 'codemirror/**', 'prism/**', 'pdfjs/**']
}
},
minifyCSS: {
enabled: !isDevelopment,
options: {
@ -48,7 +35,23 @@ module.exports = function(defaults) {
'themes/silver': '/assets/theme-silver.css',
}
}
}
},
'ember-cli-terser': {
enabled: !isDevelopment,
exclude: ['tinymce/**', 'codemirror/**', 'prism/**', 'pdfjs/**'],
hiddenSourceMap: true,
terser: {
},
// minifyJS: {
// enabled: !isDevelopment,
// options: {
// exclude: ['tinymce/**', 'codemirror/**', 'prism/**', 'pdfjs/**']
// }
// },
},
});