From cff44b8b06f7ba43c14beb9670c269c15a9076e0 Mon Sep 17 00:00:00 2001 From: rodinux Date: Sun, 15 Jan 2023 15:14:30 +0100 Subject: [PATCH 01/30] fix upgrade script, url to match VERSION, sqlite does not have a db name, there is no password users app and no shell, the directory off the app is --- scripts/upgrade | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index da5340f..f3b58bd 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -71,19 +71,19 @@ fi #================================================= [[ $YNH_APP_ID == "garradin" ]] \ - && [[ "$(cat "/opt/$app/templates/.VERSION")" != 1.2.2 ]] \ + && [[ "$(cat "/$final_path/VERSION")" != 1.2.2 ]] \ && ynh_die --message "It look like that you have an old Garradin install. You need first upgrade Garradin instance (id: $garradin_migrate_id) and after migrate to Paheko." ynh_handle_app_migration --migration_id=garradin --migration_list=garradin_migrations if [[ $migration_process -eq 1 ]]; then # Reload variables - dbname=$app - db_user=$app + #dbname=$app + #db_user=$app # Replace the user ynh_system_user_delete --username="$old_app" - test getent passwd "$app" &>/dev/null || \ - useradd -d "$datadir" --system --user-group "$app" --shell /bin/bash || \ + #test getent passwd "$app" &>/dev/null || \ + useradd -d "$final_path" --system --user-group "$app" || \ ynh_die --message "Unable to create $app system account" #================================================= From 0542d87c5b07be90e44e9db1d62a162f7ebd2326 Mon Sep 17 00:00:00 2001 From: Robles Rodolphe Date: Sun, 15 Jan 2023 16:11:47 +0100 Subject: [PATCH 02/30] Update scripts/upgrade approve Co-authored-by: Florent --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index f3b58bd..afad24f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -71,7 +71,7 @@ fi #================================================= [[ $YNH_APP_ID == "garradin" ]] \ - && [[ "$(cat "/$final_path/VERSION")" != 1.2.2 ]] \ + && [[ "$(cat "$final_path/VERSION")" != 1.2.2 ]] \ && ynh_die --message "It look like that you have an old Garradin install. You need first upgrade Garradin instance (id: $garradin_migrate_id) and after migrate to Paheko." ynh_handle_app_migration --migration_id=garradin --migration_list=garradin_migrations From 4f8f1604a11a7f9290e90c32dfdbd76d5a5c6360 Mon Sep 17 00:00:00 2001 From: rodinux Date: Sun, 15 Jan 2023 16:20:34 +0100 Subject: [PATCH 03/30] clean syntax --- check_process | 3 +++ 1 file changed, 3 insertions(+) diff --git a/check_process b/check_process index 7339701..b2c6fa7 100644 --- a/check_process +++ b/check_process @@ -11,6 +11,7 @@ setup_private=1 setup_public=1 upgrade=1 + upgrade=1 from_commit=764976b83dc93544d56ca6590dbfd747cd89a3b3 backup_restore=1 multi_instance=1 change_url=1 @@ -21,3 +22,5 @@ Notification=none ; commit=7205455e0a806a49c48c6d2f005d80d1b74a3355 name=Previous version manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666& + + From 349dff22fca32422b31a73a19fd80ef9984c7a62 Mon Sep 17 00:00:00 2001 From: rodinux Date: Sun, 15 Jan 2023 16:30:16 +0100 Subject: [PATCH 04/30] comment db migration on experimental_heper --- scripts/experimental_helper.sh | 46 +++++++++++++++++----------------- scripts/upgrade | 5 ---- 2 files changed, 23 insertions(+), 28 deletions(-) diff --git a/scripts/experimental_helper.sh b/scripts/experimental_helper.sh index b51cda3..57a6e78 100644 --- a/scripts/experimental_helper.sh +++ b/scripts/experimental_helper.sh @@ -192,35 +192,35 @@ ynh_handle_app_migration () { # MOVE THE DATABASE #================================================= - db_pwd=$(ynh_app_setting_get $old_app mysqlpwd) - db_name=$dbname + # db_pwd=$(ynh_app_setting_get $old_app mysqlpwd) + # db_name=$dbname - # Check if a database exists before trying to move it - local mysql_root_password=$(cat $MYSQL_ROOT_PWD_FILE) - if [ -n "$db_name" ] && mysqlshow -u root -p$mysql_root_password | grep -q "^| $db_name" - then - new_db_name=$(ynh_sanitize_dbid $new_app) - echo "Rename the database $db_name to $new_db_name" >&2 + # # Check if a database exists before trying to move it + # local mysql_root_password=$(cat $MYSQL_ROOT_PWD_FILE) + # if [ -n "$db_name" ] && mysqlshow -u root -p$mysql_root_password | grep -q "^| $db_name" + # then + # new_db_name=$(ynh_sanitize_dbid $new_app) + # echo "Rename the database $db_name to $new_db_name" >&2 - local sql_dump="/tmp/${db_name}-$(date '+%s').sql" + # local sql_dump="/tmp/${db_name}-$(date '+%s').sql" - # Dump the old database - ynh_mysql_dump_db "$db_name" > "$sql_dump" + # # Dump the old database + # ynh_mysql_dump_db "$db_name" > "$sql_dump" - # Create a new database - ynh_mysql_setup_db $new_db_name $new_db_name $db_pwd - # Then restore the old one into the new one - ynh_mysql_connect_as $new_db_name $db_pwd $new_db_name < "$sql_dump" + # # Create a new database + # ynh_mysql_setup_db $new_db_name $new_db_name $db_pwd + # # Then restore the old one into the new one + # ynh_mysql_connect_as $new_db_name $db_pwd $new_db_name < "$sql_dump" - # Remove the old database - ynh_mysql_remove_db $db_name $db_name - # And the dump - ynh_secure_remove --file="$sql_dump" + # # Remove the old database + # ynh_mysql_remove_db $db_name $db_name + # # And the dump + # ynh_secure_remove --file="$sql_dump" - # Update the value of $db_name - db_name=$new_db_name - ynh_app_setting_set $new_app db_name $db_name - fi + # # Update the value of $db_name + # db_name=$new_db_name + # ynh_app_setting_set $new_app db_name $db_name + # fi #================================================= # CHANGE THE FAKE DEPENDENCIES PACKAGE diff --git a/scripts/upgrade b/scripts/upgrade index afad24f..5ae5714 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -76,13 +76,8 @@ fi ynh_handle_app_migration --migration_id=garradin --migration_list=garradin_migrations if [[ $migration_process -eq 1 ]]; then - # Reload variables - #dbname=$app - #db_user=$app - # Replace the user ynh_system_user_delete --username="$old_app" - #test getent passwd "$app" &>/dev/null || \ useradd -d "$final_path" --system --user-group "$app" || \ ynh_die --message "Unable to create $app system account" From 11f0705d2947f705ad010b70167618e5866b1926 Mon Sep 17 00:00:00 2001 From: rodinux Date: Sun, 15 Jan 2023 16:41:11 +0100 Subject: [PATCH 05/30] file garradin_migration failed and end bash fi --- conf/garradin_migrations | 2 ++ scripts/upgrade | 1 + 2 files changed, 3 insertions(+) create mode 100644 conf/garradin_migrations diff --git a/conf/garradin_migrations b/conf/garradin_migrations new file mode 100644 index 0000000..fea5de3 --- /dev/null +++ b/conf/garradin_migrations @@ -0,0 +1,2 @@ +/$final_path +/etc/nginx/conf.d/$domain.d/$app.conf \ No newline at end of file diff --git a/scripts/upgrade b/scripts/upgrade index 5ae5714..830a4a7 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -80,6 +80,7 @@ if [[ $migration_process -eq 1 ]]; then ynh_system_user_delete --username="$old_app" useradd -d "$final_path" --system --user-group "$app" || \ ynh_die --message "Unable to create $app system account" +fi #================================================= # STANDARD UPGRADE STEPS From e21a15af5c4e99f86ed6fa462b40228dde89477f Mon Sep 17 00:00:00 2001 From: rodinux Date: Sun, 15 Jan 2023 16:44:37 +0100 Subject: [PATCH 06/30] syntax --- conf/garradin_migrations | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/garradin_migrations b/conf/garradin_migrations index fea5de3..9e68260 100644 --- a/conf/garradin_migrations +++ b/conf/garradin_migrations @@ -1,2 +1,2 @@ -/$final_path +$final_path /etc/nginx/conf.d/$domain.d/$app.conf \ No newline at end of file From 23e27e15e6934aec4346396162d00c20589765b8 Mon Sep 17 00:00:00 2001 From: rodinux Date: Sun, 15 Jan 2023 16:57:24 +0100 Subject: [PATCH 07/30] correct user create --- scripts/upgrade | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 830a4a7..aeaa9b8 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -78,8 +78,7 @@ ynh_handle_app_migration --migration_id=garradin --migration_list=garradin_migra if [[ $migration_process -eq 1 ]]; then # Replace the user ynh_system_user_delete --username="$old_app" - useradd -d "$final_path" --system --user-group "$app" || \ - ynh_die --message "Unable to create $app system account" + ynh_system_user_create --username=$app --home_dir="$final_path" fi #================================================= From a077a692e90a1330136b3790ad02eb580c4f3d21 Mon Sep 17 00:00:00 2001 From: rodinux Date: Sun, 15 Jan 2023 18:17:38 +0100 Subject: [PATCH 08/30] php8.0 for migration checksum --- scripts/experimental_helper.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/experimental_helper.sh b/scripts/experimental_helper.sh index 57a6e78..2eb6768 100644 --- a/scripts/experimental_helper.sh +++ b/scripts/experimental_helper.sh @@ -183,7 +183,7 @@ ynh_handle_app_migration () { ynh_replace_string "\(^checksum__etc_nginx.*\)_$old_app" "\1_$new_app/" "$settings_dir/$new_app/settings.yml" # Replace php5-fpm checksums - ynh_replace_string "\(^checksum__etc_php5.*[-_]\)$old_app" "\1$new_app/" "$settings_dir/$new_app/settings.yml" + ynh_replace_string "\(^checksum__etc_php8.O.*[-_]\)$old_app" "\1$new_app/" "$settings_dir/$new_app/settings.yml" # Replace final_path ynh_replace_string "\(^final_path: .*\)$old_app" "\1$new_app" "$settings_dir/$new_app/settings.yml" From 3e45842371acd47176008263a945185774ccfd64 Mon Sep 17 00:00:00 2001 From: rodinux Date: Sun, 15 Jan 2023 18:31:54 +0100 Subject: [PATCH 09/30] try check_upadte from garrdin --- check_process | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_process b/check_process index b2c6fa7..c93e9ad 100644 --- a/check_process +++ b/check_process @@ -11,7 +11,7 @@ setup_private=1 setup_public=1 upgrade=1 - upgrade=1 from_commit=764976b83dc93544d56ca6590dbfd747cd89a3b3 + upgrade=1 from_commit=6e100378cfac2b3b13d83bd8d7d6d402e36b8bcb backup_restore=1 multi_instance=1 change_url=1 From 15ba1a8677f5e9b296eb05920685b34ac693671f Mon Sep 17 00:00:00 2001 From: rodinux Date: Sun, 15 Jan 2023 20:05:44 +0100 Subject: [PATCH 10/30] add variable garradin_migration --- conf/garradin_migrations | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/conf/garradin_migrations b/conf/garradin_migrations index 9e68260..fe08d49 100644 --- a/conf/garradin_migrations +++ b/conf/garradin_migrations @@ -1,2 +1,3 @@ $final_path -/etc/nginx/conf.d/$domain.d/$app.conf \ No newline at end of file +/etc/nginx/conf.d/$domain.d/$app.conf +/etc/php/8.0/fpm/pool.d/$app.conf \ No newline at end of file From f045a9b1e73389f54263a9fd4e9a6df4257d973a Mon Sep 17 00:00:00 2001 From: rodinux Date: Sun, 15 Jan 2023 20:52:04 +0100 Subject: [PATCH 11/30] perhaps a mistake to resolve --- conf/garradin_migrations | 1 - 1 file changed, 1 deletion(-) diff --git a/conf/garradin_migrations b/conf/garradin_migrations index fe08d49..7688cf8 100644 --- a/conf/garradin_migrations +++ b/conf/garradin_migrations @@ -1,3 +1,2 @@ -$final_path /etc/nginx/conf.d/$domain.d/$app.conf /etc/php/8.0/fpm/pool.d/$app.conf \ No newline at end of file From f263e9df460729650fe1f0ac3d62fc980f180c18 Mon Sep 17 00:00:00 2001 From: rodinux Date: Sun, 15 Jan 2023 21:15:38 +0100 Subject: [PATCH 12/30] try fix migration --- scripts/experimental_helper.sh | 2 +- scripts/upgrade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/experimental_helper.sh b/scripts/experimental_helper.sh index 2eb6768..4370a5e 100644 --- a/scripts/experimental_helper.sh +++ b/scripts/experimental_helper.sh @@ -120,7 +120,7 @@ ynh_handle_app_migration () { # CHECK THE LIST OF FILES TO MOVE #================================================= - local temp_migration_list="$(tempfile)" + local temp_migration_list="$(mktemp)" # Build the list by removing blank lines and comment lines sed '/^#.*\|^$/d' "../conf/$migration_list" > "$temp_migration_list" diff --git a/scripts/upgrade b/scripts/upgrade index aeaa9b8..b0368db 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -77,7 +77,7 @@ ynh_handle_app_migration --migration_id=garradin --migration_list=garradin_migra if [[ $migration_process -eq 1 ]]; then # Replace the user - ynh_system_user_delete --username="$old_app" + ynh_system_user_delete --username="$old_app" --home_dir="$final_path" ynh_system_user_create --username=$app --home_dir="$final_path" fi From 0f9f95802acd75a4801259111cadae96ae8a2b6e Mon Sep 17 00:00:00 2001 From: rodinux Date: Sun, 15 Jan 2023 21:55:28 +0100 Subject: [PATCH 13/30] try fix migration --- scripts/upgrade | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index b0368db..f280f07 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -76,9 +76,16 @@ fi ynh_handle_app_migration --migration_id=garradin --migration_list=garradin_migrations if [[ $migration_process -eq 1 ]]; then + final_path="/var/www/$app" + # Replace the user - ynh_system_user_delete --username="$old_app" --home_dir="$final_path" + ynh_system_user_delete $old_app ynh_system_user_create --username=$app --home_dir="$final_path" + + # Ensuring the user has the right home dir + if [ ~$app != "$final_path" ]; then + usermod -d "$final_path" $app + fi fi #================================================= From 1e2ef97983c715a81340987bb06acc6257a01770 Mon Sep 17 00:00:00 2001 From: rodinux Date: Thu, 19 Jan 2023 09:43:18 +0100 Subject: [PATCH 14/30] release of the source experimental_helpers --- scripts/experimental_helper.sh | 119 ++++++++++++++++++--------------- scripts/upgrade | 5 -- 2 files changed, 64 insertions(+), 60 deletions(-) diff --git a/scripts/experimental_helper.sh b/scripts/experimental_helper.sh index 4370a5e..63f926c 100644 --- a/scripts/experimental_helper.sh +++ b/scripts/experimental_helper.sh @@ -1,15 +1,4 @@ -# Execute a command as another user -# usage: exec_as USER COMMAND [ARG ...] -exec_as() { - local USER=$1 - shift 1 - - if [[ $USER = $(whoami) ]]; then - eval "$@" - else - sudo -u "$USER" "$@" - fi -} +#!/bin/bash # Need also the helper https://github.com/YunoHost-Apps/Experimental_helpers/blob/master/ynh_handle_getopts_args/ynh_handle_getopts_args @@ -102,10 +91,10 @@ ynh_handle_app_migration () { if [ "$old_app_id" != "$migration_id" ] then # If the new app is not the authorized id, fail. - ynh_die --message "Incompatible application for migration from $old_app_id to $new_app_id" + ynh_die --message="Incompatible application for migration from $old_app_id to $new_app_id" fi - echo "Migrate from $old_app_id to $new_app_id" >&2 + ynh_print_info --message="Migrate from $old_app_id to $new_app_id" >&2 #================================================= # CHECK IF THE MIGRATION CAN BE DONE @@ -113,14 +102,14 @@ ynh_handle_app_migration () { # TODO Handle multi instance apps... # Check that there is not already an app installed for this id. - (yunohost app list --installed -f "$new_app" | grep -q id) \ - && ynh_die "$new_app is already installed" + (yunohost app list | grep -q -w "id: $new_app") \ + && ynh_die --message="$new_app is already installed" #================================================= # CHECK THE LIST OF FILES TO MOVE #================================================= - local temp_migration_list="$(mktemp)" + local temp_migration_list="$(tempfile)" # Build the list by removing blank lines and comment lines sed '/^#.*\|^$/d' "../conf/$migration_list" > "$temp_migration_list" @@ -131,7 +120,7 @@ ynh_handle_app_migration () { do # Replace all occurences of $app by $new_app in each file to move. local move_to_destination="${file_to_move//\$app/$new_app}" - test -e "$move_to_destination" && ynh_die "A file named $move_to_destination already exists." + test -e "$move_to_destination" && ynh_die --message="A file named $move_to_destination already exists." done < "$temp_migration_list" #================================================= @@ -140,10 +129,10 @@ ynh_handle_app_migration () { local settings_dir="/etc/yunohost/apps" cp -a "$settings_dir/$old_app" "$settings_dir/$new_app" - cp -a ../{scripts,conf} "$settings_dir/$new_app" + cp -a ../{scripts,conf,manifest.json} "$settings_dir/$new_app" # Replace the old id by the new one - ynh_replace_string "\(^id: .*\)$old_app" "\1$new_app" "$settings_dir/$new_app/settings.yml" + ynh_replace_string --match_string="\(^id: .*\)$old_app" --replace_string="\1$new_app" --target_file="$settings_dir/$new_app/settings.yml" # INFO: There a special behavior with yunohost app setting: # if the id given in argument does not match with the id # stored in the config file, the config file will be purged. @@ -151,16 +140,21 @@ ynh_handle_app_migration () { # https://github.com/YunoHost/yunohost/blob/c6b5284be8da39cf2da4e1036a730eb5e0515096/src/yunohost/app.py#L1316-L1321 # Change the label if it's simply the name of the app - old_label=$(ynh_app_setting_get $new_app label) + old_label=$(ynh_app_setting_get --app=$new_app --key=label) if [ "${old_label,,}" == "$old_app_id" ] then # Build the new label from the id of the app. With the first character as upper case new_label=$(echo $new_app_id | cut -c1 | tr [:lower:] [:upper:])$(echo $new_app_id | cut -c2-) - ynh_app_setting_set $new_app label $new_label + ynh_app_setting_set --app=$new_app --key=label --value=$new_label fi + + permissions_name=$(yunohost user permission list $old_app --short --output-as plain) + for permission_name in $permissions_name + do + yunohost tools shell -c "from yunohost.permission import permission_delete; permission_delete('$permission_name', force=True, sync_perm=False)" + done - yunohost tools shell -c "from yunohost.permission import permission_delete; permission_delete('$old_app.main', force=True, sync_perm=False)" - yunohost tools shell -c "from yunohost.permission import permission_create; permission_create('$new_app.main', url='/' , sync_perm=True)" + yunohost tools shell -c "from yunohost.permission import permission_create; permission_create('$new_app.main', url='/' , show_tile=True , sync_perm=True)" #================================================= # MOVE FILES TO THE NEW DESTINATION @@ -171,7 +165,7 @@ ynh_handle_app_migration () { # Replace all occurence of $app by $new_app in each file to move. move_to_destination="$(eval echo "${file_to_move//\$app/$new_app}")" local real_file_to_move="$(eval echo "${file_to_move//\$app/$old_app}")" - echo "Move file $real_file_to_move to $move_to_destination" >&2 + ynh_print_info --message="Move file $real_file_to_move to $move_to_destination" >&2 mv "$real_file_to_move" "$move_to_destination" done < "$temp_migration_list" @@ -180,47 +174,62 @@ ynh_handle_app_migration () { #================================================= # Replace nginx checksum - ynh_replace_string "\(^checksum__etc_nginx.*\)_$old_app" "\1_$new_app/" "$settings_dir/$new_app/settings.yml" + ynh_replace_string --match_string="\(^checksum__etc_nginx.*\)_$old_app" --replace_string="\1_$new_app" --target_file="$settings_dir/$new_app/settings.yml" - # Replace php5-fpm checksums - ynh_replace_string "\(^checksum__etc_php8.O.*[-_]\)$old_app" "\1$new_app/" "$settings_dir/$new_app/settings.yml" + # Replace php-fpm checksums + ynh_replace_string --match_string="\(^checksum__etc_php.*[-_]\)$old_app" --replace_string="\1$new_app" --target_file="$settings_dir/$new_app/settings.yml" # Replace final_path - ynh_replace_string "\(^final_path: .*\)$old_app" "\1$new_app" "$settings_dir/$new_app/settings.yml" + ynh_replace_string --match_string="\(^final_path: .*\)$old_app" --replace_string="\1$new_app" --target_file="$settings_dir/$new_app/settings.yml" + + # Replace fail2ban_filter + ynh_replace_string --match_string="\(^checksum__etc_fail2ban_filter.*\)_$old_app" --replace_string="\1_$new_app" --target_file="$settings_dir/$new_app/settings.yml" + + # Replace fail2ban_jail + ynh_replace_string --match_string="\(^checksum__etc_fail2ban_jail.*\)_$old_app" --replace_string="\1_$new_app" --target_file="$settings_dir/$new_app/settings.yml" + + # Replace systemd + ynh_replace_string --match_string="\(^checksum__etc_systemd_system.*\)_$old_app" --replace_string="\1_$new_app" --target_file="$settings_dir/$new_app/settings.yml" #================================================= - # MOVE THE DATABASE + # MOVE THE MYSQL DATABASE #================================================= - # db_pwd=$(ynh_app_setting_get $old_app mysqlpwd) - # db_name=$dbname + old_db_name=$(ynh_app_setting_get --app=$old_app --key=db_name) + + # Check if a database exists before trying to move it + local mysql_root_password=$(cat $MYSQL_ROOT_PWD_FILE) + if [ -n "$old_db_name" ] && mysqlshow -u root -p$mysql_root_password | grep -q "^| $old_db_name" + then + old_db_user=$old_db_name + db_pwd=$(ynh_app_setting_get --app=$old_app --key=mysqlpwd) - # # Check if a database exists before trying to move it - # local mysql_root_password=$(cat $MYSQL_ROOT_PWD_FILE) - # if [ -n "$db_name" ] && mysqlshow -u root -p$mysql_root_password | grep -q "^| $db_name" - # then - # new_db_name=$(ynh_sanitize_dbid $new_app) - # echo "Rename the database $db_name to $new_db_name" >&2 + new_db_name=$(ynh_sanitize_dbid --db_name=$new_app) + new_db_user=$new_db_name + ynh_print_info --message="Rename the database $db_name to $new_db_name" >&2 - # local sql_dump="/tmp/${db_name}-$(date '+%s').sql" + local sql_dump="/tmp/${db_name}-$(date '+%s').sql" - # # Dump the old database - # ynh_mysql_dump_db "$db_name" > "$sql_dump" + # Dump the old database + ynh_mysql_dump_db --database="$old_db_name" > "$sql_dump" - # # Create a new database - # ynh_mysql_setup_db $new_db_name $new_db_name $db_pwd - # # Then restore the old one into the new one - # ynh_mysql_connect_as $new_db_name $db_pwd $new_db_name < "$sql_dump" + # Create a new database + ynh_mysql_setup_db --db_user=$new_db_user --db_name=$new_db_name --db_pwd=$db_pwd + + # Then restore the old one into the new one + ynh_mysql_connect_as --user=$new_db_user --password=$db_pwd --database=$new_db_name < "$sql_dump" - # # Remove the old database - # ynh_mysql_remove_db $db_name $db_name - # # And the dump - # ynh_secure_remove --file="$sql_dump" + # Remove the old database + ynh_mysql_remove_db --db_user=$old_db_user --db_name=$old_db_name - # # Update the value of $db_name - # db_name=$new_db_name - # ynh_app_setting_set $new_app db_name $db_name - # fi + # And the dump + ynh_secure_remove --file="$sql_dump" + + # Update the value of $db_name + db_name=$new_db_name + db_user=$new_db_user + ynh_app_setting_set --app=$new_app --key=db_name --value=$db_name + fi #================================================= # CHANGE THE FAKE DEPENDENCIES PACKAGE @@ -234,7 +243,7 @@ ynh_handle_app_migration () { local old_package_name="${old_app//_/-}-ynh-deps" local new_package_name="${new_app//_/-}-ynh-deps" - if ynh_package_is_installed "$old_package_name" + if ynh_package_is_installed --package="$old_package_name" then # Install a new fake package app=$new_app @@ -254,4 +263,4 @@ ynh_handle_app_migration () { # Set migration_process to 1 to inform that an upgrade has been made migration_process=1 fi -} \ No newline at end of file +} diff --git a/scripts/upgrade b/scripts/upgrade index f280f07..ca26084 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -81,11 +81,6 @@ if [[ $migration_process -eq 1 ]]; then # Replace the user ynh_system_user_delete $old_app ynh_system_user_create --username=$app --home_dir="$final_path" - - # Ensuring the user has the right home dir - if [ ~$app != "$final_path" ]; then - usermod -d "$final_path" $app - fi fi #================================================= From 89d64d058281f4cf872ecde5f19a5837af0bc656 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Thu, 19 Jan 2023 08:43:28 +0000 Subject: [PATCH 15/30] Auto-update README --- README_fr.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README_fr.md b/README_fr.md index eaf4081..c8672a5 100644 --- a/README_fr.md +++ b/README_fr.md @@ -5,15 +5,15 @@ It shall NOT be edited by hand. # Paheko pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/paheko.svg)](https://dash.yunohost.org/appci/app/paheko) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/paheko.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/paheko.maintain.svg) +[![Niveau d’intégration](https://dash.yunohost.org/integration/paheko.svg)](https://dash.yunohost.org/appci/app/paheko) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/paheko.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/paheko.maintain.svg) [![Installer Paheko avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=paheko) *[Read this readme in english.](./README.md)* -> *Ce package vous permet d'installer Paheko rapidement et simplement sur un serveur YunoHost. -Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.* +> *Ce package vous permet d’installer Paheko rapidement et simplement sur un serveur YunoHost. +Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l’installer et en profiter.* -## Vue d'ensemble +## Vue d’ensemble Paheko (Nous avons choisi le nom Paheko, un mot de la langue Māori qui signifie « coopérer », illustrant le but du logiciel : améliorer ensemble le quotidien de la gestion d'une association) est un logiciel de gestion associative. Il est l'outil de prédilection pour gérer une association, un club sportif, une ONG, etc. Il est conçu pour répondre aux besoins d'une structure de petite à moyenne taille : gestion des adhérents, comptabilité, site web, prise de notes en réunion, archivage et partage des documents de fonctionnement de l'association, discussion entre adhérents, etc etc. @@ -33,15 +33,15 @@ Paheko (Nous avons choisi le nom Paheko, un mot de la langue Māori qui signifie **Démo :** https://paheko.cloud/essai/ -## Captures d'écran +## Captures d’écran -![Capture d'écran de Paheko](./doc/screenshots/screenshot.png) +![Capture d’écran de Paheko](./doc/screenshots/screenshot.png) ## Documentations et ressources -* Site officiel de l'app : -* Documentation officielle de l'admin : -* Dépôt de code officiel de l'app : +* Site officiel de l’app : +* Documentation officielle de l’admin : +* Dépôt de code officiel de l’app : * Documentation YunoHost pour cette app : * Signaler un bug : @@ -57,4 +57,4 @@ ou sudo yunohost app upgrade paheko -u https://github.com/YunoHost-Apps/paheko_ynh/tree/testing --debug ``` -**Plus d'infos sur le packaging d'applications :** +**Plus d’infos sur le packaging d’applications :** \ No newline at end of file From 12e563407358493e2b90b8c7c007348421112db6 Mon Sep 17 00:00:00 2001 From: Robles Rodolphe Date: Tue, 24 Jan 2023 07:49:10 +0100 Subject: [PATCH 16/30] try kill process before delete user --- scripts/upgrade | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/upgrade b/scripts/upgrade index ca26084..c413dab 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -79,6 +79,7 @@ if [[ $migration_process -eq 1 ]]; then final_path="/var/www/$app" # Replace the user + pkill -u someuser ynh_system_user_delete $old_app ynh_system_user_create --username=$app --home_dir="$final_path" fi From bf050cfbc85dbc0f937355f800ab552eccdcdc15 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 24 Jan 2023 06:49:13 +0000 Subject: [PATCH 17/30] 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 46b7ad2..0caef11 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ It shall NOT be edited by hand. # Paheko for YunoHost -[![Integration level](https://dash.yunohost.org/integration/paheko.svg)](https://dash.yunohost.org/appci/app/paheko) ![Working status](https://ci-apps.yunohost.org/ci/badges/paheko.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/paheko.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/paheko.svg)](https://dash.yunohost.org/appci/app/paheko) ![Working status](https://ci-apps.yunohost.org/ci/badges/paheko.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/paheko.maintain.svg) [![Install Paheko with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=paheko) *[Lire ce readme en français.](./README_fr.md)* diff --git a/README_fr.md b/README_fr.md index c8672a5..6c3a7dc 100644 --- a/README_fr.md +++ b/README_fr.md @@ -5,7 +5,7 @@ It shall NOT be edited by hand. # Paheko pour YunoHost -[![Niveau d’intégration](https://dash.yunohost.org/integration/paheko.svg)](https://dash.yunohost.org/appci/app/paheko) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/paheko.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/paheko.maintain.svg) +[![Niveau d’intégration](https://dash.yunohost.org/integration/paheko.svg)](https://dash.yunohost.org/appci/app/paheko) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/paheko.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/paheko.maintain.svg) [![Installer Paheko avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=paheko) *[Read this readme in english.](./README.md)* From 69f7470d4ad1187ddb80c77759cb82be141d430b Mon Sep 17 00:00:00 2001 From: Robles Rodolphe Date: Tue, 24 Jan 2023 07:50:50 +0100 Subject: [PATCH 18/30] error user variable syntax --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index c413dab..a8155a4 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -79,7 +79,7 @@ if [[ $migration_process -eq 1 ]]; then final_path="/var/www/$app" # Replace the user - pkill -u someuser + pkill -u $old_app ynh_system_user_delete $old_app ynh_system_user_create --username=$app --home_dir="$final_path" fi From 8c5097a9bd722b7c68ad661315d8ec956ca68002 Mon Sep 17 00:00:00 2001 From: Robles Rodolphe Date: Tue, 24 Jan 2023 08:10:12 +0100 Subject: [PATCH 19/30] perhaps a better syntax --- scripts/upgrade | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index a8155a4..8459550 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -79,9 +79,8 @@ if [[ $migration_process -eq 1 ]]; then final_path="/var/www/$app" # Replace the user - pkill -u $old_app - ynh_system_user_delete $old_app - ynh_system_user_create --username=$app --home_dir="$final_path" + ynh_system_user_delete --username="$old_app" + ynh_system_user_create --username="$app" --home_dir="$final_path" fi #================================================= From b302d7f444e8d7697fd6cecec1bc1849c01eeb7e Mon Sep 17 00:00:00 2001 From: Robles Rodolphe Date: Tue, 24 Jan 2023 08:36:52 +0100 Subject: [PATCH 20/30] try fix --- scripts/upgrade | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 8459550..194e02e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -76,11 +76,12 @@ fi ynh_handle_app_migration --migration_id=garradin --migration_list=garradin_migrations if [[ $migration_process -eq 1 ]]; then - final_path="/var/www/$app" + final_path="/var/www/$app" # Replace the user - ynh_system_user_delete --username="$old_app" - ynh_system_user_create --username="$app" --home_dir="$final_path" + ynh_system_user_delete --username=$old_app + ynh_system_user_create --username=$app || \ + ynh_die --message "Unable to create $app system account" fi #================================================= From ac5115e5a19ff9b7556f74d5010ee3a1bc22c175 Mon Sep 17 00:00:00 2001 From: Florent Date: Thu, 2 Feb 2023 15:29:13 +0100 Subject: [PATCH 21/30] Some improvements and attempt to fix migration --- conf/garradin_migrations | 7 ++++- conf/garradin_post_migration.sh | 8 +++++- scripts/experimental_helper.sh | 11 ++++---- scripts/install | 1 + scripts/upgrade | 47 ++++++++++++++++++--------------- 5 files changed, 45 insertions(+), 29 deletions(-) diff --git a/conf/garradin_migrations b/conf/garradin_migrations index 7688cf8..96f1226 100644 --- a/conf/garradin_migrations +++ b/conf/garradin_migrations @@ -1,2 +1,7 @@ +# App main directory +/var/www/$app + +# NGINX web server configuration /etc/nginx/conf.d/$domain.d/$app.conf -/etc/php/8.0/fpm/pool.d/$app.conf \ No newline at end of file + +/etc/php/8.0/fpm/pool.d/$app.conf diff --git a/conf/garradin_post_migration.sh b/conf/garradin_post_migration.sh index c8c6bea..4b75453 100644 --- a/conf/garradin_post_migration.sh +++ b/conf/garradin_post_migration.sh @@ -25,8 +25,14 @@ script_name="$0" ynh_secure_remove --file="/etc/yunohost/apps/$old_app" yunohost app ssowatconf + +#================================================= +# REMOVE THE OLD USER +#================================================= +ynh_user_exists --username=$old_app && ynh_system_user_delete $old_app + #================================================= # DELETE THIS SCRIPT #================================================= -echo "rm $script_name" | at now + 1 minutes \ No newline at end of file +echo "rm $script_name" | at now + 1 minutes diff --git a/scripts/experimental_helper.sh b/scripts/experimental_helper.sh index 63f926c..9f4b973 100644 --- a/scripts/experimental_helper.sh +++ b/scripts/experimental_helper.sh @@ -76,7 +76,7 @@ ynh_handle_app_migration () { fi #================================================= - # CHECK IF IT HAS TO MIGRATE + # CHECK IF IT HAS TO MIGRATE #================================================= migration_process=0 @@ -147,7 +147,7 @@ ynh_handle_app_migration () { new_label=$(echo $new_app_id | cut -c1 | tr [:lower:] [:upper:])$(echo $new_app_id | cut -c2-) ynh_app_setting_set --app=$new_app --key=label --value=$new_label fi - + permissions_name=$(yunohost user permission list $old_app --short --output-as plain) for permission_name in $permissions_name do @@ -196,10 +196,9 @@ ynh_handle_app_migration () { #================================================= old_db_name=$(ynh_app_setting_get --app=$old_app --key=db_name) - + # Check if a database exists before trying to move it - local mysql_root_password=$(cat $MYSQL_ROOT_PWD_FILE) - if [ -n "$old_db_name" ] && mysqlshow -u root -p$mysql_root_password | grep -q "^| $old_db_name" + if [ -n "$old_db_name" ] && mysqlshow | grep -q "^| $old_db_name" then old_db_user=$old_db_name db_pwd=$(ynh_app_setting_get --app=$old_app --key=mysqlpwd) @@ -215,7 +214,7 @@ ynh_handle_app_migration () { # Create a new database ynh_mysql_setup_db --db_user=$new_db_user --db_name=$new_db_name --db_pwd=$db_pwd - + # Then restore the old one into the new one ynh_mysql_connect_as --user=$new_db_user --password=$db_pwd --database=$new_db_name < "$sql_dump" diff --git a/scripts/install b/scripts/install index c251a96..7b2f7e9 100644 --- a/scripts/install +++ b/scripts/install @@ -100,6 +100,7 @@ ynh_script_progression --message="Adding a configuration file..." --weight=5 # create a key for the secret key CSFR: secret_key=$(ynh_string_random --length=50) +ynh_app_setting_set --app=$app --key=secret_key --value=$secret_key # Install configuration files ynh_add_config --template="config.local.php" --destination="$final_path/config.local.php" diff --git a/scripts/upgrade b/scripts/upgrade index 194e02e..73c67d1 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -39,9 +39,18 @@ ynh_script_progression --message="Backing up the app before upgrading (may take # Backup the current version of the app ynh_backup_before_upgrade +ynh_clean_setup_migration() { + yunohost app remove $app + app=garradin ynh_restore_upgradebackup +} + ynh_clean_setup () { # Restore it if the upgrade fails - ynh_restore_upgradebackup + if [[ $migration_process -eq 1 ]]; then + ynh_clean_setup_migration + else + ynh_restore_upgradebackup + fi } # Exit if an error occurs during the execution of the script ynh_abort_if_errors @@ -71,17 +80,13 @@ fi #================================================= [[ $YNH_APP_ID == "garradin" ]] \ - && [[ "$(cat "$final_path/VERSION")" != 1.2.2 ]] \ - && ynh_die --message "It look like that you have an old Garradin install. You need first upgrade Garradin instance (id: $garradin_migrate_id) and after migrate to Paheko." + && [[ "$(cat "$final_path/VERSION")" != 1.2.2 ]] \ + && ynh_die --message "It looks like that you have an old Garradin installed. You need to first upgrade your Garradin instance (id: $garradin_migrate_id) and after to migrate to Paheko." + ynh_handle_app_migration --migration_id=garradin --migration_list=garradin_migrations if [[ $migration_process -eq 1 ]]; then - final_path="/var/www/$app" - - # Replace the user - ynh_system_user_delete --username=$old_app - ynh_system_user_create --username=$app || \ - ynh_die --message "Unable to create $app system account" + final_path=$(ynh_app_setting_get --app=$app --key=final_path) fi #================================================= @@ -184,19 +189,19 @@ ynh_systemd_action --service_name=nginx --action=reload #================================================= if [[ $migration_process -eq 1 ]]; then - echo "Garradin has been successfully migrated to Paheko! \ -A last scheduled operation will run in a couple of minutes to finish the \ -migration in YunoHost side. Do not proceed any application operation while \ -you don't see Garradin as installed." >&2 + echo "Garradin has been successfully migrated to Paheko! \ + A last scheduled operation will run in a couple of minutes to finish the \ + migration in YunoHost side. Do not proceed any application operation while \ + you don't see Garradin as installed." >&2 - # Execute a post migration script after the end of this upgrade. - # Mainly for some cleaning - script_post_migration=garradin_post_migration.sh - ynh_replace_string --match_string __OLD_APP__ --replace_string "$old_app" --target_file ../conf/$script_post_migration - ynh_replace_string --match_string __NEW_APP__ --replace_string "$app" --target_file ../conf/$script_post_migration - cp ../conf/$script_post_migration /tmp - chmod +x /tmp/$script_post_migration - (cd /tmp; echo "/tmp/$script_post_migration > /tmp/$script_post_migration.log 2>&1" | at now + 2 minutes) + # Execute a post migration script after the end of this upgrade. + # Mainly for some cleaning + script_post_migration=garradin_post_migration.sh + ynh_replace_string --match_string __OLD_APP__ --replace_string "$old_app" --target_file ../conf/$script_post_migration + ynh_replace_string --match_string __NEW_APP__ --replace_string "$app" --target_file ../conf/$script_post_migration + cp ../conf/$script_post_migration /tmp + chmod +x /tmp/$script_post_migration + (cd /tmp; echo "/tmp/$script_post_migration > /tmp/$script_post_migration.log 2>&1" | at now + 2 minutes) fi #================================================= From b0451fc73074499667adb763bbe29fd9fff92461 Mon Sep 17 00:00:00 2001 From: Florent Date: Thu, 2 Feb 2023 16:15:15 +0100 Subject: [PATCH 22/30] Fix migration --- conf/garradin_post_migration.sh | 4 +++- scripts/upgrade | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/conf/garradin_post_migration.sh b/conf/garradin_post_migration.sh index 4b75453..b79eab4 100644 --- a/conf/garradin_post_migration.sh +++ b/conf/garradin_post_migration.sh @@ -22,7 +22,9 @@ script_name="$0" # DELETE OLD APP'S SETTINGS #================================================= -ynh_secure_remove --file="/etc/yunohost/apps/$old_app" +# `app=""` Circumvents this issue: https://github.com/YunoHost/issues/issues/2138 +app="" ynh_secure_remove --file="/etc/yunohost/apps/$old_app" + yunohost app ssowatconf diff --git a/scripts/upgrade b/scripts/upgrade index 73c67d1..ef16638 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -87,6 +87,8 @@ ynh_handle_app_migration --migration_id=garradin --migration_list=garradin_migra if [[ $migration_process -eq 1 ]]; then final_path=$(ynh_app_setting_get --app=$app --key=final_path) + ynh_permission_update --permission="main" --add="all_users" + ynh_permission_update --permission="main" --add="visitors" fi #================================================= From 111912e8e1cab1b3016c0cd4a1f890c3caf5fe2e Mon Sep 17 00:00:00 2001 From: Florent Date: Thu, 2 Feb 2023 16:54:06 +0100 Subject: [PATCH 23/30] Generate secret_key on upgrade if it does not exist and store it --- scripts/upgrade | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index ef16638..0f4b404 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -68,6 +68,13 @@ if [ -z "$final_path" ]; then ynh_app_setting_set --app=$app --key=final_path --value=$final_path fi +# If secret_key doesn't exist, create it +if [[ -z "$secret_key" ]]; then + secret_key=$(ynh_string_random --length=50) + ynh_app_setting_set --app=$app --key=secret_key --value=$secret_key +fi + + # Cleaning legacy permissions if ynh_legacy_permissions_exists; then ynh_legacy_permissions_delete_all From cd5eb4f287c21d7c99f4b99bcc7daf717798f068 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 8 Feb 2023 06:15:41 +0000 Subject: [PATCH 24/30] Upgrade to v1.2.6 --- conf/app.src | 4 ++-- manifest.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/app.src b/conf/app.src index 3d5fb91..c093286 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://fossil.kd2.org/paheko/uv/paheko-1.2.4.tar.gz -SOURCE_SUM=50f0bfe9c05d2ee1664cbb0440602bdca576f23144e85fa5f9e27feeff36494c +SOURCE_URL=https://fossil.kd2.org/paheko/uv/paheko-1.2.6.tar.gz +SOURCE_SUM=544660b7a1a45466d4d6b23f26661f5791f46abee0698dc1b1b4365d66053e85 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index 4e2934e..42b5d20 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Software to manage association", "fr": "Logiciel libre de gestion d'association" }, - "version": "1.2.4~ynh1", + "version": "1.2.6~ynh1", "url": "https://paheko.cloud", "upstream": { "license": "GPL-3.0-or-later", From f84f8d8c630c34f4ebd83d8540d12714dfee2a2a Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 8 Feb 2023 06:15:45 +0000 Subject: [PATCH 25/30] 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 0caef11..f4bff58 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ You can now upgrade Garradin with Paheko ! ![Logo Paheko](https://master.garradin.eu/garradin-devient-paheko/logo_v3_small-fs8.png) -**Shipped version:** 1.2.4~ynh1 +**Shipped version:** 1.2.6~ynh1 **Demo:** https://paheko.cloud/essai/ diff --git a/README_fr.md b/README_fr.md index 6c3a7dc..3940bb6 100644 --- a/README_fr.md +++ b/README_fr.md @@ -29,7 +29,7 @@ Paheko (Nous avons choisi le nom Paheko, un mot de la langue Māori qui signifie ![Logo Paheko](https://master.garradin.eu/garradin-devient-paheko/logo_v3_small-fs8.png) -**Version incluse :** 1.2.4~ynh1 +**Version incluse :** 1.2.6~ynh1 **Démo :** https://paheko.cloud/essai/ From c98ba3893a5227edd686cd280c70bdc420daf3d9 Mon Sep 17 00:00:00 2001 From: Florent Date: Wed, 8 Feb 2023 12:00:12 +0100 Subject: [PATCH 26/30] Add instructions for migration in DISCLAIMER --- doc/DISCLAIMER.md | 9 +++++++++ doc/DISCLAIMER_fr.md | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md index e69de29..a6f8d63 100644 --- a/doc/DISCLAIMER.md +++ b/doc/DISCLAIMER.md @@ -0,0 +1,9 @@ +### Migrate from Garradin + +This package handle the migration from Garradin to Paheko. For that, you will have to upgrade your Garradin application with this repository. This can only be done from the command-line interface - e.g. through SSH. Once you're connected, you simply have to execute the following: + +```bash +sudo yunohost app upgrade garradin -u https://github.com/YunoHost-Apps/paheko_ynh --debug +``` + +The --debug option will let you see the full output. If you encounter any issue, please report it aand paste the logs. diff --git a/doc/DISCLAIMER_fr.md b/doc/DISCLAIMER_fr.md index e69de29..84b51f8 100644 --- a/doc/DISCLAIMER_fr.md +++ b/doc/DISCLAIMER_fr.md @@ -0,0 +1,9 @@ +### Migrer depuis Garradin + +Ce paquet supporte la migration de Garradin vers Paheko. Pour ce faire, vous allez devoir mettre à jour l'application Garradin à l'aide de ce dépôt. Cette opération ne peut se faire seulement depuis une interface en ligne de commande, autrement dit en SSH. Une fois connecté/e, vous devez simplement lancer la commande suivante : + +```bash +sudo yunohost app upgrade garradin -u https://github.com/YunoHost-Apps/paheko_ynh --debug +``` + +L'option debug vous permet de voir l'entièreté du journal d'installation. Si vous rencontrez des difficultés, merci de créer un ticket en collant le journal d'erreur. From a6364b37a4452bd395a03cb4e158f43ee399338c Mon Sep 17 00:00:00 2001 From: Florent Date: Wed, 8 Feb 2023 14:14:46 +0100 Subject: [PATCH 27/30] Ask for waiting after migration --- doc/DISCLAIMER.md | 2 ++ doc/DISCLAIMER_fr.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md index a6f8d63..db374e4 100644 --- a/doc/DISCLAIMER.md +++ b/doc/DISCLAIMER.md @@ -7,3 +7,5 @@ sudo yunohost app upgrade garradin -u https://github.com/YunoHost-Apps/paheko_yn ``` The --debug option will let you see the full output. If you encounter any issue, please report it aand paste the logs. + +**Important**: After the migration, you'll have to wait a couple of minutes (at most 3 minutes) before you can start using Paheko. diff --git a/doc/DISCLAIMER_fr.md b/doc/DISCLAIMER_fr.md index 84b51f8..5bf41c2 100644 --- a/doc/DISCLAIMER_fr.md +++ b/doc/DISCLAIMER_fr.md @@ -7,3 +7,5 @@ sudo yunohost app upgrade garradin -u https://github.com/YunoHost-Apps/paheko_yn ``` L'option debug vous permet de voir l'entièreté du journal d'installation. Si vous rencontrez des difficultés, merci de créer un ticket en collant le journal d'erreur. + +**Important** : Après la migration, veuillez attendre quelques instants (maximum 3 minutes) avant de commencer à utiliser Paheko. From 1e670288c574b48b6f69bf7ac75948f940043c4c Mon Sep 17 00:00:00 2001 From: Florent Date: Wed, 8 Feb 2023 14:08:45 +0100 Subject: [PATCH 28/30] Remove PHP sessions after migration --- conf/garradin_post_migration.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/conf/garradin_post_migration.sh b/conf/garradin_post_migration.sh index b79eab4..a0395c2 100644 --- a/conf/garradin_post_migration.sh +++ b/conf/garradin_post_migration.sh @@ -18,6 +18,12 @@ old_app="__OLD_APP__" new_app="__NEW_APP__" script_name="$0" +#================================================= +# DELETE OLD APP'S SESSIONS +#================================================= + +[ -n "$old_app" ] && find /var/lib/php/sessions/ -user "$old_app" -delete + #================================================= # DELETE OLD APP'S SETTINGS #================================================= From 14c16bdc6aa8f0f0c3726a9888d9c85ceadf9f3e Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 8 Feb 2023 14:05:23 +0000 Subject: [PATCH 29/30] Auto-update README --- README.md | 14 ++++++++++++++ README_fr.md | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/README.md b/README.md index f4bff58..c6ae995 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,20 @@ You can now upgrade Garradin with Paheko ! ![Screenshot of Paheko](./doc/screenshots/screenshot.png) +## Disclaimers / important information + +### Migrate from Garradin + +This package handle the migration from Garradin to Paheko. For that, you will have to upgrade your Garradin application with this repository. This can only be done from the command-line interface - e.g. through SSH. Once you're connected, you simply have to execute the following: + +```bash +sudo yunohost app upgrade garradin -u https://github.com/YunoHost-Apps/paheko_ynh --debug +``` + +The --debug option will let you see the full output. If you encounter any issue, please report it aand paste the logs. + +**Important**: After the migration, you'll have to wait a couple of minutes (at most 3 minutes) before you can start using Paheko. + ## Documentation and resources * Official app website: diff --git a/README_fr.md b/README_fr.md index 3940bb6..8197911 100644 --- a/README_fr.md +++ b/README_fr.md @@ -37,6 +37,20 @@ Paheko (Nous avons choisi le nom Paheko, un mot de la langue Māori qui signifie ![Capture d’écran de Paheko](./doc/screenshots/screenshot.png) +## Avertissements / informations importantes + +### Migrer depuis Garradin + +Ce paquet supporte la migration de Garradin vers Paheko. Pour ce faire, vous allez devoir mettre à jour l'application Garradin à l'aide de ce dépôt. Cette opération ne peut se faire seulement depuis une interface en ligne de commande, autrement dit en SSH. Une fois connecté/e, vous devez simplement lancer la commande suivante : + +```bash +sudo yunohost app upgrade garradin -u https://github.com/YunoHost-Apps/paheko_ynh --debug +``` + +L'option debug vous permet de voir l'entièreté du journal d'installation. Si vous rencontrez des difficultés, merci de créer un ticket en collant le journal d'erreur. + +**Important** : Après la migration, veuillez attendre quelques instants (maximum 3 minutes) avant de commencer à utiliser Paheko. + ## Documentations et ressources * Site officiel de l’app : From ff9df8efcff0f3a6497fdf409cb8bff46f221df0 Mon Sep 17 00:00:00 2001 From: Robles Rodolphe Date: Sun, 12 Feb 2023 14:38:29 +0100 Subject: [PATCH 30/30] sha256sum update --- conf/app.src | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/app.src b/conf/app.src index c093286..192f8db 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ SOURCE_URL=https://fossil.kd2.org/paheko/uv/paheko-1.2.6.tar.gz -SOURCE_SUM=544660b7a1a45466d4d6b23f26661f5791f46abee0698dc1b1b4365d66053e85 +SOURCE_SUM=bb1475aac6c41c8aedaa7191ec5df5f0a0516e3a93680fadcd45663545ec8b1f SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true