From 25def532d8b64f30feb2c264ef2b9f9141eabd83 Mon Sep 17 00:00:00 2001 From: anmol26s Date: Mon, 15 Feb 2021 00:12:41 +0530 Subject: [PATCH 1/5] Updated to latest version --- README.md | 2 +- conf/app.src | 4 +- conf/app_addons.src | 4 +- manifest.json | 2 +- scripts/install | 33 ++++++++++++++-- scripts/upgrade | 91 +++++++++++++++++++++++++++++++-------------- 6 files changed, 100 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index 2a4c78d..7d029ee 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.* -Version: 2020-11-26 +Version: 21.02.11 ### Interesting links diff --git a/conf/app.src b/conf/app.src index 7a1ae2d..e7fe09c 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://codeberg.org/zot/zap/archive/fe8db82c6e31e7ce7255a086814d285d3dcbe5b8.tar.gz -SOURCE_SUM=59d081cd8525a55ed18fa0cec37181821b6ee305a1df8aa23bfcff48b85b8f7f +SOURCE_URL=https://codeberg.org/zot/zap/archive/4a62de088cc36027d6b1cb99c01eee12a18c3ce9.tar.gz +SOURCE_SUM=03ae2135792ce58823a44c216a75b14c0539fd9732d4520814db472405bdd6b0 SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR= SOURCE_FILENAME= diff --git a/conf/app_addons.src b/conf/app_addons.src index d18f4b2..1e8346c 100644 --- a/conf/app_addons.src +++ b/conf/app_addons.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://codeberg.org/zot/zap-addons/archive/6a888a5ba705fd9e2231322db9bb402abdc577f5.tar.gz -SOURCE_SUM=75d95927eeb2ab92d152796654d4e5fb35dcdea9d1d39613812034b74c481568 +SOURCE_URL=https://codeberg.org/zot/zap-addons/archive/756560a51d600b52447c810929cea88d717e95fc.tar.gz +SOURCE_SUM=99af572f730293687129f67d22a6576cc93751d808b5371af110fb836ef345d1 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR= diff --git a/manifest.json b/manifest.json index 230ba93..f400a71 100644 --- a/manifest.json +++ b/manifest.json @@ -5,7 +5,7 @@ "description": { "en": "A fediverse server." }, - "version": "2020-11-26~ynh1", + "version": "21.02.11~ynh1", "url": "https://zotlabs.com/zap/", "license": "MIT", "maintainer": { diff --git a/scripts/install b/scripts/install index f8d53fa..55f5df3 100755 --- a/scripts/install +++ b/scripts/install @@ -79,16 +79,43 @@ ynh_script_progression --message="Setting up Zap 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" +git clone clone https://codeberg.org/zot/zap.git "$final_path" + # 2 - Zap Addons # Make addon Directory and unpack the addons to this directory ynh_script_progression --message="Create addon directory inside root folder..." -mkdir $final_path/addon ynh_script_progression --message="Setting up Zap addons source files..." -ynh_setup_source --dest_dir="$final_path/addon" --source_id="app_addons" +pushd "$final_path" + mkdir -p extend/addon/zaddons + mkdir addon + git clone https://codeberg.org/zot/zap-addons.git $final_path/extend/addon/zaddons + filelist=(`ls extend/addon/zaddons`) + cd addon + for a in "${filelist[@]}" ; do + base=`basename $a` + if [ $base = '.git' ]; then + #echo 'ignoring git' + continue; + fi + if [ ! -d ../extend/addon/zaddons/$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/zaddons/$base $base + done + +popd + # 3 - Some extra folders diff --git a/scripts/upgrade b/scripts/upgrade index 48046aa..ce7fbf1 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -58,16 +58,11 @@ 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" -cp -a "$final_path/cache" "$tmpdir/cache" + # Remove the app directory securely -ynh_secure_remove "$final_path" +# ynh_secure_remove "$final_path" # If final_path doesn't exist, create it if [ -z "$final_path" ]; then @@ -75,17 +70,6 @@ if [ -z "$final_path" ]; then ynh_app_setting_set --app=$app --key=final_path --value=$final_path fi -#================================================= -# STANDARD UPGRADE STEPS -#================================================= -# DOWNLOAD, CHECK AND UNPACK SOURCE -#================================================= - -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" - #================================================= # STANDARD UPGRADE STEPS @@ -95,16 +79,69 @@ ynh_setup_source --dest_dir="$final_path" 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" +# ynh_setup_source --dest_dir="$final_path" -cp -a "$tmpdir/cache" "${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 --file="$tmpdir" -chmod -R 777 $final_path/store -mkdir $final_path/addon -ynh_setup_source --dest_dir="$final_path/addon" --source_id="app_addons" +if [ `cd $final_path && git rev-parse --is-inside-work-tree` ]; then + pushd "$final_path" + git pull + cd extend/addon/zaddons + git pull + cd ../../.. + filelist=(`ls extend/addon/zaddons`) + cd addon + for a in "${filelist[@]}" ; do + base=`basename $a` + if [ $base = '.git' ]; then + #echo 'ignoring git' + continue; + fi + if [ ! -d ../extend/addon/zaddons/$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/zaddons/$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" + cp -a "$final_path/cache" "$tmpdir/cache" + + # 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/cache" "${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 --file="$tmpdir" + chmod -R 777 $final_path/store + mkdir $final_path/addon + ynh_setup_source --dest_dir="$final_path/addon" --source_id="app_addons" + +fi #================================================= From d08102a85b064a2aa75d2e9884c2dbcf7f68ad26 Mon Sep 17 00:00:00 2001 From: anmol26s Date: Mon, 15 Feb 2021 00:53:41 +0530 Subject: [PATCH 2/5] Fixed git issue --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 55f5df3..5805ce5 100755 --- a/scripts/install +++ b/scripts/install @@ -79,7 +79,7 @@ ynh_script_progression --message="Setting up Zap 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 -git clone clone https://codeberg.org/zot/zap.git "$final_path" +git clone https://codeberg.org/zot/zap.git "$final_path" # 2 - Zap Addons From 5318479187987c79f29f494c21ad49c007ae9bd7 Mon Sep 17 00:00:00 2001 From: anmol26s Date: Mon, 15 Feb 2021 03:59:41 +0530 Subject: [PATCH 3/5] Duplicate links --- README.md | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/README.md b/README.md index 07d9f19..b9d73be 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # ZAP for YunoHost -[![Integration level](https://dash.yunohost.org/integration/zap.svg)](https://dash.yunohost.org/appci/app/zap) ![](https://ci-apps.yunohost.org/ci/badges/zap.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/zap.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/zap.svg)](https://dash.yunohost.org/appci/app/zap) ![](https://ci-apps.yunohost.org/ci/badges/zap.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/zap.maintain.svg) [![Install Zap with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=zap) > *This package allow you to install ZAP quickly and simply on a YunoHost server. @@ -10,14 +10,6 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to Version: 21.02.11 -### Interesting links - -- [YunoHost project](https://yunohost.org) -- [Zap website](https://zotlabs.com/zap/) -- [Zap code on codeberg](https://codeberg.org/zot/zap) -- [Zap addons on codeberg](https://codeberg.org/zot/zap-addons) - - ## Overview [Zap](https://zotlabs.com/zap/) is an an ethical alternative to Fediverse that provides powerful features for creating interconnected websites featuring a decentralized identity, communications, and permissions framework built using common webserver technology. From e3ef4ffdbbdd7670f40491d1529233ba95760333 Mon Sep 17 00:00:00 2001 From: anmol26s Date: Mon, 15 Feb 2021 20:26:45 +0530 Subject: [PATCH 4/5] Updated readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index b9d73be..c51fad9 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Integration level](https://dash.yunohost.org/integration/zap.svg)](https://dash.yunohost.org/appci/app/zap) ![](https://ci-apps.yunohost.org/ci/badges/zap.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/zap.maintain.svg) + [![Install Zap with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=zap) > *This package allow you to install ZAP quickly and simply on a YunoHost server. From 598be3091960d13517619f7d7d4896d681fa51ff Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 15 Feb 2021 16:15:15 +0100 Subject: [PATCH 5/5] Update README.md --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index c51fad9..935b4f1 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ # ZAP for YunoHost - -[![Integration level](https://dash.yunohost.org/integration/zap.svg)](https://dash.yunohost.org/appci/app/zap) ![](https://ci-apps.yunohost.org/ci/badges/zap.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/zap.maintain.svg) - +[![Integration level](https://dash.yunohost.org/integration/zap.svg)](https://dash.yunohost.org/appci/app/zap) ![](https://ci-apps.yunohost.org/ci/badges/zap.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/zap.maintain.svg) [![Install Zap with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=zap) > *This package allow you to install ZAP quickly and simply on a YunoHost server.