Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bf770fed83 |
+3
-10
@@ -8,16 +8,9 @@
|
|||||||
"allowCustomHomeservers": false,
|
"allowCustomHomeservers": false,
|
||||||
"featuredCommunities": {
|
"featuredCommunities": {
|
||||||
"openAsDefault": false,
|
"openAsDefault": false,
|
||||||
"spaces": [
|
"spaces": [],
|
||||||
"!-1ZBnAH-JiCOV8MGSKN77zDGTuI3pgSdy8Unu_DrDyc",
|
"rooms": [],
|
||||||
"#homelab:codestorm.net"
|
"servers": []
|
||||||
],
|
|
||||||
"rooms": [
|
|
||||||
"#jellyfin:matrix.org"
|
|
||||||
],
|
|
||||||
"servers": [
|
|
||||||
"matrixrooms.info"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"hashRouter": {
|
"hashRouter": {
|
||||||
"enabled": false,
|
"enabled": false,
|
||||||
|
|||||||
@@ -160,7 +160,13 @@ echo "[$(date '+%Y-%m-%d %H:%M:%S')] Deploying to $WEBROOT..."
|
|||||||
# /var/www/html/config.json by lxc106-cinny.sh. The build ships a DEV default
|
# /var/www/html/config.json by lxc106-cinny.sh. The build ships a DEV default
|
||||||
# (allowCustomHomeservers:true); rsyncing it would clobber the production config
|
# (allowCustomHomeservers:true); rsyncing it would clobber the production config
|
||||||
# on every deploy. Keep the app bundle and the runtime config separate.
|
# on every deploy. Keep the app bundle and the runtime config separate.
|
||||||
rsync -a --delete --exclude config.json dist/ "$WEBROOT/"
|
# [matrix #23] Keep the previous builds' hashed assets for a while: a browser
|
||||||
|
# still holding an older index.html (or service-worker precache) asks for its
|
||||||
|
# assets/index-<old hash>.js, and deleting them on every deploy broke the app
|
||||||
|
# for those users until their cached shell expired. Prune after 14 days.
|
||||||
|
rsync -a --delete --exclude config.json --exclude assets/ dist/ "$WEBROOT/"
|
||||||
|
rsync -a dist/assets/ "$WEBROOT/assets/"
|
||||||
|
find "$WEBROOT/assets" -type f -mtime +14 -delete
|
||||||
|
|
||||||
echo "[$(date '+%Y-%m-%d %H:%M:%S')] ===== Deploy complete ($VITE_APP_VERSION) ====="
|
echo "[$(date '+%Y-%m-%d %H:%M:%S')] ===== Deploy complete ($VITE_APP_VERSION) ====="
|
||||||
|
|
||||||
|
|||||||
@@ -12,4 +12,4 @@ add_header X-XSS-Protection "1; mode=block" always;
|
|||||||
add_header Referrer-Policy strict-origin-when-cross-origin always;
|
add_header Referrer-Policy strict-origin-when-cross-origin always;
|
||||||
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
|
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
|
||||||
add_header Permissions-Policy 'accelerometer=(), autoplay=(self "https://call.chat.lotusguild.org"), camera=(self "https://call.chat.lotusguild.org"), display-capture=(self "https://call.chat.lotusguild.org"), encrypted-media=(self), fullscreen=(self), geolocation=(self), gyroscope=(), magnetometer=(), microphone=(self "https://call.chat.lotusguild.org"), midi=(), payment=(), usb=()' always;
|
add_header Permissions-Policy 'accelerometer=(), autoplay=(self "https://call.chat.lotusguild.org"), camera=(self "https://call.chat.lotusguild.org"), display-capture=(self "https://call.chat.lotusguild.org"), encrypted-media=(self), fullscreen=(self), geolocation=(self), gyroscope=(), magnetometer=(), microphone=(self "https://call.chat.lotusguild.org"), midi=(), payment=(), usb=()' always;
|
||||||
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' blob:; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: https://matrix.lotusguild.org https://matrix.org https://*.matrix.org https://mozilla.org https://mozilla.modular.im https://drive.lotusguild.org https://media.giphy.com https://media0.giphy.com https://media1.giphy.com https://media2.giphy.com https://media3.giphy.com https://media4.giphy.com https://www.openstreetmap.org https://tile.openstreetmap.org; font-src 'self' data:; connect-src 'self' https://matrix.lotusguild.org wss://matrix.lotusguild.org https://isitup.lotusguild.org https://matrix.org https://*.matrix.org https://mozilla.org https://mozilla.modular.im https://chat.mozilla.org https://www.mozilla.org https://vector.im https://api.giphy.com https://*.giphy.com https://www.tiktok.com wss:; media-src 'self' https: blob:; frame-src 'self' https:; worker-src 'self' blob:; object-src 'none'; frame-ancestors 'none'; base-uri 'self'; form-action 'self';" always;
|
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' blob:; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: https://matrix.lotusguild.org https://matrix.org https://*.matrix.org https://mozilla.org https://mozilla.modular.im https://drive.lotusguild.org https://media.giphy.com https://media0.giphy.com https://media1.giphy.com https://media2.giphy.com https://media3.giphy.com https://media4.giphy.com https://www.openstreetmap.org https://tile.openstreetmap.org; font-src 'self' data:; connect-src 'self' https://matrix.lotusguild.org wss://matrix.lotusguild.org https://isitup.lotusguild.org https://matrix.org https://*.matrix.org https://mozilla.org https://mozilla.modular.im https://chat.mozilla.org https://vector.im https://api.giphy.com https://*.giphy.com wss:; media-src 'self' https: blob:; frame-src 'self' https:; worker-src 'self' blob:; object-src 'none'; frame-ancestors 'none'; base-uri 'self'; form-action 'self';" always;
|
||||||
|
|||||||
@@ -1,3 +1,12 @@
|
|||||||
|
# [matrix #23] SPA routes (/, /home/…, /login/…) are rewritten to /index.html
|
||||||
|
# inside `location /`, where no cache headers were set: browsers then reused a
|
||||||
|
# heuristically fresh shell after a deploy and requested deleted assets. Only
|
||||||
|
# the rewritten shell gets no-cache; other files there keep their defaults.
|
||||||
|
map $uri $lotus_shell_cache_control {
|
||||||
|
/index.html "no-cache, no-store, must-revalidate";
|
||||||
|
default "";
|
||||||
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
listen [::]:80;
|
listen [::]:80;
|
||||||
@@ -99,6 +108,9 @@ server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
|
# add_header here drops the server-level headers, so include them again.
|
||||||
|
include snippets/cinny-security-headers.conf;
|
||||||
|
add_header Cache-Control $lotus_shell_cache_control always;
|
||||||
rewrite ^/config\.json$ /config.json break;
|
rewrite ^/config\.json$ /config.json break;
|
||||||
rewrite ^/manifest\.json$ /manifest.json break;
|
rewrite ^/manifest\.json$ /manifest.json break;
|
||||||
rewrite ^/sw\.js$ /sw.js break;
|
rewrite ^/sw\.js$ /sw.js break;
|
||||||
|
|||||||
Reference in New Issue
Block a user