mirror of
https://github.com/YunoHost-Apps/friendica_ynh.git
synced 2024-09-03 18:36:14 +02:00
Added upgarde script,changes in install script and check_process
This commit is contained in:
parent
5911c17f7a
commit
36c210b337
3 changed files with 76 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
73
scripts/upgrade
Normal file
73
scripts/upgrade
Normal file
|
@ -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
|
Loading…
Add table
Reference in a new issue