From 67e36df7f359b160dc21398548180d05d5f443c0 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Holcroft Date: Fri, 15 Feb 2019 06:46:40 +0100 Subject: [PATCH] upgrade to 1.18.2 --- conf/app-frontend.src | 4 +-- conf/app.src | 4 +-- conf/env.prod | 3 +- conf/nginx.conf | 74 ++++++++++++------------------------------- manifest.json | 6 ++-- scripts/install | 2 -- scripts/remove | 2 +- 7 files changed, 30 insertions(+), 65 deletions(-) diff --git a/conf/app-frontend.src b/conf/app-frontend.src index 49c2e9d..e4bb4d5 100644 --- a/conf/app-frontend.src +++ b/conf/app-frontend.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://dev.funkwhale.audio/funkwhale/funkwhale/-/jobs/artifacts/0.18.1/download?job=build_front -SOURCE_SUM=086215327779453f08e7121b009dcaf721d7c3c9d5fad735c8d3194eb6f58096 +SOURCE_URL=https://dev.funkwhale.audio/funkwhale/funkwhale/-/jobs/artifacts/0.18.2/download?job=build_front +SOURCE_SUM=cec96c574c7de95a94380bde3ab5f26d61b78018821bc012f80ef62caf3b2448 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=false diff --git a/conf/app.src b/conf/app.src index 6bb0d34..dcafd2c 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://dev.funkwhale.audio/funkwhale/funkwhale/-/archive/0.18.1/funkwhale-0.18.1.tar.bz2 -SOURCE_SUM=0383dcb673e82699079583c56a3cba2d43979b0c3ba64b1cc0b9eb7b882fedbe +SOURCE_URL=https://dev.funkwhale.audio/funkwhale/funkwhale/-/archive/0.18.2/funkwhale-0.18.2.tar.bz2 +SOURCE_SUM=a4ae89e7f92ed4d047849ce36db86690d9114ec48226225e7b6db35c1cc1f936 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.bz2 SOURCE_IN_SUBDIR=true diff --git a/conf/env.prod b/conf/env.prod index 17ec32b..66d49b2 100644 --- a/conf/env.prod +++ b/conf/env.prod @@ -138,7 +138,8 @@ LDAP_START_TLS=False LDAP_ROOT_DN=ou=users,dc=yunohost,dc=org LDAP_USER_ATTR_MAP={"username":"uid"} -FUNKWHALE_FRONTEND_PATH=__FINALPATH__/front/dist +FUNKWHALE_FRONTEND_PATH=__FINALPATH__/code/front/dist +FUNKWHALE_SPA_HTML_ROOT=__FINALPATH__/code/front/dist/index.html # Nginx related configuration NGINX_MAX_BODY_SIZE=100M diff --git a/conf/nginx.conf b/conf/nginx.conf index e30876c..f23364a 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,13 +1,16 @@ -location / { - include __FINALPATH__/code/deploy/funkwhale_proxy.conf; - # this is needed if you have file import via upload enabled - client_max_body_size 100M; - proxy_pass http://127.0.0.1:__PORT__/; +location / { + include __FINALPATH__/code/deploy/funkwhale_proxy.conf; + # this is needed if you have file import via upload enabled + client_max_body_size 100M; + proxy_pass http://127.0.0.1:__PORT__/; } location /front/ { - alias __FINALPATH__/code/front/dist/; + alias __FINALPATH__/code/front/dist/; + expires 30d; + add_header Pragma public; + add_header Cache-Control "public, must-revalidate, proxy-revalidate"; } location /federation/ { @@ -15,6 +18,13 @@ location /federation/ { proxy_pass http://127.0.0.1:__PORT__/federation/; } + +location /rest/ { + include __FINALPATH__/code/deploy/funkwhale_proxy.conf; + proxy_pass http://127.0.0.1:__PORT__/api/subsonic/rest/; +} + + location /.well-known/ { include __FINALPATH__/code/deploy/funkwhale_proxy.conf; proxy_pass http://127.0.0.1:__PORT__/.well-known/; @@ -24,7 +34,7 @@ location /media/ { alias __FINALPATH__/media/; } -location __PATH__/_protected/media/ { +location /_protected/media/ { # this is an internal location that is used to serve # audio files once correct permission / authentication # has been checked on API side @@ -32,56 +42,12 @@ location __PATH__/_protected/media/ { alias __FINALPATH__/media/; } -# Transcoding logic and caching -# TODO: try to enable this -# https://code.eliotberriot.com/funkwhale/funkwhale/blob/0.8/deploy/nginx.conf#L4 -# https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cache - -location = /transcode-auth { - include __FINALPATH__/code/deploy/funkwhale_proxy.conf; - # needed so we can authenticate transcode requests, but still - # cache the result +location /_protected/music/ { internal; - set $query ''; - # ensure we actually pass the jwt to the underlytin auth url - if ($request_uri ~* "[^\?]+\?(.*)$") { - set $query $1; - } - proxy_pass http://127.0.0.1:__PORT__/api/v1/trackfiles/viewable/?$query; - proxy_pass_request_body off; - proxy_set_header Content-Length ""; + alias __FINALPATH__/import/; } -location /api/v1/trackfiles/transcode/ { - include __FINALPATH__/code/deploy/funkwhale_proxy.conf; - # this block deals with authenticating and caching transcoding - # requests. Caching is heavily recommended as transcoding - # is a CPU intensive process. - auth_request /transcode-auth; - if ($args ~ (.*)jwt=[^&]*(.*)) { - set $cleaned_args $1$2; - } - proxy_cache_key "$scheme$request_method$host$uri$is_args$cleaned_args"; - proxy_cache __NAME__-transcode; - proxy_cache_valid 200 7d; - proxy_ignore_headers "Set-Cookie"; - proxy_hide_header "Set-Cookie"; - add_header X-Cache-Status $upstream_cache_status; - proxy_pass http://127.0.0.1:__PORT__; -} -# end of transcoding logic - location /staticfiles/ { # django static files alias __FINALPATH__/code/data/static/; -} - -location /rest/ { - include __FINALPATH__/code/deploy/funkwhale_proxy.conf; - proxy_pass http://127.0.0.1:__PORT__/api/subsonic/rest/; -} - -location /_protected/music { - internal; - alias __FINALPATH__/import; -} +} \ No newline at end of file diff --git a/manifest.json b/manifest.json index 4061a11..c5200d1 100644 --- a/manifest.json +++ b/manifest.json @@ -3,12 +3,12 @@ "id": "funkwhale", "packaging_format": 1, "requirements": { - "yunohost": ">= 3.2.0" + "yunohost": ">= 3.3.0" }, "description": { "en": "A modern, convivial and free music server" }, - "version": "0.18.1~ynh1", + "version": "0.18.2~ynh1", "url": "https://funkwhale.audio", "license": "BSD-3-Clause", "maintainer": { @@ -47,4 +47,4 @@ } ] } -} +} \ No newline at end of file diff --git a/scripts/install b/scripts/install index 3a5edcf..25cedc3 100644 --- a/scripts/install +++ b/scripts/install @@ -113,8 +113,6 @@ ynh_setup_source "$final_path/code" "app-frontend" # add proxy_cache and connection_upgrade at the beginning of the domain configuration echo " -proxy_cache_path /tmp/$app-transcode levels=1:2 keys_zone=$app-transcode:10m max_size=1g inactive=7d; - # required for websocket support map \$http_upgrade \$connection_upgrade { default upgrade; diff --git a/scripts/remove b/scripts/remove index 188f246..6cd7808 100644 --- a/scripts/remove +++ b/scripts/remove @@ -95,7 +95,7 @@ ynh_secure_remove "/var/log/$app" #================================================= # remove domain specific configuration -tail -n +11 "/etc/nginx/conf.d/$domain.conf" > "/etc/nginx/conf.d/$domain.conf.temp" +tail -n +9 "/etc/nginx/conf.d/$domain.conf" > "/etc/nginx/conf.d/$domain.conf.temp" mv "/etc/nginx/conf.d/$domain.conf.temp" "/etc/nginx/conf.d/$domain.conf" # Remove the dedicated nginx config