From ce5ca666d30d41fd7e438395fd32935064ec904b Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 11 Jun 2022 10:25:22 +0200 Subject: [PATCH 1/4] 2022.06 --- conf/local-sample.config.php | 4 ++-- manifest.json | 10 +++++----- scripts/_common.sh | 10 +++++----- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/conf/local-sample.config.php b/conf/local-sample.config.php index 882204e..2e7d58a 100644 --- a/conf/local-sample.config.php +++ b/conf/local-sample.config.php @@ -19,7 +19,7 @@ return [ 'database' => [ 'hostname' => 'localhost', - 'username' => '__DB_NAME__', + 'username' => '__DB_USER__', 'password' => '__DB_PWD__', 'database' => '__DB_NAME__', 'charset' => 'utf8mb4', @@ -38,7 +38,7 @@ return [ 'register_text' => '', ], 'system' => [ - 'default_timezone' => 'UTC', + 'default_timezone' => '__TIMEZONE__', 'language' => '__LANGUAGE__', ], ]; diff --git a/manifest.json b/manifest.json index 4ca9313..34ea90c 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Social Communication Server", "fr": "Serveur de Communication Social" }, - "version": "2022.03~ynh1", + "version": "2022.06~ynh1", "url": "http://friendi.ca", "upstream": { "license": "AGPL-3.0-only", @@ -21,17 +21,17 @@ "name": "Anmol Sharma", "email": "" }, - "requirements": { - "yunohost": ">= 4.3.0" - }, "previous_maintainers": { "name": "aymhce", "email": "aymhce@gmail.com" }, + "requirements": { + "yunohost": ">= 4.3.0" + }, "multi_instance": true, "services": [ "nginx", - "php7.3-fpm", + "php8.0-fpm", "mysql" ], "arguments": { diff --git a/scripts/_common.sh b/scripts/_common.sh index 8c5cefb..2d82671 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,14 +5,14 @@ #================================================= # commit hashes -# 2022.03 -version_commit="f660c3894411d5a55ad201b0da8d46715b5b5002" -addons_version_commit="c35a6d58345ef7f99534f465d8453bccdca80450" +# 2022.06 +version_commit="7fe7d0c90437283bd0e83a7e571e1c032e5168ea" +addons_version_commit="7bb3595d467868170f95fe231edaecf0dd4e84a1" # dependencies used by the app -YNH_PHP_VERSION="7.3" +YNH_PHP_VERSION="8.0" -extra_php_dependencies="php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-imagick php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-gd" +extra_php_dependencies="php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-imagick php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-gd" #================================================= # EXPERIMENTAL HELPERS From 448c82b099811301b15ed74c391ab636bdbebd0a Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sat, 11 Jun 2022 08:25:26 +0000 Subject: [PATCH 2/4] 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 7e0b3ae..f9ce629 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Friendica is a decentralised communications platform that integrates social comm Friendica connects you effortlessly to a federated communications network of several thousand servers, with more than half a million user registrations. You can directly connect to anyone on Friendica, Mastodon, Diaspora, GnuSocial, Pleroma, or Hubzilla, regardless where each user profile is hosted. -**Shipped version:** 2022.03~ynh1 +**Shipped version:** 2022.06~ynh1 **Demo:** https://dir.friendica.social/servers diff --git a/README_fr.md b/README_fr.md index db5ed87..6633e87 100644 --- a/README_fr.md +++ b/README_fr.md @@ -19,7 +19,7 @@ Friendica is a decentralised communications platform that integrates social comm Friendica connects you effortlessly to a federated communications network of several thousand servers, with more than half a million user registrations. You can directly connect to anyone on Friendica, Mastodon, Diaspora, GnuSocial, Pleroma, or Hubzilla, regardless where each user profile is hosted. -**Version incluse :** 2022.03~ynh1 +**Version incluse :** 2022.06~ynh1 **Démo :** https://dir.friendica.social/servers From a1339986a5311dfd5d4c5e73a4439965a1337896 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 11 Jun 2022 10:34:59 +0200 Subject: [PATCH 3/4] Fix --- scripts/_common.sh | 2 +- scripts/install | 12 ++++++++++-- scripts/remove | 1 + scripts/restore | 12 +++++++++++- scripts/upgrade | 10 +++++++++- 5 files changed, 32 insertions(+), 5 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 2d82671..9c2d060 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -12,7 +12,7 @@ addons_version_commit="7bb3595d467868170f95fe231edaecf0dd4e84a1" # dependencies used by the app YNH_PHP_VERSION="8.0" -extra_php_dependencies="php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-imagick php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-gd" +pkg_dependencies="php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-imagick php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-gd" #================================================= # EXPERIMENTAL HELPERS diff --git a/scripts/install b/scripts/install index 13c5e0a..2b528a7 100644 --- a/scripts/install +++ b/scripts/install @@ -29,6 +29,7 @@ path_url='/' admin=$YNH_APP_ARG_ADMIN email=$(ynh_user_get_info --username=$admin --key=mail) language=$YNH_APP_ARG_LANGUAGE +timezone=$(cat /etc/timezone) app=$YNH_APP_INSTANCE_NAME @@ -54,6 +55,13 @@ ynh_app_setting_set --app=$app --key=admin --value=$admin ynh_app_setting_set --app=$app --key=email --value=$email ynh_app_setting_set --app=$app --key=language --value=$language +#================================================= +# INSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Installing dependencies..." --weight=6 + +ynh_install_app_dependencies $pkg_dependencies + #================================================= # CREATE DEDICATED USER #================================================= @@ -127,7 +135,7 @@ ynh_add_config --template="../conf/addon.config.php" --destination="$final_path/ ynh_script_progression --message="Configuring PHP_FPM..." --weight=4 # Create a dedicated PHP-FPM configy -ynh_add_fpm_config --package="$extra_php_dependencies" +ynh_add_fpm_config phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) # 3 - some extra folders @@ -153,7 +161,7 @@ pushd "$final_path" ynh_exec_as "$app" bin/console config system addon ldapauth popd -ynh_mysql_connect_as "$db_name" "$db_pwd" "$db_name" <<< "INSERT INTO addon (id, name, version, installed, hidden, timestamp, plugin_admin) VALUES (NULL, 'ldapauth', '', '1', '0', UNIX_TIMESTAMP(), '0');" +ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" <<< "INSERT INTO addon (id, name, version, installed, hidden, timestamp, plugin_admin) VALUES (NULL, 'ldapauth', '', '1', '0', UNIX_TIMESTAMP(), '0');" #================================================= # RELOAD NGINX diff --git a/scripts/remove b/scripts/remove index 0409f69..9aeee7f 100644 --- a/scripts/remove +++ b/scripts/remove @@ -18,6 +18,7 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) db_name=$(ynh_app_setting_get --app=$app --key=db_name) +db_user=$db_name final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= diff --git a/scripts/restore b/scripts/restore index 16865b2..f6b829e 100644 --- a/scripts/restore +++ b/scripts/restore @@ -53,6 +53,14 @@ ynh_script_progression --message="Restoring the NGINX configuration..." --weight ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" +#================================================= +# REINSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Reinstalling dependencies..." --weight=1 + +# Define and install dependencies +ynh_install_app_dependencies $pkg_dependencies + #================================================= # RESTORE THE MYSQL DATABASE #================================================= @@ -90,7 +98,7 @@ ynh_script_progression --message="Restoring PHP-FPM configuration..." --weight=1 ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" # Recreate a dedicated php-fpm config -ynh_add_fpm_config --package="$extra_php_dependencies" +ynh_add_fpm_config #================================================= # RESTORE THE CRON FILE @@ -98,6 +106,8 @@ ynh_add_fpm_config --package="$extra_php_dependencies" ynh_script_progression --message="Restoring various files..." --weight=1 ynh_restore_file "/etc/cron.d/$app" +chown root: "/etc/cron.d/$app" +chmod 644 "/etc/cron.d/$app" #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index 5ada0d1..3cc9e46 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -26,6 +26,7 @@ email=$(ynh_app_setting_get --app=$app --key=email) admin=$(ynh_app_setting_get --app=$app --key=admin) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) language=$(ynh_app_setting_get --app=$app --key=language) +timezone=$(cat /etc/timezone) #================================================= # CHECK VERSION @@ -171,13 +172,20 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." - # Create a dedicated NGINX config ynh_add_nginx_config +#================================================= +# UPGRADE DEPENDENCIES +#================================================= +ynh_script_progression --message="Upgrading dependencies..." --weight=6 + +ynh_install_app_dependencies $pkg_dependencies + #================================================= # PHP-FPM CONFIGURATION #================================================= ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=4 # Create a dedicated PHP-FPM config -ynh_add_fpm_config --package="$extra_php_dependencies" +ynh_add_fpm_config #================================================= # STORE THE CONFIG FILE CHECKSUM From 0113a43c30783325cd36bced2a4e39620302819b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 13 Jun 2022 22:54:37 +0200 Subject: [PATCH 4/4] set back PHP version --- manifest.json | 2 +- scripts/_common.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/manifest.json b/manifest.json index 34ea90c..f38d21c 100644 --- a/manifest.json +++ b/manifest.json @@ -31,7 +31,7 @@ "multi_instance": true, "services": [ "nginx", - "php8.0-fpm", + "php7.3-fpm", "mysql" ], "arguments": { diff --git a/scripts/_common.sh b/scripts/_common.sh index 9c2d060..43b3013 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -10,9 +10,9 @@ version_commit="7fe7d0c90437283bd0e83a7e571e1c032e5168ea" addons_version_commit="7bb3595d467868170f95fe231edaecf0dd4e84a1" # dependencies used by the app -YNH_PHP_VERSION="8.0" +YNH_PHP_VERSION="7.3" -pkg_dependencies="php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-imagick php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-gd" +pkg_dependencies="php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-imagick php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-gd" #================================================= # EXPERIMENTAL HELPERS