Skip to content

Commit eea8db9

Browse files
committed
Fingerprint during Ember build
1 parent e19c4ad commit eea8db9

File tree

6 files changed

+45
-34
lines changed

6 files changed

+45
-34
lines changed

domain/document/endpoint.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import (
4343
"github.com/documize/community/model/space"
4444
"github.com/documize/community/model/user"
4545
"github.com/documize/community/model/workflow"
46+
"github.com/microcosm-cc/bluemonday"
4647
)
4748

4849
// Handler contains the runtime information such as logging and database.
@@ -270,6 +271,9 @@ func (h *Handler) Update(w http.ResponseWriter, r *http.Request) {
270271
}
271272
}
272273

274+
d.Name = bluemonday.StrictPolicy().Sanitize(d.Name)
275+
d.Excerpt = bluemonday.StrictPolicy().Sanitize(d.Excerpt)
276+
273277
err = h.Store.Document.Update(ctx, d)
274278
if err != nil {
275279
h.Runtime.Rollback(ctx.Transaction)

domain/section/frame/frame.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,6 @@ func (*Provider) Refresh(ctx *provider.Context, config, data string) string {
5454
}
5555

5656
func embed(config, data string) string {
57+
// return bluemonday.UGCPolicy().Sanitize(data)
5758
return data
5859
}

domain/section/markdown/markdown.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ func (*Provider) Command(ctx *provider.Context, w http.ResponseWriter, r *http.R
4747
}
4848

4949
// Render converts markdown data into HTML suitable for browser rendering.
50+
// See also https://github.com/yuin/goldmark
5051
func (*Provider) Render(ctx *provider.Context, config, data string) string {
5152
unsafe := blackfriday.Run([]byte(data))
5253

domain/space/endpoint.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ import (
4444
"github.com/documize/community/model/space"
4545
"github.com/documize/community/model/user"
4646
wf "github.com/documize/community/model/workflow"
47+
"github.com/microcosm-cc/bluemonday"
4748
uuid "github.com/nu7hatch/gouuid"
4849
)
4950

@@ -99,7 +100,8 @@ func (h *Handler) Add(w http.ResponseWriter, r *http.Request) {
99100

100101
var sp space.Space
101102
sp.Name = model.Name
102-
sp.Description = model.Description
103+
sp.Description = bluemonday.StrictPolicy().Sanitize(model.Description)
104+
103105
sp.Icon = model.Icon
104106
sp.LabelID = model.LabelID
105107
sp.RefID = uniqueid.Generate()

edition/community.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func main() {
4141
rt.Product.Major = "4"
4242
rt.Product.Minor = "0"
4343
rt.Product.Patch = "0"
44-
rt.Product.Revision = "210817183831"
44+
rt.Product.Revision = "210907143905"
4545
rt.Product.Version = fmt.Sprintf("%s.%s.%s", rt.Product.Major, rt.Product.Minor, rt.Product.Patch)
4646
rt.Product.Edition = domain.CommunityEdition
4747
rt.Product.Title = fmt.Sprintf("%s Edition", rt.Product.Edition)

gui/ember-cli-build.js

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,48 +7,51 @@ let isDevelopment = EmberApp.env() === 'development';
77

88
module.exports = function(defaults) {
99
let app = new EmberApp(defaults, {
10-
'ember-cli-terser': {
11-
enabled: !isDevelopment,
12-
exclude: ['tinymce/**', 'codemirror/**', 'prism/**', 'pdfjs/**'],
13-
14-
hiddenSourceMap: true,
15-
16-
fingerprint: {
10+
fingerprint: {
1711
enabled: true,
1812
generateAssetMap: true,
19-
fingerprintAssetMap: true,
13+
fingerprintAssetMap: false,
2014
prepend: '/',
2115
extensions: ['js', 'css'],
2216
exclude: ['tinymce/**', 'codemirror/**', 'prism/**', 'pdfjs/**']
23-
},
17+
},
2418

25-
minifyJS: {
26-
enabled: !isDevelopment,
27-
options: {
28-
exclude: ['tinymce/**', 'codemirror/**', 'prism/**', 'pdfjs/**']
29-
}
30-
},
19+
minifyCSS: {
20+
enabled: !isDevelopment,
21+
options: {
22+
exclude: ['tinymce/**', 'codemirror/**', 'prism/**', 'pdfjs/**']
23+
}
24+
},
3125

32-
minifyCSS: {
33-
enabled: !isDevelopment,
34-
options: {
35-
exclude: ['tinymce/**', 'codemirror/**', 'prism/**', 'pdfjs/**']
26+
outputPaths: {
27+
app: {
28+
css: {
29+
'app': '/assets/documize.css',
30+
'themes/conference': '/assets/theme-conference.css',
31+
'themes/forest': '/assets/theme-forest.css',
32+
'themes/brave': '/assets/theme-brave.css',
33+
'themes/harvest': '/assets/theme-harvest.css',
34+
'themes/sunflower': '/assets/theme-sunflower.css',
35+
'themes/silver': '/assets/theme-silver.css',
3636
}
37+
}
38+
},
39+
40+
'ember-cli-terser': {
41+
enabled: !isDevelopment,
42+
exclude: ['tinymce/**', 'codemirror/**', 'prism/**', 'pdfjs/**'],
43+
44+
hiddenSourceMap: true,
45+
46+
terser: {
3747
},
3848

39-
outputPaths: {
40-
app: {
41-
css: {
42-
'app': '/assets/documize.css',
43-
'themes/conference': '/assets/theme-conference.css',
44-
'themes/forest': '/assets/theme-forest.css',
45-
'themes/brave': '/assets/theme-brave.css',
46-
'themes/harvest': '/assets/theme-harvest.css',
47-
'themes/sunflower': '/assets/theme-sunflower.css',
48-
'themes/silver': '/assets/theme-silver.css',
49-
}
50-
}
51-
}
49+
// minifyJS: {
50+
// enabled: !isDevelopment,
51+
// options: {
52+
// exclude: ['tinymce/**', 'codemirror/**', 'prism/**', 'pdfjs/**']
53+
// }
54+
// },
5255
},
5356
});
5457

0 commit comments

Comments
 (0)