diff --git a/README.md b/README.md index 536c63b..935b4f1 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,16 @@ # 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) [![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. If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.* + +Version: 21.02.11 + ## 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. Compatible with **Mastodon**, **Pleroma**, **Pixelfed**, **Friendica**, **Hubzilla**, **Funkwhale**, **Peertube**, **Plume**, **WriteFreely** and many, many more. diff --git a/conf/app.src b/conf/app.src index a4b347b..e7fe09c 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://codeberg.org/zot/zap/archive/2c9113a53a5aaa5b109a5f099bc012b48063b098.tar.gz -SOURCE_SUM=524a19ff9718c6d98d27f77be396e2300e85eb38eae26b03d6ef98da09a3967e +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/manifest.json b/manifest.json index 6143149..d60b4f8 100644 --- a/manifest.json +++ b/manifest.json @@ -5,7 +5,7 @@ "description": { "en": "A fediverse server." }, - "version": "21.02.05~ynh1", + "version": "21.02.11~ynh1", "url": "https://zotlabs.com/zap/", "license": "MIT", "maintainer": { diff --git a/scripts/install b/scripts/install index c1e738e..11d001d 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 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 897bac0..59b2638 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -58,16 +58,11 @@ ynh_abort_if_errors ynh_script_progression --message="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,15 +70,8 @@ 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 @@ -93,16 +81,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 #================================================= # NGINX CONFIGURATION