From 1edbbcd842178d5f62708e44e7af1cd70f66e71f Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 18 Jan 2022 20:40:40 +0000 Subject: [PATCH 1/3] Upgrade to v0.7.1 --- conf/amd64.src | 4 ++-- manifest.json | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/conf/amd64.src b/conf/amd64.src index 8c85104..4c663f8 100644 --- a/conf/amd64.src +++ b/conf/amd64.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/Plume-org/Plume/releases/download/0.6.0/plume-postgres.tar.gz -SOURCE_SUM=faca15f1b036929fd9c0a5cff29dbf12eb559500ee25052ba716138c5b93e63f +SOURCE_URL=https://github.com/Plume-org/Plume/releases/download/0.7.1/plume-postgres.tar.gz +SOURCE_SUM=be694c3a42fc82c724dcc00c11084b9681dfcd8eb2262102c31a9080d1ce66b3 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=false diff --git a/manifest.json b/manifest.json index 0b74fa0..919f666 100755 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Federated blogging application", "fr": "Application de blogging fédérée" }, - "version": "0.6.0~ynh3", + "version": "0.7.1~ynh1", "url": "https://joinplu.me/", "upstream": { "license": "AGPL-3.0-only", @@ -27,7 +27,7 @@ "nginx" ], "arguments": { - "install" : [ + "install": [ { "name": "domain", "type": "domain" @@ -63,7 +63,7 @@ "fr": "Les inscriptions sont-elles ouvertes à tout le monde ?" }, "default": false - } + } ] } } From 0a38c5c6379fc47edb50b9e37dd2682ab5c73675 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Tue, 18 Jan 2022 20:40:45 +0000 Subject: [PATCH 2/3] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fc136e8..081fbdc 100755 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Federated blogging engine, based on ActivityPub. It uses the Rocket framework, and Diesel to interact with the database. -**Shipped version:** 0.6.0~ynh3 +**Shipped version:** 0.7.1~ynh1 **Demo:** https://joinplu.me/#instances diff --git a/README_fr.md b/README_fr.md index 40cc0f8..14b1e4f 100644 --- a/README_fr.md +++ b/README_fr.md @@ -13,7 +13,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Federated blogging engine, based on ActivityPub. It uses the Rocket framework, and Diesel to interact with the database. -**Version incluse :** 0.6.0~ynh3 +**Version incluse :** 0.7.1~ynh1 **Démo :** https://joinplu.me/#instances From 6b2279292ceceeb6d19a277eac010735c681a961 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 21 Jan 2022 02:01:46 +0100 Subject: [PATCH 3/3] upgrade to 0.7.1~ynh1 --- check_process | 4 ++++ conf/arm64.src | 4 ++-- conf/systemd.service | 1 - scripts/install | 2 +- scripts/remove | 44 ++++++++++++++++++------------------ scripts/restore | 19 ++++++++-------- scripts/upgrade | 53 ++++++++++++++++++++++---------------------- 7 files changed, 66 insertions(+), 61 deletions(-) diff --git a/check_process b/check_process index 06c8904..831c31e 100755 --- a/check_process +++ b/check_process @@ -22,6 +22,8 @@ upgrade=1 from_commit=457f1dd7719286f28755d9561133a8e176be63c7 # 0.6.0~ynh1 upgrade=1 from_commit=0f9c1c6e3c151e94e5f53b1464aec732334209a3 + # 0.6.0~ynh2 + upgrade=1 from_commit=583e101b12a081c45bee50df9068e606b5983bb2 backup_restore=1 multi_instance=1 port_already_use=0 @@ -38,3 +40,5 @@ Notification=none name=0.5.0~ynh1 ; commit=0f9c1c6e3c151e94e5f53b1464aec732334209a3 name=0.6.0~ynh1 + ; commit=583e101b12a081c45bee50df9068e606b5983bb2 + name=0.6.0~ynh2 diff --git a/conf/arm64.src b/conf/arm64.src index 19c4291..b03a1b4 100644 --- a/conf/arm64.src +++ b/conf/arm64.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/YunoHost-Apps/plume_ynh/releases/download/0.6.0/plume-arm64-postgres.tar.gz -SOURCE_SUM=c821052f0d7c6cbb2d4eeffd143fb36b3add30b57c4bfc442d6604bd43e2f1b2 +SOURCE_URL=https://github.com/YunoHost-Apps/plume_ynh/releases/download/0.7.1/plume-arm64-postgres.tar.gz +SOURCE_SUM=872d074c492e43d391f0f932e921adc0916ed58bd6388aaa591c966ce962f8be SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=false diff --git a/conf/systemd.service b/conf/systemd.service index 4ea0196..7617069 100755 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -11,7 +11,6 @@ ExecStart=/bin/sh -c '__FINALPATH__/.cargo/bin/plume >> /var/log/__APP__/__APP__ TimeoutSec=30 Restart=always - # Sandboxing options to harden security # Depending on specificities of your service/app, you may need to tweak these # .. but this should be a good baseline diff --git a/scripts/install b/scripts/install index 29ab12c..2d0c1a2 100755 --- a/scripts/install +++ b/scripts/install @@ -90,7 +90,7 @@ ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies ynh_script_progression --message="Configuring system user..." # Create a system user -ynh_system_user_create --username=$app --home_dir="$final_path" +ynh_system_user_create --username=$app --home_dir=$final_path #================================================= # CREATE A POSTGRESQL DATABASE diff --git a/scripts/remove b/scripts/remove index eb4e008..5a4da68 100755 --- a/scripts/remove +++ b/scripts/remove @@ -43,6 +43,14 @@ ynh_script_progression --message="Stopping and removing the systemd service..." # Remove the dedicated systemd config ynh_remove_systemd_config +#================================================= +# REMOVE LOGROTATE CONFIGURATION +#================================================= +ynh_script_progression --message="Removing logrotate configuration..." + +# Remove the app-specific logrotate config +ynh_remove_logrotate + #================================================= # REMOVE THE POSTGRESQL DATABASE #================================================= @@ -51,24 +59,6 @@ ynh_script_progression --message="Removing the PostgreSQL database..." # Remove a database if it exists, along with the associated user ynh_psql_remove_db --db_user=$db_user --db_name=$db_name -#================================================= -# REMOVE DEPENDENCIES -#================================================= -ynh_script_progression --message="Removing dependencies..." - -# Remove metapackage and its dependencies -ynh_remove_app_dependencies - -export PATH="$PATH:$final_path/.cargo/bin:$final_path/.local/bin:/usr/local/sbin" - -pushd $final_path/$app - sudo -u "$app" env PATH=$PATH cargo uninstall diesel_cli -popd - -if [ -d "/usr/local/lib/rustlib" ]; then - sudo /usr/local/lib/rustlib/uninstall.sh -fi - #================================================= # REMOVE APP MAIN DIR #================================================= @@ -86,12 +76,22 @@ ynh_script_progression --message="Removing NGINX web server configuration..." ynh_remove_nginx_config #================================================= -# REMOVE LOGROTATE CONFIGURATION +# REMOVE DEPENDENCIES #================================================= -ynh_script_progression --message="Removing logrotate configuration..." +ynh_script_progression --message="Removing dependencies..." -# Remove the app-specific logrotate config -ynh_remove_logrotate +# Remove metapackage and its dependencies +ynh_remove_app_dependencies + +export PATH="$PATH:$final_path/.cargo/bin:$final_path/.local/bin:/usr/local/sbin" + +pushd $final_path/$app + sudo -u "$app" env PATH=$PATH cargo uninstall diesel_cli +popd + +if [ -d "/usr/local/lib/rustlib" ]; then + sudo /usr/local/lib/rustlib/uninstall.sh +fi #================================================= # SPECIFIC REMOVE diff --git a/scripts/restore b/scripts/restore index 9d983e3..5975fa8 100755 --- a/scripts/restore +++ b/scripts/restore @@ -39,7 +39,8 @@ db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) #================================================= ynh_script_progression --message="Validating restoration parameters..." -test ! -d $final_path || ynh_die --message="There is already a directory: $final_path " +test ! -d $final_path \ + || ynh_die --message="There is already a directory: $final_path " #================================================= # STANDARD RESTORATION STEPS @@ -56,7 +57,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" 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 THE APP MAIN DIR @@ -104,6 +105,13 @@ ynh_script_progression --message="Restoring the systemd configuration..." ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable $app.service --quiet +#================================================= +# RESTORE THE LOGROTATE CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring the logrotate configuration..." + +ynh_restore_file --origin_path="/etc/logrotate.d/$app" + #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= @@ -118,13 +126,6 @@ ynh_script_progression --message="Starting a systemd service..." ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Started plume" -#================================================= -# RESTORE THE LOGROTATE CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the logrotate configuration..." - -ynh_restore_file --origin_path="/etc/logrotate.d/$app" - #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 597b478..aca4ab1 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -30,9 +30,34 @@ architecture=$YNH_ARCH #================================================= # CHECK VERSION #================================================= +ynh_script_progression --message="Checking version..." upgrade_type=$(ynh_check_app_version_changed) +#================================================= +# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP +#================================================= +ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." + +# Backup the current version of the app +ynh_backup_before_upgrade +ynh_clean_setup () { + # Restore it if the upgrade fails + ynh_restore_upgradebackup + ynh_clean_check_starting +} +# Exit if an error occurs during the execution of the script +ynh_abort_if_errors + +#================================================= +# STANDARD UPGRADE STEPS +#================================================= +# STOP SYSTEMD SERVICE +#================================================= +ynh_script_progression --message="Stopping a systemd service..." + +ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --line_match="Stopped plume" + #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= @@ -65,37 +90,13 @@ then ynh_exec_warn_less yunohost firewall disallow TCP $port fi -#================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP -#================================================= -ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." - -# Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { - # Restore it if the upgrade fails - ynh_restore_upgradebackup - ynh_clean_check_starting -} -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - -#================================================= -# STANDARD UPGRADE STEPS -#================================================= -# STOP SYSTEMD SERVICE -#================================================= -ynh_script_progression --message="Stopping a systemd service..." - -ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --line_match="Stopped plume" - #================================================= # 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" +ynh_system_user_create --username=$app --home_dir=$final_path #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -148,7 +149,7 @@ chown -R "$app":"$app" "/var/log/$app" #================================================= # UPDATE A CONFIG FILE #================================================= -ynh_script_progression --message="Updating a config file..." +ynh_script_progression --message="Updating a configuration file..." ynh_add_config --template="../conf/.env" --destination="$final_path/$app/.env"