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 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..f38d21c 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,13 +21,13 @@ "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", diff --git a/scripts/_common.sh b/scripts/_common.sh index 8c5cefb..43b3013 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" -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" +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 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