1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/jitsi_ynh.git synced 2024-09-03 19:35:57 +02:00

replacing ynh_script_progression ynh_print_info

This commit is contained in:
yalh76 2019-07-18 22:00:55 +02:00
parent 6be634412c
commit 9ca9b92c51
5 changed files with 68 additions and 68 deletions

View file

@ -23,7 +23,7 @@ ynh_abort_if_errors
#================================================= #=================================================
# LOAD SETTINGS # LOAD SETTINGS
#================================================= #=================================================
ynh_script_progression --message="Loading installation settings..." --time --weight=1 ynh_print_info --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
@ -35,7 +35,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain)
#================================================= #=================================================
# STOP SYSTEMD SERVICE # STOP SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Stopping a systemd service..." --time --weight=1 ynh_print_info --message="Stopping a systemd service..."
ynh_systemd_action --service_name=$app-videobridge --action="stop" --log_path="/var/log/$app/$app-videobridge.log" ynh_systemd_action --service_name=$app-videobridge --action="stop" --log_path="/var/log/$app/$app-videobridge.log"
ynh_systemd_action --service_name=$app-jicofo --action="stop" --log_path="/var/log/$app/$app-jicofo.log" ynh_systemd_action --service_name=$app-jicofo --action="stop" --log_path="/var/log/$app/$app-jicofo.log"
@ -43,14 +43,14 @@ ynh_systemd_action --service_name=$app-jicofo --action="stop" --log_path="/var/l
#================================================= #=================================================
# BACKUP THE APP MAIN DIR # BACKUP THE APP MAIN DIR
#================================================= #=================================================
ynh_script_progression --message="Backing up the main app directory..." --time --weight=1 ynh_print_info --message="Backing up the main app directory..."
ynh_backup --src_path="$final_path" ynh_backup --src_path="$final_path"
#================================================= #=================================================
# BACKUP THE NGINX CONFIGURATION # BACKUP THE NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Backing up nginx web server configuration..." --time --weight=1 ynh_print_info --message="Backing up nginx web server configuration..."
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
@ -59,14 +59,14 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#================================================= #=================================================
# BACKUP LOGROTATE # BACKUP LOGROTATE
#================================================= #=================================================
ynh_script_progression --message="Backing up logrotate configuration..." --time --weight=1 ynh_print_info --message="Backing up logrotate configuration..."
ynh_backup --src_path="/etc/logrotate.d/$app" ynh_backup --src_path="/etc/logrotate.d/$app"
#================================================= #=================================================
# BACKUP METRONOME CONFIG # BACKUP METRONOME CONFIG
#================================================= #=================================================
ynh_script_progression --message="Backing up Metronome configuration..." --time --weight=1 ynh_print_info --message="Backing up Metronome configuration..."
ynh_backup --src_path="/etc/metronome/conf.d/$domain.cfg.lua" ynh_backup --src_path="/etc/metronome/conf.d/$domain.cfg.lua"
@ -77,7 +77,7 @@ ynh_backup --src_path="/usr/lib/metronome/modules/mod_smacks.lua"
#================================================= #=================================================
# BACKUP SYSTEMD # BACKUP SYSTEMD
#================================================= #=================================================
ynh_script_progression --message="Backing up systemd configuration..." --time --weight=1 ynh_print_info --message="Backing up systemd configuration..."
ynh_backup --src_path="/etc/systemd/system/$app-videobridge.service" ynh_backup --src_path="/etc/systemd/system/$app-videobridge.service"
ynh_backup --src_path="/etc/systemd/system/$app-jicofo.service" ynh_backup --src_path="/etc/systemd/system/$app-jicofo.service"
@ -85,7 +85,7 @@ ynh_backup --src_path="/etc/systemd/system/$app-jicofo.service"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." --time --weight=1 ynh_print_info --message="Starting a systemd service..."
ynh_systemd_action --service_name=$app-videobridge --action="start" --log_path="/var/log/$app/$app-videobridge.log" ynh_systemd_action --service_name=$app-videobridge --action="start" --log_path="/var/log/$app/$app-videobridge.log"
ynh_systemd_action --service_name=$app-jicofo --action="start" --log_path="/var/log/$app/$app-jicofo.log" ynh_systemd_action --service_name=$app-jicofo --action="start" --log_path="/var/log/$app/$app-jicofo.log"
@ -94,4 +94,4 @@ ynh_systemd_action --service_name=$app-jicofo --action="start" --log_path="/var/
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." --time --last ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."

