summaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2019-04-25 22:54:01 -0400
committerDaniel Micay <danielmicay@gmail.com>2019-04-25 22:57:08 -0400
commit3f4a26cc86c67ba83970ac1bc681733a56eb3629 (patch)
tree9997707c43d2531cfca6be09e44375841632c70a /static
parent7daaa2e77fa195249808977b2182b58a7a8a0057 (diff)
add htaccess based on attestation.app
Diffstat (limited to 'static')
-rw-r--r--static/.htaccess59
1 files changed, 59 insertions, 0 deletions
diff --git a/static/.htaccess b/static/.htaccess
new file mode 100644
index 00000000..94e5e482
--- /dev/null
+++ b/static/.htaccess
@@ -0,0 +1,59 @@
+Options -indexes
+
+Header always set Content-Security-Policy "default-src 'none'; connect-src 'self' https://seamlessupdate.app/; \
+font-src 'self'; img-src 'self'; manifest-src 'self'; script-src 'self'; style-src 'self'; \
+form-action 'none'; frame-ancestors 'none'; block-all-mixed-content; base-uri 'none'; \
+report-uri https://danielmicay.report-uri.com/r/d/csp/enforce"
+
+Header always set Feature-Policy "accelerometer 'none'; \
+ambient-light-sensor 'none'; \
+autoplay 'none'; \
+camera 'none'; \
+encrypted-media 'none'; \
+fullscreen 'none'; \
+geolocation 'none'; \
+gyroscope 'none'; \
+magnetometer 'none'; \
+microphone 'none'; \
+midi 'none'; \
+payment 'none'; \
+picture-in-picture 'none'; \
+speaker 'none'; \
+sync-xhr 'none'; \
+usb 'none'; \
+vr 'none'"
+
+<FilesMatch "\.(html|txt|webmanifest|xml)$">
+Header set Cache-Control "public, max-age=1800"
+</FilesMatch>
+
+<FilesMatch "\.(ico)$">
+Header set Cache-Control "public, max-age=86400"
+</FilesMatch>
+
+<FilesMatch "\.(css|js|png|woff2)$">
+Header set Cache-Control "public, max-age=31536000"
+</FilesMatch>
+
+RedirectMatch 301 ^/security.txt$ /.well-known/security.txt
+
+RewriteEngine on
+
+RewriteCond %{REQUEST_FILENAME} !-d
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteCond %{REQUEST_FILENAME}\.html -f
+RewriteRule ^([^\.]+)$ $1.html [L]
+
+RewriteCond %{ENV:REDIRECT_STATUS} ^$
+RewriteCond %{REQUEST_URI} ".*\.html$"
+RewriteCond %{REQUEST_FILENAME} -f
+RewriteRule ^(.*)\.html$ /$1 [L,R=301]
+
+AddType application/manifest+json webmanifest
+
+AddOutputFilterByType DEFLATE application/manifest+json
+AddOutputFilterByType DEFLATE application/javascript
+AddOutputFilterByType DEFLATE image/vnd.microsoft.icon
+AddOutputFilterByType DEFLATE text/css
+AddOutputFilterByType DEFLATE text/html
+AddOutputFilterByType DEFLATE text/plain