1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/thelounge_ynh.git synced 2024-09-03 20:35:54 +02:00
This commit is contained in:
ericgaspar 2021-03-22 10:00:33 +01:00
parent f0eabf81c7
commit c8a17eb743
No known key found for this signature in database
GPG key ID: 574F281483054D44
6 changed files with 16 additions and 10 deletions

View file

@ -24,6 +24,7 @@ app=$YNH_APP_INSTANCE_NAME
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
domain=$(ynh_app_setting_get --app=$app --key=domain)
config_path=$(ynh_app_setting_get --app=$app --key=config_path)
#=================================================
# DECLARE DATA AND CONF FILES TO BACKUP
@ -52,7 +53,7 @@ ynh_backup --src_path="/etc/systemd/system/$app.service"
# BACKUP CONFIG
#=================================================
ynh_backup --src_path="/home/yunohost.app/$app"
ynh_backup --src_path="$config_path"
#=================================================
# END OF SCRIPT

View file

@ -109,7 +109,7 @@ fi
ynh_script_progression --message="Starting a systemd service..."
# Start a systemd service
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Available at http"
ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="Available at http"
#=================================================
# RELOAD NGINX

View file

@ -34,6 +34,7 @@ app=$YNH_APP_INSTANCE_NAME
ynh_script_progression --message="Validating installation parameters..."
final_path=/var/www/$app
config_path=/home/yunohost.app/$app
test ! -e "$final_path" || ynh_die --message="This path already contains a folder"
# Register (book) web path
@ -46,6 +47,7 @@ ynh_script_progression --message="Storing installation settings..."
ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url
ynh_app_setting_set --app=$app --key=config_path --value=$config_path
#=================================================
# STANDARD MODIFICATIONS
@ -103,7 +105,7 @@ ynh_script_progression --message="Modifying a config file..."
mkdir -p /home/yunohost.app/$app
ynh_add_config --template="../conf/config.js" --destination="/home/yunohost.app/$app/config.js"
ynh_add_config --template="../conf/config.js" --destination="$config_path/config.js"
#=================================================
# INSTALL THE LOUNGE
@ -135,7 +137,7 @@ ynh_script_progression --message="Securing files and directories..."
# Set permissions to app files
chown -R $app: $final_path
chown -R $app: /home/yunohost.app/$app
chown -R $app: $config_path
#=================================================
# INTEGRATE SERVICE IN YUNOHOST

View file

@ -19,6 +19,7 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
port=$(ynh_app_setting_get --app=$app --key=port)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
config_path=$(ynh_app_setting_get --app=$app --key=config_path)
#=================================================
# STANDARD REMOVE
@ -72,7 +73,7 @@ ynh_remove_nginx_config
#=================================================
ynh_script_progression --message="Removing the config file..."
ynh_secure_remove --file="/home/yunohost.app/$app"
ynh_secure_remove --file="$config_path"
#=================================================
# GENERIC FINALIZATION

View file

@ -29,6 +29,7 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
config_path=$(ynh_app_setting_get --app=$app --key=config_path)
#=================================================
# CHECK IF THE APP CAN BE RESTORED
@ -69,7 +70,7 @@ ynh_restore_file --origin_path="$final_path"
#=================================================
ynh_script_progression --message="Restoring the config path..."
ynh_restore_file --origin_path="/home/yunohost.app/$app"
ynh_restore_file --origin_path="$config_path"
#=================================================
# RESTORE USER RIGHTS
@ -78,7 +79,7 @@ ynh_script_progression --message="Restoring user rights..."
# Restore permissions to app files
chown -R $app: $final_path
chown -R $app: /home/yunohost.app/$app
chown -R $app: $config_path
#=================================================
# SPECIFIC RESTORATION

View file

@ -43,6 +43,7 @@ fi
# If config_path doesn't exist, create it
if [ -z "$config_path" ]; then
config_path=/home/yunohost.app/$app
mkdir -p /home/yunohost.app/$app
ynh_app_setting_set --app=$app --key=config_path --value=$config_path
fi
@ -75,7 +76,7 @@ ynh_abort_if_errors
#=================================================
ynh_script_progression --message="Stopping a systemd service..."
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
ynh_systemd_action --service_name=$app --action=stop --log_path=systemd
#=================================================
# CREATE DEDICATED USER
@ -139,7 +140,7 @@ fi
#=================================================
ynh_script_progression --message="Modifying a config file..."
ynh_add_config --template="../conf/config.js" --destination="/home/yunohost.app/$app/config.js"
ynh_add_config --template="../conf/config.js" --destination="$config_path/config.js"
#=================================================
# SETUP SYSTEMD
@ -160,7 +161,7 @@ ynh_script_progression --message="Securing files and directories..."
# Set permissions on app files
chown -R $app: $final_path
chown -R $app: /home/yunohost.app/$app
chown -R $app: $config_path
#=================================================
# GENERIC FINALIZATION