View file

@ -40,7 +40,7 @@ focus_user="svc${app}focus"
#================================================= #=================================================
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
#================================================= #=================================================
ynh_script_progression --message="Validating installation parameters..." --time --weight=1 ynh_print_info --message="Validating installation parameters..."
final_path=/var/www/$app final_path=/var/www/$app
test ! -e "$final_path" || ynh_die --message="This path already contains a folder" test ! -e "$final_path" || ynh_die --message="This path already contains a folder"
@ -53,7 +53,7 @@ ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url
#================================================= #=================================================
# STORE SETTINGS FROM MANIFEST # STORE SETTINGS FROM MANIFEST
#================================================= #=================================================
ynh_script_progression --message="Storing installation settings..." --time --weight=1 ynh_print_info --message="Storing installation settings..."
ynh_app_setting_set --app=$app --key=domain --value=$domain 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=path --value=$path_url
@ -67,7 +67,7 @@ ynh_app_setting_set --app=$app --key=focus_user --value=$focus_user
#================================================= #=================================================
# FIND AND OPEN A PORT # FIND AND OPEN A PORT
#================================================= #=================================================
ynh_script_progression --message="Configuring firewall..." --time --weight=1 ynh_print_info --message="Configuring firewall..."
# Find a free port # Find a free port
port=$(ynh_find_port --port=4443) port=$(ynh_find_port --port=4443)
@ -90,7 +90,7 @@ ynh_app_setting_set --app=$app --key=port_component --value=$port_component
#================================================= #=================================================
# INSTALL DEPENDENCIES # INSTALL DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Installing dependencies..." --time --weight=1 ynh_print_info --message="Installing dependencies..."
ynh_install_app_dependencies $pkg_dependencies ynh_install_app_dependencies $pkg_dependencies
@ -99,7 +99,7 @@ ynh_install_nodejs --nodejs_version=10
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
ynh_script_progression --message="Setting up source files..." --time --weight=1 ynh_print_info --message="Setting up source files..."
ynh_app_setting_set --app=$app --key=final_path --value=$final_path ynh_app_setting_set --app=$app --key=final_path --value=$final_path
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
@ -110,7 +110,7 @@ ynh_setup_source --dest_dir="$final_path/jitsi-meet_temp" --source_id=jitsi-meet
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Configuring nginx web server..." --time --weight=1 ynh_print_info --message="Configuring nginx web server..."
# Create a dedicated nginx config # Create a dedicated nginx config
ynh_add_nginx_config ynh_add_nginx_config
@ -118,7 +118,7 @@ ynh_add_nginx_config
#================================================= #=================================================
# CREATE DEDICATED USER # CREATE DEDICATED USER
#================================================= #=================================================
ynh_script_progression --message="Configuring system user..." --time --weight=1 ynh_print_info --message="Configuring system user..."
# Create a system user # Create a system user
ynh_system_user_create --username=$app --home_dir=$final_path ynh_system_user_create --username=$app --home_dir=$final_path
@ -128,7 +128,7 @@ ynh_system_user_create --username=$app --home_dir=$final_path
#================================================= #=================================================
# CONFIGURE METRONOME # CONFIGURE METRONOME
#================================================= #=================================================
ynh_script_progression --message="Configuring metronome..." --time --weight=1 ynh_print_info --message="Configuring metronome..."
# Create additional domains # Create additional domains
if [[ $domain == *"domain.tld"* ]]; then if [[ $domain == *"domain.tld"* ]]; then
@ -166,7 +166,7 @@ ynh_systemd_action --service_name=metronome --action=restart
#================================================= #=================================================
# BUILD JITSI-VIDEOBRIDGE # BUILD JITSI-VIDEOBRIDGE
#================================================= #=================================================
ynh_script_progression --message="Building Jitsi-Videobridge..." --time --weight=1 ynh_print_info --message="Building Jitsi-Videobridge..."
mkdir -p "$final_path/.sip-communicator" mkdir -p "$final_path/.sip-communicator"
cp ../conf/sip-communicator.properties "$final_path/.sip-communicator/sip-communicator.properties" cp ../conf/sip-communicator.properties "$final_path/.sip-communicator/sip-communicator.properties"
@ -176,7 +176,7 @@ chown -R $app: $final_path
#================================================= #=================================================
# BUILD JITSI-JICOFO # BUILD JITSI-JICOFO
#================================================= #=================================================
ynh_script_progression --message="Building Jitsi-Jicofo..." --time --weight=1 ynh_print_info --message="Building Jitsi-Jicofo..."
pushd "$final_path/jitsi-jicofo-build" pushd "$final_path/jitsi-jicofo-build"
mvn package -DskipTests -Dassembly.skipAssembly=false mvn package -DskipTests -Dassembly.skipAssembly=false
@ -191,7 +191,7 @@ ynh_secure_remove --file="$final_path/jitsi-jicofo-build"
#================================================= #=================================================
# BUILD JITSI-MEET # BUILD JITSI-MEET
#================================================= #=================================================
ynh_script_progression --message="Building Jitsi-Meet..." --time --weight=1 ynh_print_info --message="Building Jitsi-Meet..."
pushd "$final_path/jitsi-meet_temp" pushd "$final_path/jitsi-meet_temp"
ar x jitsi-meet-web.deb data.tar.xz ar x jitsi-meet-web.deb data.tar.xz
@ -208,7 +208,7 @@ ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --targ
#================================================= #=================================================
# SETUP SYSTEMD # SETUP SYSTEMD
#================================================= #=================================================
ynh_script_progression --message="Configuring a systemd service..." --time --weight=1 ynh_print_info --message="Configuring a systemd service..."
# Create a dedicated systemd config # Create a dedicated systemd config
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/jitsi-videobridge.service" ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/jitsi-videobridge.service"
@ -241,7 +241,7 @@ chown -R $app: $final_path
#================================================= #=================================================
# SETUP LOGROTATE # SETUP LOGROTATE
#================================================= #=================================================
ynh_script_progression --message="Configuring log rotation..." --time --weight=1 ynh_print_info --message="Configuring log rotation..."
# Use logrotate to manage application logfile(s) # Use logrotate to manage application logfile(s)
ynh_use_logrotate ynh_use_logrotate
@ -257,7 +257,7 @@ yunohost service add $app-jicofo --description "$app jitsi-jicofo for jitsi" --l
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." --time --weight=1 ynh_print_info --message="Starting a systemd service..."
# Start a systemd service # Start a systemd service
ynh_systemd_action --service_name=$app-videobridge --action="start" --log_path="/var/log/$app/$app-videobridge.log" ynh_systemd_action --service_name=$app-videobridge --action="start" --log_path="/var/log/$app/$app-videobridge.log"
@ -266,7 +266,7 @@ ynh_systemd_action --service_name=$app-jicofo --action="start" --log_path="/var/
#================================================= #=================================================
# SETUP SSOWAT # SETUP SSOWAT
#================================================= #=================================================
ynh_script_progression --message="Configuring SSOwat..." --time --weight=1 ynh_print_info --message="Configuring SSOwat..."
# Make app public # Make app public
ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" ynh_app_setting_set --app=$app --key=unprotected_uris --value="/"
@ -274,7 +274,7 @@ ynh_app_setting_set --app=$app --key=unprotected_uris --value="/"
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================
ynh_script_progression --message="Reloading nginx web server..." --time --weight=1 ynh_print_info --message="Reloading nginx web server..."
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload
@ -282,4 +282,4 @@ ynh_systemd_action --service_name=nginx --action=reload
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Installation of $app completed" --time --last ynh_print_info --message="Installation of $app completed"

