From ae293d955cddcf750f2a5a91606160401f27dd23 Mon Sep 17 00:00:00 2001 From: anmol26s Date: Sun, 14 Feb 2021 04:32:55 +0530 Subject: [PATCH 1/5] Updated to version --- README.md | 2 +- conf/app.src | 4 ++-- conf/app_addons.src | 4 ++-- manifest.json | 2 +- scripts/install | 12 ++++++++---- scripts/upgrade | 45 ++++++++++++++++++++++++++++----------------- 6 files changed, 42 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 81f1a2c9..a1792490 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to ## Overview [Hubzilla](https://hub.libranet.de/directory?f=&global=1&pubforums=1) is a social networking platform built with control of your privacy at center stage. Your online communications can be as public as you wish or as private as you require. Private conversations, private photos, private videos. Your media isn't hidden behind an obscure URL which can be guessed, it is protected by state-of-the-art cross-domain authentication. What this all means for you: **less drama**. -**Shipped version:** 5.2.1 +**Shipped version:** 5.2.2 ## Screenshots diff --git a/conf/app.src b/conf/app.src index b70901a4..4ad041db 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://framagit.org/hubzilla/core/-/archive/5.2.1/core-5.2.1.tar.gz -SOURCE_SUM=0fe17e7ce47e02e90159ad4be9b2343d55f7aabdcc2bd996cb88e205aa6cc986 +SOURCE_URL=https://framagit.org/hubzilla/core/-/archive/5.2.2/core-5.2.2.tar.gz +SOURCE_SUM=827068a332f464d3ebd49531943169f1eef3e1b23102b9a9ddfb52e44b9138d8 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR= diff --git a/conf/app_addons.src b/conf/app_addons.src index ce716af0..66476e08 100644 --- a/conf/app_addons.src +++ b/conf/app_addons.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://framagit.org/hubzilla/addons/-/archive/5.2.1/addons-5.2.1.tar.gz -SOURCE_SUM=fbe5268f7e764edfcf2137362762cf3b0e29bf74dbae23b76fb1e418597cd74f +SOURCE_URL=https://framagit.org/hubzilla/addons/-/archive/5.2.2/addons-5.2.2.tar.gz +SOURCE_SUM=074559f51107f27d6eb4806c77ede213ca77b608a9c2c5b870138f587d8776ca SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR= diff --git a/manifest.json b/manifest.json index f554741f..4c9f71b3 100644 --- a/manifest.json +++ b/manifest.json @@ -8,7 +8,7 @@ }, "url": "https://zotlabs.org/page/hubzilla/hubzilla-project", "license": "MIT", - "version": "5.2.1~ynh1", + "version": "5.2.2~ynh1", "maintainer": { "name": "Anmol Sharma" }, diff --git a/scripts/install b/scripts/install index 48f80b71..3f64e949 100755 --- a/scripts/install +++ b/scripts/install @@ -76,18 +76,22 @@ fi # 1 - Hubzilla ynh_script_progression --message="Setting up Hubzilla source files..." +git clone https://framagit.org/hubzilla/core.git "$final_path" + 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" +# ynh_setup_source --dest_dir="$final_path" # 2 - Hubzilla Addons # Make addon Directory and unpack the Hubzilla addons to this directory ynh_script_progression --message="Create addon directory inside Hubzilla root folder..." -mkdir $final_path/addon -ynh_script_progression --message="Setting up Hubzilla addons source files..." +# mkdir $final_path/addon +# ynh_script_progression --message="Setting up Hubzilla addons source files..." -ynh_setup_source --dest_dir="$final_path/addon" --source_id="app_addons" +# ynh_setup_source --dest_dir="$final_path/addon" --source_id="app_addons" + + `cd "$final_path" util/add_addon_repo https://framagit.org/hubzilla/addons.git hzaddons` # 3 - Some extra folders ynh_script_progression --message="Creating smarty3 folder for personal data..." diff --git a/scripts/upgrade b/scripts/upgrade index b6f8812f..623c50c8 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -56,15 +56,7 @@ ynh_abort_if_errors #================================================= ynh_print_info "Upgrading source files..." -# Create a temporary directory -tmpdir="$(ynh_smart_mktemp 6000)" -# Backup the config file in the temp dir -cp -a "$final_path/.htconfig.php" "$tmpdir/.htconfig.php" -cp -a "$final_path/store" "$tmpdir/store" -cp -a "$final_path/php.log" "$tmpdir/php.log" -# Remove the app directory securely -ynh_secure_remove "$final_path" # If final_path doesn't exist, create it if [ -z "$final_path" ]; then @@ -79,16 +71,35 @@ fi #================================================= ynh_script_progression --message="Upgrading source files..." -# Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$final_path" +if [ `cd $final_path && git rev-parse --is-inside-work-tree` ]; then + `cd $final_path && util/udall` + chmod -R 777 $final_path/store +else + + # Create a temporary directory + tmpdir="$(ynh_smart_mktemp 6000)" + # Backup the config file in the temp dir + cp -a "$final_path/.htconfig.php" "$tmpdir/.htconfig.php" + cp -a "$final_path/store" "$tmpdir/store" + cp -a "$final_path/php.log" "$tmpdir/php.log" + + # 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" + + cp -a "$tmpdir/store" "${final_path}" + cp -a "$tmpdir/.htconfig.php" "${final_path}" + cp -a "$tmpdir/php.log" "${final_path}" + ynh_secure_remove "$tmpdir" + chmod -R 777 $final_path/store + mkdir $final_path/addon + ynh_setup_source --dest_dir="$final_path/addon" --source_id="app_addons" + +fi + -cp -a "$tmpdir/store" "${final_path}" -cp -a "$tmpdir/.htconfig.php" "${final_path}" -cp -a "$tmpdir/php.log" "${final_path}" -ynh_secure_remove "$tmpdir" -chmod -R 777 $final_path/store -mkdir $final_path/addon -ynh_setup_source --dest_dir="$final_path/addon" --source_id="app_addons" #================================================= # NGINX CONFIGURATION From 4d9a8afcf0eea4a0f86f3b433525bdc1dcbe3290 Mon Sep 17 00:00:00 2001 From: anmol26s Date: Sun, 14 Feb 2021 04:40:21 +0530 Subject: [PATCH 2/5] Fixed update --- scripts/install | 2 +- scripts/upgrade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 3f64e949..c73f1f1c 100755 --- a/scripts/install +++ b/scripts/install @@ -91,7 +91,7 @@ ynh_script_progression --message="Create addon directory inside Hubzilla root fo # ynh_setup_source --dest_dir="$final_path/addon" --source_id="app_addons" - `cd "$final_path" util/add_addon_repo https://framagit.org/hubzilla/addons.git hzaddons` + `cd $final_path && util/add_addon_repo https://framagit.org/hubzilla/addons.git hzaddons` # 3 - Some extra folders ynh_script_progression --message="Creating smarty3 folder for personal data..." diff --git a/scripts/upgrade b/scripts/upgrade index 623c50c8..9a216bd2 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -73,7 +73,7 @@ ynh_script_progression --message="Upgrading source files..." if [ `cd $final_path && git rev-parse --is-inside-work-tree` ]; then `cd $final_path && util/udall` - chmod -R 777 $final_path/store + chmod -R 777 $final_path/store else # Create a temporary directory From d79087ba3b43d157cb60d79cabdba416832089ca Mon Sep 17 00:00:00 2001 From: anmol26s Date: Sun, 14 Feb 2021 04:47:07 +0530 Subject: [PATCH 3/5] Fixed install --- scripts/install | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index c73f1f1c..041a66b1 100755 --- a/scripts/install +++ b/scripts/install @@ -91,7 +91,9 @@ ynh_script_progression --message="Create addon directory inside Hubzilla root fo # ynh_setup_source --dest_dir="$final_path/addon" --source_id="app_addons" - `cd $final_path && util/add_addon_repo https://framagit.org/hubzilla/addons.git hzaddons` +pushd "$final_path" + `util/add_addon_repo https://framagit.org/hubzilla/addons.git hzaddons` +popd # 3 - Some extra folders ynh_script_progression --message="Creating smarty3 folder for personal data..." From b53a15cc5aac93933caf442cdac7302f7b7b8c7b Mon Sep 17 00:00:00 2001 From: anmol26s Date: Sun, 14 Feb 2021 05:23:04 +0530 Subject: [PATCH 4/5] Fixed install --- scripts/install | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 041a66b1..2b5fc5f2 100755 --- a/scripts/install +++ b/scripts/install @@ -92,7 +92,31 @@ ynh_script_progression --message="Create addon directory inside Hubzilla root fo # ynh_setup_source --dest_dir="$final_path/addon" --source_id="app_addons" pushd "$final_path" - `util/add_addon_repo https://framagit.org/hubzilla/addons.git hzaddons` + mkdir -p extend/addon/hzaddons + mkdir addon + git clone https://framagit.org/hubzilla/addons.git $final_path/extend/addon/hzaddons + filelist=(`ls extend/addon/hzaddons`) + cd addon + for a in "${filelist[@]}" ; do + base=`basename $a` + if [ $base = '.git' ]; then + #echo 'ignoring git' + continue; + fi + if [ ! -d ../extend/addon/hzaddons/$base ]; then + #echo $a 'not a directory' + continue; + fi + if [ -x $base ]; then + #echo $base 'file exists' + continue; + fi + + echo linking $base + + ln -s ../extend/addon/hzaddons/$base $base +done + popd # 3 - Some extra folders From 4fe593702aa9ffe357cd160ffec530134a24f917 Mon Sep 17 00:00:00 2001 From: anmol26s Date: Sun, 14 Feb 2021 05:39:24 +0530 Subject: [PATCH 5/5] Fixed install & install --- scripts/install | 2 +- scripts/upgrade | 36 ++++++++++++++++++++++++++++++++++-- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 2b5fc5f2..3ecc821a 100755 --- a/scripts/install +++ b/scripts/install @@ -115,7 +115,7 @@ pushd "$final_path" echo linking $base ln -s ../extend/addon/hzaddons/$base $base -done + done popd diff --git a/scripts/upgrade b/scripts/upgrade index 9a216bd2..a928e9db 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -72,8 +72,40 @@ fi ynh_script_progression --message="Upgrading source files..." if [ `cd $final_path && git rev-parse --is-inside-work-tree` ]; then - `cd $final_path && util/udall` - chmod -R 777 $final_path/store + pushd "$final_path" + git pull + cd extend/addon/hzaddons + git pull + cd ../../.. + filelist=(`ls extend/addon/hzaddons`) + cd addon + for a in "${filelist[@]}" ; do + base=`basename $a` + if [ $base = '.git' ]; then + #echo 'ignoring git' + continue; + fi + if [ ! -d ../extend/addon/hzaddons/$base ]; then + #echo $a 'not a directory' + continue; + fi + if [ -x $base ]; then + #echo $base 'file exists' + continue; + fi + + echo linking $base + + ln -s ../extend/addon/hzaddons/$base $base + done + for x in `ls` ; do + if [ -L "$x" ] && ! [ -e "$x" ]; then + echo "removing dead symlink $x" ; + rm -- "$x"; + fi; + done + popd + chmod -R 777 $final_path/store else # Create a temporary directory