mirror of
https://github.com/YunoHost-Apps/tiddlywiki_ynh.git
synced 2024-09-03 20:26:34 +02:00
Fix
This commit is contained in:
parent
cdad609cea
commit
2254fe148d
5 changed files with 41 additions and 40 deletions
|
@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers
|
||||||
#=================================================
|
#=================================================
|
||||||
# RETRIEVE ARGUMENTS
|
# RETRIEVE ARGUMENTS
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Retrieve arguments from the manifest"
|
ynh_script_progression --message="Retrieve arguments from the manifest"
|
||||||
|
|
||||||
old_domain=$YNH_APP_OLD_DOMAIN
|
old_domain=$YNH_APP_OLD_DOMAIN
|
||||||
old_path=$YNH_APP_OLD_PATH
|
old_path=$YNH_APP_OLD_PATH
|
||||||
|
@ -25,7 +25,7 @@ app=$YNH_APP_INSTANCE_NAME
|
||||||
#=================================================
|
#=================================================
|
||||||
# LOAD SETTINGS
|
# LOAD SETTINGS
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Loading installation settings..."
|
ynh_script_progression --message="Loading installation settings..."
|
||||||
|
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
port=$(ynh_app_setting_get --app=$app --key=port)
|
port=$(ynh_app_setting_get --app=$app --key=port)
|
||||||
|
@ -51,14 +51,14 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
# STOP SYSTEMD SERVICE
|
# STOP SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Stopping a systemd service..."
|
ynh_script_progression --message="Stopping a systemd service..."
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action=stop
|
ynh_systemd_action --service_name=$app --action=stop
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# MODIFY URL IN NGINX CONF
|
# MODIFY URL IN NGINX CONF
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Updating NGINX web server configuration..."
|
ynh_script_progression --message="Updating NGINX web server configuration..."
|
||||||
|
|
||||||
nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf
|
nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf
|
||||||
|
|
||||||
|
@ -89,14 +89,14 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SYSTEMD SERVICE
|
# START SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Starting a systemd service..."
|
ynh_script_progression --message="Starting a systemd service..."
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action=start
|
ynh_systemd_action --service_name=$app --action=start
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Reloading NGINX web server..."
|
ynh_script_progression --message="Reloading NGINX web server..."
|
||||||
|
|
||||||
ynh_systemd_action --service_name=nginx --action=reload
|
ynh_systemd_action --service_name=nginx --action=reload
|
||||||
|
|
||||||
|
@ -104,4 +104,4 @@ ynh_systemd_action --service_name=nginx --action=reload
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_print_info --message="Change of URL completed for $app"
|
ynh_script_progression --message="Change of URL completed for $app"
|
||||||
|
|
|
@ -115,6 +115,7 @@ ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --targ
|
||||||
ynh_replace_string --match_string="__YNH_NODE__" --replace_string="$ynh_node" --target_file="../conf/systemd.service"
|
ynh_replace_string --match_string="__YNH_NODE__" --replace_string="$ynh_node" --target_file="../conf/systemd.service"
|
||||||
ynh_replace_string --match_string="__PASSWORD__" --replace_string="$password" --target_file="../conf/systemd.service"
|
ynh_replace_string --match_string="__PASSWORD__" --replace_string="$password" --target_file="../conf/systemd.service"
|
||||||
ynh_replace_string --match_string="__ADMIN__" --replace_string="$admin" --target_file="../conf/systemd.service"
|
ynh_replace_string --match_string="__ADMIN__" --replace_string="$admin" --target_file="../conf/systemd.service"
|
||||||
|
|
||||||
ynh_add_systemd_config
|
ynh_add_systemd_config
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -138,7 +139,7 @@ yunohost service add $app --description="A non-linear personal web notebook" --l
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Starting a systemd service..." --weight=2
|
ynh_script_progression --message="Starting a systemd service..." --weight=2
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="Serving on"
|
ynh_systemd_action --service_name=$app --action=restart --log_path=systemd --line_match="Serving on"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SSOWAT
|
# SETUP SSOWAT
|
||||||
|
|
|
@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers
|
||||||
#=================================================
|
#=================================================
|
||||||
# LOAD SETTINGS
|
# LOAD SETTINGS
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Loading installation settings..."
|
ynh_script_progression --message="Loading installation settings..."
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
|
@ -29,14 +29,14 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
# Remove a service from the admin panel, added by `yunohost service add`
|
# Remove a service from the admin panel, added by `yunohost service add`
|
||||||
if ynh_exec_warn_less yunohost service status $app >/dev/null
|
if ynh_exec_warn_less yunohost service status $app >/dev/null
|
||||||
then
|
then
|
||||||
ynh_print_info --message="Removing $app service..."
|
ynh_script_progression --message="Removing $app service..."
|
||||||
yunohost service remove $app
|
yunohost service remove $app
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STOP AND REMOVE SERVICE
|
# STOP AND REMOVE SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Stopping and removing the systemd service..."
|
ynh_script_progression --message="Stopping and removing the systemd service..."
|
||||||
|
|
||||||
# Remove the dedicated systemd config
|
# Remove the dedicated systemd config
|
||||||
ynh_remove_systemd_config
|
ynh_remove_systemd_config
|
||||||
|
@ -44,14 +44,14 @@ ynh_remove_systemd_config
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE DEPENDENCIES
|
# REMOVE DEPENDENCIES
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Removing dependencies..."
|
ynh_script_progression --message="Removing dependencies..."
|
||||||
|
|
||||||
ynh_remove_nodejs
|
ynh_remove_nodejs
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE APP MAIN DIR
|
# REMOVE APP MAIN DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Removing app main directory..."
|
ynh_script_progression --message="Removing app main directory..."
|
||||||
|
|
||||||
# Remove the app directory securely
|
# Remove the app directory securely
|
||||||
ynh_secure_remove --file=$final_path
|
ynh_secure_remove --file=$final_path
|
||||||
|
@ -59,7 +59,7 @@ ynh_secure_remove --file=$final_path
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE NGINX CONFIGURATION
|
# REMOVE NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Removing NGINX web server configuration..."
|
ynh_script_progression --message="Removing NGINX web server configuration..."
|
||||||
|
|
||||||
# Remove the dedicated nginx config
|
# Remove the dedicated nginx config
|
||||||
ynh_remove_nginx_config
|
ynh_remove_nginx_config
|
||||||
|
@ -69,7 +69,7 @@ ynh_remove_nginx_config
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE DEDICATED USER
|
# REMOVE DEDICATED USER
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Removing the dedicated system user..."
|
ynh_script_progression --message="Removing the dedicated system user..."
|
||||||
|
|
||||||
# Delete a system user
|
# Delete a system user
|
||||||
ynh_system_user_delete --username=$app
|
ynh_system_user_delete --username=$app
|
||||||
|
@ -78,4 +78,4 @@ ynh_system_user_delete --username=$app
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_print_info --message="Removal of $app completed"
|
ynh_script_progression --message="Removal of $app completed"
|
||||||
|
|
|
@ -23,7 +23,7 @@ ynh_abort_if_errors
|
||||||
#=================================================
|
#=================================================
|
||||||
# LOAD SETTINGS
|
# LOAD SETTINGS
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Loading settings..." --weight=1
|
ynh_script_progression --message="Loading installation settings..." --weight=1
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK IF THE APP CAN BE RESTORED
|
# CHECK IF THE APP CAN BE RESTORED
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Validating restoration parameters..." --weight=1
|
ynh_script_progression --message="Validating restoration parameters..." --weight=1
|
||||||
|
|
||||||
ynh_webpath_available --domain=$domain --path_url=$path_url \
|
ynh_webpath_available --domain=$domain --path_url=$path_url \
|
||||||
|| ynh_die --message="Path not available: ${domain}${path_url}"
|
|| ynh_die --message="Path not available: ${domain}${path_url}"
|
||||||
|
@ -52,14 +52,14 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE APP MAIN DIR
|
# RESTORE THE APP MAIN DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Restoring the app main directory..." --weight=1
|
ynh_script_progression --message="Restoring the app main directory..." --weight=1
|
||||||
|
|
||||||
ynh_restore_file --origin_path="$final_path"
|
ynh_restore_file --origin_path="$final_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RECREATE THE DEDICATED USER
|
# RECREATE THE DEDICATED USER
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Recreating the dedicated system user..." --weight=1
|
ynh_script_progression --message="Recreating the dedicated system user..." --weight=1
|
||||||
|
|
||||||
# Create the dedicated user (if not existing)
|
# Create the dedicated user (if not existing)
|
||||||
ynh_system_user_create --username=$app --home_dir=$final_path
|
ynh_system_user_create --username=$app --home_dir=$final_path
|
||||||
|
@ -76,15 +76,15 @@ chown -R $app:$app $final_path
|
||||||
#=================================================
|
#=================================================
|
||||||
# REINSTALL DEPENDENCIES
|
# REINSTALL DEPENDENCIES
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Reinstalling dependencies..." --weight=1
|
ynh_script_progression --message="Reinstalling dependencies..." --weight=1
|
||||||
|
|
||||||
# Install Nodejs
|
# Install Nodejs
|
||||||
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
|
ynh_install_nodejs --nodejs_version=$nodejs_version
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE SYSTEMD
|
# RESTORE SYSTEMD
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Restoring the systemd configuration..." --weight=1
|
ynh_script_progression --message="Restoring the systemd configuration..." --weight=1
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
|
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
|
||||||
systemctl enable $app.service --quiet
|
systemctl enable $app.service --quiet
|
||||||
|
@ -99,16 +99,16 @@ yunohost service add $app --description="A non-linear personal web notebook" --l
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SYSTEMD SERVICE
|
# START SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Starting a systemd service..."
|
ynh_script_progression --message="Starting a systemd service..."
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="Serving on"
|
ynh_systemd_action --service_name=$app --action=restart --log_path=systemd --line_match="Serving on"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Reloading NGINX web server..." --weight=1
|
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
|
||||||
|
|
||||||
ynh_systemd_action --service_name=nginx --action=reload
|
ynh_systemd_action --service_name=nginx --action=reload
|
||||||
|
|
||||||
|
@ -116,4 +116,4 @@ ynh_systemd_action --service_name=nginx --action=reload
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_print_info --message="Restoration completed for $app" --last
|
ynh_script_progression --message="Restoration completed for $app" --last
|
||||||
|
|
|
@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers
|
||||||
#=================================================
|
#=================================================
|
||||||
# LOAD SETTINGS
|
# LOAD SETTINGS
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Loading installation settings..." --weight=1
|
ynh_script_progression --message="Loading installation settings..." --weight=1
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ upgrade_type=$(ynh_check_app_version_changed)
|
||||||
#=================================================
|
#=================================================
|
||||||
# ENSURE DOWNWARD COMPATIBILITY
|
# ENSURE DOWNWARD COMPATIBILITY
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Ensuring downward compatibility..." --weight=1
|
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
||||||
|
|
||||||
# If final_path doesn't exist, create it
|
# If final_path doesn't exist, create it
|
||||||
if [ -z "$final_path" ]; then
|
if [ -z "$final_path" ]; then
|
||||||
|
@ -48,7 +48,7 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Backing up the app before upgrading (may take a while)..." --weight=1
|
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1
|
||||||
|
|
||||||
# Backup the current version of the app
|
# Backup the current version of the app
|
||||||
ynh_backup_before_upgrade
|
ynh_backup_before_upgrade
|
||||||
|
@ -65,14 +65,14 @@ ynh_abort_if_errors
|
||||||
#=================================================
|
#=================================================
|
||||||
# STOP SYSTEMD SERVICE
|
# STOP SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Stopping a systemd service..." --weight=1
|
ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action=stop
|
ynh_systemd_action --service_name=$app --action=stop
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE DEDICATED USER
|
# CREATE DEDICATED USER
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Making sure dedicated system user exists..." --weight=1
|
ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1
|
||||||
|
|
||||||
# Create a dedicated user (if not existing)
|
# Create a dedicated user (if not existing)
|
||||||
ynh_system_user_create --username=$app --home_dir=$final_path
|
ynh_system_user_create --username=$app --home_dir=$final_path
|
||||||
|
@ -83,7 +83,7 @@ ynh_system_user_create --username=$app --home_dir=$final_path
|
||||||
|
|
||||||
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||||
then
|
then
|
||||||
ynh_print_info --message="Upgrading source files..."
|
ynh_script_progression --message="Upgrading source files..."
|
||||||
|
|
||||||
pushd $final_path
|
pushd $final_path
|
||||||
ynh_use_nodejs
|
ynh_use_nodejs
|
||||||
|
@ -94,7 +94,7 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
# NGINX CONFIGURATION
|
# NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Upgrading NGINX web server configuration..." --weight=1
|
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1
|
||||||
|
|
||||||
# Create a dedicated nginx config
|
# Create a dedicated nginx config
|
||||||
ynh_add_nginx_config
|
ynh_add_nginx_config
|
||||||
|
@ -102,14 +102,14 @@ ynh_add_nginx_config
|
||||||
#=================================================
|
#=================================================
|
||||||
# UPGRADE DEPENDENCIES
|
# UPGRADE DEPENDENCIES
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Upgrading dependencies..." --weight=1
|
ynh_script_progression --message="Upgrading dependencies..." --weight=1
|
||||||
|
|
||||||
ynh_install_nodejs --nodejs_version=$nodejs_version
|
ynh_install_nodejs --nodejs_version=$nodejs_version
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SYSTEMD
|
# SETUP SYSTEMD
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Upgrading systemd configuration..." --weight=1
|
ynh_script_progression --message="Upgrading systemd configuration..." --weight=1
|
||||||
|
|
||||||
ynh_add_systemd_config
|
ynh_add_systemd_config
|
||||||
|
|
||||||
|
@ -132,14 +132,14 @@ yunohost service add $app --description="A non-linear personal web notebook" --l
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SYSTEMD SERVICE
|
# START SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Starting a systemd service..." --weight=1
|
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="Serving on"
|
ynh_systemd_action --service_name=$app --action=restart --log_path=systemd --line_match="Serving on"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Reloading NGINX web server..."
|
ynh_script_progression --message="Reloading NGINX web server..."
|
||||||
|
|
||||||
ynh_systemd_action --service_name=nginx --action=reload
|
ynh_systemd_action --service_name=nginx --action=reload
|
||||||
|
|
||||||
|
@ -147,4 +147,4 @@ ynh_systemd_action --service_name=nginx --action=reload
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_print_info --message="Upgrade of $app completed" --last
|
ynh_script_progression --message="Upgrade of $app completed" --last
|
||||||
|
|
Loading…
Reference in a new issue