From 0ef9651c7d98894073ce78392a05c82062eff32d Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Holcroft Date: Mon, 23 Jul 2018 08:03:54 +0200 Subject: [PATCH 1/2] Upgrade to 0.16 --- README.md | 2 +- check_process | 6 +++--- conf/app-frontend.src | 4 ++-- conf/app.src | 4 ++-- conf/env.prod | 3 ++- manifest.json | 2 +- scripts/install | 2 +- scripts/upgrade | 14 +++++++++----- 8 files changed, 21 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 2f7b12c..6b2c440 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ A modern, convivial and free music server on YunoHost Installation requires a dedicated domain for now. I hope subpath installation will be possible in the future. -**Shipped version:** 0.15 (this is an Alpha version!) +**Shipped version:** 0.16 (this is an Alpha version!) ## Admin diff --git a/check_process b/check_process index 7b3f835..97543df 100644 --- a/check_process +++ b/check_process @@ -16,7 +16,7 @@ setup_private=1 setup_public=1 upgrade=1 - upgrade=1 from_commit=ddb98f0220b9da59bd41ca354247dd36ec8657dc + upgrade=1 from_commit=11c81c1f503691272df5002dad8278bd82f34535 backup_restore=1 multi_instance=1 incorrect_path=0 @@ -39,6 +39,6 @@ Email=jean-baptiste@holcroft.fr Notification=all ;;; Upgrade options - ; commit=ddb98f0220b9da59bd41ca354247dd36ec8657dc - name=Upgrade from 0.14.2 + ; commit=11c81c1f503691272df5002dad8278bd82f34535 + name=Upgrade from 0.15~ynh2 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 cc7792a..c9f06e6 100644 --- a/conf/app-frontend.src +++ b/conf/app-frontend.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://code.eliotberriot.com/funkwhale/funkwhale/-/jobs/artifacts/0.15/download?job=build_front -SOURCE_SUM=3989a94cdec9ab5ea62d395d0b683ea15e216a6ae9ccef8f48b56de71a57990f +SOURCE_URL=https://code.eliotberriot.com/funkwhale/funkwhale/-/jobs/artifacts/0.16/download?job=build_front +SOURCE_SUM=771d74d8d2eff977ad6946900b00093de167f9b9cd1d2e9ca7001a0e372fa0be SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=false diff --git a/conf/app.src b/conf/app.src index 9eb234b..28ab953 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://code.eliotberriot.com/funkwhale/funkwhale/-/archive/0.15/funkwhale-0.15.tar.bz2 -SOURCE_SUM=a153ee377c573cc1f9963b72392c19d6a0dd30e32bdacde7e20467ff729722c1 +SOURCE_URL=https://code.eliotberriot.com/funkwhale/funkwhale/-/archive/0.16/funkwhale-0.16.tar.bz2 +SOURCE_SUM=a5e4628e9f27b0163d06101f34aefb8d376e54bc3d10660422894b64b3030e4e SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.bz2 SOURCE_IN_SUBDIR=true diff --git a/conf/env.prod b/conf/env.prod index d6234f0..44c58bb 100644 --- a/conf/env.prod +++ b/conf/env.prod @@ -25,7 +25,8 @@ # FUNKWHALE_VERSION=latest # In-place import, see https://code.eliotberriot.com/funkwhale/funkwhale/tags/0.10 -MUSIC_DIRECTORY_PATH=__FINALPATH__/data/music +MUSIC_DIRECTORY_SERVE_PATH=__FINALPATH__/data/music +MUSIC_DIRECTORY_PATH=/music # General configuration # --------------------- diff --git a/manifest.json b/manifest.json index 4cf1095..a0a7171 100644 --- a/manifest.json +++ b/manifest.json @@ -8,7 +8,7 @@ "description": { "en": "A modern, convivial and free music server" }, - "version": "0.15~ynh2", + "version": "0.16~ynh2", "url": "https://funkwhale.audio", "license": "BSD-3-Clause", "maintainer": { diff --git a/scripts/install b/scripts/install index 0b6c80f..8685e9a 100644 --- a/scripts/install +++ b/scripts/install @@ -219,8 +219,8 @@ systemctl restart "$app".target # SECURE FILES AND DIRECTORIES #================================================= -# Set permissions to app files chown -R "$app": "$final_path" +chmod -R 755 "$final_path/front/dist/" #================================================= # SETUP SSOWAT diff --git a/scripts/upgrade b/scripts/upgrade index 9d72bfd..21f0f94 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -35,10 +35,6 @@ if [ -z "$redis_db" ]; then ynh_app_setting_set "$app" redis_db "$redis_db" fi -# We don't need backports anymore -ynh_secure_remove /etc/apt/sources.list.d/stretch-backports.list -ynh_secure_remove /etc/apt/sources.list.d/jessie-backports.list - #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= @@ -131,6 +127,9 @@ python3 -m venv "$final_path/virtualenv" pip install --upgrade setuptools pip install wheel pip install -r "${final_path}/api/requirements.txt" + + # https://code.eliotberriot.com/funkwhale/funkwhale/tags/0.16 + pip uninstall django-cacheops --yes ) #================================================= @@ -178,6 +177,11 @@ chmod +x "$final_path/load_env" ynh_psql_execute_as_root "ALTER USER $db_user WITH NOSUPERUSER;" 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 + # https://code.eliotberriot.com/funkwhale/funkwhale/tags/0.16 #image-thumbnails-manual-action-required + python api/manage.py script create_image_variations --no-input ) #================================================= @@ -200,8 +204,8 @@ systemctl restart "$app".target # SECURE FILES AND DIRECTORIES #================================================= -# Set right permissions for curl installation chown -R "$app": "$final_path" +chmod -R 755 "$final_path/front/dist/" #================================================= # SETUP SSOWAT From f9067f4686124b646c1d90e84eb40531f4316e30 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Date: Tue, 10 Jul 2018 23:54:58 +0200 Subject: [PATCH 2/2] upgrade ynh_send_readme_to_admin helper if mail binary isn't properly selected, it may create an infinite loop at install --- scripts/_common.sh | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 0017550..c24474a 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -213,7 +213,7 @@ ynh_psql_drop_user() { # 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 informations...}" + local app_message="${1:-...No specific information...}" local recipients="${2:-root}" # Retrieve the email of users @@ -243,12 +243,25 @@ ynh_send_readme_to_admin() { local mail_subject="☁️🆈🅽🅷☁️: \`$app\` was just installed!" local mail_message="This is an automated message from your beloved YunoHost server. -Specific informations for the application $app. + +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 -a "Content-Type: text/plain; charset=UTF-8" -s "$mail_subject" "$recipients" + echo "$mail_message" | $mail_bin -a "Content-Type: text/plain; charset=UTF-8" -s "$mail_subject" "$recipients" } +