From f83c4c5b54f50521ed652fd9a2bf6d15d0ad6cf8 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Tue, 6 Jun 2023 22:20:18 +0200 Subject: [PATCH 1/7] Fix nginx to load css in admin site https://dev.funkwhale.audio/funkwhale/funkwhale/-/issues/2146 --- conf/nginx.conf | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index b1254ba..31798eb 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -110,7 +110,7 @@ location /media/attachments/ { # if you're storing media files in a S3 bucket. #location ~ /_protected/media/(.+) { # internal; - # alias ${MEDIA_ROOT}/$1; # NON-S3 + # alias __DATA_DIR__/data/media//$1; # NON-S3 # # Needed to ensure DSub auth isn't forwarded to S3/Minio, see #932. # proxy_set_header Authorization ""; # S3 # proxy_pass $1; # S3 @@ -127,6 +127,18 @@ location /_protected/music/ { more_set_headers "Access-Control-Allow-Origin: *"; } +# Allow direct access to /staticfiles +location /staticfiles/ { + alias __DATA_DIR__/data/static/; + more_set_headers "Access-Control-Allow-Origin: *"; +} + +# Allow direct access to only specific subdirectories in /media +location /media/dynamic_preferences/ { + alias __DATA_DIR__/data/media/dynamic_preferences/; + more_set_headers "Access-Control-Allow-Origin: *"; +} + location /manifest.json { return 302 /api/v1/instance/spa-manifest.json; } From a929801869684a12c8fb175a6455cca5682dda15 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Thu, 8 Jun 2023 10:48:52 +0200 Subject: [PATCH 2/7] Update nginx.conf --- conf/nginx.conf | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 31798eb..15bf0d2 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -108,14 +108,14 @@ location /media/attachments/ { # has been checked on API side. # Comment the "NON-S3" commented lines and uncomment "S3" commented lines # if you're storing media files in a S3 bucket. - #location ~ /_protected/media/(.+) { - # internal; - # alias __DATA_DIR__/data/media//$1; # NON-S3 - # # Needed to ensure DSub auth isn't forwarded to S3/Minio, see #932. + location ~ /_protected/media/(.+) { + internal; + alias __DATA_DIR__/data/media/$1; # NON-S3 + # Needed to ensure DSub auth isn't forwarded to S3/Minio, see #932. # proxy_set_header Authorization ""; # S3 # proxy_pass $1; # S3 - # more_set_headers "Access-Control-Allow-Origin: *"; - #} + more_set_headers "Access-Control-Allow-Origin: *"; + } location /_protected/music/ { # this is an internal location that is used to serve From 48a57a1be696e47a840081b99d7facdd36d67f3b Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Sat, 10 Jun 2023 21:23:17 +0200 Subject: [PATCH 3/7] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 7b430ad..21059df 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Funkwhale" description.en = "Convivial and modern music server" description.fr = "Serveur de musique moderne et convivial" -version = "1.3.0~ynh1" +version = "1.3.0~ynh2" maintainers = ["Thovi98"] From b77d9d4be6f404d1decc9caf5a64dbe93bb18110 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sat, 10 Jun 2023 19:23:20 +0000 Subject: [PATCH 4/7] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b954f11..ae3a76c 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Funkwhale is a community-driven project that lets you listen and share music and audio within a decentralized, open network. -**Shipped version:** 1.3.0~ynh1 +**Shipped version:** 1.3.0~ynh2 **Demo:** https://demo.funkwhale.audio diff --git a/README_fr.md b/README_fr.md index d00752c..3e21271 100644 --- a/README_fr.md +++ b/README_fr.md @@ -18,7 +18,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Funkwhale est un projet communautaire qui vous permet d'écouter et de partager de la musique et de l'audio au sein d'un réseau ouvert et décentralisé. -**Version incluse :** 1.3.0~ynh1 +**Version incluse :** 1.3.0~ynh2 **Démo :** https://demo.funkwhale.audio From 35b486bd94128b66a609df799a3e63e03f791219 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Sat, 10 Jun 2023 21:24:54 +0200 Subject: [PATCH 5/7] Update nginx.conf formatting --- conf/nginx.conf | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 15bf0d2..5055b22 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -103,19 +103,19 @@ location /media/attachments/ { more_set_headers "Access-Control-Allow-Origin: *"; } - # This is an internal location that is used to serve - # media (uploaded) files once correct permission / authentication - # has been checked on API side. - # Comment the "NON-S3" commented lines and uncomment "S3" commented lines - # if you're storing media files in a S3 bucket. - location ~ /_protected/media/(.+) { - internal; - alias __DATA_DIR__/data/media/$1; # NON-S3 - # Needed to ensure DSub auth isn't forwarded to S3/Minio, see #932. +# This is an internal location that is used to serve +# media (uploaded) files once correct permission / authentication +# has been checked on API side. +# Comment the "NON-S3" commented lines and uncomment "S3" commented lines +# if you're storing media files in a S3 bucket. +location ~ /_protected/media/(.+) { + internal; + alias __DATA_DIR__/data/media/$1; # NON-S3 +# Needed to ensure DSub auth isn't forwarded to S3/Minio, see #932. # proxy_set_header Authorization ""; # S3 # proxy_pass $1; # S3 more_set_headers "Access-Control-Allow-Origin: *"; - } +} location /_protected/music/ { # this is an internal location that is used to serve From 6077aa58697dcac72cfbdfb1a9b4a14ab608bc67 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Sat, 10 Jun 2023 21:32:32 +0200 Subject: [PATCH 6/7] fix traversal path nginx? --- conf/nginx.conf | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 5055b22..52c2b35 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -110,12 +110,12 @@ location /media/attachments/ { # if you're storing media files in a S3 bucket. location ~ /_protected/media/(.+) { internal; - alias __DATA_DIR__/data/media/$1; # NON-S3 + alias __DATA_DIR__/data/media/$1/; # NON-S3 # Needed to ensure DSub auth isn't forwarded to S3/Minio, see #932. -# proxy_set_header Authorization ""; # S3 -# proxy_pass $1; # S3 - more_set_headers "Access-Control-Allow-Origin: *"; -} +# proxy_set_header Authorization ""; # S3 +# proxy_pass $1; # S3 + more_set_headers "Access-Control-Allow-Origin: *"; + } location /_protected/music/ { # this is an internal location that is used to serve From ee9ded63618ea367ff35e6dd7c94e43d38fe16a2 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Sat, 10 Jun 2023 21:36:13 +0200 Subject: [PATCH 7/7] Fix traversal path nginx? --- conf/nginx.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 52c2b35..686b45d 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -108,9 +108,9 @@ location /media/attachments/ { # has been checked on API side. # Comment the "NON-S3" commented lines and uncomment "S3" commented lines # if you're storing media files in a S3 bucket. -location ~ /_protected/media/(.+) { +location ~ /_protected/media/(.+)/ { internal; - alias __DATA_DIR__/data/media/$1/; # NON-S3 + alias __DATA_DIR__/data/media/$1; # NON-S3 # Needed to ensure DSub auth isn't forwarded to S3/Minio, see #932. # proxy_set_header Authorization ""; # S3 # proxy_pass $1; # S3