From bccd3aacf1dcd8ac34e987e6f0b4de1f5ff621e1 Mon Sep 17 00:00:00 2001 From: Amo Date: Tue, 25 May 2021 02:16:53 +0530 Subject: [PATCH] Updated to 2020.04 --- README.md | 6 +++--- check_process | 4 ++-- conf/addons.src | 4 ++-- conf/app.src | 4 ++-- manifest.json | 4 ++-- scripts/install | 10 +++++----- scripts/upgrade | 44 ++++++++++++++++++++++++++++++++++++++++---- 7 files changed, 56 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index b597609..ee726f7 100644 --- a/README.md +++ b/README.md @@ -10,12 +10,12 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to ## Overview Friendica is a software to create a distributed social network. It is part of the federation of servers that are running with Friendica, Diaspora and Hubzilla which are compatible to each other. -**Version:** 2021.01 +**Version:** 2021.04 Current snapshot in *sources*: -* https://github.com/friendica/friendica: 2021.01 -* https://github.com/friendica/friendica-addons: 2021.01 +* https://github.com/friendica/friendica: 2021.04 +* https://github.com/friendica/friendica-addons: 2021.04 **Warning:** It's advised to use Barracuda as MySQL DB file format for your Friendica database. diff --git a/check_process b/check_process index 4b72b27..5db0593 100644 --- a/check_process +++ b/check_process @@ -10,10 +10,10 @@ setup_private=0 setup_public=1 upgrade=1 - backup_restore=1 + upgrade=1 from_commit=b3642c110f0e927ba36ee32e738a81e6afce958f7ackup_restore=1 multi_instance=1 port_already_use=0 change_url=0 ;;; Options - Email=anmol@datamol.org + Email="" Notification=change diff --git a/conf/addons.src b/conf/addons.src index a0c78eb..711bbcb 100644 --- a/conf/addons.src +++ b/conf/addons.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://files.friendi.ca/friendica-addons-2021.01.tar.gz -SOURCE_SUM=13d1a31373ec3e47913386241f5bee7524c18ddb77258cbf7b410450ec2cd601 +SOURCE_URL=https://files.friendi.ca/friendica-addons-2021.04.tar.gz +SOURCE_SUM=6c798634ce75d25bb71c80a00fcd3b6dd48be3ca2e233ca0f9ed80981cba83af SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/app.src b/conf/app.src index 5a0600c..36543d3 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://files.friendi.ca/friendica-full-2021.01.tar.gz -SOURCE_SUM=b6f6ac81a0dd8e4bd32848ab2b6a54c35baf104d77abb589751fbd4f26edbcd7 +SOURCE_URL=https://files.friendi.ca/friendica-full-2021.04.tar.gz +SOURCE_SUM=440d3a39cd701c3a4179f89fcb1a7197c3bf03f02c087c4a6e1bbe88932a1ce4 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=2 diff --git a/manifest.json b/manifest.json index 34d1ea5..8462dac 100644 --- a/manifest.json +++ b/manifest.json @@ -8,10 +8,10 @@ }, "url": "http://friendi.ca", "license": "AGPL-3.0-only", - "version": "2021.01~ynh2", + "version": "2021.04~ynh2", "maintainer": { "name": "Anmol Sharma", - "email": "anmol@datamol.org" + "email": "" }, "requirements": { "yunohost": ">= 4.1.0" diff --git a/scripts/install b/scripts/install index 696b753..129d95b 100644 --- a/scripts/install +++ b/scripts/install @@ -73,14 +73,14 @@ ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name 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 -ynh_setup_source --dest_dir="$final_path" +# 1- Clone stable repo +$git clone https://github.com/friendica/friendica.git -b stable "$final_path" +# Copy .htaccess-dist to ..htaccess cp -f "$final_path/.htaccess-dist" "$final_path/.htaccess" -# 2 - Addons -mkdir $final_path/addon -ynh_setup_source --dest_dir="$final_path/addon" --source_id="addons" +# 2 - Clone addons repo +git clone https://github.com/friendica/friendica-addons.git -b stable "$final_path/addon" #================================================= # NGINX CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index 7affa29..01fc9b1 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -94,15 +94,52 @@ fi if [ "$upgrade_type" == "UPGRADE_APP" ] then + +# Check if the repo can be updated with git + if [ `cd $final_path && git rev-parse --is-inside-work-tree` ]; + then + # Update through git + pushd "$final_path" + git fetch + git checkout stable + git pull + popd + pushd "$final_path/addon" + git fetch + git checkout stable + git pull + popd +# If git is not present upgrade through manual method +else + + # Create a temporary directory and backup smarty3 folder + tmpdir="$(ynh_smart_mktemp 6000)" ynh_script_progression --message="Upgrading source files..." + cp -a "$final_path/view/smarty3" "$tmpdir/view/smarty3" + + # Remove the app directory securely + ynh_secure_remove "$final_path" # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" + + # Remove the addon directory securely + ynh_secure_remove "$final_path/addon" + + # Remove addon + ynh_secure_remove "$final_path/addon" + # Download, check integrity, uncompress and patch addons + ynh_setup_source --dest_dir="$final_path/addon" --source_id="addons" + + # Restore the smarty3 folder + cp -a "$tmpdir/view/smarty3" "${final_path}" + + fi fi # Copy config file for correct place config="$final_path/config/local.config.php" -cp -f "/var/www/$app/config/local-sample.config.php" $config +cp -a "/var/www/$app/config/local-sample.config.php" $config # Replace strings in config file ynh_replace_string --match_string="your.mysqlhost.com" --replace_string="localhost" --target_file="$config" @@ -112,9 +149,8 @@ ynh_replace_string --match_string="mysqlpassword" --replace_string="$db_pwd ynh_replace_string --match_string="'admin_email' => ''," --replace_string="'admin_email' => '$admin_mail'," --target_file="$config" ynh_replace_string --match_string="OPEN" --replace_string="CLOSED" --target_file="$config" -#Copy Addons -ynh_secure_remove "$final_path/addon" -ynh_setup_source --dest_dir="$final_path/addon" --source_id="addons" +# ldap addon config +cp -f "../conf/addon.config.php" "$final_path/config/." # 3 - some extra folders chmod -R 775 $final_path/view/smarty3