From edf73acc0867cfc2b3367fe388ef734aef0555f5 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Mon, 2 Nov 2020 13:01:44 -0500 Subject: [PATCH] add Global Privacy Control metadata --- nginx/server.conf | 2 +- process_static | 2 +- static/.well-known/gpc.json | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 static/.well-known/gpc.json diff --git a/nginx/server.conf b/nginx/server.conf index d4ca3eee..25cd5525 100644 --- a/nginx/server.conf +++ b/nginx/server.conf @@ -103,7 +103,7 @@ server { gzip_static off; } - location ~ "\.(txt|xml)$" { + location ~ "\.(json|txt|xml)$" { include /etc/nginx/snippets/security-headers.conf; add_header Cache-Control "public, max-age=1800"; } diff --git a/process_static b/process_static index 2d6a6826..923c234e 100755 --- a/process_static +++ b/process_static @@ -10,6 +10,6 @@ json_reformat -m < static_tmp/manifest.webmanifest | sponge static_tmp/manifest. find static_tmp -name '*.css' -exec csso {} -o {} \; find static_tmp -name '*.html' -exec html-minifier --collapse-whitespace --process-scripts "application/ld+json" --collapse-boolean-attributes --remove-attribute-quotes --remove-comments --remove-empty-attributes --remove-redundant-attributes --remove-script-type-attributes --remove-style-link-type-attributes --sort-attributes --sort-class-name {} -o {} \; find static_tmp -name '*.js' -exec terser --module -cmo {} {} \; -find static_tmp -regex '\(.+/LICENSE\|.+\.\(css\|html\|ico\|js\|svg\|txt\|webmanifest\|xml\)\)' \ +find static_tmp -regex '\(.+/LICENSE\|.+\.\(css\|html\|ico\|js\|svg\|json\|txt\|webmanifest\|xml\)\)' \ -exec zopfli {} \; -exec touch -r {} {}.gz \; \ -exec brotli -k {} \; diff --git a/static/.well-known/gpc.json b/static/.well-known/gpc.json new file mode 100644 index 00000000..6f51b5c9 --- /dev/null +++ b/static/.well-known/gpc.json @@ -0,0 +1 @@ +{ "gpc": true, "version": 1 }