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..3ecc821a 100755 --- a/scripts/install +++ b/scripts/install @@ -76,18 +76,48 @@ 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" + +pushd "$final_path" + 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 ynh_script_progression --message="Creating smarty3 folder for personal data..." diff --git a/scripts/upgrade b/scripts/upgrade index b6f8812f..a928e9db 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,67 @@ 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 + 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 + 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