View file

@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
# LOAD SETTINGS # LOAD SETTINGS
#================================================= #=================================================
ynh_script_progression --message="Loading installation settings..." --time --weight=1 ynh_print_info --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
@ -32,20 +32,20 @@ focus_user=$(ynh_app_setting_get --app=$app --key=focus_user)
# 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-videobridge >/dev/null if ynh_exec_warn_less yunohost service status $app-videobridge >/dev/null
then then
ynh_script_progression --message="Removing $app-videobridge service..." --time --weight=1 ynh_print_info --message="Removing $app-videobridge service..."
yunohost service remove $app-videobridge yunohost service remove $app-videobridge
fi fi
if ynh_exec_warn_less yunohost service status $app-jicofo >/dev/null if ynh_exec_warn_less yunohost service status $app-jicofo >/dev/null
then then
ynh_script_progression --message="Removing $app-jicofo service..." --time --weight=1 ynh_print_info --message="Removing $app-jicofo service..."
yunohost service remove $app-jicofo yunohost service remove $app-jicofo
fi fi
#================================================= #=================================================
# STOP AND REMOVE SERVICE # STOP AND REMOVE SERVICE
#================================================= #=================================================
ynh_script_progression --message="Stopping and removing the systemd service..." --time --weight=1 ynh_print_info --message="Stopping and removing the systemd service..."
# Remove the dedicated systemd config # Remove the dedicated systemd config
ynh_remove_systemd_config --service=$app-videobridge ynh_remove_systemd_config --service=$app-videobridge
@ -54,7 +54,7 @@ ynh_remove_systemd_config --service=$app-jicofo
#================================================= #=================================================
# REMOVE DEPENDENCIES # REMOVE DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Removing dependencies..." --time --weight=1 ynh_print_info --message="Removing dependencies..."
# Remove metapackage and its dependencies # Remove metapackage and its dependencies
ynh_remove_app_dependencies ynh_remove_app_dependencies
@ -64,7 +64,7 @@ ynh_remove_nodejs
#================================================= #=================================================
# REMOVE APP MAIN DIR # REMOVE APP MAIN DIR
#================================================= #=================================================
ynh_script_progression --message="Removing app main directory..." --time --weight=1 ynh_print_info --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"
@ -72,7 +72,7 @@ ynh_secure_remove --file="$final_path"
#================================================= #=================================================
# REMOVE NGINX CONFIGURATION # REMOVE NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Removing nginx web server configuration..." --time --weight=1 ynh_print_info --message="Removing nginx web server configuration..."
# Remove the dedicated nginx config # Remove the dedicated nginx config
ynh_remove_nginx_config ynh_remove_nginx_config
@ -80,7 +80,7 @@ ynh_remove_nginx_config
#================================================= #=================================================
# REMOVE LOGROTATE CONFIGURATION # REMOVE LOGROTATE CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Removing logrotate configuration..." --time --weight=1 ynh_print_info --message="Removing logrotate configuration..."
# Remove the app-specific logrotate config # Remove the app-specific logrotate config
ynh_remove_logrotate ynh_remove_logrotate
@ -91,19 +91,19 @@ ynh_remove_logrotate
if yunohost firewall list | grep -q "\- $port$" if yunohost firewall list | grep -q "\- $port$"
then then
ynh_script_progression --message="Closing port $port..." ynh_print_info --message="Closing port $port..."
ynh_exec_warn_less yunohost firewall disallow TCP $port ynh_exec_warn_less yunohost firewall disallow TCP $port
fi fi
if yunohost firewall list | grep -q "\- $port_videobridge$" if yunohost firewall list | grep -q "\- $port_videobridge$"
then then
ynh_script_progression --message="Closing port $port_videobridge..." ynh_print_info --message="Closing port $port_videobridge..."
ynh_exec_warn_less yunohost firewall disallow UDP $port_videobridge ynh_exec_warn_less yunohost firewall disallow UDP $port_videobridge
fi fi
if yunohost firewall list | grep -q "\- $port_component$" if yunohost firewall list | grep -q "\- $port_component$"
then then
ynh_script_progression --message="Closing port $port_component..." ynh_print_info --message="Closing port $port_component..."
ynh_exec_warn_less yunohost firewall disallow TCP $port_component ynh_exec_warn_less yunohost firewall disallow TCP $port_component
fi fi
@ -112,7 +112,7 @@ fi
#================================================= #=================================================
# RECONFIGURE METRONOME # RECONFIGURE METRONOME
#================================================= #=================================================
ynh_script_progression --message="Reconfiguring Metronome..." --time --weight=1 ynh_print_info --message="Reconfiguring Metronome..."
# Reconfigure metronome # Reconfigure metronome
ynh_secure_remove --file="/etc/metronome/conf.d/$domain.cfg.lua" ynh_secure_remove --file="/etc/metronome/conf.d/$domain.cfg.lua"
@ -151,7 +151,7 @@ ynh_secure_remove --file="/var/log/$app/"
#================================================= #=================================================
# REMOVE DEDICATED USER # REMOVE DEDICATED USER
#================================================= #=================================================
ynh_script_progression --message="Removing the dedicated system user..." --time --weight=1 ynh_print_info --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
@ -160,4 +160,4 @@ ynh_system_user_delete --username=$app
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Removal of $app completed" --time --last ynh_print_info --message="Removal of $app completed"

