From 5d2ea781117a498304327c8d4391c2ef948d7116 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 10 Jun 2020 08:57:49 +0200 Subject: [PATCH 01/49] Update README.md --- README.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index cc2755a..9f01e33 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Funkwhale +# Funkwhale for YunoHost -[![Integration level](https://dash.yunohost.org/integration/funkwhale.svg)](https://dash.yunohost.org/appci/app/funkwhale) +[![Integration level](https://dash.yunohost.org/integration/funkwhale.svg)](https://dash.yunohost.org/appci/app/funkwhale) ![](https://ci-apps.yunohost.org/ci/badges/funkwhale.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/funkwhale.maintain.svg) [![Install Funkwhale with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=funkwhale) > *This package allow you to install Funkwhale quickly and simply on a YunoHost server. @@ -48,9 +48,8 @@ The admin interface is accessible with the address: your.domain.fr/api/admin #### Supported architectures -* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/funkwhale%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/funkwhale/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/funkwhale%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/funkwhale/) * ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/funkwhale%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/funkwhale/) -* Jessie x86-64b - [![Build Status](https://ci-stretch.nohost.me/ci/logs/funkwhale%20%28Apps%29.svg)](https://ci-stretch.nohost.me/ci/apps/funkwhale/) ## Links @@ -65,7 +64,6 @@ The admin interface is accessible with the address: your.domain.fr/api/admin Developers info ---------------- -**Only if you want to use a testing branch for coding, instead of merging directly into master.** Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/funkwhale_ynh/tree/testing). To try the testing branch, please proceed like that. From 65d4541750648436b5dc9dd2e7ba63a0bd8d1af1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Ainsworth?= Date: Mon, 12 Oct 2020 19:56:20 +0100 Subject: [PATCH 02/49] Test bump to 1.0 --- check_process | 3 +- conf/app-frontend.src | 4 +- conf/app.src | 4 +- manifest.json | 6 +- scripts/upgrade | 6 + .../extra_files/app/api/requirements/base.txt | 110 ++++++++---------- 6 files changed, 64 insertions(+), 69 deletions(-) diff --git a/check_process b/check_process index ba13771..e52d86f 100644 --- a/check_process +++ b/check_process @@ -46,4 +46,5 @@ manifest_arg=domain=DOMAIN&path=/&admin=USER&is_public=1 ; commit=18dd9d6a59ad1f0d03dc634b20e805b5c4f6c6e9 name=Upgrade from 0.21 manifest_arg=domain=DOMAIN&path=/&admin=USER&is_public=1 - + ; commit=5fe8d545994eed02707ed0133a68db919bd5d3bb + name=Upgrade from 0.21.1 diff --git a/conf/app-frontend.src b/conf/app-frontend.src index d01874d..857fe10 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.21.1/download?job=build_front -SOURCE_SUM=94888623d44da2d5c774827e206ce4981a810b54043d7f4b2cfd04b37052718a +SOURCE_URL=https://dev.funkwhale.audio/funkwhale/funkwhale/-/jobs/artifacts/1.0/download?job=build_front +SOURCE_SUM=f062d7485325a78f08afaf2c641d8616e983d82d11dfc1e656cbc09a113c4202 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=false diff --git a/conf/app.src b/conf/app.src index 8942426..86fb56a 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://dev.funkwhale.audio/funkwhale/funkwhale/-/archive/0.21.1/funkwhale-0.21.1.tar.gz -SOURCE_SUM=94239023d52f1327941a28d0bec7c0eebe991f80b5ea25257485c7d27320957a +SOURCE_URL=https://dev.funkwhale.audio/funkwhale/funkwhale/-/archive/1.0/funkwhale-1.0.tar.gz +SOURCE_SUM=c305ad352b739f0665c775922ab657991fa3c4c6830bf93210e98659a08f37d5 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.bz2 SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index 22ed87d..0ca71d5 100644 --- a/manifest.json +++ b/manifest.json @@ -5,7 +5,7 @@ "description": { "en": "A modern, convivial and free music server" }, - "version": "0.21.1~ynh1", + "version": "0.1.0.1~ynh1", "url": "https://funkwhale.audio", "license": "AGPL-3.0-or-later", "maintainer": { @@ -17,7 +17,7 @@ "email": "jean-baptiste@holcroft.fr" }], "requirements": { - "yunohost": ">= 3.6" + "yunohost": ">= 3.8" }, "multi_instance": true, "services": [ @@ -53,4 +53,4 @@ } ] } -} +} \ No newline at end of file diff --git a/scripts/upgrade b/scripts/upgrade index 956e563..ca690db 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -216,6 +216,12 @@ ynh_replace_string --match_string="__KEY__" --replace_string="$key" # Delete pre 0.17 federated tracks [manual action suggested] # https://dev.funkwhale.audio/funkwhale/funkwhale/tags/0.18 python api/manage.py script delete_pre_017_federated_uploads --no-input + + # Delete the original thumbnails and generate new ones for + # higher quality images + # https://docs.funkwhale.audio/changelog.html#increased-quality-of-jpeg-thumbnails-manual-action-required + rm -rf "$final_path/media/__sized__" + python api/manage.py fw media generate-thumbnail ) #================================================= diff --git a/sources/extra_files/app/api/requirements/base.txt b/sources/extra_files/app/api/requirements/base.txt index 6e31f85..88f7099 100644 --- a/sources/extra_files/app/api/requirements/base.txt +++ b/sources/extra_files/app/api/requirements/base.txt @@ -1,86 +1,74 @@ -# Bleeding edge Django -django>=3.0.5,<3.1; python_version > '3.5' -django>=2.2.12,<3; python_version < '3.6' -setuptools>=36 +django~=3.0.8 +setuptools>=49 # Configuration -django-environ>=0.4,<0.5 +django-environ~=0.4 # Images -Pillow>=6.2,<7 +Pillow~=7.0 -# For user registration, either via email or social -# Well-built with regular release cycles! -django-allauth>=0.41,<0.42 +django-allauth~=0.42 - -# Python-PostgreSQL Database Adapter -psycopg2-binary>=2.8,<=2.9 +psycopg2-binary~=2.8 # Time zones support -pytz==2019.3 +pytz==2020.1 # Redis support -django-redis>=4.11,<4.12 -redis>=3.4,<3.5 -kombu>=4.5,<4.6 +django-redis~=4.12 +redis~=3.5 +kombu~=4.6 -celery>=4.3,<4.4 +celery~=4.4 # Your custom requirements go here -django-cors-headers>=3.2,<3.3 -musicbrainzngs==0.6 -djangorestframework>=3.11,<3.12 -djangorestframework-jwt>=1.11,<1.12 -arrow>=0.15.5,<0.16 -persisting-theory>=0.2,<0.3 -django-versatileimagefield>=2.0,<2.1 -django-filter>=2.1,<2.2 -django-rest-auth>=0.9,<0.10 -# XXX: remove when we drop support for python 3.5 -ipython>=7.10,<8; python_version > '3.5' -ipython>=7,<7.10; python_version < '3.6' -mutagen>=1.44,<1.45 +django-cors-headers~=3.4 +musicbrainzngs~=0.7.1 +djangorestframework~=3.11 +djangorestframework-jwt~=1.11 +arrow~=0.15.5 +persisting-theory~=0.2 +django-versatileimagefield~=2.0 +django-filter~=2.3 +django-rest-auth~=0.9 +ipython~=7.10 +mutagen~=1.45 -pymemoize==1.0.3 +pymemoize~=1.0 -django-dynamic-preferences>=1.8.1,<1.9 -raven>=6.10,<7 -python-magic==0.4.15 -channels>=2.4,<2.5 -# XXX: remove when we drop support for python 3.5 -channels_redis==2.2.1; python_version < '3.6' -channels_redis>=2.3.2,<2.4; python_version > '3.5' -uvicorn==0.8.6; python_version < '3.6' -uvicorn>=0.11.3,<0.12; python_version > '3.5' -gunicorn>=20.0.4,<20.1 +django-dynamic-preferences~=1.10 +raven~=6.10 +python-magic~=0.4 +channels~=2.4 +channels_redis~=3.0 +uvicorn[standard]~=0.12 +gunicorn~=20.0 -cryptography>=2.8,<3 +cryptography~=2.9 # requests-http-signature==0.0.3 # clone until the branch is merged and released upstream git+https://github.com/EliotBerriot/requests-http-signature.git@signature-header-support -django-cleanup>=4,<4.1 -requests>=2.22<2.23 -pyOpenSSL>=19<20 +django-cleanup~=5.0 +requests~=2.24 +pyOpenSSL~=19.1 # for LDAP authentication -python-ldap>=3.2.0,<3.3 -django-auth-ldap>=2.1.0,<2.2 +python-ldap~=3.3 +django-auth-ldap~=2.2 -pydub>=0.23.1,<0.24 -pyld==1.0.4 -aiohttp>=3.6,<3.7 -autobahn>=19.3.3 +pydub~=0.24 +pyld~=1.0 +aiohttp~=3.6 -django-oauth-toolkit==1.2 -django-storages>=1.9.1,<1.10 -boto3<3 -unicode-slugify==0.1.3 -django-cacheops==4.2 +django-oauth-toolkit~=1.3 +django-storages~=1.9 +boto3~=1.14 +unicode-slugify~=0.1 +django-cacheops~=5.0 -click>=7,<8 -service_identity==18.1.0 -markdown>=3.2,<4 -bleach>=3,<4 +click~=7.1 +service_identity~=18.1 +markdown~=3.2 +bleach~=3.1 feedparser==6.0.0b3 -watchdog==0.10.2 +watchdog~=0.10 \ No newline at end of file From 3e2bf3981db4fee3d8b58788bf946af81b1b5e7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Ainsworth?= Date: Mon, 12 Oct 2020 20:01:54 +0100 Subject: [PATCH 03/49] Bump to Yunohost 4 (for Debian upgrade) --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 0ca71d5..69cbe6f 100644 --- a/manifest.json +++ b/manifest.json @@ -17,7 +17,7 @@ "email": "jean-baptiste@holcroft.fr" }], "requirements": { - "yunohost": ">= 3.8" + "yunohost": ">= 4.0" }, "multi_instance": true, "services": [ From a341b6fbaed7ec541952e077fb24839160d49519 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Ainsworth?= Date: Mon, 12 Oct 2020 21:51:15 +0100 Subject: [PATCH 04/49] Test removal of nonexistent scripts --- scripts/upgrade | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index ca690db..c828739 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -206,16 +206,16 @@ ynh_replace_string --match_string="__KEY__" --replace_string="$key" python api/manage.py collectstatic --clear --noinput # https://code.eliotberriot.com/funkwhale/funkwhale/tags/0.16 # users-now-have-an-activitypub-actor-manual-action-required - python api/manage.py script create_actors --no-input + # python api/manage.py script create_actors --no-input # https://code.eliotberriot.com/funkwhale/funkwhale/tags/0.16 #image-thumbnails-manual-action-required - python api/manage.py script create_image_variations --no-input + # python api/manage.py script create_image_variations --no-input # https://docs.funkwhale.audio/upgrading/0.17.html#upgrade-instructions - python api/manage.py script migrate_to_user_libraries --no-input + # python api/manage.py script migrate_to_user_libraries --no-input # Delete pre 0.17 federated tracks [manual action suggested] # https://dev.funkwhale.audio/funkwhale/funkwhale/tags/0.18 - python api/manage.py script delete_pre_017_federated_uploads --no-input + # python api/manage.py script delete_pre_017_federated_uploads --no-input # Delete the original thumbnails and generate new ones for # higher quality images From 9ea305151cbbbdfb3437c0af631e3ae451301a0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Ainsworth?= Date: Mon, 12 Oct 2020 21:54:56 +0100 Subject: [PATCH 05/49] Correct Typo --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index c828739..7cf2238 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -221,7 +221,7 @@ ynh_replace_string --match_string="__KEY__" --replace_string="$key" # higher quality images # https://docs.funkwhale.audio/changelog.html#increased-quality-of-jpeg-thumbnails-manual-action-required rm -rf "$final_path/media/__sized__" - python api/manage.py fw media generate-thumbnail + python api/manage.py fw media generate-thumbnails ) #================================================= From 76fe8fc214c79ee77348059e662db2e6cca24325 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Ainsworth?= Date: Sun, 29 Nov 2020 13:29:22 +0000 Subject: [PATCH 06/49] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d986e02..d6485b0 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ A modern, convivial and free music server on YunoHost Installation requires a dedicated domain or subdomain. Installing in a subpath is not supported by the upstream project due to dependency requirements. -**Shipped version:** 0.21.1 +**Shipped version:** 1.0 ## Screenshots From 452f2cad22a5546087f5a69d4dace8154ba71a59 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 4 Dec 2020 16:51:27 +0100 Subject: [PATCH 07/49] Fix linter warnings --- scripts/_common.sh | 69 ---------------------------------------------- scripts/restore | 12 ++++---- scripts/upgrade | 13 ++++----- 3 files changed, 11 insertions(+), 83 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 180e689..45b1e90 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -125,72 +125,3 @@ $(yunohost tools diagnosis | grep -B 100 "services:" | sed '/services:/d')" # Send the email to the recipients echo "$mail_message" | $mail_bin -a "Content-Type: text/plain; charset=UTF-8" -s "$mail_subject" "$recipients" } - -#================================================= -# fail2ban helpers -# taken from https://github.com/YunoHost-Apps/shaarli_ynh -#================================================= - -# Create a dedicated fail2ban config (jail and filter conf files) -# -# usage: ynh_add_fail2ban_config log_file filter [max_retry [ports]] -# | arg: log_file - Log file to be checked by fail2ban -# | arg: failregex - Failregex to be looked for by fail2ban -# | arg: max_retry - Maximum number of retries allowed before banning IP address - default: 3 -# | arg: ports - Ports blocked for a banned IP address - default: http,https -ynh_add_fail2ban_config () { - local logpath - local failregex - local max_retry - local ports - - logpath=$1 - failregex=$2 - max_retry=${3:-3} - ports=${4:-http,https} - - test -n "$logpath" || ynh_die --message="ynh_add_fail2ban_config expects a logfile path as first argument and received nothing." - test -n "$failregex" || ynh_die --message="ynh_add_fail2ban_config expects a failure regex as second argument and received nothing." - - finalfail2banjailconf="/etc/fail2ban/jail.d/$app.conf" - finalfail2banfilterconf="/etc/fail2ban/filter.d/$app.conf" - ynh_backup_if_checksum_is_different "$finalfail2banjailconf" 1 - ynh_backup_if_checksum_is_different "$finalfail2banfilterconf" 1 - - sudo tee "$finalfail2banjailconf" <&2 - echo "WARNING${fail2ban_error#*WARNING}" >&2 - fi -} - -# Remove the dedicated fail2ban config (jail and filter conf files) -# -# usage: ynh_remove_fail2ban_config -ynh_remove_fail2ban_config () { - ynh_secure_remove "/etc/fail2ban/jail.d/$app.conf" - ynh_secure_remove "/etc/fail2ban/filter.d/$app.conf" - systemctl reload fail2ban -} diff --git a/scripts/restore b/scripts/restore index d135d4e..0eb59f6 100644 --- a/scripts/restore +++ b/scripts/restore @@ -131,17 +131,17 @@ ynh_restore_file --origin_path="/etc/systemd/system/$app-server.service" ynh_restore_file --origin_path="/etc/systemd/system/$app-worker.service" ynh_restore_file --origin_path="/etc/systemd/system/$app.target" -systemctl enable "$app-beat.service" -systemctl enable "$app-server.service" -systemctl enable "$app-worker.service" +systemctl enable "$app-beat.service" --quiet +systemctl enable "$app-server.service" --quiet +systemctl enable "$app-worker.service" --quiet #================================================= # ADVERTISE SERVICE IN ADMIN PANEL #================================================= -yunohost service add "$app-server" --log "/var/log/$app/server.log" -yunohost service add "$app-worker" --log "/var/log/$app/worker.log" -yunohost service add "$app-beat" --log "/var/log/$app/beat.log" +yunohost service add "$app-server" --log="/var/log/$app/server.log" +yunohost service add "$app-worker" --log="/var/log/$app/worker.log" +yunohost service add "$app-beat" --log="/var/log/$app/beat.log" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/upgrade b/scripts/upgrade index 7cf2238..e88049c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -74,13 +74,6 @@ ynh_abort_if_errors # CHECK THE PATH #================================================= -# Normalize the URL path syntax -path_url=$(ynh_normalize_url_path "$path_url") - -#================================================= -# CHECK THE PATH -#================================================= - # see 0.20.0: https://docs.funkwhale.audio/changelog.html#automatically-load-env-file loadfile="$final_path/code/load_env" if [ -e "$loadfile" ] ; then @@ -220,7 +213,7 @@ ynh_replace_string --match_string="__KEY__" --replace_string="$key" # Delete the original thumbnails and generate new ones for # higher quality images # https://docs.funkwhale.audio/changelog.html#increased-quality-of-jpeg-thumbnails-manual-action-required - rm -rf "$final_path/media/__sized__" + ynh_secure_remove "$final_path/media/__sized__" python api/manage.py fw media generate-thumbnails ) @@ -263,6 +256,10 @@ chmod -R 755 "$final_path/code/front/dist/" mkdir -p "/var/log/$app" chown -R "$app": "/var/log/$app" +yunohost service add "$app-server" --log="/var/log/$app/server.log" +yunohost service add "$app-worker" --log="/var/log/$app/worker.log" +yunohost service add "$app-beat" --log="/var/log/$app/beat.log" + #================================================= # SETUP SSOWAT #================================================= From f0a628dc6ddd1de04f2bfaa80ec3559234485df0 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 4 Dec 2020 16:56:37 +0100 Subject: [PATCH 08/49] Fix linter --- scripts/backup | 8 ++++---- scripts/install | 6 +++--- scripts/upgrade | 4 ++++ 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/scripts/backup b/scripts/backup index d8a772f..3c0c590 100644 --- a/scripts/backup +++ b/scripts/backup @@ -32,11 +32,13 @@ domain=$(ynh_app_setting_get --app="$app" --key=domain) db_name=$(ynh_app_setting_get --app="$app" --key=db_name) #================================================= -# STANDARD BACKUP STEPS +# DECLARE DATA AND CONF FILES TO BACKUP +#================================================= +ynh_print_info --message="Declaring files to be backed up..." + #================================================= # BACKUP THE APP MAIN DIR #================================================= -ynh_print_info --message="Backing up the main app directory..." backup_core_only=$(ynh_app_setting_get --app="$app" --key=backup_core_only) # If backup_core_only have any value in the settings.yml file, do not backup the data directory @@ -51,7 +53,6 @@ fi #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= -ynh_print_info --message="Backing up nginx web server configuration..." ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_backup --src_path="/etc/nginx/conf.d/$domain.conf" @@ -68,7 +69,6 @@ ynh_psql_dump_db --database="$db_name" > db.sql #================================================= # BACKUP SYSTEMD #================================================= -ynh_print_info --message="Backing up systemd configuration..." ynh_backup --src_path="/etc/systemd/system/$app-beat.service" ynh_backup --src_path="/etc/systemd/system/$app-server.service" diff --git a/scripts/install b/scripts/install index c0a1315..f4ab769 100644 --- a/scripts/install +++ b/scripts/install @@ -212,9 +212,9 @@ chown -R "$app": "/var/log/$app" # ADVERTISE SERVICE IN ADMIN PANEL #================================================= -yunohost service add "$app-server" --log "/var/log/$app/server.log" -yunohost service add "$app-worker" --log "/var/log/$app/worker.log" -yunohost service add "$app-beat" --log "/var/log/$app/beat.log" +yunohost service add "$app-server" --log="/var/log/$app/server.log" +yunohost service add "$app-worker" --log="/var/log/$app/worker.log" +yunohost service add "$app-beat" --log="/var/log/$app/beat.log" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/upgrade b/scripts/upgrade index e88049c..fc75a1b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -256,6 +256,10 @@ chmod -R 755 "$final_path/code/front/dist/" mkdir -p "/var/log/$app" chown -R "$app": "/var/log/$app" +#================================================= +# ADVERTISE SERVICE IN ADMIN PANEL +#================================================= + yunohost service add "$app-server" --log="/var/log/$app/server.log" yunohost service add "$app-worker" --log="/var/log/$app/worker.log" yunohost service add "$app-beat" --log="/var/log/$app/beat.log" From 4fcdd9badf54acdf4539b8fc68e89c77516687b7 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 4 Dec 2020 17:08:43 +0100 Subject: [PATCH 09/49] Fix linter warnings --- scripts/install | 28 ++++++++++++++-------------- scripts/remove | 36 +++++++++++++----------------------- scripts/restore | 20 ++++++++++---------- scripts/upgrade | 40 +++++++++++++++------------------------- 4 files changed, 52 insertions(+), 72 deletions(-) diff --git a/scripts/install b/scripts/install index f4ab769..66a3806 100644 --- a/scripts/install +++ b/scripts/install @@ -33,7 +33,7 @@ app=$YNH_APP_INSTANCE_NAME #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= -ynh_print_info --message="Validating installation parameters..." +ynh_script_progression --message="Validating installation parameters..." final_path="/var/www/$app" test ! -e "$final_path" || ynh_die --message="This path already contains a folder" @@ -44,7 +44,7 @@ ynh_webpath_register --app="$app" --domain="$domain" --path_url="$path_url" #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -ynh_print_info --message="Storing installation settings..." +ynh_script_progression --message="Storing installation settings..." ynh_app_setting_set --app="$app" --key=domain --value="$domain" ynh_app_setting_set --app="$app" --key=path --value="$path_url" @@ -56,7 +56,7 @@ ynh_app_setting_set --app="$app" --key=admin --value="$admin" #================================================= # FIND AND OPEN A PORT #================================================= -ynh_print_info --message="Configuring firewall..." +ynh_script_progression --message="Configuring firewall..." # Find a free port port=$(ynh_find_port --port=5000) @@ -66,14 +66,14 @@ ynh_app_setting_set --app="$app" --key=port --value="$port" #================================================= # INSTALL DEPENDENCIES #================================================= -ynh_print_info --message="Installing dependencies..." +ynh_script_progression --message="Installing dependencies..." ynh_install_app_dependencies $pkg_dependencies #================================================= # CREATE A POSTGRESQL DATABASE #================================================= -ynh_print_info --message="Creating a PostgreSQL database..." +ynh_script_progression --message="Creating a PostgreSQL database..." ynh_psql_test_if_first_run @@ -89,7 +89,7 @@ ynh_psql_setup_db --db_name="$db_name" --db_user="$db_user" --db_pwd="$db_pwd" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_print_info --message="Setting up source files..." +ynh_script_progression --message="Setting up source files..." ynh_app_setting_set --app="$app" --key=final_path --value="$final_path" # Download, check integrity, uncompress and patch the source from app.src @@ -104,7 +104,7 @@ ynh_setup_source --dest_dir="$final_path/code" --source_id="app-frontend" #================================================= # NGINX CONFIGURATION #================================================= -ynh_print_info --message="Configuring nginx web server..." +ynh_script_progression --message="Configuring nginx web server..." # Create a dedicated nginx config ynh_add_nginx_config @@ -112,7 +112,7 @@ ynh_add_nginx_config #================================================= # CREATE DEDICATED USER #================================================= -ynh_print_info --message="Configuring system user..." +ynh_script_progression --message="Configuring system user..." # Create a system user ynh_system_user_create --username="$app" --home_dir="$final_path" @@ -179,7 +179,7 @@ admin_mail=$(ynh_user_get_info --username="$admin" --key="mail") #================================================= # SETUP SYSTEMD #================================================= -ynh_print_info --message="Configuring a systemd service..." +ynh_script_progression --message="Configuring a systemd service..." cp ../conf/funkwhale.target "/etc/systemd/system/$app.target" ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="/etc/systemd/system/$app.target" @@ -219,7 +219,7 @@ yunohost service add "$app-beat" --log="/var/log/$app/beat.log" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_print_info --message="Starting a systemd service..." +ynh_script_progression --message="Starting a systemd service..." ynh_systemd_action --action="start" --service_name="${app}-beat" ynh_systemd_action --action="start" --service_name="${app}-server" @@ -228,7 +228,7 @@ ynh_systemd_action --action="start" --service_name="${app}-worker" #================================================= # SETUP FAIL2BAN #================================================= -ynh_print_info --message="Configuring fail2ban..." +ynh_script_progression --message="Configuring Fail2Ban..." # Create a dedicated fail2ban config ynh_add_fail2ban_config --logpath="/var/log/nginx/$domain-access.log" --failregex=".* \"POST /api/v1/token/ HTTP/1.1\" 400 68.*$" --max_retry=5 @@ -236,7 +236,7 @@ ynh_add_fail2ban_config --logpath="/var/log/nginx/$domain-access.log" --failrege #================================================= # SETUP SSOWAT #================================================= -ynh_print_info --message="Configuring SSOwat..." +ynh_script_progression --message="Configuring SSOwat..." # Make app public if necessary if [ "$is_public" -eq 1 ] @@ -248,7 +248,7 @@ fi #================================================= # RELOAD NGINX #================================================= -ynh_print_info --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload @@ -256,4 +256,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_print_info --message="Installation of $app completed" +ynh_script_progression --message="Installation of $app completed" diff --git a/scripts/remove b/scripts/remove index 8cd36d7..ecbe446 100644 --- a/scripts/remove +++ b/scripts/remove @@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_print_info --message="Loading installation settings..." +ynh_script_progression --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME @@ -32,26 +32,26 @@ redis_db=$(ynh_app_setting_get --app="$app" --key=redis_db) # Remove a service from the admin panel, added by `yunohost service add` if yunohost service status "$app-server" >/dev/null 2>&1 then - ynh_print_info --message="Remove $app-server service" + ynh_script_progression --message="Remove $app-server service" yunohost service remove "$app-server" fi if yunohost service status "$app-worker" >/dev/null 2>&1 then - ynh_print_info --message="Remove $app-worker service" + ynh_script_progression --message="Remove $app-worker service" yunohost service remove "$app-worker" fi if yunohost service status "$app-beat" >/dev/null 2>&1 then - ynh_print_info --message="Remove $app-beat service" + ynh_script_progression --message="Remove $app-beat service" yunohost service remove "$app-beat" fi #================================================= # STOP AND REMOVE SERVICE #================================================= -ynh_print_info --message="Stopping and removing the systemd service" +ynh_script_progression --message="Stopping and removing the systemd service" ynh_systemd_action --action="stop" --service_name="${app}-beat" ynh_systemd_action --action="stop" --service_name="${app}-server" @@ -67,7 +67,7 @@ ynh_secure_remove --file="/etc/systemd/system/$app.target" #================================================= # REMOVE THE POSTGRESQL DATABASE #================================================= -ynh_print_info --message="Removing the PostgreSQL database" +ynh_script_progression --message="Removing the PostgreSQL database" # Remove a database if it exists, along with the associated user ynh_psql_remove_db --db_name="$db_name" --db_user="$db_user" @@ -75,7 +75,7 @@ ynh_psql_remove_db --db_name="$db_name" --db_user="$db_user" #================================================= # REMOVE THE REDIS DATABASE #================================================= -ynh_print_info --message="Removing the Redis database" +ynh_script_progression --message="Removing the Redis database" # Remove a database if it exists, along with the associated user ynh_redis_remove_db "$redis_db" @@ -83,7 +83,7 @@ ynh_redis_remove_db "$redis_db" #================================================= # REMOVE DEPENDENCIES #================================================= -ynh_print_info --message="Removing dependencies" +ynh_script_progression --message="Removing dependencies" # Remove metapackage and its dependencies ynh_remove_app_dependencies @@ -91,7 +91,7 @@ ynh_remove_app_dependencies #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_print_info --message="Removing app main directory" +ynh_script_progression --message="Removing app main directory" # Remove the app directory securely ynh_secure_remove --file="$final_path" @@ -101,25 +101,15 @@ ynh_secure_remove --file="/var/log/$app" #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_print_info --message="Removing nginx web server configuration" +ynh_script_progression --message="Removing NGINX web server configuration" # Remove the dedicated nginx config ynh_remove_nginx_config -#================================================= -# CLOSE A PORT -#================================================= - -if yunohost firewall list | grep -q "\- $port$" -then - ynh_print_info --message="Closing port $port" - ynh_exec_warn_less yunohost firewall disallow TCP $port -fi - #================================================= # REMOVE FAIL2BAN CONFIGURATION #================================================= -ynh_print_info --message="Removing fail2ban configuration..." +ynh_script_progression --message="Removing fail2ban configuration..." ynh_remove_fail2ban_config @@ -128,7 +118,7 @@ ynh_remove_fail2ban_config #================================================= # REMOVE DEDICATED USER #================================================= -ynh_print_info --message="Removing the dedicated system user" +ynh_script_progression --message="Removing the dedicated system user" # Delete a system user ynh_system_user_delete --username="$app" @@ -137,4 +127,4 @@ ynh_system_user_delete --username="$app" # END OF SCRIPT #================================================= -ynh_print_info --message="Removal of $app completed" +ynh_script_progression --message="Removal of $app completed" diff --git a/scripts/restore b/scripts/restore index 0eb59f6..7802232 100644 --- a/scripts/restore +++ b/scripts/restore @@ -23,7 +23,7 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_print_info --message="Loading settings..." +ynh_script_progression --message="Loading settings..." app=$YNH_APP_INSTANCE_NAME @@ -37,7 +37,7 @@ db_pwd=$(ynh_app_setting_get --app="$app" --key=psqlpwd) #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= -ynh_print_info --message="Validating restoration parameters..." +ynh_script_progression --message="Validating restoration parameters..." ynh_webpath_available --domain="$domain" --path_url="$path_url" \ || ynh_die --message="Path not available: ${domain}${path_url}" @@ -56,7 +56,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.conf" #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_print_info --message="Restoring the app main directory..." +ynh_script_progression --message="Restoring the app main directory..." backup_core_only=$(ynh_app_setting_get --app="$app" --key=backup_core_only) @@ -86,7 +86,7 @@ fi #================================================= # RECREATE THE DEDICATED USER #================================================= -ynh_print_info --message="Recreating the dedicated system user..." +ynh_script_progression --message="Recreating the dedicated system user..." # Create the dedicated user (if not existing) ynh_system_user_create --username="$app" --home_dir="$final_path" @@ -107,7 +107,7 @@ chown -R "$app": "/var/log/$app" #================================================= # REINSTALL DEPENDENCIES #================================================= -ynh_print_info --message="Reinstalling dependencies..." +ynh_script_progression --message="Reinstalling dependencies..." # Define and install dependencies ynh_install_app_dependencies $pkg_dependencies @@ -115,7 +115,7 @@ ynh_install_app_dependencies $pkg_dependencies #================================================= # RESTORE THE POSTGRESQL DATABASE #================================================= -ynh_print_info --message="Restoring the PostgreSQL database..." +ynh_script_progression --message="Restoring the PostgreSQL database..." ynh_psql_test_if_first_run ynh_psql_setup_db --db_user="$db_user" --db_name="$db_name" --db_pwd="$db_pwd" @@ -124,7 +124,7 @@ ynh_psql_execute_file_as_root --file="./db.sql" --database="$db_name" #================================================= # RESTORE SYSTEMD #================================================= -ynh_print_info --message="Restoring the systemd configuration..." +ynh_script_progression --message="Restoring the systemd configuration..." ynh_restore_file --origin_path="/etc/systemd/system/$app-beat.service" ynh_restore_file --origin_path="/etc/systemd/system/$app-server.service" @@ -146,7 +146,7 @@ yunohost service add "$app-beat" --log="/var/log/$app/beat.log" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_print_info --message="Starting a systemd service..." +ynh_script_progression --message="Starting a systemd service..." ynh_systemd_action --action="start" --service_name="${app}-beat" ynh_systemd_action --action="start" --service_name="${app}-server" @@ -157,7 +157,7 @@ ynh_systemd_action --action="start" --service_name="${app}-worker" #================================================= # RELOAD NGINX #================================================= -ynh_print_info --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload @@ -165,4 +165,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_print_info --message="Restoration completed for $app" +ynh_script_progression --message="Restoration completed for $app" diff --git a/scripts/upgrade b/scripts/upgrade index fc75a1b..890fe04 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_print_info --message="Loading installation settings..." +ynh_script_progression --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME @@ -30,7 +30,7 @@ code_migration=$(ynh_app_setting_get --app="$app" --key=code_migration) #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= -ynh_print_info --message="Ensuring downward compatibility..." +ynh_script_progression --message="Ensuring downward compatibility..." # If redis_db doesn't exist, create it if [ -z "$redis_db" ]; then @@ -55,7 +55,7 @@ fi #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_print_info --message="Backing up the app before upgrading (may take a while)..." +ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." # Inform the backup/restore process that it should not save the data directory ynh_app_setting_set --app="$app" --key=backup_core_only --value=1 @@ -80,22 +80,12 @@ if [ -e "$loadfile" ] ; then ynh_secure_remove --file="$loadfile" fi -#================================================= -# CLOSE A PORT -#================================================= - -if yunohost firewall list | grep -q "\- $port$" -then - echo "Close port $port" - yunohost firewall disallow TCP $port 2>&1 -fi - #================================================= # STANDARD UPGRADE STEPS #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_print_info --message="Stopping a systemd service..." +ynh_script_progression --message="Stopping a systemd service..." ynh_systemd_action --action="stop" --service_name="${app}-beat" ynh_systemd_action --action="stop" --service_name="${app}-server" @@ -104,7 +94,7 @@ ynh_systemd_action --action="stop" --service_name="${app}-worker" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_print_info --message="Upgrading source files..." +ynh_script_progression --message="Upgrading source files..." ynh_app_setting_set --app="$app" --key=final_path --value="$final_path" # Download, check integrity, uncompress and patch the source from app.src @@ -119,22 +109,22 @@ ynh_setup_source --dest_dir="$final_path/code" --source_id="app-frontend" #================================================= # NGINX CONFIGURATION #================================================= -ynh_print_info --message="Upgrading nginx web server configuration..." +ynh_script_progression --message="Upgrading NGINX web server configuration..." -# Create a dedicated nginx config +# Create a dedicated NGINX config ynh_add_nginx_config #================================================= # UPGRADE DEPENDENCIES #================================================= -ynh_print_info --message="Upgrading dependencies..." +ynh_script_progression --message="Upgrading dependencies..." ynh_install_app_dependencies $pkg_dependencies #================================================= # CREATE DEDICATED USER #================================================= -ynh_print_info --message="Making sure dedicated system user exists..." +ynh_script_progression --message="Making sure dedicated system user exists..." # Create a dedicated user (if not existing) ynh_system_user_create --username="$app" --home_dir="$final_path" @@ -227,7 +217,7 @@ ynh_store_file_checksum --file="$configfile" #================================================= # SETUP SYSTEMD #================================================= -ynh_print_info --message="Upgrading systemd configuration..." +ynh_script_progression --message="Upgrading systemd configuration..." cp ../conf/funkwhale.target "/etc/systemd/system/$app.target" ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="/etc/systemd/system/$app.target" @@ -242,7 +232,7 @@ ynh_add_systemd_config --service="$app-beat" --template="funkwhale-beat.servic #================================================= # UPGRADE FAIL2BAN #================================================= -ynh_print_info --message="Reconfiguring fail2ban..." +ynh_script_progression --message="Reconfiguring Fail2Ban..." ynh_add_fail2ban_config --logpath="/var/log/nginx/$domain-access.log" --failregex=".* \"POST /api/v1/token/ HTTP/1.1\" 400 68.*$" --max_retry=5 @@ -267,7 +257,7 @@ yunohost service add "$app-beat" --log="/var/log/$app/beat.log" #================================================= # SETUP SSOWAT #================================================= -ynh_print_info --message="Upgrading SSOwat configuration..." +ynh_script_progression --message="Upgrading SSOwat configuration..." # Make app public if necessary if [ "$is_public" -eq 1 ] @@ -279,7 +269,7 @@ fi #================================================= # START SYSTEMD SERVICE #================================================= -ynh_print_info --message="Starting a systemd service..." +ynh_script_progression --message="Starting a systemd service..." ynh_systemd_action --action="start" --service_name="${app}-beat" ynh_systemd_action --action="start" --service_name="${app}-server" @@ -288,7 +278,7 @@ ynh_systemd_action --action="start" --service_name="${app}-worker" #================================================= # RELOAD NGINX #================================================= -ynh_print_info --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload @@ -302,4 +292,4 @@ ynh_app_setting_set --app="$app" --key=code_migration --value=2 # END OF SCRIPT #================================================= -ynh_print_info --message="Upgrade of $app completed" +ynh_script_progression --message="Upgrade of $app completed" From eac6e16df08eaf0c46f93ffb36e3403e314b1385 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 4 Dec 2020 17:47:05 +0100 Subject: [PATCH 10/49] Cleaning up --- check_process | 24 +++--------------------- scripts/remove | 2 +- 2 files changed, 4 insertions(+), 22 deletions(-) diff --git a/check_process b/check_process index e52d86f..a451a0f 100644 --- a/check_process +++ b/check_process @@ -22,29 +22,11 @@ incorrect_path=0 port_already_use=0 change_url=0 -;;; Levels - ;;; Options Email=cda@rootkey.co.uk Notification=all ;;; Upgrade options - ; commit=80a5044d13a6782063fee2d7fb7a01832a6aa767 - name=Upgrade from 0.16.3 -manifest_arg=domain=DOMAIN&path=/&admin=USER&is_public=1 - ; commit=806bcb0f320d8e3e28711a9ae1d2b175b95c65ce - name=Upgrade from 0.17.0~ynh2 -manifest_arg=domain=DOMAIN&path=/&admin=USER&is_public=1 - ; commit=99bae16efca321ce50ba9a98c62996169195e0ba - name=Upgrade from 0.18.3 -manifest_arg=domain=DOMAIN&path=/&admin=USER&is_public=1 ; commit=4d4bf0981e2d3a00eaae6b19bd54344fe55d6530 - name=Upgrade from 0.19.1 -manifest_arg=domain=DOMAIN&path=/&admin=USER&is_public=1 - ; commit=4d4bf0981e2d3a00eaae6b19bd54344fe55d6530 - name=Upgrade from 0.20.1 -manifest_arg=domain=DOMAIN&path=/&admin=USER&is_public=1 - ; commit=18dd9d6a59ad1f0d03dc634b20e805b5c4f6c6e9 - name=Upgrade from 0.21 -manifest_arg=domain=DOMAIN&path=/&admin=USER&is_public=1 - ; commit=5fe8d545994eed02707ed0133a68db919bd5d3bb - name=Upgrade from 0.21.1 + name=Upgrade to 0.19.1 and fix channels-redis bug + manifest_arg=domain=DOMAIN&path=/&admin=USER&is_public=1 + \ No newline at end of file diff --git a/scripts/remove b/scripts/remove index ecbe446..0567cde 100644 --- a/scripts/remove +++ b/scripts/remove @@ -109,7 +109,7 @@ ynh_remove_nginx_config #================================================= # REMOVE FAIL2BAN CONFIGURATION #================================================= -ynh_script_progression --message="Removing fail2ban configuration..." +ynh_script_progression --message="Removing Fail2Ban configuration..." ynh_remove_fail2ban_config From 5b240fb9005e1880851a6566ff4b3e2fbc6e216f Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 4 Dec 2020 17:48:30 +0100 Subject: [PATCH 11/49] Update README.md --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d6485b0..693a6f5 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![Install Funkwhale with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=funkwhale) > *This package allows you to install Funkwhale quickly and simply on a YunoHost server. -If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it. +If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.* ## Overview A modern, convivial and free music server on YunoHost @@ -61,8 +61,7 @@ The admin interface is accessible at the address: your.domain.fr/api/admin --- -Developers info ----------------- +## Developers info Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/funkwhale_ynh/tree/testing). From ee0de8fe94e2b120e22226f643199b53363a7d72 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Fri, 4 Dec 2020 18:09:35 +0100 Subject: [PATCH 12/49] Update to 1.0.1 (#119) * Update to 1.0.1 --- README.md | 19 +++++++++---------- check_process | 1 - conf/app-frontend.src | 4 ++-- conf/app.src | 4 ++-- manifest.json | 21 +++++++++++++-------- 5 files changed, 26 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 693a6f5..ff5983f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Funkwhale for YunoHost -[![Integration level](https://dash.yunohost.org/integration/funkwhale.svg)](https://dash.yunohost.org/appci/app/funkwhale) ![](https://ci-apps.yunohost.org/ci/badges/funkwhale.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/funkwhale.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/funkwhale.svg)](https://dash.yunohost.org/appci/app/funkwhale) ![](https://ci-apps.yunohost.org/ci/badges/funkwhale.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/funkwhale.maintain.svg) [![Install Funkwhale with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=funkwhale) > *This package allows you to install Funkwhale quickly and simply on a YunoHost server. @@ -11,7 +11,7 @@ A modern, convivial and free music server on YunoHost Installation requires a dedicated domain or subdomain. Installing in a subpath is not supported by the upstream project due to dependency requirements. -**Shipped version:** 1.0 +**Shipped version:** 1.0.1 ## Screenshots @@ -21,21 +21,17 @@ Installation requires a dedicated domain or subdomain. Installing in a subpath i The admin uses the login you provided at installation. The password is the same you use for YunoHost. -The admin interface is accessible at the address: your.domain.fr/api/admin +The admin interface is accessible at the address: `your.domain.fr/api/admin` # State of this package * The following have been tested with this package and work fine: - * [x] install/remove/backup/remove/upgrade with x86_64 - * [x] import file with web interface, imports from youtube, interraction with MusicBrainz + * [x] install/remove/backup/remove/upgrade with x86_64 and ARM + * [x] import file with web interface, imports from YouTube, interraction with MusicBrainz * [x] [Subsonic API](https://docs.funkwhale.audio/users/apps.html) * [x] [Federation](https://docs.funkwhale.audio/federation.html) tests - * [x] [CLI Import](https://docs.funkwhale.audio/importing-music.html#from-music-directory-on-the-server) Remember to `source $final_path/venv/bin/activate`, then `source $final_path/load_env` before typinh using manage.py. - * [x] ARM support - -* end-user configuration required: - * [x] LDAP integration + * [x] [CLI Import](https://docs.funkwhale.audio/importing-music.html#from-music-directory-on-the-server) Remember to `source $final_path/venv/bin/activate`, then `source $final_path/load_env` before typinh using manage.py. * to be added: * [ ] Store files in HOME, see https://github.com/YunoHost-Apps/funkwhale_ynh/issues/15 @@ -46,6 +42,9 @@ The admin interface is accessible at the address: your.domain.fr/api/admin ## YunoHost specific features + * Are LDAP and HTTP auth supported? **Yes** + * Can the app be used by multiple users? **Yes** + #### Supported architectures * x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/funkwhale%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/funkwhale/) diff --git a/check_process b/check_process index a451a0f..b0e4657 100644 --- a/check_process +++ b/check_process @@ -29,4 +29,3 @@ Notification=all ; commit=4d4bf0981e2d3a00eaae6b19bd54344fe55d6530 name=Upgrade to 0.19.1 and fix channels-redis bug manifest_arg=domain=DOMAIN&path=/&admin=USER&is_public=1 - \ No newline at end of file diff --git a/conf/app-frontend.src b/conf/app-frontend.src index 857fe10..9448940 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/1.0/download?job=build_front -SOURCE_SUM=f062d7485325a78f08afaf2c641d8616e983d82d11dfc1e656cbc09a113c4202 +SOURCE_URL=https://dev.funkwhale.audio/funkwhale/funkwhale/builds/artifacts/1.0.1/download?job=build_front +SOURCE_SUM=0b77367cb4e8d1b57af59282af90ac41e0915de85cf5337b02f16e6aa0bd0129 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=false diff --git a/conf/app.src b/conf/app.src index 86fb56a..e1e4b3a 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://dev.funkwhale.audio/funkwhale/funkwhale/-/archive/1.0/funkwhale-1.0.tar.gz -SOURCE_SUM=c305ad352b739f0665c775922ab657991fa3c4c6830bf93210e98659a08f37d5 +SOURCE_URL=https://dev.funkwhale.audio/funkwhale/funkwhale/-/archive/1.0.1/funkwhale-1.01.tar.gz +SOURCE_SUM=103e45a3c8ae2a1223cb83689ed0a8f35bc7dfa053725a9dfd211e0e0973141b SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.bz2 SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index 69cbe6f..201d58d 100644 --- a/manifest.json +++ b/manifest.json @@ -3,9 +3,10 @@ "id": "funkwhale", "packaging_format": 1, "description": { - "en": "A modern, convivial and free music server" + "en": "Modern, convivial and free music server", + "fr": "Serveur de musique moderne, convivial et gratuit" }, - "version": "0.1.0.1~ynh1", + "version": "1.0.1~ynh1", "url": "https://funkwhale.audio", "license": "AGPL-3.0-or-later", "maintainer": { @@ -17,7 +18,7 @@ "email": "jean-baptiste@holcroft.fr" }], "requirements": { - "yunohost": ">= 4.0" + "yunohost": ">= 4.0.0" }, "multi_instance": true, "services": [ @@ -28,7 +29,8 @@ "name": "domain", "type": "domain", "ask": { - "en": "Choose a domain for funkwhale" + "en": "Choose a domain for Funkwhale", + "fr": "Choisissez un nom de domaine pour Funkwhale" }, "example": "example.com" }, @@ -36,7 +38,8 @@ "name": "admin", "type": "user", "ask": { - "en": "Choose an admin user" + "en": "Choose an admin user", + "fr": "Choisissez l'administrateur" }, "example": "sporiff" }, @@ -44,13 +47,15 @@ "name": "is_public", "type": "boolean", "ask": { - "en": "Is it a public application?" + "en": "Is it a public application?", + "fr": "Est-ce une application publique ?" }, "help": { - "en": "Allows unauthenticated users to access the user interface (mandatory for federation)" + "en": "Allows unauthenticated users to access the user interface (mandatory for federation).", + "fr": "Permet aux utilisateurs non authentifiés d'accéder à l'interface utilisateur (obligatoire pour la fédération)." }, "default": true } ] } -} \ No newline at end of file +} From 32a467ed4455070fbf6734596f142c6570bd81e2 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 4 Dec 2020 18:25:18 +0100 Subject: [PATCH 13/49] Set new permissions --- manifest.json | 2 +- scripts/install | 9 +++++---- scripts/upgrade | 12 ------------ 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/manifest.json b/manifest.json index 69cbe6f..2d8f9e8 100644 --- a/manifest.json +++ b/manifest.json @@ -17,7 +17,7 @@ "email": "jean-baptiste@holcroft.fr" }], "requirements": { - "yunohost": ">= 4.0" + "yunohost": ">= 4.0.0" }, "multi_instance": true, "services": [ diff --git a/scripts/install b/scripts/install index 66a3806..38d8193 100644 --- a/scripts/install +++ b/scripts/install @@ -238,11 +238,12 @@ ynh_add_fail2ban_config --logpath="/var/log/nginx/$domain-access.log" --failrege #================================================= ynh_script_progression --message="Configuring SSOwat..." -# Make app public if necessary -if [ "$is_public" -eq 1 ] +# Make app public if necessary or protect it +if [ $is_public -eq 1 ] then - # makes sure no SSO credentials to be passed - ynh_app_setting_set --app="$app" --key=skipped_uris --value="/" + # Everyone can access the app. + # The "main" permission is automatically created before the install script. + ynh_permission_update --permission "main" --add "visitors" fi #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 890fe04..ba53da0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -254,18 +254,6 @@ yunohost service add "$app-server" --log="/var/log/$app/server.log" yunohost service add "$app-worker" --log="/var/log/$app/worker.log" yunohost service add "$app-beat" --log="/var/log/$app/beat.log" -#================================================= -# SETUP SSOWAT -#================================================= -ynh_script_progression --message="Upgrading SSOwat configuration..." - -# Make app public if necessary -if [ "$is_public" -eq 1 ] -then - # makes sure no SSO credentials to be passed - ynh_app_setting_set --app="$app" --key=skipped_uris --value="/" -fi - #================================================= # START SYSTEMD SERVICE #================================================= From e289550a44493b8e16a167922cf852b1c40f81bd Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 14 Dec 2020 21:40:14 +0100 Subject: [PATCH 14/49] Add French Readme --- README_fr.md | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 README_fr.md diff --git a/README_fr.md b/README_fr.md new file mode 100644 index 0000000..692226a --- /dev/null +++ b/README_fr.md @@ -0,0 +1,85 @@ +# Funkwhale pour YunoHost + +[![Integration level](https://dash.yunohost.org/integration/funkwhale.svg)](https://dash.yunohost.org/appci/app/funkwhale) ![](https://ci-apps.yunohost.org/ci/badges/funkwhale.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/funkwhale.maintain.svg) +[![Install Funkwhale with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=funkwhale) + +*[Read this readme in english.](./README.md)* + +> *Ce package vous permet d'installer Funkwhale rapidement et simplement sur un serveur YunoHost. +Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/#/install) pour apprendre comment l'installer.* + +## Vue d'ensemble +Un serveur de musique moderne, convivial et gratuit sur YunoHost + +L'installation nécessite un domaine ou un sous-domaine dédié. L'installation dans un chemin du domaine n'est pas prise en charge par le projet en amont en raison des exigences de dépendance. + +**Version incluse :** 1.0.1 + +## Captures d'écran + +![](https://funkwhale.audio/img/desktop.5e79eb16.jpg) + +## Démo + +* [Démo officielle](https://demo.funkwhale.audio) + +**Nom d’utilisateur :** demo **Mot de passe :** demo + +## Admin + +L'administrateur utilise le login que vous avez fourni lors de l'installation. Le mot de passe est le même que celui que vous utilisez pour YunoHost. + +L'interface d'administration est accessible à l'adresse : votre.domaine.fr/api/admin + +# État de ce paquet + +* Les éléments suivants ont été testés avec ce paquet et fonctionnent : + + * [x] installer/supprimer/sauvegarder/supprimer/mettre à jour avec x86_64 + * [x] importation des fichiers avec l’interface web, importations depuis youtube, interraction avec MusicBrainz + * [x] [API Subsonic] (https://docs.funkwhale.audio/users/apps.html) + * [x] [Fédération](https://docs.funkwhale.audio/federation.html) tests + * [x] [Import CLI](https://docs.funkwhale.audio/importing-music.html#from-music-directory-on-the-server) N'oubliez pas de `source $final_path/venv/bin/activate`, puis `source $final_path/load_env` avant de taper en utilisant manage.py. + * [x] Support ARM + +* configuration de l'utilisateur final requise : + * [x] Intégration LDAP + +* à ajouter : + * [ ] Stocker les fichiers dans HOME, voir https://github.com/YunoHost-Apps/funkwhale_ynh/issues/15 + +## Documentation + + * Documentation officielle : https://docs.funkwhale.audio + +## Caractéristiques spécifiques YunoHost + +#### Support multi-utilisateur + +* L'authentification LDAP et HTTP est-elle prise en charge ? **OUI** +* L'application peut-elle être utilisée par plusieurs utilisateurs ? **OUI** + +#### Architectures supportées + +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/funkwhale%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/funkwhale/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/funkwhale%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/funkwhale/) + +## Liens + + * Signaler un bug : https://github.com/YunoHost-Apps/funkwhale_ynh + * Site de l’application : https://docs.funkwhale.audio + * Dépôt de l'application principale : https://dev.funkwhale.audio/funkwhale/funkwhale + * Site web YunoHost : https://yunohost.org/ + +--- + +## Informations pour les développeurs + +Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/REPLACEBYYOURAPP_ynh/tree/testing). + +Pour essayer la branche testing, procédez comme suit. +``` +sudo yunohost app install https://github.com/YunoHost-Apps/funkwhale_ynh/tree/testing --debug +or +sudo yunohost app upgrade funkwhale -u https://github.com/YunoHost-Apps/funkwhale_ynh/tree/testing --debug +``` From feb367b6d20e2a8203b7f53c74e692ccd746b877 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 14 Dec 2020 21:41:20 +0100 Subject: [PATCH 15/49] Readme update --- README.md | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index ff5983f..ae4a59e 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,12 @@ # Funkwhale for YunoHost -[![Integration level](https://dash.yunohost.org/integration/funkwhale.svg)](https://dash.yunohost.org/appci/app/funkwhale) ![](https://ci-apps.yunohost.org/ci/badges/funkwhale.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/funkwhale.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/funkwhale.svg)](https://dash.yunohost.org/appci/app/funkwhale) ![](https://ci-apps.yunohost.org/ci/badges/funkwhale.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/funkwhale.maintain.svg) [![Install Funkwhale with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=funkwhale) +*[Lire ce readme en français.](./README_fr.md)* + > *This package allows you to install Funkwhale quickly and simply on a YunoHost server. -If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.* +If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it. ## Overview A modern, convivial and free music server on YunoHost @@ -17,21 +19,31 @@ Installation requires a dedicated domain or subdomain. Installing in a subpath i ![](https://funkwhale.audio/img/desktop.5e79eb16.jpg) +## Demo + +* [Official demo](https://demo.funkwhale.audio) + +**Username:** demo **Password:** demo + ## Admin The admin uses the login you provided at installation. The password is the same you use for YunoHost. -The admin interface is accessible at the address: `your.domain.fr/api/admin` +The admin interface is accessible at the address: your.domain.fr/api/admin # State of this package * The following have been tested with this package and work fine: - * [x] install/remove/backup/remove/upgrade with x86_64 and ARM - * [x] import file with web interface, imports from YouTube, interraction with MusicBrainz + * [x] install/remove/backup/remove/upgrade with x86_64 + * [x] import file with web interface, imports from youtube, interraction with MusicBrainz * [x] [Subsonic API](https://docs.funkwhale.audio/users/apps.html) * [x] [Federation](https://docs.funkwhale.audio/federation.html) tests - * [x] [CLI Import](https://docs.funkwhale.audio/importing-music.html#from-music-directory-on-the-server) Remember to `source $final_path/venv/bin/activate`, then `source $final_path/load_env` before typinh using manage.py. + * [x] [CLI Import](https://docs.funkwhale.audio/importing-music.html#from-music-directory-on-the-server) Remember to `source $final_path/venv/bin/activate`, then `source $final_path/load_env` before typinh using manage.py. + * [x] ARM support + +* end-user configuration required: + * [x] LDAP integration * to be added: * [ ] Store files in HOME, see https://github.com/YunoHost-Apps/funkwhale_ynh/issues/15 @@ -42,8 +54,10 @@ The admin interface is accessible at the address: `your.domain.fr/api/admin` ## YunoHost specific features - * Are LDAP and HTTP auth supported? **Yes** - * Can the app be used by multiple users? **Yes** +#### Multi-user support + +* Are LDAP and HTTP auth supported? **YES** +* Can the app be used by multiple users? **YES** #### Supported architectures @@ -53,14 +67,14 @@ The admin interface is accessible at the address: `your.domain.fr/api/admin` ## Links * Report a bug about this package: https://github.com/YunoHost-Apps/funkwhale_ynh - * Report a bug about Funkwhale itself: https://code.eliotberriot.com/funkwhale/funkwhale/ * App website: https://docs.funkwhale.audio * Upstream app repository: https://dev.funkwhale.audio/funkwhale/funkwhale * YunoHost website: https://yunohost.org/ --- -## Developers info +Developers info +---------------- Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/funkwhale_ynh/tree/testing). From 21f7dc030679b2d528c25b6609d5e7a26505577e Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 14 Dec 2020 21:50:23 +0100 Subject: [PATCH 16/49] Update README.md --- README.md | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index ae4a59e..39984ba 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Funkwhale for YunoHost -[![Integration level](https://dash.yunohost.org/integration/funkwhale.svg)](https://dash.yunohost.org/appci/app/funkwhale) ![](https://ci-apps.yunohost.org/ci/badges/funkwhale.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/funkwhale.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/funkwhale.svg)](https://dash.yunohost.org/appci/app/funkwhale) ![](https://ci-apps.yunohost.org/ci/badges/funkwhale.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/funkwhale.maintain.svg) [![Install Funkwhale with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=funkwhale) *[Lire ce readme en français.](./README_fr.md)* @@ -29,21 +29,17 @@ Installation requires a dedicated domain or subdomain. Installing in a subpath i The admin uses the login you provided at installation. The password is the same you use for YunoHost. -The admin interface is accessible at the address: your.domain.fr/api/admin +The admin interface is accessible at the address: `your.domain.fr/api/admin` # State of this package * The following have been tested with this package and work fine: - * [x] install/remove/backup/remove/upgrade with x86_64 - * [x] import file with web interface, imports from youtube, interraction with MusicBrainz + * [x] install/remove/backup/remove/upgrade with x86_64 and ARM + * [x] import file with web interface, imports from YouTube, interraction with MusicBrainz * [x] [Subsonic API](https://docs.funkwhale.audio/users/apps.html) * [x] [Federation](https://docs.funkwhale.audio/federation.html) tests - * [x] [CLI Import](https://docs.funkwhale.audio/importing-music.html#from-music-directory-on-the-server) Remember to `source $final_path/venv/bin/activate`, then `source $final_path/load_env` before typinh using manage.py. - * [x] ARM support - -* end-user configuration required: - * [x] LDAP integration + * [x] [CLI Import](https://docs.funkwhale.audio/importing-music.html#from-music-directory-on-the-server) Remember to `source $final_path/venv/bin/activate`, then `source $final_path/load_env` before typinh using manage.py. * to be added: * [ ] Store files in HOME, see https://github.com/YunoHost-Apps/funkwhale_ynh/issues/15 @@ -54,10 +50,8 @@ The admin interface is accessible at the address: your.domain.fr/api/admin ## YunoHost specific features -#### Multi-user support - -* Are LDAP and HTTP auth supported? **YES** -* Can the app be used by multiple users? **YES** + * Are LDAP and HTTP auth supported? **Yes** + * Can the app be used by multiple users? **Yes** #### Supported architectures From 0d1a2d805966e9e75449b3db0138351a95a3fcdc Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 14 Dec 2020 21:53:22 +0100 Subject: [PATCH 17/49] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 39984ba..c9d9d3d 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ *[Lire ce readme en français.](./README_fr.md)* > *This package allows you to install Funkwhale quickly and simply on a YunoHost server. -If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it. +If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.* ## Overview A modern, convivial and free music server on YunoHost From 73883e6cc5cb4b70f80faf8f182e560e87edc559 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 14 Dec 2020 22:05:07 +0100 Subject: [PATCH 18/49] Update README_fr.md --- README_fr.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/README_fr.md b/README_fr.md index 692226a..9db7d94 100644 --- a/README_fr.md +++ b/README_fr.md @@ -37,13 +37,9 @@ L'interface d'administration est accessible à l'adresse : votre.domaine.fr/api/ * [x] installer/supprimer/sauvegarder/supprimer/mettre à jour avec x86_64 * [x] importation des fichiers avec l’interface web, importations depuis youtube, interraction avec MusicBrainz - * [x] [API Subsonic] (https://docs.funkwhale.audio/users/apps.html) - * [x] [Fédération](https://docs.funkwhale.audio/federation.html) tests + * [x] [API Subsonic](https://docs.funkwhale.audio/users/apps.html) + * [x] Tests de [Fédération](https://docs.funkwhale.audio/federation.html) * [x] [Import CLI](https://docs.funkwhale.audio/importing-music.html#from-music-directory-on-the-server) N'oubliez pas de `source $final_path/venv/bin/activate`, puis `source $final_path/load_env` avant de taper en utilisant manage.py. - * [x] Support ARM - -* configuration de l'utilisateur final requise : - * [x] Intégration LDAP * à ajouter : * [ ] Stocker les fichiers dans HOME, voir https://github.com/YunoHost-Apps/funkwhale_ynh/issues/15 From 4fec2a1813e3dea58ae8096d5a5ebfe5c35f1a8f Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 14 Dec 2020 22:12:11 +0100 Subject: [PATCH 19/49] Update README.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com> --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index c9d9d3d..643502f 100644 --- a/README.md +++ b/README.md @@ -67,8 +67,7 @@ The admin interface is accessible at the address: `your.domain.fr/api/admin` --- -Developers info ----------------- +## Developers info Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/funkwhale_ynh/tree/testing). From 5120dc8ca6fe790c36735a71f9cbe49249719bfe Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 14 Dec 2020 22:12:26 +0100 Subject: [PATCH 20/49] Update README_fr.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com> --- README_fr.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_fr.md b/README_fr.md index 9db7d94..9fb6bb4 100644 --- a/README_fr.md +++ b/README_fr.md @@ -71,7 +71,7 @@ L'interface d'administration est accessible à l'adresse : votre.domaine.fr/api/ ## Informations pour les développeurs -Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/REPLACEBYYOURAPP_ynh/tree/testing). +Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/funkwhale_ynh/tree/testing). Pour essayer la branche testing, procédez comme suit. ``` From 4a7d55f1e19b5dced8469d7b18a133358597503c Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Sat, 19 Dec 2020 19:53:20 +0100 Subject: [PATCH 21/49] Update README.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 643502f..0796aea 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Funkwhale for YunoHost [![Integration level](https://dash.yunohost.org/integration/funkwhale.svg)](https://dash.yunohost.org/appci/app/funkwhale) ![](https://ci-apps.yunohost.org/ci/badges/funkwhale.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/funkwhale.maintain.svg) -[![Install Funkwhale with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=funkwhale) +[![Install Funkwhale with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=funkwhale) *[Lire ce readme en français.](./README_fr.md)* From fa41dd52769b23d8497f321fb08c642bebc17165 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Sat, 19 Dec 2020 19:53:34 +0100 Subject: [PATCH 22/49] Update README_fr.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com> --- README_fr.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_fr.md b/README_fr.md index 9fb6bb4..8d71111 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,7 +1,7 @@ # Funkwhale pour YunoHost [![Integration level](https://dash.yunohost.org/integration/funkwhale.svg)](https://dash.yunohost.org/appci/app/funkwhale) ![](https://ci-apps.yunohost.org/ci/badges/funkwhale.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/funkwhale.maintain.svg) -[![Install Funkwhale with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=funkwhale) +[![Install Funkwhale with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=funkwhale) *[Read this readme in english.](./README.md)* From 05c47d876eb63328cb35e5736f2c891422e9e015 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sat, 9 Jan 2021 22:43:04 +0100 Subject: [PATCH 23/49] Finding an available port --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 38d8193..f50e92f 100644 --- a/scripts/install +++ b/scripts/install @@ -56,7 +56,7 @@ ynh_app_setting_set --app="$app" --key=admin --value="$admin" #================================================= # FIND AND OPEN A PORT #================================================= -ynh_script_progression --message="Configuring firewall..." +ynh_script_progression --message="Finding an available port..." # Find a free port port=$(ynh_find_port --port=5000) From 7c44eaab7626136ecb589d6972c9ccd3692e3075 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Thu, 11 Mar 2021 20:03:28 +0100 Subject: [PATCH 24/49] Uprade to 1.1 and fixes Twisted by retrograding it (#129) --- README.md | 2 +- README_fr.md | 2 +- conf/app-frontend.src | 4 +- conf/app.src | 4 +- manifest.json | 4 +- .../extra_files/app/api/requirements/base.txt | 93 ++++++++++--------- 6 files changed, 56 insertions(+), 53 deletions(-) diff --git a/README.md b/README.md index 0796aea..410335c 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ A modern, convivial and free music server on YunoHost Installation requires a dedicated domain or subdomain. Installing in a subpath is not supported by the upstream project due to dependency requirements. -**Shipped version:** 1.0.1 +**Shipped version:** 1.1 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 8d71111..0c14ba1 100644 --- a/README_fr.md +++ b/README_fr.md @@ -13,7 +13,7 @@ Un serveur de musique moderne, convivial et gratuit sur YunoHost L'installation nécessite un domaine ou un sous-domaine dédié. L'installation dans un chemin du domaine n'est pas prise en charge par le projet en amont en raison des exigences de dépendance. -**Version incluse :** 1.0.1 +**Version incluse :** 1.1 ## Captures d'écran diff --git a/conf/app-frontend.src b/conf/app-frontend.src index 9448940..52d9f61 100644 --- a/conf/app-frontend.src +++ b/conf/app-frontend.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://dev.funkwhale.audio/funkwhale/funkwhale/builds/artifacts/1.0.1/download?job=build_front -SOURCE_SUM=0b77367cb4e8d1b57af59282af90ac41e0915de85cf5337b02f16e6aa0bd0129 +SOURCE_URL=https://dev.funkwhale.audio/funkwhale/funkwhale/builds/artifacts/1.1/download?job=build_front +SOURCE_SUM=cf985340ba0fe477fa5f9b8940102e016c0c75a9941dd8acabb8dc5f77cda000 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=false diff --git a/conf/app.src b/conf/app.src index e1e4b3a..67a52e9 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://dev.funkwhale.audio/funkwhale/funkwhale/-/archive/1.0.1/funkwhale-1.01.tar.gz -SOURCE_SUM=103e45a3c8ae2a1223cb83689ed0a8f35bc7dfa053725a9dfd211e0e0973141b +SOURCE_URL=https://dev.funkwhale.audio/funkwhale/funkwhale/-/archive/1.1/funkwhale-1.1.tar.gz +SOURCE_SUM=924a31ba385c9c52204d78aa89a00b5f53240bf91a13b2c08945fde8f770d345 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.bz2 SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index d3c644d..d5f1259 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Modern, convivial and free music server", "fr": "Serveur de musique moderne, convivial et gratuit" }, - "version": "1.0.1~ynh1", + "version": "1.1~ynh1", "url": "https://funkwhale.audio", "license": "AGPL-3.0-or-later", "maintainer": { @@ -58,4 +58,4 @@ } ] } -} \ No newline at end of file +} diff --git a/sources/extra_files/app/api/requirements/base.txt b/sources/extra_files/app/api/requirements/base.txt index 88f7099..35d71c2 100644 --- a/sources/extra_files/app/api/requirements/base.txt +++ b/sources/extra_files/app/api/requirements/base.txt @@ -1,74 +1,77 @@ django~=3.0.8 setuptools>=49 # Configuration -django-environ~=0.4 +django-environ~=0.4.0 # Images -Pillow~=7.0 +Pillow~=7.0.0 -django-allauth~=0.42 +django-allauth~=0.42.0 -psycopg2-binary~=2.8 +psycopg2-binary~=2.8.0 # Time zones support pytz==2020.1 # Redis support -django-redis~=4.12 -redis~=3.5 -kombu~=4.6 +django-redis~=4.12.0 +redis~=3.5.0 +kombu~=4.6.0 -celery~=4.4 +celery~=4.4.0 # Your custom requirements go here -django-cors-headers~=3.4 +django-cors-headers~=3.4.0 musicbrainzngs~=0.7.1 -djangorestframework~=3.11 -djangorestframework-jwt~=1.11 +djangorestframework~=3.11.0 +djangorestframework-jwt~=1.11.0 arrow~=0.15.5 -persisting-theory~=0.2 -django-versatileimagefield~=2.0 -django-filter~=2.3 -django-rest-auth~=0.9 -ipython~=7.10 -mutagen~=1.45 +persisting-theory~=0.2.0 +django-versatileimagefield~=2.0.0 +django-filter~=2.3.0 +django-rest-auth~=0.9.0 +ipython~=7.10.0 +mutagen~=1.45.0 -pymemoize~=1.0 +pymemoize~=1.0.0 django-dynamic-preferences~=1.10 -raven~=6.10 -python-magic~=0.4 -channels~=2.4 -channels_redis~=3.0 -uvicorn[standard]~=0.12 -gunicorn~=20.0 +raven~=6.10.0 +python-magic~=0.4.0 +channels~=2.4.0 +channels_redis~=3.0.0 +uvicorn[standard]~=0.12.0 +gunicorn~=20.0.0 -cryptography~=2.9 +cryptography~=2.9.0 # requests-http-signature==0.0.3 # clone until the branch is merged and released upstream -git+https://github.com/EliotBerriot/requests-http-signature.git@signature-header-support -django-cleanup~=5.0 -requests~=2.24 -pyOpenSSL~=19.1 +git+https://github.com/agateblue/requests-http-signature.git@signature-header-support +django-cleanup~=5.0.0 +requests~=2.24.0 +pyOpenSSL~=19.1.0 # for LDAP authentication -python-ldap~=3.3 -django-auth-ldap~=2.2 +python-ldap~=3.3.0 +django-auth-ldap~=2.2.0 -pydub~=0.24 -pyld~=1.0 -aiohttp~=3.6 +pydub~=0.24.0 +pyld~=1.0.0 +aiohttp~=3.6.0 -django-oauth-toolkit~=1.3 -django-storages~=1.9 -boto3~=1.14 -unicode-slugify~=0.1 -django-cacheops~=5.0 +django-oauth-toolkit~=1.3.0 +django-storages~=1.9.0 +boto3~=1.14.0 +unicode-slugify~=0.1.0 +django-cacheops~=5.0.0 -click~=7.1 -service_identity~=18.1 -markdown~=3.2 -bleach~=3.1 -feedparser==6.0.0b3 -watchdog~=0.10 \ No newline at end of file +click~=7.1.0 +service_identity~=18.1.0 +markdown~=3.2.0 +bleach~=3.1.0 +feedparser~=6.0.0 +watchdog~=1.0.2 + +## Pin third party dependency to avoid issue with latest version +twisted==20.3.0 From fc22726fa67f77c7f7fc2d036a9f8f3219047ab6 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 12 Mar 2021 08:50:52 +0100 Subject: [PATCH 25/49] Fix linter warning : no need to use $is_public --- scripts/install | 7 +++---- scripts/upgrade | 8 +++++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/scripts/install b/scripts/install index f50e92f..beb1454 100644 --- a/scripts/install +++ b/scripts/install @@ -48,7 +48,6 @@ ynh_script_progression --message="Storing installation settings..." ynh_app_setting_set --app="$app" --key=domain --value="$domain" ynh_app_setting_set --app="$app" --key=path --value="$path_url" -ynh_app_setting_set --app="$app" --key=is_public --value="$is_public" ynh_app_setting_set --app="$app" --key=admin --value="$admin" #================================================= @@ -68,7 +67,7 @@ ynh_app_setting_set --app="$app" --key=port --value="$port" #================================================= ynh_script_progression --message="Installing dependencies..." -ynh_install_app_dependencies $pkg_dependencies +ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies #================================================= # CREATE A POSTGRESQL DATABASE @@ -236,14 +235,14 @@ ynh_add_fail2ban_config --logpath="/var/log/nginx/$domain-access.log" --failrege #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring SSOwat..." +ynh_script_progression --message="Configuring permissions..." # Make app public if necessary or protect it if [ $is_public -eq 1 ] then # Everyone can access the app. # The "main" permission is automatically created before the install script. - ynh_permission_update --permission "main" --add "visitors" + ynh_permission_update --permission="main" --add="visitors" fi #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index ba53da0..a01b565 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -18,7 +18,6 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app="$app" --key=domain) path_url=$(ynh_app_setting_get --app="$app" --key=path) -is_public=$(ynh_app_setting_get --app="$app" --key=is_public) final_path=$(ynh_app_setting_get --app="$app" --key=final_path) db_name=$(ynh_app_setting_get --app="$app" --key=db_name) db_user="$db_name" @@ -52,6 +51,13 @@ if [ ! -d "$final_path/code/" ]; then ynh_app_setting_set --app="$app" --key=code_migration --value=1 fi +# Cleaning legacy permissions +if ynh_legacy_permissions_exists; then + ynh_legacy_permissions_delete_all + + ynh_app_setting_delete --app=$app --key=is_public +fi + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= From 9bfa53df3d6a35ee14d7003469127dced1b47a8b Mon Sep 17 00:00:00 2001 From: Amos Blanton Date: Thu, 15 Apr 2021 14:30:36 +0200 Subject: [PATCH 26/49] Clarify custom paths needed to import collections of music files in Readme. (#134) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update readme to indicate custom import path Yunohost installations of Funkwhale use a different path for file imports than those indicated in the Funkwhale documentation.. (/var/www/Funkwhale/import). We should therefore indicate to the admin user what that path is, and steps necessary to use it. Addresses #132. * Fix bash highlighting. * Update README.md Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com> Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com> --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 410335c..370da1a 100644 --- a/README.md +++ b/README.md @@ -28,9 +28,15 @@ Installation requires a dedicated domain or subdomain. Installing in a subpath i ## Admin The admin uses the login you provided at installation. The password is the same you use for YunoHost. - The admin interface is accessible at the address: `your.domain.fr/api/admin` +To add a collection of music files to a library in your YunoHost installation of Funkwhale, create a symlink to your collection titled "import" in `/var/www/funkwhale` +```console +foo@bar:~$sudo ln -s /your/music/collection /var/www/funkwhale/import +``` +The files can then be added to your library from the *uploading* tab in a music library under the heading **Import music from your server**. + + # State of this package * The following have been tested with this package and work fine: From 33392f79e92ce2d970f8908018a7a7a0e3084d83 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 16 Apr 2021 14:14:27 +0200 Subject: [PATCH 27/49] Apply Example_ynh (#131) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Testing (#130) * Uprade to 1.1 and fixes Twisted by retrograding it (#129) * Apply example_ynh Fix #15 * Fix services * Fix several merging * Stick to official install process * fix path_transversal * Using option '--log_type systemd' with 'yunohost service add' is not relevant anymore * Try to fix package_check * Fix package_check test * Update check_process * Trying to fix package_check * Update env.prod * remove sleep * Better service name * missing datadir * line 111: upgrade_type: unbound variable * Implement --is_big * Fix stopping service from previous version * Fix upgrade * Fix upgrade * Apply example_ynh * Apply example_ynh * Fix rights * Update api.src * Update env.prod * Update front.src * Update manifest.json * Update README.md * Update README_fr.md * Fix chmod * Fix rights Co-authored-by: Thomas <51749973+Thovi98@users.noreply.github.com> Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com> --- README.md | 30 +- README_fr.md | 33 +-- check_process | 9 +- conf/api.src | 7 + conf/app-frontend.src | 6 - conf/app.src | 6 - conf/env.prod | 61 +++- conf/front.src | 7 + conf/funkwhale-beat.service | 26 +- conf/funkwhale-server.service | 26 +- conf/funkwhale-worker.service | 26 +- conf/nginx.conf | 158 +++++++--- issue_template.md | 55 ++++ manifest.json | 25 +- pull_request_template.md | 16 ++ scripts/_common.sh | 7 +- scripts/backup | 55 ++-- scripts/install | 211 +++++++------- scripts/remove | 73 +++-- scripts/restore | 114 ++++---- scripts/upgrade | 272 +++++++++--------- .../extra_files/app/api/requirements/base.txt | 77 ----- 22 files changed, 656 insertions(+), 644 deletions(-) create mode 100644 conf/api.src delete mode 100644 conf/app-frontend.src delete mode 100644 conf/app.src create mode 100644 conf/front.src create mode 100644 issue_template.md create mode 100644 pull_request_template.md delete mode 100644 sources/extra_files/app/api/requirements/base.txt diff --git a/README.md b/README.md index 370da1a..995a54d 100644 --- a/README.md +++ b/README.md @@ -6,18 +6,18 @@ *[Lire ce readme en français.](./README_fr.md)* > *This package allows you to install Funkwhale quickly and simply on a YunoHost server. -If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.* +If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* ## Overview A modern, convivial and free music server on YunoHost Installation requires a dedicated domain or subdomain. Installing in a subpath is not supported by the upstream project due to dependency requirements. -**Shipped version:** 1.1 +**Shipped version:** 1.1.1 ## Screenshots -![](https://funkwhale.audio/img/desktop.5e79eb16.jpg) +![](https://upload.wikimedia.org/wikipedia/commons/d/d8/Capture_d%27%C3%A9cran_de_la_page_d%27accueil_de_Funkwhale.png) ## Demo @@ -36,20 +36,6 @@ foo@bar:~$sudo ln -s /your/music/collection /var/www/funkwhale/import ``` The files can then be added to your library from the *uploading* tab in a music library under the heading **Import music from your server**. - -# State of this package - -* The following have been tested with this package and work fine: - - * [x] install/remove/backup/remove/upgrade with x86_64 and ARM - * [x] import file with web interface, imports from YouTube, interraction with MusicBrainz - * [x] [Subsonic API](https://docs.funkwhale.audio/users/apps.html) - * [x] [Federation](https://docs.funkwhale.audio/federation.html) tests - * [x] [CLI Import](https://docs.funkwhale.audio/importing-music.html#from-music-directory-on-the-server) Remember to `source $final_path/venv/bin/activate`, then `source $final_path/load_env` before typinh using manage.py. - -* to be added: - * [ ] Store files in HOME, see https://github.com/YunoHost-Apps/funkwhale_ynh/issues/15 - ## Documentation * Official documentation: https://docs.funkwhale.audio @@ -61,21 +47,21 @@ The files can then be added to your library from the *uploading* tab in a music #### Supported architectures -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/funkwhale%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/funkwhale/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/funkwhale%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/funkwhale/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/funkwhale.svg)](https://ci-apps.yunohost.org/ci/apps/funkwhale/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/funkwhale.svg)](https://ci-apps-arm.yunohost.org/ci/apps/funkwhale/) ## Links - * Report a bug about this package: https://github.com/YunoHost-Apps/funkwhale_ynh + * Report a bug: https://github.com/YunoHost-Apps/funkwhale_ynh/issues * App website: https://docs.funkwhale.audio * Upstream app repository: https://dev.funkwhale.audio/funkwhale/funkwhale * YunoHost website: https://yunohost.org/ --- -## Developers info +## Developer info -Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/funkwhale_ynh/tree/testing). +Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/funkwhale_ynh/tree/testing). To try the testing branch, please proceed like that. ``` diff --git a/README_fr.md b/README_fr.md index 0c14ba1..0c93780 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,7 +1,7 @@ # Funkwhale pour YunoHost -[![Integration level](https://dash.yunohost.org/integration/funkwhale.svg)](https://dash.yunohost.org/appci/app/funkwhale) ![](https://ci-apps.yunohost.org/ci/badges/funkwhale.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/funkwhale.maintain.svg) -[![Install Funkwhale with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=funkwhale) +[![Niveau d'intégration](https://dash.yunohost.org/integration/funkwhale.svg)](https://dash.yunohost.org/appci/app/funkwhale) ![](https://ci-apps.yunohost.org/ci/badges/funkwhale.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/funkwhale.maintain.svg) +[![Installer Funkwhale avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=funkwhale) *[Read this readme in english.](./README.md)* @@ -13,17 +13,17 @@ Un serveur de musique moderne, convivial et gratuit sur YunoHost L'installation nécessite un domaine ou un sous-domaine dédié. L'installation dans un chemin du domaine n'est pas prise en charge par le projet en amont en raison des exigences de dépendance. -**Version incluse :** 1.1 +**Version incluse :** 1.1.1 ## Captures d'écran -![](https://funkwhale.audio/img/desktop.5e79eb16.jpg) +![](https://upload.wikimedia.org/wikipedia/commons/d/d8/Capture_d%27%C3%A9cran_de_la_page_d%27accueil_de_Funkwhale.png) ## Démo * [Démo officielle](https://demo.funkwhale.audio) -**Nom d’utilisateur :** demo **Mot de passe :** demo +**Nom d’utilisateur :** demo **Mot de passe :** demo ## Admin @@ -31,19 +31,6 @@ L'administrateur utilise le login que vous avez fourni lors de l'installation. L L'interface d'administration est accessible à l'adresse : votre.domaine.fr/api/admin -# État de ce paquet - -* Les éléments suivants ont été testés avec ce paquet et fonctionnent : - - * [x] installer/supprimer/sauvegarder/supprimer/mettre à jour avec x86_64 - * [x] importation des fichiers avec l’interface web, importations depuis youtube, interraction avec MusicBrainz - * [x] [API Subsonic](https://docs.funkwhale.audio/users/apps.html) - * [x] Tests de [Fédération](https://docs.funkwhale.audio/federation.html) - * [x] [Import CLI](https://docs.funkwhale.audio/importing-music.html#from-music-directory-on-the-server) N'oubliez pas de `source $final_path/venv/bin/activate`, puis `source $final_path/load_env` avant de taper en utilisant manage.py. - -* à ajouter : - * [ ] Stocker les fichiers dans HOME, voir https://github.com/YunoHost-Apps/funkwhale_ynh/issues/15 - ## Documentation * Documentation officielle : https://docs.funkwhale.audio @@ -57,13 +44,13 @@ L'interface d'administration est accessible à l'adresse : votre.domaine.fr/api/ #### Architectures supportées -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/funkwhale%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/funkwhale/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/funkwhale%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/funkwhale/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/funkwhale.svg)](https://ci-apps.yunohost.org/ci/apps/funkwhale/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/funkwhale.svg)](https://ci-apps-arm.yunohost.org/ci/apps/funkwhale/) ## Liens - * Signaler un bug : https://github.com/YunoHost-Apps/funkwhale_ynh - * Site de l’application : https://docs.funkwhale.audio + * Signaler un bug : https://github.com/YunoHost-Apps/funkwhale_ynh/issues + * Site de l'application : https://docs.funkwhale.audio * Dépôt de l'application principale : https://dev.funkwhale.audio/funkwhale/funkwhale * Site web YunoHost : https://yunohost.org/ @@ -76,6 +63,6 @@ Merci de faire vos pull request sur la [branche testing](https://github.com/Yuno Pour essayer la branche testing, procédez comme suit. ``` sudo yunohost app install https://github.com/YunoHost-Apps/funkwhale_ynh/tree/testing --debug -or +ou sudo yunohost app upgrade funkwhale -u https://github.com/YunoHost-Apps/funkwhale_ynh/tree/testing --debug ``` diff --git a/check_process b/check_process index b0e4657..ea05a96 100644 --- a/check_process +++ b/check_process @@ -1,4 +1,4 @@ -# See here for more informations +# See here for more information # https://github.com/YunoHost/package_check#syntax-check_process-file # Move this file from check_process.default to check_process when you have filled it. @@ -16,7 +16,10 @@ setup_private=1 setup_public=1 upgrade=1 - upgrade=1 from_commit=4d4bf0981e2d3a00eaae6b19bd54344fe55d6530 + # 0.19.1 + upgrade=1 from_commit=4d4bf0981e2d3a00eaae6b19bd54344fe55d6530 + # 1.1~ynh1 + upgrade=1 from_commit=8172790fb461d16f09089593fdac380f0d499c83 backup_restore=1 multi_instance=1 incorrect_path=0 @@ -29,3 +32,5 @@ Notification=all ; commit=4d4bf0981e2d3a00eaae6b19bd54344fe55d6530 name=Upgrade to 0.19.1 and fix channels-redis bug manifest_arg=domain=DOMAIN&path=/&admin=USER&is_public=1 + ; commit=8172790fb461d16f09089593fdac380f0d499c83 + name=1.1~ynh1 diff --git a/conf/api.src b/conf/api.src new file mode 100644 index 0000000..2f4f89c --- /dev/null +++ b/conf/api.src @@ -0,0 +1,7 @@ +SOURCE_URL=https://dev.funkwhale.audio/funkwhale/funkwhale/-/jobs/artifacts/1.1.1/download?job=build_api +SOURCE_SUM=c77ebc37378df26a621f5f702fad3f94b56207bbfd69001bda4b45bcda515332 +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=zip +SOURCE_IN_SUBDIR=true +SOURCE_FILENAME=api_1.1.1.zip +SOURCE_EXTRACT=true diff --git a/conf/app-frontend.src b/conf/app-frontend.src deleted file mode 100644 index 52d9f61..0000000 --- a/conf/app-frontend.src +++ /dev/null @@ -1,6 +0,0 @@ -SOURCE_URL=https://dev.funkwhale.audio/funkwhale/funkwhale/builds/artifacts/1.1/download?job=build_front -SOURCE_SUM=cf985340ba0fe477fa5f9b8940102e016c0c75a9941dd8acabb8dc5f77cda000 -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=zip -SOURCE_IN_SUBDIR=false -SOURCE_FILENAME= diff --git a/conf/app.src b/conf/app.src deleted file mode 100644 index 67a52e9..0000000 --- a/conf/app.src +++ /dev/null @@ -1,6 +0,0 @@ -SOURCE_URL=https://dev.funkwhale.audio/funkwhale/funkwhale/-/archive/1.1/funkwhale-1.1.tar.gz -SOURCE_SUM=924a31ba385c9c52204d78aa89a00b5f53240bf91a13b2c08945fde8f770d345 -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.bz2 -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= diff --git a/conf/env.prod b/conf/env.prod index 4a62772..53887a3 100644 --- a/conf/env.prod +++ b/conf/env.prod @@ -36,9 +36,10 @@ FUNKWHALE_API_IP=127.0.0.1 FUNKWHALE_API_PORT=__PORT__ # The number of web workers to start in parallel. Higher means you can handle # more concurrent requests, but also leads to higher CPU/Memory usage -FUNKWHALE_WEB_WORKERS=1 +FUNKWHALE_WEB_WORKERS=6 # Replace this by the definitive, public domain you will use for -# your instance +# your instance. It cannot be changed after initial deployment +# without breaking your instance. FUNKWHALE_HOSTNAME=__DOMAIN__ FUNKWHALE_PROTOCOL=https @@ -52,6 +53,10 @@ FUNKWHALE_PROTOCOL=https # EMAIL_CONFIG=smtp+ssl://user@:password@youremail.host:465 # EMAIL_CONFIG=smtp+tls://user@:password@youremail.host:587 +# Make email verification mandatory before using the service +# Doesn't apply to admins. +# ACCOUNT_EMAIL_VERIFICATION_ENFORCE=false + # The email address to use to send system emails. # DEFAULT_FROM_EMAIL=noreply@yourdomain @@ -67,7 +72,7 @@ REVERSE_PROXY_TYPE=nginx # DATABASE_URL=postgresql://:@:/ # DATABASE_URL=postgresql://funkwhale:passw0rd@localhost:5432/funkwhale_database # Use the next one if you followed Debian installation guide -DATABASE_URL=postgresql://__DBUSER__:__DBPWD__@:5432/__DBNAME__ +DATABASE_URL=postgresql://__DB_USER__:__DB_PWD__@:5432/__DB_NAME__ # Cache configuration # Examples: @@ -86,16 +91,22 @@ CACHE_URL=redis://127.0.0.1:6379/__REDIS_DB__ # For the Celery/asynchronous tasks part: # CELERY_BROKER_URL=redis+socket:///run/redis/redis.sock?virtual_host=0 +# Number of worker processes to execute. Defaults to 0, in which case it uses your number of CPUs +# Celery workers handle background tasks (such file imports or federation +# messaging). The more processes a worker gets, the more tasks +# can be processed in parallel. However, more processes also means +# a bigger memory footprint. +# CELERYD_CONCURRENCY=0 # Where media files (such as album covers or audio tracks) should be stored # on your system? # (Ensure this directory actually exists) -MEDIA_ROOT=__FINALPATH__/media +MEDIA_ROOT=__DATADIR__/media # Where static files (such as API css or icons) should be compiled # on your system? # (Ensure this directory actually exists) -STATIC_ROOT=__FINALPATH__/code/data/static +STATIC_ROOT=__DATADIR__/static # which settings module should django use? # You don't have to touch this unless you really know what you're doing @@ -125,8 +136,8 @@ RAVEN_DSN=https://44332e9fdd3d42879c7d35bf8562c6a4:0062dc16a22b41679cd5765e5342f # MUSIC_DIRECTORY_PATH=/srv/funkwhale/data/music # # MUSIC_DIRECTORY_SERVE_PATH= # stays commented, not needed -MUSIC_DIRECTORY_PATH=__FINALPATH__/import -MUSIC_DIRECTORY_SERVE_PATH=__FINALPATH__/import +MUSIC_DIRECTORY_PATH=__DATADIR__/music +MUSIC_DIRECTORY_SERVE_PATH=__DATADIR__/music # LDAP settings # Use the following options to allow authentication on your Funkwhale instance @@ -142,10 +153,40 @@ LDAP_BIND_PASSWORD='' LDAP_SEARCH_FILTER=(|(uid={0})) LDAP_START_TLS=False LDAP_ROOT_DN=ou=users,dc=yunohost,dc=org -LDAP_USER_ATTR_MAP={"username":"uid"} +LDAP_USER_ATTR_MAP={"username": "uid"} -FUNKWHALE_FRONTEND_PATH=__FINALPATH__/code/front/dist -FUNKWHALE_SPA_HTML_ROOT=__FINALPATH__/code/front/dist/index.html +FUNKWHALE_FRONTEND_PATH=__FINALPATH__/front/dist +FUNKWHALE_SPA_HTML_ROOT=__FINALPATH__/front/dist/index.html # Nginx related configuration NGINX_MAX_BODY_SIZE=100M + +## External storages configuration +# Funkwhale can store uploaded files on Amazon S3 and S3-compatible storages (such as Minio) +# Uncomment and fill the variables below + +# AWS_ACCESS_KEY_ID= +# AWS_SECRET_ACCESS_KEY= +# AWS_STORAGE_BUCKET_NAME= +# An optional bucket subdirectory were you want to store the files. This is especially useful +# if you plan to use share the bucket with other services +# AWS_LOCATION= + +# If you use a S3-compatible storage such as minio, set the following variable +# the full URL to the storage server. Example: +# AWS_S3_ENDPOINT_URL=https://minio.mydomain.com +# AWS_S3_ENDPOINT_URL= + +# If you want to serve media directly from your S3 bucket rather than through a proxy, +# set this to true +# PROXY_MEDIA=false + +# If you are using Amazon S3 to serve media directly, you will need to specify your region +# name in order to access files. Example: +# AWS_S3_REGION_NAME=eu-west-2 +# AWS_S3_REGION_NAME= + +# If you are using Amazon S3, use this setting to configure how long generated URLs should stay +# valid. The default value is 3600 (60 minutes). The maximum accepted value is 604800 (7 days) + +# AWS_QUERYSTRING_EXPIRE= diff --git a/conf/front.src b/conf/front.src new file mode 100644 index 0000000..7b550d4 --- /dev/null +++ b/conf/front.src @@ -0,0 +1,7 @@ +SOURCE_URL=https://dev.funkwhale.audio/funkwhale/funkwhale/builds/artifacts/1.1.1/download?job=build_front +SOURCE_SUM=d94f0deaa88b8d90dd10b363cf817a80f9d2822419e8bbc7282bacd27351127b +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=zip +SOURCE_IN_SUBDIR=true +SOURCE_FILENAME=front_1.1.1.zip +SOURCE_EXTRACT=true diff --git a/conf/funkwhale-beat.service b/conf/funkwhale-beat.service index 55fae20..2efd191 100644 --- a/conf/funkwhale-beat.service +++ b/conf/funkwhale-beat.service @@ -1,30 +1,14 @@ [Unit] -Description=Funkwhale (__APP__) celery beat process +Description=__APP__ celery beat process After=redis.service postgresql.service PartOf=__APP__.target [Service] User=__APP__ Group=__APP__ -WorkingDirectory=__FINALPATH__/code/api -EnvironmentFile=__FINALPATH__/code/config/.env - -ExecStart=__FINALPATH__/code/virtualenv/bin/celery -A funkwhale_api.taskapp beat \ - --loglevel INFO --logfile=/var/log/__APP__/beat.log - -#NoNewPrivileges=true -#PrivateDevices=true -#PrivateTmp=true -#ProtectHome=true -#ProtectSystem=strict -#ProtectControlGroups=yes -#ProtectKernelModules=yes -#ReadOnlyPaths=__FINALPATH__/code/config/.env __FINALPATH__/code/ -#ReadWritePaths=__FINALPATH__/media __FINALPATH__/import __FINALPATH__/code/api /var/log/__APP__ - -StandardOutput=syslog -StandardError=syslog -SyslogIdentifier=__APP__-beat +WorkingDirectory=__FINALPATH__/api +EnvironmentFile=__FINALPATH__/config/.env +ExecStart=__FINALPATH__/virtualenv/bin/celery -A funkwhale_api.taskapp beat -l INFO [Install] -WantedBy=multi-user.target \ No newline at end of file +WantedBy=multi-user.target diff --git a/conf/funkwhale-server.service b/conf/funkwhale-server.service index 88c482d..59d5dd2 100644 --- a/conf/funkwhale-server.service +++ b/conf/funkwhale-server.service @@ -1,32 +1,14 @@ [Unit] -Description=Funkwhale (__APP__) application server +Description=__APP__ application server After=redis.service postgresql.service PartOf=__APP__.target [Service] User=__APP__ Group=__APP__ -WorkingDirectory=__FINALPATH__/code/api -EnvironmentFile=__FINALPATH__/code/config/.env - -ExecStart=__FINALPATH__/code/virtualenv/bin/gunicorn config.asgi:application \ - -w ${FUNKWHALE_WEB_WORKERS} \ - -k uvicorn.workers.UvicornWorker \ - -b ${FUNKWHALE_API_IP}:${FUNKWHALE_API_PORT} - -#NoNewPrivileges=true -#PrivateDevices=true -#PrivateTmp=true -#ProtectHome=true -#ProtectSystem=strict -#ProtectControlGroups=yes -#ProtectKernelModules=yes -#ReadOnlyPaths=__FINALPATH__/code/config/.env __FINALPATH__/code/ -#ReadWritePaths=__FINALPATH__/media __FINALPATH__/import /var/log/__APP__ - -StandardOutput=syslog -StandardError=syslog -SyslogIdentifier=__APP__-server +WorkingDirectory=__FINALPATH__/api +EnvironmentFile=__FINALPATH__/config/.env +ExecStart=__FINALPATH__/virtualenv/bin/gunicorn config.asgi:application -w ${FUNKWHALE_WEB_WORKERS} -k uvicorn.workers.UvicornWorker -b ${FUNKWHALE_API_IP}:${FUNKWHALE_API_PORT} [Install] WantedBy=multi-user.target diff --git a/conf/funkwhale-worker.service b/conf/funkwhale-worker.service index c0cefea..ca8bd26 100644 --- a/conf/funkwhale-worker.service +++ b/conf/funkwhale-worker.service @@ -1,30 +1,14 @@ [Unit] -Description=Funkwhale (__APP__) celery worker +Description=__APP__ celery worker After=redis.service postgresql.service PartOf=__APP__.target [Service] User=__APP__ Group=__APP__ -WorkingDirectory=__FINALPATH__/code/api -EnvironmentFile=__FINALPATH__/code/config/.env - -ExecStart=__FINALPATH__/code/virtualenv/bin/celery -A funkwhale_api.taskapp worker -l INFO \ - --loglevel INFO --logfile=/var/log/__APP__/worker.log - -#NoNewPrivileges=true -#PrivateDevices=true -#PrivateTmp=true -#ProtectHome=true -#ProtectSystem=strict -#ProtectControlGroups=yes -#ProtectKernelModules=yes -#ReadOnlyPaths=__FINALPATH__/code/config/.env __FINALPATH__/code/ -#ReadWritePaths=__FINALPATH__/media __FINALPATH__/import /var/log/__APP__ - -StandardOutput=syslog -StandardError=syslog -SyslogIdentifier=__APP__-worker +WorkingDirectory=__FINALPATH__/api +EnvironmentFile=__FINALPATH__/config/.env +ExecStart=__FINALPATH__/virtualenv/bin/celery -A funkwhale_api.taskapp worker -l INFO --concurrency=0 [Install] -WantedBy=multi-user.target \ No newline at end of file +WantedBy=multi-user.target diff --git a/conf/nginx.conf b/conf/nginx.conf index 62e96a0..3ffa7c1 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,67 +1,145 @@ +root __FINALPATH__/front/dist; + 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__/; + + # Force usage of https + if ($scheme = http) { + rewrite ^ https://$server_name$request_uri? permanent; + } + + # global proxy conf + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Host $host:$server_port; + proxy_set_header X-Forwarded-Port $server_port; + proxy_redirect off; + + # websocket support + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade; + + # this is needed if you have file import via upload enabled + client_max_body_size 100M; + proxy_pass http://127.0.0.1:__PORT__/; + + # Include SSOWAT user panel. + include conf.d/yunohost_panel.conf.inc; } location /front/ { - alias __FINALPATH__/code/front/dist/; - expires 30d; - more_set_headers "Pragma: public"; - more_set_headers "Cache-Control: public, must-revalidate, proxy-revalidate"; - more_set_headers "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:"; - more_set_headers "Referrer-Policy: strict-origin-when-cross-origin"; - more_set_headers "X-Frame-Options: SAMEORIGIN"; - more_set_headers "Service-Worker-Allowed: /"; - + more_set_headers "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:"; + more_set_headers "Referrer-Policy: strict-origin-when-cross-origin"; + more_set_headers "Service-Worker-Allowed: /"; + more_set_headers "X-Frame-Options: SAMEORIGIN"; + alias __FINALPATH__/front/dist/; + expires 30d; + more_set_headers "Pragma: public"; + more_set_headers "Cache-Control: public, must-revalidate, proxy-revalidate"; } location /front/embed.html { - more_set_headers "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:"; - more_set_headers "Referrer-Policy: strict-origin-when-cross-origin"; - more_set_headers "X-Frame-Options: ALLOW"; - more_set_headers "Pragma: public"; - more_set_headers "Cache-Control: public, must-revalidate, proxy-revalidate"; - alias __FINALPATH__/code/front/dist/embed.html; - expires 30d; + more_set_headers "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:"; + more_set_headers "Referrer-Policy: strict-origin-when-cross-origin"; + + more_set_headers "X-Frame-Options: ALLOW"; + alias __FINALPATH__/front/dist/embed.html; + expires 30d; + more_set_headers "Pragma: public"; + more_set_headers "Cache-Control: public, must-revalidate, proxy-revalidate"; } location /federation/ { - include __FINALPATH__/code/deploy/funkwhale_proxy.conf; - proxy_pass http://127.0.0.1:__PORT__/federation/; + + # global proxy conf + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Host $host:$server_port; + proxy_set_header X-Forwarded-Port $server_port; + proxy_redirect off; + + # websocket support + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade; + + proxy_pass http://127.0.0.1:__PORT__/federation/; } - +# You can comment this if you do not plan to use the Subsonic API location /rest/ { - include __FINALPATH__/code/deploy/funkwhale_proxy.conf; - proxy_pass http://127.0.0.1:__PORT__/api/subsonic/rest/; -} + # global proxy conf + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Host $host:$server_port; + proxy_set_header X-Forwarded-Port $server_port; + proxy_redirect off; + + # websocket support + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade; + + 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/; + + # global proxy conf + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Host $host:$server_port; + proxy_set_header X-Forwarded-Port $server_port; + proxy_redirect off; + + # websocket support + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade; + + proxy_pass http://127.0.0.1:__PORT__/.well-known/; } location /media/ { - alias __FINALPATH__/media/; + alias __DATADIR__/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 - internal; - alias __FINALPATH__/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 + internal; + alias __DATADIR__/media; } -location /_protected/music/ { - internal; - alias __FINALPATH__/import/; +# Comment the previous location and uncomment this one if you're storing +# media files in a S3 bucket +# location ~ /_protected/media/(.+) { +# internal; +# # Needed to ensure DSub auth isn't forwarded to S3/Minio, see #932 +# proxy_set_header Authorization ""; +# proxy_pass $1; +# } + +location /_protected/music { + # this is an internal location that is used to serve + # audio files once correct permission / authentication + # has been checked on API side + # Set this to the same value as your MUSIC_DIRECTORY_PATH setting + internal; + alias __DATADIR__/music; } location /staticfiles/ { - # django static files - alias __FINALPATH__/code/data/static/; + # django static files + alias __DATADIR__/static/; } diff --git a/issue_template.md b/issue_template.md new file mode 100644 index 0000000..faf5143 --- /dev/null +++ b/issue_template.md @@ -0,0 +1,55 @@ +--- +name: Bug report +about: When creating a bug report, please use the following template to provide all the relevant information and help debugging efficiently. + +--- + +**How to post a meaningful bug report** +1. *Read this whole template first.* +2. *Determine if you are on the right place:* + - *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change_url...), you are on the right place!* + - *Otherwise, the issue may be due to Funkwhale itself. Refer to its documentation or repository for help.* + - *When in doubt, post here and we will figure it out together.* +3. *Delete the italic comments as you write over them below, and remove this guide.* +--- + +### Describe the bug + +*A clear and concise description of what the bug is.* + +### Context + +- Hardware: *VPS bought online / Old laptop or computer / Raspberry Pi at home / Internet Cube with VPN / Other ARM board / ...* +- YunoHost version: x.x.x +- I have access to my server: *Through SSH | through the webadmin | direct access via keyboard / screen | ...* +- Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: *no / yes* + - If yes, please explain: +- Using, or trying to install package version/branch: +- If upgrading, current package version: *can be found in the admin, or with `yunohost app info $app_id`* + +### Steps to reproduce + +- *If you performed a command from the CLI, the command itself is enough. For example:* + ```sh + sudo yunohost app install funkwhale + ``` +- *If you used the webadmin, please perform the equivalent command from the CLI first.* +- *If the error occurs in your browser, explain what you did:* + 1. *Go to '...'* + 2. *Click on '...'* + 3. *Scroll down to '...'* + 4. *See error* + +### Expected behavior + +*A clear and concise description of what you expected to happen. You can remove this section if the command above is enough to understand your intent.* + +### Logs + +*When an operation fails, YunoHost provides a simple way to share the logs.* +- *In the webadmin, the error message contains a link to the relevant log page. On that page, you will be able to 'Share with Yunopaste'. If you missed it, the logs of previous operations are also available under Tools > Logs.* +- *In command line, the command to share the logs is displayed at the end of the operation and looks like `yunohost log display [log name] --share`. If you missed it, you can find the log ID of a previous operation using `yunohost log list`.* + +*After sharing the log, please copypaste directly the link provided by YunoHost (to help readability, no need to copypaste the entire content of the log here, just the link is enough...)* + +*If applicable and useful, add screenshots to help explain your problem.* diff --git a/manifest.json b/manifest.json index d5f1259..08991a5 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Modern, convivial and free music server", "fr": "Serveur de musique moderne, convivial et gratuit" }, - "version": "1.1~ynh1", + "version": "1.1.1~ynh1", "url": "https://funkwhale.audio", "license": "AGPL-3.0-or-later", "maintainer": { @@ -18,42 +18,27 @@ "email": "jean-baptiste@holcroft.fr" }], "requirements": { - "yunohost": ">= 4.0.0" + "yunohost": ">= 4.1.3" }, "multi_instance": true, "services": [ "nginx" ], "arguments": { - "install": [{ + "install" : [ + { "name": "domain", "type": "domain", - "ask": { - "en": "Choose a domain for Funkwhale", - "fr": "Choisissez un nom de domaine pour Funkwhale" - }, "example": "example.com" }, { "name": "admin", "type": "user", - "ask": { - "en": "Choose an admin user", - "fr": "Choisissez l'administrateur" - }, - "example": "sporiff" + "example": "johndoe" }, { "name": "is_public", "type": "boolean", - "ask": { - "en": "Is it a public application?", - "fr": "Est-ce une application publique ?" - }, - "help": { - "en": "Allows unauthenticated users to access the user interface (mandatory for federation).", - "fr": "Permet aux utilisateurs non authentifiés d'accéder à l'interface utilisateur (obligatoire pour la fédération)." - }, "default": true } ] diff --git a/pull_request_template.md b/pull_request_template.md new file mode 100644 index 0000000..6c28fc5 --- /dev/null +++ b/pull_request_template.md @@ -0,0 +1,16 @@ +## Problem +- *Description of why you made this PR* + +## Solution +- *And how do you fix that problem* + +## PR Status +- [ ] Code finished. +- [ ] Tested with Package_check. +- [ ] Fix or enhancement tested. +- [ ] Upgrade from last version tested. +- [ ] Can be reviewed and tested. + +## Package_check results +--- +* An automatic package_check will be launch at https://ci-apps-dev.yunohost.org/, when you add a specific comment to your Pull Request: "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!"* diff --git a/scripts/_common.sh b/scripts/_common.sh index 45b1e90..9916587 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,9 +5,9 @@ #================================================= # dependencies used by the app -pkg_dependencies="build-essential curl ffmpeg \ - libjpeg-dev libmagic-dev libpq-dev postgresql postgresql-contrib python3-dev virtualenv \ - redis-server libldap2-dev libsasl2-dev \ +pkg_dependencies="curl python3-pip python3-venv git unzip libldap2-dev libsasl2-dev gettext-base zlib1g-dev libffi-dev libssl-dev \ + build-essential ffmpeg libjpeg-dev libmagic-dev libpq-dev postgresql postgresql-contrib python3-dev make \ + redis-server \ `# add arm support` \ zlib1g-dev libffi-dev libssl-dev" @@ -15,7 +15,6 @@ pkg_dependencies="build-essential curl ffmpeg \ # PERSONAL HELPERS #================================================= - #================================================= # EXPERIMENTAL HELPERS #================================================= diff --git a/scripts/backup b/scripts/backup index 3c0c590..1f8656c 100644 --- a/scripts/backup +++ b/scripts/backup @@ -6,7 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= -#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts +# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers @@ -27,9 +27,10 @@ ynh_print_info --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME -final_path=$(ynh_app_setting_get --app="$app" --key=final_path) -domain=$(ynh_app_setting_get --app="$app" --key=domain) -db_name=$(ynh_app_setting_get --app="$app" --key=db_name) +final_path=$(ynh_app_setting_get --app=$app --key=final_path) +domain=$(ynh_app_setting_get --app=$app --key=domain) +db_name=$(ynh_app_setting_get --app=$app --key=db_name) +datadir=$(ynh_app_setting_get --app=$app --key=datadir) #================================================= # DECLARE DATA AND CONF FILES TO BACKUP @@ -40,22 +41,37 @@ ynh_print_info --message="Declaring files to be backed up..." # BACKUP THE APP MAIN DIR #================================================= -backup_core_only=$(ynh_app_setting_get --app="$app" --key=backup_core_only) -# If backup_core_only have any value in the settings.yml file, do not backup the data directory -if [ -z "$backup_core_only" ] -then - ynh_backup --src_path="$final_path" -else - echo "Data dir will not be saved, because backup_core_only is set." >&2 - ynh_backup --src_path="$final_path/code" -fi +ynh_backup --src_path="$final_path" #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" -ynh_backup --src_path="/etc/nginx/conf.d/$domain.conf" + +#================================================= +# BACKUP FAIL2BAN CONFIGURATION +#================================================= + +ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf" +ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf" + +#================================================= +# SPECIFIC BACKUP +#================================================= +# BACKUP SYSTEMD +#================================================= + +ynh_backup --src_path="/etc/systemd/system/${app}-beat.service" +ynh_backup --src_path="/etc/systemd/system/${app}-server.service" +ynh_backup --src_path="/etc/systemd/system/${app}-worker.service" +ynh_backup --src_path="/etc/systemd/system/$app.target" + +#================================================= +# BACKUP VARIOUS FILES +#================================================= + +ynh_backup --src_path="$datadir" --is_big #================================================= # BACKUP THE POSTGRESQL DATABASE @@ -64,17 +80,6 @@ ynh_print_info --message="Backing up the PostgreSQL database..." ynh_psql_dump_db --database="$db_name" > db.sql -#================================================= -# SPECIFIC BACKUP -#================================================= -# BACKUP SYSTEMD -#================================================= - -ynh_backup --src_path="/etc/systemd/system/$app-beat.service" -ynh_backup --src_path="/etc/systemd/system/$app-server.service" -ynh_backup --src_path="/etc/systemd/system/$app-worker.service" -ynh_backup --src_path="/etc/systemd/system/$app.target" - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/install b/scripts/install index beb1454..68b412b 100644 --- a/scripts/install +++ b/scripts/install @@ -25,8 +25,10 @@ ynh_abort_if_errors domain=$YNH_APP_ARG_DOMAIN path_url="/" -is_public=$YNH_APP_ARG_IS_PUBLIC admin=$YNH_APP_ARG_ADMIN +is_public=$YNH_APP_ARG_IS_PUBLIC + +admin_mail=$(ynh_user_get_info --username="$admin" --key="mail") app=$YNH_APP_INSTANCE_NAME @@ -35,20 +37,22 @@ app=$YNH_APP_INSTANCE_NAME #================================================= ynh_script_progression --message="Validating installation parameters..." -final_path="/var/www/$app" +final_path=/var/www/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" +datadir="/home/yunohost.app/${app}/data" + # Register (book) web path -ynh_webpath_register --app="$app" --domain="$domain" --path_url="$path_url" +ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url #================================================= # STORE SETTINGS FROM MANIFEST #================================================= ynh_script_progression --message="Storing installation settings..." -ynh_app_setting_set --app="$app" --key=domain --value="$domain" -ynh_app_setting_set --app="$app" --key=path --value="$path_url" -ynh_app_setting_set --app="$app" --key=admin --value="$admin" +ynh_app_setting_set --app=$app --key=domain --value=$domain +ynh_app_setting_set --app=$app --key=path --value=$path_url +ynh_app_setting_set --app=$app --key=admin --value=$admin #================================================= # STANDARD MODIFICATIONS @@ -57,10 +61,9 @@ ynh_app_setting_set --app="$app" --key=admin --value="$admin" #================================================= ynh_script_progression --message="Finding an available port..." -# Find a free port +# Find an available port port=$(ynh_find_port --port=5000) -# Open this port -ynh_app_setting_set --app="$app" --key=port --value="$port" +ynh_app_setting_set --app=$app --key=port --value=$port #================================================= # INSTALL DEPENDENCIES @@ -69,6 +72,14 @@ ynh_script_progression --message="Installing dependencies..." ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Configuring system user..." + +# Create a system user +ynh_system_user_create --username=$app --home_dir="$final_path" + #================================================= # CREATE A POSTGRESQL DATABASE #================================================= @@ -76,168 +87,150 @@ ynh_script_progression --message="Creating a PostgreSQL database..." ynh_psql_test_if_first_run -db_name=$(ynh_sanitize_dbid "$app") -db_user="$db_name" +db_name=$(ynh_sanitize_dbid --db_name=$app) +db_user=$db_name db_pwd=$(ynh_string_random) -ynh_app_setting_set --app="$app" --key=db_name --value="$db_name" -ynh_app_setting_set --app="$app" --key=psqlpwd --value="$db_pwd" +ynh_app_setting_set --app=$app --key=db_name --value=$db_name +ynh_app_setting_set --app=$app --key=db_pwd --value=$db_pwd # Initialize database and store postgres password for upgrade -ynh_psql_setup_db --db_name="$db_name" --db_user="$db_user" --db_pwd="$db_pwd" +ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= ynh_script_progression --message="Setting up source files..." -ynh_app_setting_set --app="$app" --key=final_path --value="$final_path" +ynh_app_setting_set --app=$app --key=final_path --value=$final_path +ynh_app_setting_set --app=$app --key=datadir --value=$datadir # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$final_path/code" -ynh_setup_source --dest_dir="$final_path/code" --source_id="app-frontend" +ynh_setup_source --dest_dir="$final_path/api" --source_id="api" +ynh_setup_source --dest_dir="$final_path/front" --source_id="front" -( - cd "$final_path" - mkdir -p code/config code/api code/data/static media import code/front -) +pushd $final_path + mkdir -p config +popd + +chmod -R 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" + +mkdir -p $datadir +pushd $datadir + mkdir -p static media music +popd + +chmod -R 750 "$datadir" +chmod -R o-rwx "$datadir" +chown -R $app:www-data "$datadir" #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring nginx web server..." +ynh_script_progression --message="Configuring NGINX web server..." -# Create a dedicated nginx config -ynh_add_nginx_config - -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Configuring system user..." - -# Create a system user -ynh_system_user_create --username="$app" --home_dir="$final_path" +# Create a dedicated NGINX config +ynh_add_nginx_config "datadir" #================================================= # SPECIFIC SETUP #================================================= -# PYTHON DEPENDENCIES +# ADD A CONFIGURATION #================================================= +ynh_script_progression --message="Adding a config file..." -virtualenv -p python3 "$final_path/code/virtualenv" -( - set +o nounset - source "${final_path}/code/virtualenv/bin/activate" - set -o nounset - pip install --upgrade pip - pip install --upgrade setuptools - pip install wheel - pip install -r "${final_path}/code/api/requirements.txt" -) - -#================================================= -# MODIFY THE CONFIG FILE -#================================================= - -configfile="$final_path/code/config/.env" - -cp ../conf/env.prod "$configfile" - -key=$(ynh_string_random) +key=$(ynh_string_random --length=45 | base64) redis_db=$(ynh_redis_get_free_db) -ynh_app_setting_set --app="$app" --key=key --value="$key" -ynh_app_setting_set --app="$app" --key=redis_db --value="$redis_db" +ynh_app_setting_set --app=$app --key=key --value=$key +ynh_app_setting_set --app=$app --key=redis_db --value=$redis_db -ynh_replace_string --match_string="__REDIS_DB__" --replace_string="$redis_db" --target_file="$configfile" -ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$configfile" -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$configfile" -ynh_replace_string --match_string="__DBUSER__" --replace_string="$db_name" --target_file="$configfile" -ynh_replace_string --match_string="__DBPWD__" --replace_string="$db_pwd" --target_file="$configfile" -ynh_replace_string --match_string="__DBNAME__" --replace_string="$app" --target_file="$configfile" -ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="$configfile" -ynh_replace_string --match_string="__KEY__" --replace_string="$key" --target_file="$configfile" +ynh_add_config --template="../conf/env.prod" --destination="$final_path/config/.env" -#================================================= -# CONFIGURE ADMIN USER -#================================================= - -admin_mail=$(ynh_user_get_info --username="$admin" --key="mail") -( - set +o nounset - source "${final_path}/code/virtualenv/bin/activate" - set -o nounset - cd "$final_path/code/" - - # needed for enabling the 'unaccent' extension - ynh_psql_execute_as_root --sql="ALTER USER $db_user WITH SUPERUSER;" --database="$db_name" - python api/manage.py migrate - ynh_psql_execute_as_root --sql="ALTER USER $db_user WITH NOSUPERUSER;" --database="$db_name" - echo "from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser('$admin', '$admin_mail', 'funkwhale') " | python api/manage.py shell - python api/manage.py collectstatic -) +chmod 400 "$final_path/config/.env" +chown $app:$app "$final_path/config/.env" #================================================= # SETUP SYSTEMD #================================================= ynh_script_progression --message="Configuring a systemd service..." -cp ../conf/funkwhale.target "/etc/systemd/system/$app.target" -ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="/etc/systemd/system/$app.target" +ynh_add_config --template="../conf/funkwhale.target" --destination="/etc/systemd/system/$app.target" # Create a dedicated systemd config -ynh_add_systemd_config --service="$app-server" --template="funkwhale-server.service" -ynh_add_systemd_config --service="$app-worker" --template="funkwhale-worker.service" -ynh_add_systemd_config --service="$app-beat" --template="funkwhale-beat.service" +ynh_add_systemd_config --service="${app}-server" --template="funkwhale-server.service" --others_var="datadir" +ynh_add_systemd_config --service="${app}-worker" --template="funkwhale-worker.service" --others_var="datadir" +ynh_add_systemd_config --service="${app}-beat" --template="funkwhale-beat.service" --others_var="datadir" #================================================= -# STORE THE CONFIG FILE CHECKSUM +# INSTALL PYTHON DEPENDENCIES #================================================= +ynh_script_progression --message="Installing Python dependencies..." -# Calculate and store the config file checksum into the app settings -ynh_store_file_checksum --file="$configfile" +pushd $final_path + python3 -m venv $final_path/virtualenv + source $final_path/virtualenv/bin/activate + pip install --upgrade pip + pip install --upgrade setuptools + pip install wheel + pip install -r api/requirements.txt +popd + +#================================================= +# BUILDING FUNKWHALE +#================================================= +ynh_script_progression --message="Building funkwhale..." + +pushd $final_path + source $final_path/virtualenv/bin/activate + + # needed for enabling the 'unaccent' extension + ynh_psql_execute_as_root --sql="ALTER USER $db_user WITH SUPERUSER;" --database="$db_name" + python api/manage.py migrate + ynh_psql_execute_as_root --sql="ALTER USER $db_user WITH NOSUPERUSER;" --database="$db_name" + echo "from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser('$admin', '$admin_mail', 'funkwhale') " | python api/manage.py shell + echo "yes" | python api/manage.py collectstatic +popd + +chmod -R 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" #================================================= # GENERIC FINALIZATION #================================================= -# SECURE FILES AND DIRECTORIES +# INTEGRATE SERVICE IN YUNOHOST #================================================= +ynh_script_progression --message="Integrating service in YunoHost..." -chown -R "$app": "$final_path" -chmod -R 755 "$final_path/code/front/dist/" - -mkdir -p "/var/log/$app" -chown -R "$app": "/var/log/$app" - -#================================================= -# ADVERTISE SERVICE IN ADMIN PANEL -#================================================= - -yunohost service add "$app-server" --log="/var/log/$app/server.log" -yunohost service add "$app-worker" --log="/var/log/$app/worker.log" -yunohost service add "$app-beat" --log="/var/log/$app/beat.log" +yunohost service add "${app}-beat" +yunohost service add "${app}-server" +yunohost service add "${app}-worker" #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression --message="Starting a systemd service..." -ynh_systemd_action --action="start" --service_name="${app}-beat" -ynh_systemd_action --action="start" --service_name="${app}-server" -ynh_systemd_action --action="start" --service_name="${app}-worker" +# Start a systemd service +ynh_systemd_action --service_name="${app}-beat" --action="start" --log_path="systemd" --line_match="Running with the following plugins enabled" +ynh_systemd_action --service_name="${app}-server" --action="start" --log_path="systemd" --line_match="Application startup complete" +ynh_systemd_action --service_name="${app}-worker" --action="start" --log_path="systemd" --line_match="Running with the following plugins enabled" #================================================= # SETUP FAIL2BAN #================================================= ynh_script_progression --message="Configuring Fail2Ban..." -# Create a dedicated fail2ban config -ynh_add_fail2ban_config --logpath="/var/log/nginx/$domain-access.log" --failregex=".* \"POST /api/v1/token/ HTTP/1.1\" 400 68.*$" --max_retry=5 +# Create a dedicated Fail2Ban config +ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-access.log" --failregex=".* \"POST /api/v1/token/ HTTP/1.1\" 400 68.*$" --max_retry=5 #================================================= # SETUP SSOWAT #================================================= ynh_script_progression --message="Configuring permissions..." -# Make app public if necessary or protect it +# Make app public if necessary if [ $is_public -eq 1 ] then # Everyone can access the app. diff --git a/scripts/remove b/scripts/remove index 0567cde..5ad36aa 100644 --- a/scripts/remove +++ b/scripts/remove @@ -16,74 +16,74 @@ ynh_script_progression --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app="$app" --key=domain) -port=$(ynh_app_setting_get --app="$app" --key=port) -db_name=$(ynh_app_setting_get --app="$app" --key=db_name) -db_user="$db_name" -final_path=$(ynh_app_setting_get --app="$app" --key=final_path) -redis_db=$(ynh_app_setting_get --app="$app" --key=redis_db) +domain=$(ynh_app_setting_get --app=$app --key=domain) +port=$(ynh_app_setting_get --app=$app --key=port) +db_name=$(ynh_app_setting_get --app=$app --key=db_name) +db_user=$db_name +final_path=$(ynh_app_setting_get --app=$app --key=final_path) +redis_db=$(ynh_app_setting_get --app=$app --key=redis_db) #================================================= # STANDARD REMOVE #================================================= -# REMOVE SERVICE FROM ADMIN PANEL +# REMOVE SERVICE INTEGRATION IN YUNOHOST #================================================= -# Remove a service from the admin panel, added by `yunohost service add` -if yunohost service status "$app-server" >/dev/null 2>&1 +# Remove the service from the list of services known by YunoHost (added from `yunohost service add`) +if ynh_exec_warn_less yunohost service status "${app}-server" >/dev/null then - ynh_script_progression --message="Remove $app-server service" - yunohost service remove "$app-server" + ynh_script_progression --message="Removing ${app}-server service integration..." + yunohost service remove "${app}-server" fi -if yunohost service status "$app-worker" >/dev/null 2>&1 +if ynh_exec_warn_less yunohost service status "${app}-worker" >/dev/null then - ynh_script_progression --message="Remove $app-worker service" - yunohost service remove "$app-worker" + ynh_script_progression --message="Removing ${app}-worker service integration..." + yunohost service remove "${app}-worker" fi -if yunohost service status "$app-beat" >/dev/null 2>&1 +if ynh_exec_warn_less yunohost service status "${app}-beat" >/dev/null then - ynh_script_progression --message="Remove $app-beat service" - yunohost service remove "$app-beat" + ynh_script_progression --message="Removing ${app}-beat service integration..." + yunohost service remove "${app}-beat" fi #================================================= # STOP AND REMOVE SERVICE #================================================= -ynh_script_progression --message="Stopping and removing the systemd service" +ynh_script_progression --message="Stopping and removing the systemd service..." -ynh_systemd_action --action="stop" --service_name="${app}-beat" -ynh_systemd_action --action="stop" --service_name="${app}-server" -ynh_systemd_action --action="stop" --service_name="${app}-worker" +ynh_systemd_action --service_name="${app}-beat" --action="stop" --log_path="systemd" --line_match="Stopped $app" +ynh_systemd_action --service_name="${app}-server" --action="stop" --log_path="systemd" --line_match="Stopped $app" +ynh_systemd_action --service_name="${app}-worker" --action="stop" --log_path="systemd" --line_match="Stopped $app" # Remove the dedicated systemd config -ynh_remove_systemd_config --service="$app-server" -ynh_remove_systemd_config --service="$app-worker" -ynh_remove_systemd_config --service="$app-beat" +ynh_remove_systemd_config --service="${app}-beat" +ynh_remove_systemd_config --service="${app}-server" +ynh_remove_systemd_config --service="${app}-worker" ynh_secure_remove --file="/etc/systemd/system/$app.target" #================================================= # REMOVE THE POSTGRESQL DATABASE #================================================= -ynh_script_progression --message="Removing the PostgreSQL database" +ynh_script_progression --message="Removing the PostgreSQL database..." # Remove a database if it exists, along with the associated user -ynh_psql_remove_db --db_name="$db_name" --db_user="$db_user" +ynh_psql_remove_db --db_user=$db_user --db_name=$db_name #================================================= # REMOVE THE REDIS DATABASE #================================================= -ynh_script_progression --message="Removing the Redis database" +ynh_script_progression --message="Removing the Redis database..." # Remove a database if it exists, along with the associated user -ynh_redis_remove_db "$redis_db" +ynh_redis_remove_db $redis_db #================================================= # REMOVE DEPENDENCIES #================================================= -ynh_script_progression --message="Removing dependencies" +ynh_script_progression --message="Removing dependencies..." # Remove metapackage and its dependencies ynh_remove_app_dependencies @@ -91,26 +91,25 @@ ynh_remove_app_dependencies #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory" +ynh_script_progression --message="Removing app main directory..." # Remove the app directory securely ynh_secure_remove --file="$final_path" -ynh_secure_remove --file="/var/log/$app" - #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing NGINX web server configuration" +ynh_script_progression --message="Removing NGINX web server configuration..." -# Remove the dedicated nginx config +# Remove the dedicated NGINX config ynh_remove_nginx_config #================================================= # REMOVE FAIL2BAN CONFIGURATION #================================================= -ynh_script_progression --message="Removing Fail2Ban configuration..." +ynh_script_progression --message="Removing Fail2ban configuration..." +# Remove the dedicated Fail2Ban config ynh_remove_fail2ban_config #================================================= @@ -118,10 +117,10 @@ ynh_remove_fail2ban_config #================================================= # REMOVE DEDICATED USER #================================================= -ynh_script_progression --message="Removing the dedicated system user" +ynh_script_progression --message="Removing the dedicated system user..." # Delete a system user -ynh_system_user_delete --username="$app" +ynh_system_user_delete --username=$app #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index 7802232..6098cb9 100644 --- a/scripts/restore +++ b/scripts/restore @@ -6,7 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= -#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts +# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers @@ -23,25 +23,26 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading settings..." +ynh_script_progression --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app="$app" --key=domain) -path_url=$(ynh_app_setting_get --app="$app" --key=path) -final_path=$(ynh_app_setting_get --app="$app" --key=final_path) -db_name=$(ynh_app_setting_get --app="$app" --key=db_name) -db_user="$db_name" -db_pwd=$(ynh_app_setting_get --app="$app" --key=psqlpwd) +domain=$(ynh_app_setting_get --app=$app --key=domain) +path_url=$(ynh_app_setting_get --app=$app --key=path) +final_path=$(ynh_app_setting_get --app=$app --key=final_path) +db_name=$(ynh_app_setting_get --app=$app --key=db_name) +db_user=$db_name +db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) +datadir=$(ynh_app_setting_get --app=$app --key=datadir) #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= ynh_script_progression --message="Validating restoration parameters..." -ynh_webpath_available --domain="$domain" --path_url="$path_url" \ +ynh_webpath_available --domain=$domain --path_url=$path_url \ || ynh_die --message="Path not available: ${domain}${path_url}" -test ! -d "$final_path" \ +test ! -d $final_path \ || ynh_die --message="There is already a directory: $final_path " #================================================= @@ -49,39 +50,9 @@ test ! -d "$final_path" \ #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= +ynh_script_progression --message="Restoring the NGINX web server configuration..." ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.conf" - -#================================================= -# RESTORE THE APP MAIN DIR -#================================================= -ynh_script_progression --message="Restoring the app main directory..." - -backup_core_only=$(ynh_app_setting_get --app="$app" --key=backup_core_only) - -# If backup_core_only have any value, then restore only code -if [ -z "$backup_core_only" ] -then - ynh_restore_file --origin_path="$final_path/code" -else - ynh_restore_file --origin_path="$final_path" -fi - -# Remove the option backup_core_only if it's in the settings.yml file -ynh_app_setting_delete --app="$app" --key=backup_core_only - -code_migration=$(ynh_app_setting_get --app="$app" --key=code_migration) - -# make sure we revert the last code organization -if [ "$code_migration" -eq 1 ] -then - mv "$final_path/code/"* "$final_path" - mv "$final_path/media" "$final_path/code/data/media" - mv "$final_path/import" "$final_path/code/data/music" - ynh_secure_remove --file="$final_path/code" - ynh_app_setting_delete --app="$app" --key=code_migration -fi #================================================= # RECREATE THE DEDICATED USER @@ -89,21 +60,37 @@ fi ynh_script_progression --message="Recreating the dedicated system user..." # Create the dedicated user (if not existing) -ynh_system_user_create --username="$app" --home_dir="$final_path" +ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= -# RESTORE USER RIGHTS +# RESTORE THE APP MAIN DIR #================================================= +ynh_script_progression --message="Restoring the app main directory..." -# Restore permissions on app files -chown -R "$app": "$final_path" -chmod -R 755 "$final_path/code/front/dist/" +ynh_restore_file --origin_path="$final_path" -mkdir -p "/var/log/$app" -chown -R "$app": "/var/log/$app" +chmod -R 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" #================================================= # SPECIFIC RESTORATION +#================================================= +# RESTORE VARIOUS FILES +#================================================= +ynh_script_progression --message="Restoring various files..." + +ynh_restore_file --origin_path="$datadir" --not_mandatory + +mkdir -p $datadir +pushd $datadir + mkdir -p static media music +popd + +chmod -R 750 "$datadir" +chmod -R o-rwx "$datadir" +chown -R $app:www-data "$datadir" + #================================================= # REINSTALL DEPENDENCIES #================================================= @@ -118,39 +105,40 @@ ynh_install_app_dependencies $pkg_dependencies ynh_script_progression --message="Restoring the PostgreSQL database..." ynh_psql_test_if_first_run -ynh_psql_setup_db --db_user="$db_user" --db_name="$db_name" --db_pwd="$db_pwd" -ynh_psql_execute_file_as_root --file="./db.sql" --database="$db_name" +ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd +ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name #================================================= # RESTORE SYSTEMD #================================================= ynh_script_progression --message="Restoring the systemd configuration..." -ynh_restore_file --origin_path="/etc/systemd/system/$app-beat.service" -ynh_restore_file --origin_path="/etc/systemd/system/$app-server.service" -ynh_restore_file --origin_path="/etc/systemd/system/$app-worker.service" +ynh_restore_file --origin_path="/etc/systemd/system/${app}-beat.service" +ynh_restore_file --origin_path="/etc/systemd/system/${app}-server.service" +ynh_restore_file --origin_path="/etc/systemd/system/${app}-worker.service" ynh_restore_file --origin_path="/etc/systemd/system/$app.target" -systemctl enable "$app-beat.service" --quiet -systemctl enable "$app-server.service" --quiet -systemctl enable "$app-worker.service" --quiet +systemctl enable "${app}-beat.service" --quiet +systemctl enable "${app}-server.service" --quiet +systemctl enable "${app}-worker.service" --quiet #================================================= -# ADVERTISE SERVICE IN ADMIN PANEL +# INTEGRATE SERVICE IN YUNOHOST #================================================= +ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add "$app-server" --log="/var/log/$app/server.log" -yunohost service add "$app-worker" --log="/var/log/$app/worker.log" -yunohost service add "$app-beat" --log="/var/log/$app/beat.log" +yunohost service add "${app}-beat" +yunohost service add "${app}-server" +yunohost service add "${app}-worker" #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression --message="Starting a systemd service..." -ynh_systemd_action --action="start" --service_name="${app}-beat" -ynh_systemd_action --action="start" --service_name="${app}-server" -ynh_systemd_action --action="start" --service_name="${app}-worker" +ynh_systemd_action --service_name="${app}-beat" --action="start" --log_path="systemd" --line_match="Running with the following plugins enabled" +ynh_systemd_action --service_name="${app}-server" --action="start" --log_path="systemd" --line_match="Application startup complete" +ynh_systemd_action --service_name="${app}-worker" --action="start" --log_path="systemd" --line_match="Running with the following plugins enabled" #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index a01b565..1dca0059 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -16,15 +16,23 @@ ynh_script_progression --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app="$app" --key=domain) -path_url=$(ynh_app_setting_get --app="$app" --key=path) -final_path=$(ynh_app_setting_get --app="$app" --key=final_path) -db_name=$(ynh_app_setting_get --app="$app" --key=db_name) -db_user="$db_name" -port=$(ynh_app_setting_get --app="$app" --key=port) -db_pwd=$(ynh_app_setting_get --app="$app" --key=psqlpwd) -redis_db=$(ynh_app_setting_get --app="$app" --key=redis_db) -code_migration=$(ynh_app_setting_get --app="$app" --key=code_migration) +domain=$(ynh_app_setting_get --app=$app --key=domain) +path_url=$(ynh_app_setting_get --app=$app --key=path) +final_path=$(ynh_app_setting_get --app=$app --key=final_path) +db_name=$(ynh_app_setting_get --app=$app --key=db_name) +db_user=$db_name +db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) +datadir=$(ynh_app_setting_get --app=$app --key=datadir) +port=$(ynh_app_setting_get --app=$app --key=port) +redis_db=$(ynh_app_setting_get --app=$app --key=redis_db) +key=$(ynh_app_setting_get --app=$app --key=key) + +#================================================= +# CHECK VERSION +#================================================= +ynh_script_progression --message="Checking version..." + +upgrade_type=$(ynh_check_app_version_changed) #================================================= # ENSURE DOWNWARD COMPATIBILITY @@ -33,22 +41,14 @@ ynh_script_progression --message="Ensuring downward compatibility..." # If redis_db doesn't exist, create it if [ -z "$redis_db" ]; then - redis_db=0 - ynh_app_setting_set --app="$app" --key=redis_db --value="$redis_db" + redis_db=$(ynh_redis_get_free_db) + ynh_app_setting_set --app=$app --key=redis_db --value=$redis_db fi -# make sure we have the last code organization -if [ ! -d "$final_path/code/" ]; then - mkdir "$final_path-tmp" - mv "$final_path"/* "$final_path-tmp/" - - mkdir "$final_path/code" - mv "$final_path-tmp/data/media" "$final_path/media" - mv "$final_path-tmp/data/music" "$final_path/import" - mv "$final_path-tmp"/* "$final_path/code" - - ynh_secure_remove --file="$final_path-tmp/" - ynh_app_setting_set --app="$app" --key=code_migration --value=1 +# If db_pwd doesn't exist, create it +if [ -z "$db_pwd" ]; then + db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) + ynh_app_setting_set --app=$app --key=db_pwd --value=$db_pwd fi # Cleaning legacy permissions @@ -63,29 +63,16 @@ fi #================================================= ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." -# Inform the backup/restore process that it should not save the data directory -ynh_app_setting_set --app="$app" --key=backup_core_only --value=1 - # Backup the current version of the app ynh_backup_before_upgrade ynh_clean_setup () { - # restore it if the upgrade fails + # Restore it if the upgrade fails ynh_clean_check_starting ynh_restore_upgradebackup } # Exit if an error occurs during the execution of the script ynh_abort_if_errors -#================================================= -# CHECK THE PATH -#================================================= - -# see 0.20.0: https://docs.funkwhale.audio/changelog.html#automatically-load-env-file -loadfile="$final_path/code/load_env" -if [ -e "$loadfile" ] ; then - ynh_secure_remove --file="$loadfile" -fi - #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -93,24 +80,79 @@ fi #================================================= ynh_script_progression --message="Stopping a systemd service..." -ynh_systemd_action --action="stop" --service_name="${app}-beat" -ynh_systemd_action --action="stop" --service_name="${app}-server" -ynh_systemd_action --action="stop" --service_name="${app}-worker" +ynh_systemd_action --action="stop" --service_name="${app}-beat" --log_path="systemd" --line_match="Stopped" +ynh_systemd_action --action="stop" --service_name="${app}-server" --log_path="systemd" --line_match="Stopped" +ynh_systemd_action --action="stop" --service_name="${app}-worker" --log_path="systemd" --line_match="Stopped" + +#================================================= +# MOVE DATAS +#================================================= + +# If datadir doesn't exist, create it +if [ -z "$datadir" ]; then + # Do a full backup before moving datas + yunohost backup create --apps $app + + datadir="/home/yunohost.app/${app}/data" + ynh_script_progression --message="Moving datas to $datadir..." + + mkdir -p $datadir + pushd $datadir + mkdir -p static media music + popd + + ynh_backup_if_checksum_is_different --file="$final_path/code/config/.env" + mkdir -p $final_path/config + rsync -a $final_path/code/config/ $final_path/config/ + chmod 600 $final_path/config/.env + ynh_store_file_checksum --file="$final_path/config/.env" + ynh_delete_file_checksum --file="$final_path/code/config/.env" + + if [ -d "$final_path/code/data/static/" ]; then + rsync -a $final_path/code/data/static/ $datadir/static/ + fi + if [ -d "$final_path/media/" ]; then + rsync -a $final_path/media/ $datadir/media/ + fi + if [ -d "$final_path/import/" ]; then + rsync -a $final_path/import/ $datadir/music/ + fi + + ynh_secure_remove --file="$final_path/code" + ynh_secure_remove --file="$final_path/media" + ynh_secure_remove --file="$final_path/import" + + ynh_app_setting_set --app=$app --key=datadir --value=$datadir + + upgrade_type="UPGRADE_APP" +fi + +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Making sure dedicated system user exists..." + +# Create a dedicated user (if not existing) +ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Upgrading source files..." -ynh_app_setting_set --app="$app" --key=final_path --value="$final_path" -# Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$final_path/code" -ynh_setup_source --dest_dir="$final_path/code" --source_id="app-frontend" +if [ "$upgrade_type" == "UPGRADE_APP" ] +then + ynh_script_progression --message="Upgrading source files..." -( - cd "$final_path" - mkdir -p code/config code/api code/data/static media import code/front -) + ynh_secure_remove --file="$final_path/api" + ynh_secure_remove --file="$final_path/front" + # Download, check integrity, uncompress and patch the source from app.src + ynh_setup_source --dest_dir="$final_path/api" --source_id="api" + ynh_setup_source --dest_dir="$final_path/front" --source_id="front" +fi + +chmod -R 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" #================================================= # NGINX CONFIGURATION @@ -118,7 +160,7 @@ ynh_setup_source --dest_dir="$final_path/code" --source_id="app-frontend" ynh_script_progression --message="Upgrading NGINX web server configuration..." # Create a dedicated NGINX config -ynh_add_nginx_config +ynh_add_nginx_config "datadir" #================================================= # UPGRADE DEPENDENCIES @@ -127,72 +169,47 @@ ynh_script_progression --message="Upgrading dependencies..." ynh_install_app_dependencies $pkg_dependencies -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." - -# Create a dedicated user (if not existing) -ynh_system_user_create --username="$app" --home_dir="$final_path" - #================================================= # SPECIFIC UPGRADE #================================================= -# PYTHON DEPENDENCIES +# INSTALL PYTHON DEPENDENCIES #================================================= +ynh_script_progression --message="Installing Python dependencies..." -ynh_secure_remove --file="$final_path/code/virtualenv" -virtualenv -p python3 "$final_path/code/virtualenv" -( - set +o nounset - source "${final_path}/code/virtualenv/bin/activate" - set -o nounset +pushd $final_path + ynh_secure_remove --file="$final_path/virtualenv" + python3 -m venv $final_path/virtualenv + source $final_path/virtualenv/bin/activate pip install --upgrade pip pip install --upgrade setuptools pip install wheel - pip install -r "${final_path}/code/api/requirements.txt" - - # https://code.eliotberriot.com/funkwhale/funkwhale/tags/0.16 - pip uninstall django-cacheops --yes -) + pip install -r api/requirements.txt +popd #================================================= -# MODIFY THE CONFIG FILE +# UPDATE A CONFIG FILE #================================================= +ynh_script_progression --message="Updating a config file..." -configfile="$final_path/code/config/.env" -ynh_backup_if_checksum_is_different --file="$configfile" -cp ../conf/env.prod "$configfile" +ynh_add_config --template="../conf/env.prod" --destination="$final_path/config/.env" -key=$(ynh_string_random) - -ynh_app_setting_set --app="$app" --key=key --value="$key" - -ynh_replace_string --match_string="__REDIS_DB__" --replace_string="$redis_db" --target_file="$configfile" -ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$configfile" -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$configfile" -ynh_replace_string --match_string="__DBUSER__" --replace_string="$db_name" --target_file="$configfile" -ynh_replace_string --match_string="__DBPWD__" --replace_string="$db_pwd" --target_file="$configfile" -ynh_replace_string --match_string="__DBNAME__" --replace_string="$app" --target_file="$configfile" -ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="$configfile" -ynh_replace_string --match_string="__KEY__" --replace_string="$key" --target_file="$configfile" +chmod 400 "$final_path/config/.env" +chown $app:$app "$final_path/config/.env" #================================================= -# MIGRATE +# UPGRADE FUNKWHALE #================================================= +ynh_script_progression --message="Upgrading Funkwhale..." -( - set +o nounset - source "${final_path}/code/virtualenv/bin/activate" - set -o nounset - cd "$final_path/code" +pushd $final_path + source $final_path/virtualenv/bin/activate # needed for enabling the 'unaccent' extension ynh_psql_execute_as_root --sql="ALTER USER $db_user WITH SUPERUSER;" --database="$db_name" python api/manage.py migrate ynh_psql_execute_as_root --sql="ALTER USER $db_user WITH NOSUPERUSER;" --database="$db_name" - python api/manage.py collectstatic --clear --noinput + echo "yes" | python api/manage.py collectstatic --clear --noinput # https://code.eliotberriot.com/funkwhale/funkwhale/tags/0.16 # users-now-have-an-activitypub-actor-manual-action-required # python api/manage.py script create_actors --no-input @@ -209,65 +226,54 @@ ynh_replace_string --match_string="__KEY__" --replace_string="$key" # Delete the original thumbnails and generate new ones for # higher quality images # https://docs.funkwhale.audio/changelog.html#increased-quality-of-jpeg-thumbnails-manual-action-required - ynh_secure_remove "$final_path/media/__sized__" + ynh_secure_remove --file="$final_path/media/__sized__" python api/manage.py fw media generate-thumbnails -) +popd -#================================================= -# STORE THE CONFIG FILE CHECKSUM -#================================================= - -# Recalculate and store the checksum of the file for the next upgrade. -ynh_store_file_checksum --file="$configfile" +chmod -R 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" #================================================= # SETUP SYSTEMD #================================================= ynh_script_progression --message="Upgrading systemd configuration..." -cp ../conf/funkwhale.target "/etc/systemd/system/$app.target" -ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="/etc/systemd/system/$app.target" +ynh_add_config --template="../conf/funkwhale.target" --destination="/etc/systemd/system/$app.target" # Create a dedicated systemd config -ynh_add_systemd_config --service="$app-server" --template="funkwhale-server.service" -ynh_add_systemd_config --service="$app-worker" --template="funkwhale-worker.service" -ynh_add_systemd_config --service="$app-beat" --template="funkwhale-beat.service" +ynh_add_systemd_config --service="${app}-server" --template="funkwhale-server.service" --others_var="datadir" +ynh_add_systemd_config --service="${app}-worker" --template="funkwhale-worker.service" --others_var="datadir" +ynh_add_systemd_config --service="${app}-beat" --template="funkwhale-beat.service" --others_var="datadir" #================================================= # GENERIC FINALIZATION #================================================= -# UPGRADE FAIL2BAN +# INTEGRATE SERVICE IN YUNOHOST #================================================= -ynh_script_progression --message="Reconfiguring Fail2Ban..." +ynh_script_progression --message="Integrating service in YunoHost..." -ynh_add_fail2ban_config --logpath="/var/log/nginx/$domain-access.log" --failregex=".* \"POST /api/v1/token/ HTTP/1.1\" 400 68.*$" --max_retry=5 - -#================================================= -# SECURE FILES AND DIRECTORIES -#================================================= - -chown -R "$app": "$final_path" -chmod -R 755 "$final_path/code/front/dist/" - -mkdir -p "/var/log/$app" -chown -R "$app": "/var/log/$app" - -#================================================= -# ADVERTISE SERVICE IN ADMIN PANEL -#================================================= - -yunohost service add "$app-server" --log="/var/log/$app/server.log" -yunohost service add "$app-worker" --log="/var/log/$app/worker.log" -yunohost service add "$app-beat" --log="/var/log/$app/beat.log" +yunohost service add "${app}-beat" +yunohost service add "${app}-server" +yunohost service add "${app}-worker" #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression --message="Starting a systemd service..." -ynh_systemd_action --action="start" --service_name="${app}-beat" -ynh_systemd_action --action="start" --service_name="${app}-server" -ynh_systemd_action --action="start" --service_name="${app}-worker" +# Start a systemd service +ynh_systemd_action --service_name="${app}-beat" --action="start" --log_path="systemd" --line_match="Running with the following plugins enabled" +ynh_systemd_action --service_name="${app}-server" --action="start" --log_path="systemd" --line_match="Application startup complete" +ynh_systemd_action --service_name="${app}-worker" --action="start" --log_path="systemd" --line_match="Running with the following plugins enabled" + +#================================================= +# UPGRADE FAIL2BAN +#================================================= +ynh_script_progression --message="Reconfiguring Fail2Ban..." + +# Create a dedicated Fail2Ban config +ynh_add_fail2ban_config --logpath="/var/log/nginx/$domain-access.log" --failregex=".* \"POST /api/v1/token/ HTTP/1.1\" 400 68.*$" --max_retry=5 #================================================= # RELOAD NGINX @@ -276,12 +282,6 @@ ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload -#================================================= -# REMOVE CODE MIGRATION FLAG -#================================================= - -ynh_app_setting_set --app="$app" --key=code_migration --value=2 - #================================================= # END OF SCRIPT #================================================= diff --git a/sources/extra_files/app/api/requirements/base.txt b/sources/extra_files/app/api/requirements/base.txt deleted file mode 100644 index 35d71c2..0000000 --- a/sources/extra_files/app/api/requirements/base.txt +++ /dev/null @@ -1,77 +0,0 @@ -django~=3.0.8 -setuptools>=49 -# Configuration -django-environ~=0.4.0 - -# Images -Pillow~=7.0.0 - -django-allauth~=0.42.0 - -psycopg2-binary~=2.8.0 - -# Time zones support -pytz==2020.1 - -# Redis support -django-redis~=4.12.0 -redis~=3.5.0 -kombu~=4.6.0 - -celery~=4.4.0 - - -# Your custom requirements go here -django-cors-headers~=3.4.0 -musicbrainzngs~=0.7.1 -djangorestframework~=3.11.0 -djangorestframework-jwt~=1.11.0 -arrow~=0.15.5 -persisting-theory~=0.2.0 -django-versatileimagefield~=2.0.0 -django-filter~=2.3.0 -django-rest-auth~=0.9.0 -ipython~=7.10.0 -mutagen~=1.45.0 - -pymemoize~=1.0.0 - -django-dynamic-preferences~=1.10 -raven~=6.10.0 -python-magic~=0.4.0 -channels~=2.4.0 -channels_redis~=3.0.0 -uvicorn[standard]~=0.12.0 -gunicorn~=20.0.0 - -cryptography~=2.9.0 -# requests-http-signature==0.0.3 -# clone until the branch is merged and released upstream -git+https://github.com/agateblue/requests-http-signature.git@signature-header-support -django-cleanup~=5.0.0 -requests~=2.24.0 -pyOpenSSL~=19.1.0 - -# for LDAP authentication -python-ldap~=3.3.0 -django-auth-ldap~=2.2.0 - -pydub~=0.24.0 -pyld~=1.0.0 -aiohttp~=3.6.0 - -django-oauth-toolkit~=1.3.0 -django-storages~=1.9.0 -boto3~=1.14.0 -unicode-slugify~=0.1.0 -django-cacheops~=5.0.0 - -click~=7.1.0 -service_identity~=18.1.0 -markdown~=3.2.0 -bleach~=3.1.0 -feedparser~=6.0.0 -watchdog~=1.0.2 - -## Pin third party dependency to avoid issue with latest version -twisted==20.3.0 From f544a346efe36aeeb9101269677169eaec0d508c Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 16 Apr 2021 19:13:04 +0200 Subject: [PATCH 28/49] Update conf/nginx.conf Co-authored-by: Thomas <51749973+Thovi98@users.noreply.github.com> --- conf/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 3ffa7c1..f256e43 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -113,7 +113,7 @@ location /media/ { alias __DATADIR__/media/; } -location /_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 From acac688cdc85775501a9069abdd46aba9da36701 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 16 Apr 2021 19:13:10 +0200 Subject: [PATCH 29/49] Update conf/nginx.conf Co-authored-by: Thomas <51749973+Thovi98@users.noreply.github.com> --- conf/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index f256e43..81db54f 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -130,7 +130,7 @@ location /_protected/media/ { # proxy_pass $1; # } -location /_protected/music { +location /_protected/music/ { # this is an internal location that is used to serve # audio files once correct permission / authentication # has been checked on API side From 60dbbdfae88191f10c0ad03e801c45a1cb37fb6e Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 16 Apr 2021 20:18:56 +0200 Subject: [PATCH 30/49] fix --- conf/nginx.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 81db54f..3ffa7c1 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -113,7 +113,7 @@ location /media/ { alias __DATADIR__/media/; } -location /_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 @@ -130,7 +130,7 @@ location /_protected/media/ { # proxy_pass $1; # } -location /_protected/music/ { +location /_protected/music { # this is an internal location that is used to serve # audio files once correct permission / authentication # has been checked on API side From 394c6995cba3a9e95b8d40924b8c39ee918266b1 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 17 Apr 2021 15:20:12 +0200 Subject: [PATCH 31/49] Fix rights for datadir from previous version --- scripts/upgrade | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 8f86aee..38a423f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -107,11 +107,15 @@ if [ -z "$datadir" ]; then pushd $datadir mkdir -p static media music popd + + chmod -R 750 "$datadir" + chmod -R o-rwx "$datadir" + chown -R $app:www-data "$datadir" ynh_backup_if_checksum_is_different --file="$final_path/code/config/.env" mkdir -p $final_path/config rsync -a $final_path/code/config/ $final_path/config/ - chmod 600 $final_path/config/.env + chmod 400 $final_path/config/.env ynh_store_file_checksum --file="$final_path/config/.env" ynh_delete_file_checksum --file="$final_path/code/config/.env" From deb66eaf9e119523c9042f63768cb90e642c92ad Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 17 Apr 2021 15:20:44 +0200 Subject: [PATCH 32/49] Update upgrade --- scripts/upgrade | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 38a423f..1631f67 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -134,6 +134,10 @@ if [ -z "$datadir" ]; then ynh_secure_remove --file="$final_path/import" ynh_app_setting_set --app=$app --key=datadir --value=$datadir + + chmod -R 750 "$datadir" + chmod -R o-rwx "$datadir" + chown -R $app:www-data "$datadir" upgrade_type="UPGRADE_APP" fi From f61a9c9cf48f45f432b3f75b05d9097f8d612554 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 17 Apr 2021 18:31:25 +0200 Subject: [PATCH 33/49] Fix recursive chmod --- scripts/install | 6 +++--- scripts/restore | 4 ++-- scripts/upgrade | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/install b/scripts/install index 68b412b..bf0e8cb 100644 --- a/scripts/install +++ b/scripts/install @@ -111,7 +111,7 @@ pushd $final_path mkdir -p config popd -chmod -R 750 "$final_path" +chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" @@ -120,7 +120,7 @@ pushd $datadir mkdir -p static media music popd -chmod -R 750 "$datadir" +chmod 750 "$datadir" chmod -R o-rwx "$datadir" chown -R $app:www-data "$datadir" @@ -192,7 +192,7 @@ pushd $final_path echo "yes" | python api/manage.py collectstatic popd -chmod -R 750 "$final_path" +chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" diff --git a/scripts/restore b/scripts/restore index 6098cb9..9b33c98 100644 --- a/scripts/restore +++ b/scripts/restore @@ -69,7 +69,7 @@ ynh_script_progression --message="Restoring the app main directory..." ynh_restore_file --origin_path="$final_path" -chmod -R 750 "$final_path" +chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" @@ -87,7 +87,7 @@ pushd $datadir mkdir -p static media music popd -chmod -R 750 "$datadir" +chmod 750 "$datadir" chmod -R o-rwx "$datadir" chown -R $app:www-data "$datadir" diff --git a/scripts/upgrade b/scripts/upgrade index 1631f67..8116e84 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -108,7 +108,7 @@ if [ -z "$datadir" ]; then mkdir -p static media music popd - chmod -R 750 "$datadir" + chmod 750 "$datadir" chmod -R o-rwx "$datadir" chown -R $app:www-data "$datadir" @@ -135,7 +135,7 @@ if [ -z "$datadir" ]; then ynh_app_setting_set --app=$app --key=datadir --value=$datadir - chmod -R 750 "$datadir" + chmod 750 "$datadir" chmod -R o-rwx "$datadir" chown -R $app:www-data "$datadir" @@ -165,7 +165,7 @@ then ynh_setup_source --dest_dir="$final_path/front" --source_id="front" fi -chmod -R 750 "$final_path" +chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" @@ -245,7 +245,7 @@ pushd $final_path python api/manage.py fw media generate-thumbnails popd -chmod -R 750 "$final_path" +chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" From a18d1a701dceaf7e0a4c5cfb114907aad2233a4e Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 21 Apr 2021 23:35:59 +0200 Subject: [PATCH 34/49] Fix import link --- README.md | 4 ++-- conf/env.prod | 2 +- conf/nginx.conf | 3 --- scripts/upgrade | 8 ++++++++ 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 995a54d..5d3d9d0 100644 --- a/README.md +++ b/README.md @@ -30,9 +30,9 @@ Installation requires a dedicated domain or subdomain. Installing in a subpath i The admin uses the login you provided at installation. The password is the same you use for YunoHost. The admin interface is accessible at the address: `your.domain.fr/api/admin` -To add a collection of music files to a library in your YunoHost installation of Funkwhale, create a symlink to your collection titled "import" in `/var/www/funkwhale` +To add a collection of music files to a library in your YunoHost installation of Funkwhale, create a symlink to your collection titled "music" in `/home/yunohost.app/funkwhale/data` ```console -foo@bar:~$sudo ln -s /your/music/collection /var/www/funkwhale/import +foo@bar:~$sudo ln -s /your/music/collection /home/yunohost.app/funkwhale/data/music ``` The files can then be added to your library from the *uploading* tab in a music library under the heading **Import music from your server**. diff --git a/conf/env.prod b/conf/env.prod index 53887a3..87a3eb9 100644 --- a/conf/env.prod +++ b/conf/env.prod @@ -137,7 +137,7 @@ RAVEN_DSN=https://44332e9fdd3d42879c7d35bf8562c6a4:0062dc16a22b41679cd5765e5342f # # MUSIC_DIRECTORY_SERVE_PATH= # stays commented, not needed MUSIC_DIRECTORY_PATH=__DATADIR__/music -MUSIC_DIRECTORY_SERVE_PATH=__DATADIR__/music +#MUSIC_DIRECTORY_SERVE_PATH=__DATADIR__/import # LDAP settings # Use the following options to allow authentication on your Funkwhale instance diff --git a/conf/nginx.conf b/conf/nginx.conf index 3ffa7c1..3cc4058 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -24,9 +24,6 @@ location / { # this is needed if you have file import via upload enabled client_max_body_size 100M; proxy_pass http://127.0.0.1:__PORT__/; - - # Include SSOWAT user panel. - include conf.d/yunohost_panel.conf.inc; } location /front/ { diff --git a/scripts/upgrade b/scripts/upgrade index 8116e84..aa21fd0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -125,13 +125,21 @@ if [ -z "$datadir" ]; then if [ -d "$final_path/media/" ]; then rsync -a $final_path/media/ $datadir/media/ fi + if [ -d "$final_path/code/data/media/" ]; then + rsync -a $final_path/code/data/media/ $datadir/media/ + fi if [ -d "$final_path/import/" ]; then rsync -a $final_path/import/ $datadir/music/ fi + if [ -d "$final_path/code/data/music/" ]; then + rsync -a $final_path/code/data/music/ $datadir/music/ + fi ynh_secure_remove --file="$final_path/code" ynh_secure_remove --file="$final_path/media" + ynh_secure_remove --file="$final_path/code/data/media" ynh_secure_remove --file="$final_path/import" + ynh_secure_remove --file="$final_path/code/data/music" ynh_app_setting_set --app=$app --key=datadir --value=$datadir From e75e325d964a6b4ea1b6ba69b2fd873b4ce90744 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 24 Apr 2021 13:04:55 +0200 Subject: [PATCH 35/49] Update README_fr.md Co-authored-by: Thomas <51749973+Thovi98@users.noreply.github.com> --- README_fr.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README_fr.md b/README_fr.md index 0c93780..b99c61e 100644 --- a/README_fr.md +++ b/README_fr.md @@ -30,7 +30,9 @@ L'installation nécessite un domaine ou un sous-domaine dédié. L'installation L'administrateur utilise le login que vous avez fourni lors de l'installation. Le mot de passe est le même que celui que vous utilisez pour YunoHost. L'interface d'administration est accessible à l'adresse : votre.domaine.fr/api/admin - +Pour ajouter une collection de fichiers musicaux à une bibliothèque dans votre installation YunoHost de Funkwhale, créez un lien symbolique vers votre collection intitulée "music" dans `/home/yunohost.app/funkwhale/data/`. +`foo@bar:~$sudo ln -s /your/music/collection /home/yunohost.app/funkwhale/data/music` +Les fichiers peuvent ensuite être ajoutés à votre bibliothèque à partir de l'onglet *Envoi* dans une bibliothèque musicale sous la rubrique **Importer de la musique de votre serveur**. ## Documentation * Documentation officielle : https://docs.funkwhale.audio From e28c67a2b61c5c986696a8b0718daf4cee761ae3 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Thu, 13 May 2021 17:47:01 +0200 Subject: [PATCH 36/49] [autopatch] Update issue and PR templates --- issue_template.md => .github/ISSUE_TEMPLATE.md | 4 ++-- .github/PULL_REQUEST_TEMPLATE.md | 16 ++++++++++++++++ pull_request_template.md | 16 ---------------- 3 files changed, 18 insertions(+), 18 deletions(-) rename issue_template.md => .github/ISSUE_TEMPLATE.md (94%) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 pull_request_template.md diff --git a/issue_template.md b/.github/ISSUE_TEMPLATE.md similarity index 94% rename from issue_template.md rename to .github/ISSUE_TEMPLATE.md index faf5143..2729a6b 100644 --- a/issue_template.md +++ b/.github/ISSUE_TEMPLATE.md @@ -8,7 +8,7 @@ about: When creating a bug report, please use the following template to provide 1. *Read this whole template first.* 2. *Determine if you are on the right place:* - *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change_url...), you are on the right place!* - - *Otherwise, the issue may be due to Funkwhale itself. Refer to its documentation or repository for help.* + - *Otherwise, the issue may be due to the app itself. Refer to its documentation or repository for help.* - *When in doubt, post here and we will figure it out together.* 3. *Delete the italic comments as you write over them below, and remove this guide.* --- @@ -31,7 +31,7 @@ about: When creating a bug report, please use the following template to provide - *If you performed a command from the CLI, the command itself is enough. For example:* ```sh - sudo yunohost app install funkwhale + sudo yunohost app install the_app ``` - *If you used the webadmin, please perform the equivalent command from the CLI first.* - *If the error occurs in your browser, explain what you did:* diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..ef70e18 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,16 @@ +## Problem + +- *Description of why you made this PR* + +## Solution + +- *And how do you fix that problem* + +## PR Status + +- [ ] Code finished and ready to be reviewed/tested +- [ ] The fix/enhancement were manually tested (if applicable) + +## Automatic tests + +Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ *after creating the PR*, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization) diff --git a/pull_request_template.md b/pull_request_template.md deleted file mode 100644 index 6c28fc5..0000000 --- a/pull_request_template.md +++ /dev/null @@ -1,16 +0,0 @@ -## Problem -- *Description of why you made this PR* - -## Solution -- *And how do you fix that problem* - -## PR Status -- [ ] Code finished. -- [ ] Tested with Package_check. -- [ ] Fix or enhancement tested. -- [ ] Upgrade from last version tested. -- [ ] Can be reviewed and tested. - -## Package_check results ---- -* An automatic package_check will be launch at https://ci-apps-dev.yunohost.org/, when you add a specific comment to your Pull Request: "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!"* From 0574bcd732858190deeb080b2dd3806533f75ee1 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 13 May 2021 22:35:44 +0200 Subject: [PATCH 37/49] remove others_var --- check_process | 6 +++++- manifest.json | 4 ++-- scripts/install | 6 +++--- scripts/upgrade | 6 +++--- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/check_process b/check_process index ea05a96..de19364 100644 --- a/check_process +++ b/check_process @@ -19,7 +19,9 @@ # 0.19.1 upgrade=1 from_commit=4d4bf0981e2d3a00eaae6b19bd54344fe55d6530 # 1.1~ynh1 - upgrade=1 from_commit=8172790fb461d16f09089593fdac380f0d499c83 + upgrade=1 from_commit=8172790fb461d16f09089593fdac380f0d499c83 + # 1.1.1~ynh1 + upgrade=1 from_commit=fa9587f61e4bb4f9db8667b1c6701ede37ac8e91 backup_restore=1 multi_instance=1 incorrect_path=0 @@ -34,3 +36,5 @@ Notification=all manifest_arg=domain=DOMAIN&path=/&admin=USER&is_public=1 ; commit=8172790fb461d16f09089593fdac380f0d499c83 name=1.1~ynh1 + ; commit=fa9587f61e4bb4f9db8667b1c6701ede37ac8e91 + name=1.1.1~ynh1 diff --git a/manifest.json b/manifest.json index 08991a5..d4b73ce 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Modern, convivial and free music server", "fr": "Serveur de musique moderne, convivial et gratuit" }, - "version": "1.1.1~ynh1", + "version": "1.1.1~ynh2", "url": "https://funkwhale.audio", "license": "AGPL-3.0-or-later", "maintainer": { @@ -18,7 +18,7 @@ "email": "jean-baptiste@holcroft.fr" }], "requirements": { - "yunohost": ">= 4.1.3" + "yunohost": ">= 4.2.0" }, "multi_instance": true, "services": [ diff --git a/scripts/install b/scripts/install index bf0e8cb..08c4709 100644 --- a/scripts/install +++ b/scripts/install @@ -158,9 +158,9 @@ ynh_script_progression --message="Configuring a systemd service..." ynh_add_config --template="../conf/funkwhale.target" --destination="/etc/systemd/system/$app.target" # Create a dedicated systemd config -ynh_add_systemd_config --service="${app}-server" --template="funkwhale-server.service" --others_var="datadir" -ynh_add_systemd_config --service="${app}-worker" --template="funkwhale-worker.service" --others_var="datadir" -ynh_add_systemd_config --service="${app}-beat" --template="funkwhale-beat.service" --others_var="datadir" +ynh_add_systemd_config --service="${app}-server" --template="funkwhale-server.service" +ynh_add_systemd_config --service="${app}-worker" --template="funkwhale-worker.service" +ynh_add_systemd_config --service="${app}-beat" --template="funkwhale-beat.service" #================================================= # INSTALL PYTHON DEPENDENCIES diff --git a/scripts/upgrade b/scripts/upgrade index aa21fd0..60e2228 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -265,9 +265,9 @@ ynh_script_progression --message="Upgrading systemd configuration..." ynh_add_config --template="../conf/funkwhale.target" --destination="/etc/systemd/system/$app.target" # Create a dedicated systemd config -ynh_add_systemd_config --service="${app}-server" --template="funkwhale-server.service" --others_var="datadir" -ynh_add_systemd_config --service="${app}-worker" --template="funkwhale-worker.service" --others_var="datadir" -ynh_add_systemd_config --service="${app}-beat" --template="funkwhale-beat.service" --others_var="datadir" +ynh_add_systemd_config --service="${app}-server" --template="funkwhale-server.service" +ynh_add_systemd_config --service="${app}-worker" --template="funkwhale-worker.service" +ynh_add_systemd_config --service="${app}-beat" --template="funkwhale-beat.service" #================================================= # GENERIC FINALIZATION From 2bf5019a3842a01aa3b454b3fff6cd09cbf825f0 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 13 May 2021 23:13:40 +0200 Subject: [PATCH 38/49] no more needed --- scripts/_common.sh | 61 ---------------------------------------------- 1 file changed, 61 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 9916587..dc8c79b 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -63,64 +63,3 @@ ynh_redis_remove_db() { local db=$1 redis-cli -n "$db" flushall } - -# Send an email to inform the administrator -# -# usage: ynh_send_readme_to_admin app_message [recipients] -# | arg: app_message - The message to send to the administrator. -# | arg: recipients - The recipients of this email. Use spaces to separate multiples recipients. - default: root -# example: "root admin@domain" -# If you give the name of a YunoHost user, ynh_send_readme_to_admin will find its email adress for you -# example: "root admin@domain user1 user2" -ynh_send_readme_to_admin() { - local app_message="${1:-...No specific information...}" - local recipients="${2:-root}" - - # Retrieve the email of users - find_mails () { - local list_mails="$1" - local mail - local recipients=" " - # Read each mail in argument - for mail in $list_mails - do - # Keep root or a real email address as it is - if [ "$mail" = "root" ] || echo "$mail" | grep --quiet "@" - then - recipients="$recipients $mail" - else - # But replace an user name without a domain after by its email - if mail=$(ynh_user_get_info "$mail" "mail" 2> /dev/null) - then - recipients="$recipients $mail" - fi - fi - done - echo "$recipients" - } - recipients=$(find_mails "$recipients") - - local mail_subject="☁️🆈🅽🅷☁️: \`$app\` was just installed!" - - local mail_message="This is an automated message from your beloved YunoHost server. - -Specific information for the application $app. - -$app_message - ---- -Automatic diagnosis data from YunoHost - -$(yunohost tools diagnosis | grep -B 100 "services:" | sed '/services:/d')" - - # Define binary to use for mail command - if [ -e /usr/bin/bsd-mailx ] - then - local mail_bin=/usr/bin/bsd-mailx - else - local mail_bin=/usr/bin/mail.mailutils - fi - - # Send the email to the recipients - echo "$mail_message" | $mail_bin -a "Content-Type: text/plain; charset=UTF-8" -s "$mail_subject" "$recipients" -} From 631b8344b40a8202ef9260cfcdef185e4e074682 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Wed, 19 May 2021 15:39:50 +0200 Subject: [PATCH 39/49] Upgrade to 1.1.2 --- conf/api.src | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/api.src b/conf/api.src index 2f4f89c..70d6744 100644 --- a/conf/api.src +++ b/conf/api.src @@ -1,7 +1,7 @@ -SOURCE_URL=https://dev.funkwhale.audio/funkwhale/funkwhale/-/jobs/artifacts/1.1.1/download?job=build_api -SOURCE_SUM=c77ebc37378df26a621f5f702fad3f94b56207bbfd69001bda4b45bcda515332 +SOURCE_URL=https://dev.funkwhale.audio/funkwhale/funkwhale/-/jobs/artifacts/1.1.2/download?job=build_api +SOURCE_SUM=b05b9852b95ed6585433f154980515275a727a67479f4cb63594727728eb4bba SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=api_1.1.1.zip +SOURCE_FILENAME=api_1.1.2.zip SOURCE_EXTRACT=true From 27b56bbfbdc73a5d1c80ae3de881ce27a01068fd Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Wed, 19 May 2021 15:41:22 +0200 Subject: [PATCH 40/49] Upgrade to 1.1.2 --- conf/front.src | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/front.src b/conf/front.src index 7b550d4..23c8cff 100644 --- a/conf/front.src +++ b/conf/front.src @@ -1,7 +1,7 @@ -SOURCE_URL=https://dev.funkwhale.audio/funkwhale/funkwhale/builds/artifacts/1.1.1/download?job=build_front -SOURCE_SUM=d94f0deaa88b8d90dd10b363cf817a80f9d2822419e8bbc7282bacd27351127b +SOURCE_URL=https://dev.funkwhale.audio/funkwhale/funkwhale/builds/artifacts/1.1.2/download?job=build_front +SOURCE_SUM=746f204834faba05a10104223509d8d012d989a98510b73b232d8ebcd17dddf3 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=front_1.1.1.zip +SOURCE_FILENAME=front_master.zip SOURCE_EXTRACT=true From 2049142114b793ab6cd780f6b38472045a437aa6 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Wed, 19 May 2021 15:41:48 +0200 Subject: [PATCH 41/49] Update manifest.json --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index d4b73ce..4389aff 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Modern, convivial and free music server", "fr": "Serveur de musique moderne, convivial et gratuit" }, - "version": "1.1.1~ynh2", + "version": "1.1.2~ynh1", "url": "https://funkwhale.audio", "license": "AGPL-3.0-or-later", "maintainer": { From 2f4e63e114e6e05a8ddb8c5eeec6e6a880c37890 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Wed, 19 May 2021 15:42:05 +0200 Subject: [PATCH 42/49] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5d3d9d0..e1b4e6f 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ A modern, convivial and free music server on YunoHost Installation requires a dedicated domain or subdomain. Installing in a subpath is not supported by the upstream project due to dependency requirements. -**Shipped version:** 1.1.1 +**Shipped version:** 1.1.2 ## Screenshots From 804a08cb96d0a1ecdc93ca2bd615100b3f7fcb2a Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Wed, 19 May 2021 15:42:22 +0200 Subject: [PATCH 43/49] Update README_fr.md --- README_fr.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_fr.md b/README_fr.md index b99c61e..a61b722 100644 --- a/README_fr.md +++ b/README_fr.md @@ -13,7 +13,7 @@ Un serveur de musique moderne, convivial et gratuit sur YunoHost L'installation nécessite un domaine ou un sous-domaine dédié. L'installation dans un chemin du domaine n'est pas prise en charge par le projet en amont en raison des exigences de dépendance. -**Version incluse :** 1.1.1 +**Version incluse :** 1.1.2 ## Captures d'écran From 0f0a36b417046eecc5a376b438be9606b8782405 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Wed, 19 May 2021 15:45:03 +0200 Subject: [PATCH 44/49] Update check_process --- check_process | 3 --- 1 file changed, 3 deletions(-) diff --git a/check_process b/check_process index de19364..ef8ac83 100644 --- a/check_process +++ b/check_process @@ -31,9 +31,6 @@ Email=cda@rootkey.co.uk Notification=all ;;; Upgrade options - ; commit=4d4bf0981e2d3a00eaae6b19bd54344fe55d6530 - name=Upgrade to 0.19.1 and fix channels-redis bug - manifest_arg=domain=DOMAIN&path=/&admin=USER&is_public=1 ; commit=8172790fb461d16f09089593fdac380f0d499c83 name=1.1~ynh1 ; commit=fa9587f61e4bb4f9db8667b1c6701ede37ac8e91 From ac73a3a6bc8a09eed9bba1ad9e32a799fb6cb91e Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Wed, 19 May 2021 15:48:35 +0200 Subject: [PATCH 45/49] Update check_process --- check_process | 2 -- 1 file changed, 2 deletions(-) diff --git a/check_process b/check_process index ef8ac83..0a5d2d7 100644 --- a/check_process +++ b/check_process @@ -16,8 +16,6 @@ setup_private=1 setup_public=1 upgrade=1 - # 0.19.1 - upgrade=1 from_commit=4d4bf0981e2d3a00eaae6b19bd54344fe55d6530 # 1.1~ynh1 upgrade=1 from_commit=8172790fb461d16f09089593fdac380f0d499c83 # 1.1.1~ynh1 From 37a840242585fba980c52827c4955ae834d6c9f6 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Wed, 19 May 2021 16:17:50 +0200 Subject: [PATCH 46/49] Update api.src --- conf/api.src | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/api.src b/conf/api.src index 70d6744..5b93b90 100644 --- a/conf/api.src +++ b/conf/api.src @@ -3,5 +3,5 @@ SOURCE_SUM=b05b9852b95ed6585433f154980515275a727a67479f4cb63594727728eb4bba SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=api_1.1.2.zip +SOURCE_FILENAME=api_master.zip SOURCE_EXTRACT=true From f22fd156351e83aa203a26d9fbbe3e23a5ada9fc Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Wed, 19 May 2021 16:27:46 +0200 Subject: [PATCH 47/49] Update api.src --- conf/api.src | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/api.src b/conf/api.src index 5b93b90..d2878e9 100644 --- a/conf/api.src +++ b/conf/api.src @@ -1,5 +1,5 @@ SOURCE_URL=https://dev.funkwhale.audio/funkwhale/funkwhale/-/jobs/artifacts/1.1.2/download?job=build_api -SOURCE_SUM=b05b9852b95ed6585433f154980515275a727a67479f4cb63594727728eb4bba +SOURCE_SUM=a0057edcff716327e49eafe7cff95e64919f8e6f32541525cc1462a25097635e SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true From 0e4482a2fd2a9c19dbae53bd2f6548c68f986540 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 19 May 2021 19:43:05 +0200 Subject: [PATCH 48/49] Others var (#143) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Upgrade to 1.1.1 (#138) * Update README.md * Test bump to 1.0 * Bump to Yunohost 4 (for Debian upgrade) * Test removal of nonexistent scripts * Correct Typo * Update README.md * Fix linter warnings * Fix linter * Fix linter warnings * Cleaning up * Update README.md * Update to 1.0.1 (#119) * Update to 1.0.1 * Set new permissions * Add French Readme * Readme update * Update README.md * Update README.md * Update README_fr.md * Update README.md Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com> * Update README_fr.md Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com> * Update README.md Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com> * Update README_fr.md Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com> * Finding an available port * Uprade to 1.1 and fixes Twisted by retrograding it (#129) * Fix linter warning : no need to use $is_public * Clarify custom paths needed to import collections of music files in Readme. (#134) * Update readme to indicate custom import path Yunohost installations of Funkwhale use a different path for file imports than those indicated in the Funkwhale documentation.. (/var/www/Funkwhale/import). We should therefore indicate to the admin user what that path is, and steps necessary to use it. Addresses #132. * Fix bash highlighting. * Update README.md Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com> Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com> * Apply Example_ynh (#131) * Testing (#130) * Uprade to 1.1 and fixes Twisted by retrograding it (#129) * Apply example_ynh Fix #15 * Fix services * Fix several merging * Stick to official install process * fix path_transversal * Using option '--log_type systemd' with 'yunohost service add' is not relevant anymore * Try to fix package_check * Fix package_check test * Update check_process * Trying to fix package_check * Update env.prod * remove sleep * Better service name * missing datadir * line 111: upgrade_type: unbound variable * Implement --is_big * Fix stopping service from previous version * Fix upgrade * Fix upgrade * Apply example_ynh * Apply example_ynh * Fix rights * Update api.src * Update env.prod * Update front.src * Update manifest.json * Update README.md * Update README_fr.md * Fix chmod * Fix rights Co-authored-by: Thomas <51749973+Thovi98@users.noreply.github.com> Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com> * Update conf/nginx.conf Co-authored-by: Thomas <51749973+Thovi98@users.noreply.github.com> * Update conf/nginx.conf Co-authored-by: Thomas <51749973+Thovi98@users.noreply.github.com> * fix * Fix rights for datadir from previous version * Update upgrade * Fix recursive chmod * Fix import link * Update README_fr.md Co-authored-by: Thomas <51749973+Thovi98@users.noreply.github.com> Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com> Co-authored-by: Alexandre Aubin Co-authored-by: Ciarán Ainsworth Co-authored-by: Ciarán Ainsworth Co-authored-by: ericgaspar Co-authored-by: Thomas <51749973+Thovi98@users.noreply.github.com> Co-authored-by: Amos Blanton * remove others_var * no more needed Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com> Co-authored-by: Alexandre Aubin Co-authored-by: Ciarán Ainsworth Co-authored-by: Ciarán Ainsworth Co-authored-by: ericgaspar Co-authored-by: Thomas <51749973+Thovi98@users.noreply.github.com> Co-authored-by: Amos Blanton --- check_process | 6 ++++- manifest.json | 4 +-- scripts/_common.sh | 61 ---------------------------------------------- scripts/install | 6 ++--- scripts/upgrade | 6 ++--- 5 files changed, 13 insertions(+), 70 deletions(-) diff --git a/check_process b/check_process index ea05a96..de19364 100644 --- a/check_process +++ b/check_process @@ -19,7 +19,9 @@ # 0.19.1 upgrade=1 from_commit=4d4bf0981e2d3a00eaae6b19bd54344fe55d6530 # 1.1~ynh1 - upgrade=1 from_commit=8172790fb461d16f09089593fdac380f0d499c83 + upgrade=1 from_commit=8172790fb461d16f09089593fdac380f0d499c83 + # 1.1.1~ynh1 + upgrade=1 from_commit=fa9587f61e4bb4f9db8667b1c6701ede37ac8e91 backup_restore=1 multi_instance=1 incorrect_path=0 @@ -34,3 +36,5 @@ Notification=all manifest_arg=domain=DOMAIN&path=/&admin=USER&is_public=1 ; commit=8172790fb461d16f09089593fdac380f0d499c83 name=1.1~ynh1 + ; commit=fa9587f61e4bb4f9db8667b1c6701ede37ac8e91 + name=1.1.1~ynh1 diff --git a/manifest.json b/manifest.json index 08991a5..d4b73ce 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Modern, convivial and free music server", "fr": "Serveur de musique moderne, convivial et gratuit" }, - "version": "1.1.1~ynh1", + "version": "1.1.1~ynh2", "url": "https://funkwhale.audio", "license": "AGPL-3.0-or-later", "maintainer": { @@ -18,7 +18,7 @@ "email": "jean-baptiste@holcroft.fr" }], "requirements": { - "yunohost": ">= 4.1.3" + "yunohost": ">= 4.2.0" }, "multi_instance": true, "services": [ diff --git a/scripts/_common.sh b/scripts/_common.sh index 9916587..dc8c79b 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -63,64 +63,3 @@ ynh_redis_remove_db() { local db=$1 redis-cli -n "$db" flushall } - -# Send an email to inform the administrator -# -# usage: ynh_send_readme_to_admin app_message [recipients] -# | arg: app_message - The message to send to the administrator. -# | arg: recipients - The recipients of this email. Use spaces to separate multiples recipients. - default: root -# example: "root admin@domain" -# If you give the name of a YunoHost user, ynh_send_readme_to_admin will find its email adress for you -# example: "root admin@domain user1 user2" -ynh_send_readme_to_admin() { - local app_message="${1:-...No specific information...}" - local recipients="${2:-root}" - - # Retrieve the email of users - find_mails () { - local list_mails="$1" - local mail - local recipients=" " - # Read each mail in argument - for mail in $list_mails - do - # Keep root or a real email address as it is - if [ "$mail" = "root" ] || echo "$mail" | grep --quiet "@" - then - recipients="$recipients $mail" - else - # But replace an user name without a domain after by its email - if mail=$(ynh_user_get_info "$mail" "mail" 2> /dev/null) - then - recipients="$recipients $mail" - fi - fi - done - echo "$recipients" - } - recipients=$(find_mails "$recipients") - - local mail_subject="☁️🆈🅽🅷☁️: \`$app\` was just installed!" - - local mail_message="This is an automated message from your beloved YunoHost server. - -Specific information for the application $app. - -$app_message - ---- -Automatic diagnosis data from YunoHost - -$(yunohost tools diagnosis | grep -B 100 "services:" | sed '/services:/d')" - - # Define binary to use for mail command - if [ -e /usr/bin/bsd-mailx ] - then - local mail_bin=/usr/bin/bsd-mailx - else - local mail_bin=/usr/bin/mail.mailutils - fi - - # Send the email to the recipients - echo "$mail_message" | $mail_bin -a "Content-Type: text/plain; charset=UTF-8" -s "$mail_subject" "$recipients" -} diff --git a/scripts/install b/scripts/install index bf0e8cb..08c4709 100644 --- a/scripts/install +++ b/scripts/install @@ -158,9 +158,9 @@ ynh_script_progression --message="Configuring a systemd service..." ynh_add_config --template="../conf/funkwhale.target" --destination="/etc/systemd/system/$app.target" # Create a dedicated systemd config -ynh_add_systemd_config --service="${app}-server" --template="funkwhale-server.service" --others_var="datadir" -ynh_add_systemd_config --service="${app}-worker" --template="funkwhale-worker.service" --others_var="datadir" -ynh_add_systemd_config --service="${app}-beat" --template="funkwhale-beat.service" --others_var="datadir" +ynh_add_systemd_config --service="${app}-server" --template="funkwhale-server.service" +ynh_add_systemd_config --service="${app}-worker" --template="funkwhale-worker.service" +ynh_add_systemd_config --service="${app}-beat" --template="funkwhale-beat.service" #================================================= # INSTALL PYTHON DEPENDENCIES diff --git a/scripts/upgrade b/scripts/upgrade index aa21fd0..60e2228 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -265,9 +265,9 @@ ynh_script_progression --message="Upgrading systemd configuration..." ynh_add_config --template="../conf/funkwhale.target" --destination="/etc/systemd/system/$app.target" # Create a dedicated systemd config -ynh_add_systemd_config --service="${app}-server" --template="funkwhale-server.service" --others_var="datadir" -ynh_add_systemd_config --service="${app}-worker" --template="funkwhale-worker.service" --others_var="datadir" -ynh_add_systemd_config --service="${app}-beat" --template="funkwhale-beat.service" --others_var="datadir" +ynh_add_systemd_config --service="${app}-server" --template="funkwhale-server.service" +ynh_add_systemd_config --service="${app}-worker" --template="funkwhale-worker.service" +ynh_add_systemd_config --service="${app}-beat" --template="funkwhale-beat.service" #================================================= # GENERIC FINALIZATION From c56621c8649de7e923c9cc37a579eeea2826605a Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Wed, 19 May 2021 21:11:13 +0200 Subject: [PATCH 49/49] Update check_process --- check_process | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/check_process b/check_process index 0a5d2d7..de19364 100644 --- a/check_process +++ b/check_process @@ -16,6 +16,8 @@ setup_private=1 setup_public=1 upgrade=1 + # 0.19.1 + upgrade=1 from_commit=4d4bf0981e2d3a00eaae6b19bd54344fe55d6530 # 1.1~ynh1 upgrade=1 from_commit=8172790fb461d16f09089593fdac380f0d499c83 # 1.1.1~ynh1 @@ -29,6 +31,9 @@ Email=cda@rootkey.co.uk Notification=all ;;; Upgrade options + ; commit=4d4bf0981e2d3a00eaae6b19bd54344fe55d6530 + name=Upgrade to 0.19.1 and fix channels-redis bug + manifest_arg=domain=DOMAIN&path=/&admin=USER&is_public=1 ; commit=8172790fb461d16f09089593fdac380f0d499c83 name=1.1~ynh1 ; commit=fa9587f61e4bb4f9db8667b1c6701ede37ac8e91