diff --git a/README.md b/README.md index 63e1db5..e3eda20 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # Pleroma app for Yunohost -[![Integration level](https://dash.yunohost.org/integration/pleroma.svg)](https://dash.yunohost.org/appci/app/pleroma) +[![Integration level](https://dash.yunohost.org/integration/pleroma.svg)](https://dash.yunohost.org/appci/app/pleroma) ![](https://ci-apps.yunohost.org/ci/badges/pleroma.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/pleroma.maintain.svg) [![Install Pleroma with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=pleroma) -> *This package allow you to install Pleroma 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.* +> *This package allows you to install Pleroma quickly and simply on a YunoHost server. +If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* ## Overview Pleroma is a microblogging server software that can federate (= exchange messages with) other servers that support ActivityPub. What that means is that you can host a server for yourself or your friends and stay in control of your online identity, but still exchange messages with people on larger servers. Pleroma will federate with all servers that implement ActivityPub, like Friendica, GNU Social, Hubzilla, Mastodon, Misskey, Peertube, and Pixelfed. @@ -23,7 +23,7 @@ For user friendly details about Pleroma: [see here](https://blog.soykaf.com/post - Tootdon (Android + iOS) - Tootle (iOS) -**Shipped version:** 2.0.5 +**Shipped version:** 2.0.7 ## Important points to read before installing @@ -73,7 +73,7 @@ You can make users **moderators**. They will then be able to **delete any post** ## YunoHost specific features -#### Multi-users support +#### Multi-user support LDAP supported but HTTP auth not. @@ -81,13 +81,9 @@ The app can be used by multiple users. #### Supported architectures -* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/pleroma%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/pleroma/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/pleroma%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/pleroma/) * ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/pleroma%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/pleroma/) -## Limitations - -* No known limitations. - ## Links * Report a bug: https://github.com/YunoHost-Apps/pleroma_ynh/issues @@ -98,10 +94,10 @@ The app can be used by multiple users. --- -Developers info +Developer info ---------------- -Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/pleroma_ynh/tree/testing). +Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/pleroma_ynh/tree/testing). To try the testing branch, please proceed like that. ``` diff --git a/check_process b/check_process index 6dba010..9f974e2 100755 --- a/check_process +++ b/check_process @@ -41,6 +41,8 @@ upgrade=1 from_commit=251a08383f59be006803fd12013baa92b03c1ef7 # 2.0.5~ynh1 upgrade=1 from_commit=06f0005707e77fae566fedbd6e5e37f390df5173 + # 2.0.5~ynh2 + upgrade=1 from_commit=30696599937984e9879da22220253f005e290cd0 backup_restore=1 multi_instance=0 # This test is no longer necessary since the version 2.7 (PR: https://github.com/YunoHost/yunohost/pull/304), you can still do it if your app could be installed with this version. @@ -74,3 +76,5 @@ Notification=yes name=2.0.2~ynh2 ; commit=06f0005707e77fae566fedbd6e5e37f390df5173 name=2.0.5~ynh1 + ; commit=30696599937984e9879da22220253f005e290cd0 + name=2.0.5~ynh2 diff --git a/conf/arm.src b/conf/arm.src index 8169ad1..30f0fb5 100644 --- a/conf/arm.src +++ b/conf/arm.src @@ -1,6 +1,6 @@ -SOURCE_URL=https://git.pleroma.social/pleroma/pleroma/-/jobs/116116/artifacts/download -SOURCE_SUM=e736a37744aa42760e3c3db64208461854d6ce1224625e8dc9c0c3482a222a35 +SOURCE_URL=https://git.pleroma.social/pleroma/pleroma/-/jobs/126024/artifacts/download +SOURCE_SUM=765faec1323d25d399ce3b34030dfccedb1d0f55a54e14e6d6dfdc7812df65f0 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=pleroma-v2.0.5-arm.zip +SOURCE_FILENAME=pleroma-v2.0.7-arm.zip diff --git a/conf/arm64.src b/conf/arm64.src index 6911607..c24cf8f 100644 --- a/conf/arm64.src +++ b/conf/arm64.src @@ -1,6 +1,6 @@ -SOURCE_URL=https://git.pleroma.social/pleroma/pleroma/-/jobs/116118/artifacts/download -SOURCE_SUM=99834c52f5baed56b4ca8c821b6d39b965d41b6ae7572c2a483f659fa3e99947 +SOURCE_URL=https://git.pleroma.social/pleroma/pleroma/-/jobs/126026/artifacts/download +SOURCE_SUM=cefb340415978a3379564ec93f9c168c3c60bcc73032970e5a5a3dc490b4e712 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=pleroma-v2.0.5-arm64.zip +SOURCE_FILENAME=pleroma-v2.0.7-arm64.zip diff --git a/conf/x86-64.src b/conf/x86-64.src index 963093f..991e9e1 100644 --- a/conf/x86-64.src +++ b/conf/x86-64.src @@ -1,6 +1,6 @@ -SOURCE_URL=https://git.pleroma.social/pleroma/pleroma/-/jobs/116114/artifacts/download -SOURCE_SUM=4a285a240c305e311fbd5834d37af1697ce2779b98c6058e94fa1d9a623d2569 +SOURCE_URL=https://git.pleroma.social/pleroma/pleroma/-/jobs/126022/artifacts/download +SOURCE_SUM=5698798b4c38e05ca273381265dfe3988ed96344a52b2d1418c65ccf3f1dfed5 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=pleroma-v2.0.5-x86-64.zip +SOURCE_FILENAME=pleroma-v2.0.7-x86-64.zip diff --git a/issue_template.md b/issue_template.md index 2fd2c35..fbdd93d 100644 --- a/issue_template.md +++ b/issue_template.md @@ -8,7 +8,7 @@ about: Create a report to help us debug, it would be nice to fill the template a 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 pleroma itself. Refer to its documentation or repository for help.* + - *Otherwise, the issue may be due to Pleroma itself. Refer to its documentation or repository for help.* - *If you have a doubt, post here, we will figure it out together.* 3. *Delete the italic comments as you write over them below, and remove this guide.* --- diff --git a/manifest.json b/manifest.json index dfbc0d4..e308137 100755 --- a/manifest.json +++ b/manifest.json @@ -3,10 +3,10 @@ "id": "pleroma", "packaging_format": 1, "description": { - "en": "Pleroma is an OStatus-compatible social networking server written in Elixir, compatible with GNU Social and Mastodon", - "fr": "Pleroma est un réseau social écrit en Elixir, compatible avec OStatus, GNU Social et Mastodon" + "en": "An OStatus-compatible social networking server written in Elixir, compatible with GNU Social and Mastodon", + "fr": "Un réseau social écrit en Elixir, compatible avec OStatus, GNU Social et Mastodon" }, - "version": "2.0.5~ynh3", + "version": "2.0.7~ynh1", "url": "https://git.pleroma.social/pleroma/pleroma", "license": "AGPL-3.0-only", "maintainer": [ @@ -40,7 +40,7 @@ "type": "user", "ask": { "en": "Choose an admin user", - "fr": "Choisissez l’administrateur" + "fr": "Choisissez l'administrateur" }, "example": "johndoe" }, diff --git a/scripts/backup b/scripts/backup index 74f86b2..e0d7ef6 100755 --- a/scripts/backup +++ b/scripts/backup @@ -13,7 +13,6 @@ source /usr/share/yunohost/helpers #================================================= # MANAGE SCRIPT FAILURE #================================================= -ynh_print_info --message="Managing script failure..." ynh_clean_setup () { ynh_clean_check_starting @@ -31,7 +30,6 @@ 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) - cache=$(ynh_app_setting_get --app=$app --key=cache) #================================================= diff --git a/scripts/change_url b/scripts/change_url index 1732b01..c0cf702 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -24,7 +24,7 @@ app=$YNH_APP_INSTANCE_NAME #================================================= # LOAD SETTINGS #================================================= -ynh_print_info --message="Loading installation settings..." +ynh_script_progression --message="Loading installation settings..." # Needed for helper "ynh_add_nginx_config" final_path=$(ynh_app_setting_get --app=$app --key=final_path) @@ -37,7 +37,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_print_info --message="Backing up the app before changing its url (may take a while)..." +ynh_script_progression --message="Backing up the app before changing its url (may take a while)..." # Backup the current version of the app ynh_backup_before_upgrade @@ -72,7 +72,7 @@ fi #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_print_info --message="Stopping a systemd service..." +ynh_script_progression --message="Stopping a systemd service..." ynh_systemd_action --service_name=$app --action="stop" --log_path=systemd --line_match="Stopped $app" @@ -81,7 +81,7 @@ pkill -u $app #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_print_info --message="Updating nginx web server configuration..." +ynh_script_progression --message="Updating nginx web server configuration..." nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf @@ -112,18 +112,11 @@ fi #================================================= # MODIFY A CONFIG FILE #================================================= -ynh_print_info --message="Modifying a config file..." +ynh_script_progression --message="Modifying a config file..." config="/etc/$app/config.exs" ynh_backup_if_checksum_is_different --file="$config" ynh_replace_string --match_string="$old_domain" --replace_string="$new_domain" --target_file="$config" - -#================================================= -# STORE THE CONFIG FILE CHECKSUM -#================================================= -ynh_print_info --message="Storing the config file checksum..." - -# Recalculate and store the checksum of the file for the next upgrade. ynh_store_file_checksum --file="$config" #================================================= @@ -131,9 +124,10 @@ ynh_store_file_checksum --file="$config" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_print_info --message="Starting a systemd service..." +ynh_script_progression --message="Starting a systemd service..." ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="Started $app" + if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then sleep 60 fi @@ -141,7 +135,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 @@ -149,4 +143,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_print_info --message="Change of URL completed for $app" +ynh_script_progression --message="Change of URL completed for $app" diff --git a/scripts/install b/scripts/install index 87b8bac..7816a33 100755 --- a/scripts/install +++ b/scripts/install @@ -13,7 +13,6 @@ source /usr/share/yunohost/helpers #================================================= # MANAGE SCRIPT FAILURE #================================================= -ynh_print_info --message="Managing script failure..." ynh_clean_setup () { ynh_clean_check_starting @@ -24,7 +23,7 @@ ynh_abort_if_errors #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= -ynh_print_info --message="Retrieving arguments from the manifest..." +ynh_script_progression --message="Retrieving arguments from the manifest..." domain=$YNH_APP_ARG_DOMAIN path_url="/" @@ -49,7 +48,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" @@ -60,7 +59,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 @@ -79,7 +78,7 @@ ynh_app_setting_set --app=$app --key=signing_salt --value=$signing_salt #================================================= # FIND AND OPEN A PORT #================================================= -ynh_print_info --message="Configuring firewall..." +ynh_script_progression --message="Configuring firewall..." # Find an available port port=$(ynh_find_port --port=8095) @@ -88,14 +87,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..." db_name=$(ynh_sanitize_dbid --db_name=$app) db_user=$db_name @@ -112,7 +111,7 @@ ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";" - #================================================= # 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 @@ -122,7 +121,7 @@ ynh_setup_source --dest_dir="$final_path/$app" --source_id=$architecture #================================================= # 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 @@ -142,7 +141,7 @@ fi #================================================= # 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" @@ -152,7 +151,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # CREATE THE DATA DIRECTORY #================================================= -ynh_print_info --message="Creating the data directory..." +ynh_script_progression --message="Creating the data directory..." # Define app's data directory datadir="/home/yunohost.app/${app}" @@ -171,7 +170,7 @@ ynh_app_setting_set --app=$app --key=datadir --value="$datadir" #================================================= # CREATE THE CONFIG DIRECTORY #================================================= -ynh_print_info --message="Creating the config directory..." +ynh_script_progression --message="Creating the config directory..." mkdir -p /etc/$app chown -R $app /etc/$app @@ -181,7 +180,7 @@ config="/etc/$app/config.exs" #================================================= # SETUP SYSTEMD #================================================= -ynh_print_info --message="Configuring a systemd service..." +ynh_script_progression --message="Configuring a systemd service..." # Create a dedicated systemd config ynh_add_systemd_config @@ -189,7 +188,7 @@ ynh_add_systemd_config #================================================= # MAKE SETUP #================================================= -ynh_print_info --message="Making setup..." +ynh_script_progression --message="Making setup..." # Give permission to the final_path chown -R "$app":"$app" "$final_path" @@ -234,7 +233,7 @@ popd #================================================= # STORE THE CONFIG FILE CHECKSUM #================================================= -ynh_print_info --message="Storing the config file checksum..." +ynh_script_progression --message="Storing the config file checksum..." # Calculate and store the config file checksum into the app settings ynh_store_file_checksum --file="$config" @@ -244,7 +243,7 @@ ynh_store_file_checksum --file="$config" #================================================= # SECURE FILES AND DIRECTORIES #================================================= -ynh_print_info --message="Securing files and directories..." +ynh_script_progression --message="Securing files and directories..." # Set permissions to app files chown -R "$app":"$app" "$final_path" @@ -252,14 +251,14 @@ chown -R "$app":"$app" "$final_path" #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= -ynh_print_info --message="Integrating service in YunoHost..." +ynh_script_progression --message="Integrating service in YunoHost..." yunohost service add $app --description "$app daemon for Pleroma" --log_type "systemd" #================================================= # SETUP SSOWAT #================================================= -ynh_print_info --message="Configuring SSOwat..." +ynh_script_progression --message="Configuring SSOwat..." # Make app public if necessary if [ $is_public -eq 1 ] @@ -271,7 +270,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 @@ -279,4 +278,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 079f815..462eacc 100755 --- 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 @@ -28,19 +28,19 @@ datadir=$(ynh_app_setting_get --app=$app --key=datadir) #================================================= # REMOVE SERVICE INTEGRATION IN YUNOHOST #================================================= -ynh_print_info --message="Removing service integration in YunoHost..." +ynh_script_progression --message="Removing service integration in YunoHost..." # 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 >/dev/null then - ynh_print_info --message="Removing $app service..." + ynh_script_progression --message="Removing $app service..." yunohost service remove $app fi #================================================= # STOP ALL PLEROMA SERVICES #================================================= -ynh_print_info --message="Stopping all pleroma services..." +ynh_script_progression --message="Stopping all pleroma services..." ynh_systemd_action --service_name=$app --action="stop" --log_path=systemd --line_match="Stopped $app" @@ -49,7 +49,7 @@ pkill -u $app #================================================= # STOP AND REMOVE SERVICE #================================================= -ynh_print_info --message="Stopping and removing the systemd service..." +ynh_script_progression --message="Stopping and removing the systemd service..." # Remove the dedicated systemd config ynh_remove_systemd_config @@ -57,7 +57,7 @@ ynh_remove_systemd_config #================================================= # 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_user="$db_user" --db_name="$db_name" @@ -65,7 +65,7 @@ ynh_psql_remove_db --db_user="$db_user" --db_name="$db_name" #================================================= # REMOVE DEPENDENCIES #================================================= -ynh_print_info --message="Removing dependencies..." +ynh_script_progression --message="Removing dependencies..." # Remove metapackage and its dependencies ynh_remove_app_dependencies @@ -73,7 +73,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" @@ -81,7 +81,7 @@ ynh_secure_remove --file="$final_path" #================================================= # 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 @@ -90,11 +90,11 @@ ynh_secure_remove --file="/etc/nginx/conf.d/$app-cache.conf" #================================================= # CLOSE A PORT #================================================= -ynh_print_info --message="Closing a port..." +ynh_script_progression --message="Closing a port..." if yunohost firewall list | grep -q "\- $port$" then - ynh_print_info --message="Closing port $port..." + ynh_script_progression --message="Closing port $port..." ynh_exec_warn_less yunohost firewall disallow TCP $port fi @@ -103,7 +103,7 @@ fi #================================================= # REMOVE DIRECTORIES #================================================= -ynh_print_info --message="Removing directories..." +ynh_script_progression --message="Removing directories..." # Remove the config directory securely ynh_secure_remove --file="/etc/$app" @@ -116,7 +116,7 @@ ynh_secure_remove --file="$datadir" #================================================= # 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 @@ -125,4 +125,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 d9babf8..c4e556c 100755 --- a/scripts/restore +++ b/scripts/restore @@ -13,7 +13,6 @@ source /usr/share/yunohost/helpers #================================================= # MANAGE SCRIPT FAILURE #================================================= -ynh_print_info --message="Managing script failure..." ynh_clean_setup () { ynh_clean_check_starting @@ -24,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 @@ -41,7 +40,7 @@ datadir=$(ynh_app_setting_get --app=$app --key=datadir) #================================================= # 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}" @@ -53,7 +52,7 @@ test ! -d $final_path \ #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= -ynh_print_info --message="Restoring the nginx configuration..." +ynh_script_progression --message="Restoring the nginx configuration..." ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" @@ -65,14 +64,14 @@ fi #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_print_info --message="Restoring the app main directory..." +ynh_script_progression --message="Restoring the app main directory..." ynh_restore_file --origin_path="$final_path" #================================================= # 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" @@ -80,7 +79,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # RESTORE USER RIGHTS #================================================= -ynh_print_info --message="Restoring user rights..." +ynh_script_progression --message="Restoring user rights..." # Restore permissions on app files chown -R "$app":"$app" "$final_path" @@ -90,7 +89,7 @@ chown -R "$app":"$app" "$final_path" #================================================= # RECREATE THE DATA DIRECTORY #================================================= -ynh_print_info --message="Recreating the data directory..." +ynh_script_progression --message="Recreating the data directory..." # Create app folders mkdir -p "$datadir/" @@ -106,14 +105,14 @@ ynh_app_setting_set --app=$app --key=datadir --value="$datadir" #================================================= # RESTORE THE CONFIG FILE #================================================= -ynh_print_info --message="Restoring the config file..." +ynh_script_progression --message="Restoring the config file..." ynh_restore_file --origin_path="/etc/$app/config.exs" #================================================= # REINSTALL DEPENDENCIES #================================================= -ynh_print_info --message="Reinstalling dependencies..." +ynh_script_progression --message="Reinstalling dependencies..." # Define and install dependencies ynh_install_app_dependencies $pkg_dependencies @@ -121,7 +120,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 @@ -134,7 +133,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.service" systemctl enable $app.service @@ -142,14 +141,14 @@ systemctl enable $app.service #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= -ynh_print_info --message="Integrating service in YunoHost..." +ynh_script_progression --message="Integrating service in YunoHost..." yunohost service add $app --description "$app daemon for Pleroma" --log_type "systemd" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_print_info --message="Starting a systemd service..." +ynh_script_progression --message="Starting a systemd service..." ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="Started $app" if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then @@ -161,7 +160,7 @@ fi #================================================= # RELOAD NGINX AND PHP-FPM #================================================= -ynh_print_info --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading nginx web server..." ynh_systemd_action --service_name=nginx --action=reload @@ -169,4 +168,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 f52f470..f3b3455 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -14,7 +14,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 @@ -37,14 +37,14 @@ registration=$(ynh_app_setting_get --app=$app --key=registration) #================================================= # CHECK VERSION #================================================= -ynh_print_info --message="Checking version..." +ynh_script_progression --message="Checking version..." upgrade_type=$(ynh_check_app_version_changed) #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= -ynh_print_info --message="Ensuring downward compatibility..." +ynh_script_progression --message="Ensuring downward compatibility..." # Fix is_public as a boolean value if [ "$is_public" = "Yes" ]; then @@ -84,7 +84,7 @@ fi if yunohost firewall list | grep -q "\- $port$" then - ynh_print_info --message="Closing port $port..." + ynh_script_progression --message="Closing port $port..." ynh_exec_warn_less yunohost firewall disallow TCP $port fi @@ -95,7 +95,7 @@ apt-key del A14F4FCA #================================================= # CHECK VERSION NUMBER #================================================= -ynh_print_info --message="Checking version number..." +ynh_script_progression --message="Checking version number..." if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then sleep 60 @@ -107,7 +107,7 @@ previous_version="${version}" #================================================= # 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)..." # Backup the current version of the app ynh_backup_before_upgrade @@ -124,7 +124,7 @@ ynh_abort_if_errors #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_print_info --message="Stopping a systemd service..." +ynh_script_progression --message="Stopping a systemd service..." ynh_systemd_action --service_name=$app --action="stop" --log_path=systemd --line_match="Stopped $app" @@ -137,7 +137,7 @@ fi #================================================= if ynh_version_gt "1.1.1~ynh1" "${previous_version}" ; then - ynh_print_info --message="Upgrading to OTP release..." + ynh_script_progression --message="Upgrading to OTP release..." # Define app's data directory datadir="/home/yunohost.app/${app}" @@ -184,7 +184,7 @@ fi if [ "$upgrade_type" == "UPGRADE_APP" ] then - ynh_print_info --message="Upgrading source files..." + ynh_script_progression --message="Upgrading source files..." # Download, check integrity, uncompress and patch the source from app.src architecture=$(ynh_detect_arch) @@ -194,7 +194,7 @@ fi #================================================= # 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 ynh_add_nginx_config @@ -215,14 +215,14 @@ fi #================================================= # 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" @@ -232,7 +232,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # MODIFY A CONFIG FILE #================================================= -ynh_print_info --message="Modifying a config file..." +ynh_script_progression --message="Modifying a config file..." config="/etc/$app/config.exs" @@ -241,7 +241,7 @@ ynh_backup_if_checksum_is_different --file="$config" #================================================= # MAKE UPGRADE #================================================= -ynh_print_info --message="Making upgrade..." +ynh_script_progression --message="Making upgrade..." # Give permission to the final_path chown -R "$app":"$app" "$final_path" @@ -253,7 +253,7 @@ popd #================================================= # STORE THE CONFIG FILE CHECKSUM #================================================= -ynh_print_info --message="Storing the config file checksum..." +ynh_script_progression --message="Storing the config file checksum..." # Recalculate and store the checksum of the file for the next upgrade. ynh_store_file_checksum --file="$config" @@ -261,7 +261,7 @@ ynh_store_file_checksum --file="$config" #================================================= # SETUP SYSTEMD #================================================= -ynh_print_info --message="Upgrading systemd configuration..." +ynh_script_progression --message="Upgrading systemd configuration..." # Create a dedicated systemd config ynh_add_systemd_config @@ -271,7 +271,7 @@ ynh_add_systemd_config #================================================= # SECURE FILES AND DIRECTORIES #================================================= -ynh_print_info --message="Securing files and directories..." +ynh_script_progression --message="Securing files and directories..." # Set permissions on app files chown -R "$app":"$app" "$final_path" @@ -279,7 +279,7 @@ chown -R "$app":"$app" "$final_path" #================================================= # 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 ] @@ -291,7 +291,7 @@ fi #================================================= # START SYSTEMD SERVICE #================================================= -ynh_print_info --message="Starting a systemd service..." +ynh_script_progression --message="Starting a systemd service..." ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="Started $app" if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then @@ -301,7 +301,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 @@ -309,4 +309,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_print_info --message="Upgrade of $app completed" +ynh_script_progression --message="Upgrade of $app completed"