View file

@ -23,7 +23,7 @@ ynh_abort_if_errors
#================================================= #=================================================
# LOAD SETTINGS # LOAD SETTINGS
#================================================= #=================================================
ynh_script_progression --message="Loading settings..." --time --weight=1 ynh_print_info --message="Loading settings..."
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
@ -41,7 +41,7 @@ port_component=$(ynh_app_setting_get --app=$app --key=port_component)
#================================================= #=================================================
# CHECK IF THE APP CAN BE RESTORED # CHECK IF THE APP CAN BE RESTORED
#================================================= #=================================================
ynh_script_progression --message="Validating restoration parameters..." --time --weight=1 ynh_print_info --message="Validating restoration parameters..."
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}"
@ -59,14 +59,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_script_progression --message="Restoring the app main directory..." --time --weight=1 ynh_print_info --message="Restoring the app main directory..."
ynh_restore_file --origin_path="$final_path" ynh_restore_file --origin_path="$final_path"
#================================================= #=================================================
# RECREATE THE DEDICATED USER # RECREATE THE DEDICATED USER
#================================================= #=================================================
ynh_script_progression --message="Recreating the dedicated system user..." --time --weight=1 ynh_print_info --message="Recreating the dedicated system user..."
# 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
@ -83,7 +83,7 @@ chown -R root: $final_path
#================================================= #=================================================
# REINSTALL DEPENDENCIES # REINSTALL DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Reinstalling dependencies..." --time --weight=1 ynh_print_info --message="Reinstalling dependencies..."
# Define and install dependencies # Define and install dependencies
ynh_install_app_dependencies $pkg_dependencies ynh_install_app_dependencies $pkg_dependencies
@ -93,7 +93,7 @@ ynh_install_nodejs --nodejs_version=10
#================================================= #=================================================
# CONFIGURE FIREWALL # CONFIGURE FIREWALL
#================================================= #=================================================
ynh_script_progression --message="Configuring firewall..." --time --weight=1 ynh_print_info --message="Configuring firewall..."
# Open this port # Open this port
ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port
@ -103,7 +103,7 @@ ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port_component
#================================================= #=================================================
# CONFIGURE METRONOME # CONFIGURE METRONOME
#================================================= #=================================================
ynh_script_progression --message="Configuring metronome..." --time --weight=1 ynh_print_info --message="Configuring metronome..."
# Create additional domains # Create additional domains
if [[ $domain == *"domain.tld"* ]]; then if [[ $domain == *"domain.tld"* ]]; then
@ -135,7 +135,7 @@ ynh_systemd_action --service_name=metronome --action=restart
#================================================= #=================================================
# RESTORE SYSTEMD # RESTORE SYSTEMD
#================================================= #=================================================
ynh_script_progression --message="Restoring the systemd configuration..." --time --weight=1 ynh_print_info --message="Restoring the systemd configuration..."
ynh_restore_file --origin_path="/etc/systemd/system/$app-videobridge.service" ynh_restore_file --origin_path="/etc/systemd/system/$app-videobridge.service"
systemctl enable $app-videobridge.service systemctl enable $app-videobridge.service
@ -152,7 +152,7 @@ yunohost service add $app-jicofo --log "/var/log/$app/$app-jicofo.log"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." --time --weight=1 ynh_print_info --message="Starting a systemd service..."
ynh_systemd_action --service_name=$app-videobridge --action="start" --log_path="/var/log/$app/$app-videobridge.log" ynh_systemd_action --service_name=$app-videobridge --action="start" --log_path="/var/log/$app/$app-videobridge.log"
ynh_systemd_action --service_name=$app-jicofo --action="start" --log_path="/var/log/$app/$app-jicofo.log" ynh_systemd_action --service_name=$app-jicofo --action="start" --log_path="/var/log/$app/$app-jicofo.log"
@ -168,7 +168,7 @@ ynh_restore_file --origin_path="/etc/logrotate.d/$app"
#================================================= #=================================================
# RELOAD NGINX AND PHP-FPM # RELOAD NGINX AND PHP-FPM
#================================================= #=================================================
ynh_script_progression --message="Reloading nginx web server and php-fpm..." --time --weight=1 ynh_print_info --message="Reloading nginx web server and php-fpm..."
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload
@ -176,4 +176,4 @@ ynh_systemd_action --service_name=nginx --action=reload
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Restoration completed for $app" --time --last ynh_print_info --message="Restoration completed for $app"

