1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/synapse-admin_ynh.git synced 2024-09-03 20:26:34 +02:00
This commit is contained in:
ericgaspar 2022-01-24 23:05:47 +01:00
parent 988e7180c5
commit 14918e0209
No known key found for this signature in database
GPG key ID: 574F281483054D44
4 changed files with 31 additions and 37 deletions

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/Awesome-Technologies/synapse-admin/archive/refs/tags/0.8.3.tar.gz
SOURCE_SUM=10b8cebe45f3e5edc1817f67e57d9d59535a7aa17eb383b6d31eb2217dd5a898
SOURCE_URL=https://github.com/Awesome-Technologies/synapse-admin/archive/refs/tags/0.8.4.tar.gz
SOURCE_SUM=5c49b539587bb58ccddf0aa102215dfb963b848cab9e8078f1ad5d626ffda98f
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true

View file

@ -82,13 +82,13 @@ ynh_script_progression --message="Setting up source files..." --weight=2
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
git clone --quiet https://github.com/Awesome-Technologies/synapse-admin.git -b master "$final_path"
#git clone --quiet https://github.com/Awesome-Technologies/synapse-admin.git -b master "$final_path"
# Reset branch to the level of update we needed
pushd "$final_path"
git reset --hard --quiet $version_commit
popd
#pushd "$final_path"
# git reset --hard --quiet $version_commit
#popd
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
@ -150,14 +150,6 @@ ynh_script_progression --message="Securing files and directories..."
# Set permissions to app files
chown -R $app: $final_path
#=================================================
# SETUP LOGROTATE
#=================================================
ynh_script_progression --message="Configuring log rotation..." --weight=1
# Use logrotate to manage application logfile(s)
ynh_use_logrotate
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================

View file

@ -32,8 +32,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
ynh_script_progression --message="Validating restoration parameters..." --weight=2
test ! -d $final_path \
|| ynh_die --message="There is already a directory: $final_path "
test ! -d $final_path || ynh_die --message="There is already a directory: $final_path "
#=================================================
# STANDARD RESTORATION STEPS

View file

@ -24,22 +24,9 @@ port=$(ynh_app_setting_get --app=$app --key=port)
#=================================================
# CHECK VERSION
#=================================================
ynh_script_progression --message="Checking version..."
upgrade_type=$(ynh_check_app_version_changed)
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all
ynh_app_setting_delete --app=$app --key=is_public
fi
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
@ -54,6 +41,18 @@ ynh_clean_setup () {
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all
ynh_app_setting_delete --app=$app --key=is_public
fi
#=================================================
# STANDARD UPGRADE STEPS
#=================================================
@ -79,12 +78,14 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
then
ynh_script_progression --message="Upgrading source files..." --weight=160
pushd "$final_path"
git fetch --quiet
git checkout master --quiet
git pull --quiet
git reset --hard $version_commit --quiet
popd
ynh_setup_source --dest_dir="$final_path" --keep="$final_path/.env"
#pushd "$final_path"
# git fetch --quiet
# git checkout master --quiet
# git pull --quiet
# git reset --hard $version_commit --quiet
#popd
fi
chmod 750 "$final_path"
@ -126,6 +127,8 @@ then
popd
fi
chown -R $app: $final_path
#=================================================
# SETUP SYSTEMD
#=================================================
@ -148,7 +151,7 @@ yunohost service add $app --description "UI admin for Synapse" --log="/var/log/$
#=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="HTTP Server listening"
ynh_systemd_action --service_name=$app --action=start --log_path=systemd #--line_match="HTTP Server listening"
#=================================================
# RELOAD NGINX