funkwhale: Sync frontend template with upstream

This commit is contained in:
Alexander Olofsson 2022-11-25 21:40:21 +01:00
parent 802d83645d
commit a6476ed30a
No known key found for this signature in database
GPG key ID: D439C9470CB04C73
3 changed files with 25 additions and 30 deletions

View file

@ -4,7 +4,7 @@ appVersion: "1.2.9"
description: A social platform to enjoy and share music description: A social platform to enjoy and share music
icon: https://funkwhale.audio/favicon.png icon: https://funkwhale.audio/favicon.png
name: funkwhale name: funkwhale
version: 0.6.1 version: 0.7.0
dependencies: dependencies:
- name: redis - name: redis

View file

@ -15,22 +15,25 @@ data:
server localhost:5000; server localhost:5000;
} }
# Required for websocket support.
map $http_upgrade $connection_upgrade { map $http_upgrade $connection_upgrade {
default upgrade; default upgrade;
'' close; '' close;
} }
server { server {
listen 80; listen 80;
listen [::]:80; listen [::]:80;
charset utf-8;
server_name ${FUNKWHALE_HOSTNAME}; server_name _;
root /frontend; add_header Content-Security-Policy "default-src 'self'; connect-src https: wss: http: ws: 'self' 'unsafe-eval'; script-src 'self' 'wasm-unsafe-eval'; style-src https: http: 'self' 'unsafe-inline'; img-src https: http: 'self' data:; font-src https: http: 'self' data:; media-src https: http: 'self' data:; object-src 'none'";
add_header Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self' data:; object-src 'none'; media-src 'self' data:; worker-src 'self'";
add_header Referrer-Policy "strict-origin-when-cross-origin"; add_header Referrer-Policy "strict-origin-when-cross-origin";
add_header X-Frame-Options "SAMEORIGIN" always; add_header X-Frame-Options "SAMEORIGIN" always;
add_header Service-Worker-Allowed "/";
root /frontend;
# compression settings # compression settings
gzip on; gzip on;
@ -67,25 +70,16 @@ data:
} }
location /front/ { location /front/ {
add_header Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self' data:; object-src 'none'; media-src 'self' data:; worker-src 'self'";
add_header Referrer-Policy "strict-origin-when-cross-origin";
add_header Service-Worker-Allowed "/";
add_header X-Frame-Options "ALLOW";
alias /frontend/; alias /frontend/;
expires 30d; expires 1d;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
} }
location /front/embed.html { location /front/embed.html {
add_header Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self' data:; object-src 'none'; media-src 'self' data:; worker-src 'self'"; add_header Content-Security-Policy "connect-src https: http: 'self'; default-src 'self'; script-src 'self' unpkg.com 'unsafe-inline' 'unsafe-eval'; style-src https: http: 'self' 'unsafe-inline'; img-src https: http: 'self' data:; font-src https: http: 'self' data:; object-src 'none'; media-src https: http: 'self' data:";
add_header Referrer-Policy "strict-origin-when-cross-origin"; add_header Referrer-Policy "strict-origin-when-cross-origin";
add_header X-Frame-Options "" always;
alias /frontend/embed.html; alias /frontend/embed.html;
expires 30d; expires 1d;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
} }
location /federation/ { location /federation/ {
@ -106,24 +100,23 @@ data:
location /media/ { location /media/ {
alias ${MEDIA_ROOT}/; alias ${MEDIA_ROOT}/;
add_header Access-Control-Allow-Origin '*';
} }
{{- if .Values.s3.enabled }}
location ~ /_protected/media/(.+) {
internal;
# Needed to ensure DSub auth isn't forwarded to S3/Minio, see #932
proxy_set_header Authorization "";
proxy_pass $1;
}
{{- else }}
# this is an internal location that is used to serve # this is an internal location that is used to serve
# audio files once correct permission / authentication # audio files once correct permission / authentication
# has been checked on API side # has been checked on API side
location /_protected/media { location ~ /_protected/media/(.+) {
internal; internal;
alias ${MEDIA_ROOT}; {{- if .Values.s3.enabled }}
} # Needed to ensure DSub auth isn't forwarded to S3/Minio, see #932.
proxy_set_header Authorization "";
proxy_pass $1;
{{- else }}
alias ${MEDIA_ROOT}/$1;
{{- end }} {{- end }}
add_header Access-Control-Allow-Origin '*';
}
location /_protected/music { location /_protected/music {
# this is an internal location that is used to serve # this is an internal location that is used to serve
@ -131,7 +124,8 @@ data:
# has been checked on API side # has been checked on API side
# Set this to the same value as your MUSIC_DIRECTORY_PATH setting # Set this to the same value as your MUSIC_DIRECTORY_PATH setting
internal; internal;
alias ${MUSIC_DIRECTORY_SERVE_PATH}; alias ${MUSIC_DIRECTORY_SERVE_PATH}/;
add_header Access-Control-Allow-Origin '*';
} }
location /staticfiles/ { location /staticfiles/ {

View file

@ -23,6 +23,7 @@ spec:
metadata: metadata:
annotations: annotations:
checksum/configmap: {{ include (print .Template.BasePath "/configmap.yaml") . | sha256sum }} checksum/configmap: {{ include (print .Template.BasePath "/configmap.yaml") . | sha256sum }}
checksum/frontend: {{ include (print .Template.BasePath "/configmap-front.yaml") . | sha256sum }}
checksum/secret: {{ include (print .Template.BasePath "/secret.yaml") . | sha256sum }} checksum/secret: {{ include (print .Template.BasePath "/secret.yaml") . | sha256sum }}
labels: labels:
app.kubernetes.io/name: {{ include "funkwhale.name" . }} app.kubernetes.io/name: {{ include "funkwhale.name" . }}