View file

@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
# LOAD SETTINGS # LOAD SETTINGS
#================================================= #=================================================
ynh_script_progression --message="Loading installation settings..." --time --weight=1 ynh_print_info --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
@ -36,7 +36,7 @@ upgrade_type=$(ynh_check_app_version_changed)
#================================================= #=================================================
# ENSURE DOWNWARD COMPATIBILITY # ENSURE DOWNWARD COMPATIBILITY
#================================================= #=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --time --weight=1 ynh_print_info --message="Ensuring downward compatibility..."
# 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
@ -47,7 +47,7 @@ fi
#================================================= #=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#================================================= #=================================================
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --time --weight=1 ynh_print_info --message="Backing up the app before upgrading (may take a while)..."
# Backup the current version of the app # Backup the current version of the app
ynh_backup_before_upgrade ynh_backup_before_upgrade
@ -63,7 +63,7 @@ ynh_abort_if_errors
#================================================= #=================================================
# STOP SYSTEMD SERVICE # STOP SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Stopping a systemd service..." --time --weight=1 ynh_print_info --message="Stopping a systemd service..."
ynh_systemd_action --service_name=$app-videobridge --action="stop" --log_path="/var/log/$app/$app-videobridge.log" ynh_systemd_action --service_name=$app-videobridge --action="stop" --log_path="/var/log/$app/$app-videobridge.log"
ynh_systemd_action --service_name=$app-jicofo --action="stop" --log_path="/var/log/$app/$app-jicofo.log" ynh_systemd_action --service_name=$app-jicofo --action="stop" --log_path="/var/log/$app/$app-jicofo.log"
@ -74,7 +74,7 @@ ynh_systemd_action --service_name=$app-jicofo --action="stop" --log_path="/var/l
if [ "$upgrade_type" == "UPGRADE_APP" ] if [ "$upgrade_type" == "UPGRADE_APP" ]
then then
ynh_script_progression --message="Upgrading source files..." --time --weight=1 ynh_print_info --message="Upgrading source files..."
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path/jitsi-videobridge" --source_id=jitsi-videobridge ynh_setup_source --dest_dir="$final_path/jitsi-videobridge" --source_id=jitsi-videobridge
@ -85,7 +85,7 @@ fi
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Upgrading nginx web server configuration..." --time --weight=1 ynh_print_info --message="Upgrading nginx web server configuration..."
# Create a dedicated nginx config # Create a dedicated nginx config
ynh_add_nginx_config ynh_add_nginx_config
@ -93,7 +93,7 @@ ynh_add_nginx_config
#================================================= #=================================================
# UPGRADE DEPENDENCIES # UPGRADE DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Upgrading dependencies..." --time --weight=1 ynh_print_info --message="Upgrading dependencies..."
ynh_install_app_dependencies $pkg_dependencies ynh_install_app_dependencies $pkg_dependencies
@ -102,7 +102,7 @@ ynh_install_nodejs --nodejs_version=10
#================================================= #=================================================
# CREATE DEDICATED USER # CREATE DEDICATED USER
#================================================= #=================================================
ynh_script_progression --message="Making sure dedicated system user exists..." --time --weight=1 ynh_print_info --message="Making sure dedicated system user exists..."
# 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
@ -112,7 +112,7 @@ ynh_system_user_create --username=$app --home_dir=$final_path
#================================================= #=================================================
# BUILD JITSI-VIDEOBRIDGE # BUILD JITSI-VIDEOBRIDGE
#================================================= #=================================================
ynh_script_progression --message="Building Jitsi-Videobridge..." --time --weight=1 ynh_print_info --message="Building Jitsi-Videobridge..."
if [ "$upgrade_type" == "UPGRADE_APP" ] if [ "$upgrade_type" == "UPGRADE_APP" ]
then then
@ -124,7 +124,7 @@ fi
#================================================= #=================================================
# BUILD JITSI-JICOFO # BUILD JITSI-JICOFO
#================================================= #=================================================
ynh_script_progression --message="Building Jitsi-Jicofo..." --time --weight=1 ynh_print_info --message="Building Jitsi-Jicofo..."
if [ "$upgrade_type" == "UPGRADE_APP" ] if [ "$upgrade_type" == "UPGRADE_APP" ]
then then
@ -144,7 +144,7 @@ fi
#================================================= #=================================================
# BUILD JITSI-MEET # BUILD JITSI-MEET
#================================================= #=================================================
ynh_script_progression --message="Building Jitsi-Meet..." --time --weight=1 ynh_print_info --message="Building Jitsi-Meet..."
if [ "$upgrade_type" == "UPGRADE_APP" ] if [ "$upgrade_type" == "UPGRADE_APP" ]
@ -171,7 +171,7 @@ fi
#================================================= #=================================================
# SETUP LOGROTATE # SETUP LOGROTATE
#================================================= #=================================================
ynh_script_progression --message="Upgrading logrotate configuration..." --time --weight=1 ynh_print_info --message="Upgrading logrotate configuration..."
# Use logrotate to manage app-specific logfile(s) # Use logrotate to manage app-specific logfile(s)
ynh_use_logrotate --non-append ynh_use_logrotate --non-append
@ -179,7 +179,7 @@ ynh_use_logrotate --non-append
#================================================= #=================================================
# SETUP SYSTEMD # SETUP SYSTEMD
#================================================= #=================================================
ynh_script_progression --message="Upgrading systemd configuration..." --time --weight=1 ynh_print_info --message="Upgrading systemd configuration..."
# Create a dedicated systemd config # Create a dedicated systemd config
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/jitsi-videobridge.service" ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/jitsi-videobridge.service"
@ -205,7 +205,7 @@ chown -R root: $final_path
#================================================= #=================================================
# SETUP SSOWAT # SETUP SSOWAT
#================================================= #=================================================
ynh_script_progression --message="Upgrading SSOwat configuration..." --time --weight=1 ynh_print_info --message="Upgrading SSOwat configuration..."
# Make app public # Make app public
ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" ynh_app_setting_set --app=$app --key=unprotected_uris --value="/"
@ -213,7 +213,7 @@ ynh_app_setting_set --app=$app --key=unprotected_uris --value="/"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." --time --weight=1 ynh_print_info --message="Starting a systemd service..."
ynh_systemd_action --service_name=$app-videobridge --action="start" --log_path="/var/log/$app/$app-videobridge.log" ynh_systemd_action --service_name=$app-videobridge --action="start" --log_path="/var/log/$app/$app-videobridge.log"
ynh_systemd_action --service_name=$app-jicofo --action="start" --log_path="/var/log/$app/$app-jicofo.log" ynh_systemd_action --service_name=$app-jicofo --action="start" --log_path="/var/log/$app/$app-jicofo.log"
@ -221,7 +221,7 @@ ynh_systemd_action --service_name=$app-jicofo --action="start" --log_path="/var/
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================
ynh_script_progression --message="Reloading nginx web server..." --time --weight=1 ynh_print_info --message="Reloading nginx web server..."
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload
@ -229,4 +229,4 @@ ynh_systemd_action --service_name=nginx --action=reload
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Upgrade of $app completed" --time --last ynh_print_info --message="Upgrade of $app completed"