File tree 3 files changed +26
-0
lines changed
hieradata/environments/production/roles
3 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,17 @@ profile::miscweb::sites:
18
18
name : jquery/demos.jquerymobile.com
19
19
branch : main
20
20
allow_php : true
21
+ # script-src: unsafe-eval for syntax highlighting on all pages
22
+ # img-src: data: for inline SVGs
23
+ # style-src|font-src: load fonts from Google Fonts
24
+ csp_header : |
25
+ default-src 'self';
26
+ script-src 'self' 'unsafe-eval';
27
+ img-src 'self' data:;
28
+ style-src 'self' fonts.googleapis.com;
29
+ font-src 'self' fonts.gstatic.com;
30
+ report-uri https://csp-report-api.openjs-foundation.workers.dev/;
31
+ report-to csp-endpoint
21
32
podcast.jquery.com :
22
33
repository :
23
34
name : jquery/podcast.jquery.com
@@ -42,6 +53,14 @@ profile::miscweb::sites:
42
53
}
43
54
php_env :
44
55
THEMEROLLER_ZIPDIR : /var/cache/themeroller-zip
56
+ # style-src: lots of inline styles
57
+ # img-src: data: for inline images
58
+ csp_header : |
59
+ default-src 'self';
60
+ style-src 'self' 'unsafe-inline';
61
+ img-src 'self' data:;
62
+ report-uri https://csp-report-api.openjs-foundation.workers.dev/;
63
+ report-to csp-endpoint
45
64
bugs.jquery.com :
46
65
repository :
47
66
name : jquery/bugs.jquery.com
Original file line number Diff line number Diff line change @@ -20,6 +20,11 @@ server {
20
20
21
21
# Add Content Security Policy headers
22
22
add_header Reporting-Endpoints "csp-endpoint='https://csp-report-api.openjs-foundation.workers.dev/'";
23
+ <%- if @site['csp_header'] -%>
24
+ add_header Content-Security-Policy-Report-Only "
25
+ <%= @site['csp_header'] %>
26
+ ";
27
+ <%- else -%>
23
28
# script-src: add 'wasm-unsafe-eval' for WebAssembly-driven search on
24
29
# bugs.jquery.com, bugs.jqueryui.com, and plugins.jquery.com
25
30
# img-src: allow secure.gravatar.com images on plugins.jquery.com
@@ -34,6 +39,7 @@ server {
34
39
report-uri https://csp-report-api.openjs-foundation.workers.dev/;
35
40
report-to csp-endpoint
36
41
";
42
+ <%- end -%>
37
43
38
44
<%- if @site['allow_php'] -%>
39
45
index index.php index.html;
Original file line number Diff line number Diff line change 9
9
allow_php => Optional[Boolean],
10
10
php_env => Optional[Hash[String[1], String]],
11
11
certificate => Optional[String[1]],
12
+ csp_header => Optional[String[1]],
12
13
}]
You can’t perform that action at this time.
0 commit comments