diff --git a/check_process b/check_process index d2e1b4e..24fe02c 100644 --- a/check_process +++ b/check_process @@ -2,7 +2,6 @@ auto_remove=1 ; Manifest domain="domain.tld" (DOMAIN) - path="/" (PATH) admin="john" (USER) ; Checks pkg_linter=1 @@ -11,8 +10,8 @@ setup_nourl=0 setup_private=0 setup_public=1 - upgrade=0 - backup_restore=0 + upgrade=1 + backup_restore=1 multi_instance=0 incorrect_path=1 port_already_use=0 diff --git a/scripts/install b/scripts/install index a19dda8..a18665f 100644 --- a/scripts/install +++ b/scripts/install @@ -24,7 +24,7 @@ ynh_abort_if_errors domain=$YNH_APP_ARG_DOMAIN path_url='/' admin=$YNH_APP_ARG_ADMIN -is_public='true' +is_public=1 # This is a multi-instance app, meaning it can be installed several times independently # The id of the app as stated in the manifest is available as $YNH_APP_ID diff --git a/scripts/upgrade b/scripts/upgrade new file mode 100644 index 0000000..de58645 --- /dev/null +++ b/scripts/upgrade @@ -0,0 +1,73 @@ +#!/bin/bash + +#================================================= +# GENERIC START +#================================================= +# IMPORT GENERIC HELPERS +#================================================= + +source _common.sh +source /usr/share/yunohost/helpers + +#================================================= +# LOAD SETTINGS +#================================================= + +app=$YNH_APP_INSTANCE_NAME + +domain=$(ynh_app_setting_get $app domain) +path_url=$(ynh_app_setting_get $app path) +final_path=$(ynh_app_setting_get $app final_path) + +CHECK_PATH # Vérifie et corrige la syntaxe du path. + + + +#================================================= +# CHECK THE PATH +#================================================= + +# Normalize the URL path syntax +path_url=$(ynh_normalize_url_path $path_url) + + +# Make backup of old app folder and create again the app folder +sudo mv ${final_path} ${final_path}.old + +# Download, check integrity, uncompress and patch the source from app.src +ynh_setup_source "$final_path" +sudo cp -a ${final_path}.old/.htconfig.php ${final_path} +sudo rm -Rf ${final_path}.old + +#Copy Addons +addons_file=`sudo cat ../conf/friendica-addons/source_file`; +sudo wget -nv -i ../conf/friendica-addons/source_url -O ${addons_file}.zip +sudo md5sum -c ../conf/friendica-addons/source_md5 --status || (echo "Corrupt source" >&2 && false) +sudo unzip -q ${addons_file}.zip -d ../conf/friendica-addons/ +sudo mkdir $final_path/addon +sudo cp -r ../conf/friendica-addons/${addons_file}/. $final_path/addon + +# 3 - some extra folders +sudo chmod -R 777 $final_path/view/smarty3 + + + +# Set www-data to owner +sudo chown -R www-data:www-data $final_path + +# Create a dedicated nginx config +ynh_add_nginx_config +# configure friendica + +# Set up poller +sed -i "s@YNH_WWW_PATH@$final_path@g" ../conf/poller-cron +sudo cp ../conf/poller-cron /etc/cron.d/$app + + +ynh_app_setting_set $app skipped_uris "/" + + +# Reload services +sudo service php5-fpm reload || true +sudo service nginx reload || true +sudo yunohost app ssowatconf