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:
parent
6be634412c
commit
9ca9b92c51
5 changed files with 68 additions and 68 deletions
|
@ -23,7 +23,7 @@ ynh_abort_if_errors
|
|||
#=================================================
|
||||
# LOAD SETTINGS
|
||||
#=================================================
|
||||
ynh_script_progression --message="Loading installation settings..." --time --weight=1
|
||||
ynh_print_info --message="Loading installation settings..."
|
||||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
|
@ -35,7 +35,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain)
|
|||
#=================================================
|
||||
# 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-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
|
||||
#=================================================
|
||||
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"
|
||||
|
||||
#=================================================
|
||||
# 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"
|
||||
|
||||
|
@ -59,14 +59,14 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
|||
#=================================================
|
||||
# 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"
|
||||
|
||||
#=================================================
|
||||
# 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"
|
||||
|
||||
|
@ -77,7 +77,7 @@ ynh_backup --src_path="/usr/lib/metronome/modules/mod_smacks.lua"
|
|||
#=================================================
|
||||
# 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-jicofo.service"
|
||||
|
@ -85,7 +85,7 @@ ynh_backup --src_path="/etc/systemd/system/$app-jicofo.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-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
|
||||
#=================================================
|
||||
|
||||
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)."
|
||||
|
|
|
@ -40,7 +40,7 @@ focus_user="svc${app}focus"
|
|||
#=================================================
|
||||
# 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
|
||||
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
|
||||
#=================================================
|
||||
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=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
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring firewall..." --time --weight=1
|
||||
ynh_print_info --message="Configuring firewall..."
|
||||
|
||||
# Find a free port
|
||||
port=$(ynh_find_port --port=4443)
|
||||
|
@ -90,7 +90,7 @@ ynh_app_setting_set --app=$app --key=port_component --value=$port_component
|
|||
#=================================================
|
||||
# INSTALL DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Installing dependencies..." --time --weight=1
|
||||
ynh_print_info --message="Installing dependencies..."
|
||||
|
||||
ynh_install_app_dependencies $pkg_dependencies
|
||||
|
||||
|
@ -99,7 +99,7 @@ ynh_install_nodejs --nodejs_version=10
|
|||
#=================================================
|
||||
# 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
|
||||
# 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
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring nginx web server..." --time --weight=1
|
||||
ynh_print_info --message="Configuring nginx web server..."
|
||||
|
||||
# Create a dedicated nginx config
|
||||
ynh_add_nginx_config
|
||||
|
@ -118,7 +118,7 @@ ynh_add_nginx_config
|
|||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring system user..." --time --weight=1
|
||||
ynh_print_info --message="Configuring system user..."
|
||||
|
||||
# Create a system user
|
||||
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
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring metronome..." --time --weight=1
|
||||
ynh_print_info --message="Configuring metronome..."
|
||||
|
||||
# Create additional domains
|
||||
if [[ $domain == *"domain.tld"* ]]; then
|
||||
|
@ -166,7 +166,7 @@ ynh_systemd_action --service_name=metronome --action=restart
|
|||
#=================================================
|
||||
# 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"
|
||||
cp ../conf/sip-communicator.properties "$final_path/.sip-communicator/sip-communicator.properties"
|
||||
|
@ -176,7 +176,7 @@ chown -R $app: $final_path
|
|||
#=================================================
|
||||
# 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"
|
||||
mvn package -DskipTests -Dassembly.skipAssembly=false
|
||||
|
@ -191,7 +191,7 @@ ynh_secure_remove --file="$final_path/jitsi-jicofo-build"
|
|||
#=================================================
|
||||
# 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"
|
||||
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
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring a systemd service..." --time --weight=1
|
||||
ynh_print_info --message="Configuring a systemd service..."
|
||||
|
||||
# Create a dedicated systemd config
|
||||
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
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring log rotation..." --time --weight=1
|
||||
ynh_print_info --message="Configuring log rotation..."
|
||||
|
||||
# Use logrotate to manage application logfile(s)
|
||||
ynh_use_logrotate
|
||||
|
@ -257,7 +257,7 @@ yunohost service add $app-jicofo --description "$app jitsi-jicofo for jitsi" --l
|
|||
#=================================================
|
||||
# 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
|
||||
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
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring SSOwat..." --time --weight=1
|
||||
ynh_print_info --message="Configuring SSOwat..."
|
||||
|
||||
# Make app public
|
||||
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
|
||||
#=================================================
|
||||
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
|
||||
|
||||
|
@ -282,4 +282,4 @@ ynh_systemd_action --service_name=nginx --action=reload
|
|||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Installation of $app completed" --time --last
|
||||
ynh_print_info --message="Installation of $app completed"
|
||||
|
|
|
@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers
|
|||
#=================================================
|
||||
# LOAD SETTINGS
|
||||
#=================================================
|
||||
ynh_script_progression --message="Loading installation settings..." --time --weight=1
|
||||
ynh_print_info --message="Loading installation settings..."
|
||||
|
||||
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`
|
||||
if ynh_exec_warn_less yunohost service status $app-videobridge >/dev/null
|
||||
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
|
||||
fi
|
||||
|
||||
if ynh_exec_warn_less yunohost service status $app-jicofo >/dev/null
|
||||
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
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# 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
|
||||
ynh_remove_systemd_config --service=$app-videobridge
|
||||
|
@ -54,7 +54,7 @@ ynh_remove_systemd_config --service=$app-jicofo
|
|||
#=================================================
|
||||
# REMOVE DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing dependencies..." --time --weight=1
|
||||
ynh_print_info --message="Removing dependencies..."
|
||||
|
||||
# Remove metapackage and its dependencies
|
||||
ynh_remove_app_dependencies
|
||||
|
@ -64,7 +64,7 @@ ynh_remove_nodejs
|
|||
#=================================================
|
||||
# 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
|
||||
ynh_secure_remove --file="$final_path"
|
||||
|
@ -72,7 +72,7 @@ ynh_secure_remove --file="$final_path"
|
|||
#=================================================
|
||||
# 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
|
||||
ynh_remove_nginx_config
|
||||
|
@ -80,7 +80,7 @@ ynh_remove_nginx_config
|
|||
#=================================================
|
||||
# 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
|
||||
ynh_remove_logrotate
|
||||
|
@ -91,19 +91,19 @@ ynh_remove_logrotate
|
|||
|
||||
if yunohost firewall list | grep -q "\- $port$"
|
||||
then
|
||||
ynh_script_progression --message="Closing port $port..."
|
||||
ynh_print_info --message="Closing port $port..."
|
||||
ynh_exec_warn_less yunohost firewall disallow TCP $port
|
||||
fi
|
||||
|
||||
if yunohost firewall list | grep -q "\- $port_videobridge$"
|
||||
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
|
||||
fi
|
||||
|
||||
if yunohost firewall list | grep -q "\- $port_component$"
|
||||
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
|
||||
fi
|
||||
|
||||
|
@ -112,7 +112,7 @@ fi
|
|||
#=================================================
|
||||
# RECONFIGURE METRONOME
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reconfiguring Metronome..." --time --weight=1
|
||||
ynh_print_info --message="Reconfiguring Metronome..."
|
||||
|
||||
# Reconfigure metronome
|
||||
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
|
||||
#=================================================
|
||||
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
|
||||
ynh_system_user_delete --username=$app
|
||||
|
@ -160,4 +160,4 @@ ynh_system_user_delete --username=$app
|
|||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Removal of $app completed" --time --last
|
||||
ynh_print_info --message="Removal of $app completed"
|
||||
|
|
|
@ -23,7 +23,7 @@ ynh_abort_if_errors
|
|||
#=================================================
|
||||
# LOAD SETTINGS
|
||||
#=================================================
|
||||
ynh_script_progression --message="Loading settings..." --time --weight=1
|
||||
ynh_print_info --message="Loading settings..."
|
||||
|
||||
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
|
||||
#=================================================
|
||||
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_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
|
||||
#=================================================
|
||||
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"
|
||||
|
||||
#=================================================
|
||||
# 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)
|
||||
ynh_system_user_create --username=$app --home_dir=$final_path
|
||||
|
@ -83,7 +83,7 @@ chown -R root: $final_path
|
|||
#=================================================
|
||||
# REINSTALL DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reinstalling dependencies..." --time --weight=1
|
||||
ynh_print_info --message="Reinstalling dependencies..."
|
||||
|
||||
# Define and install dependencies
|
||||
ynh_install_app_dependencies $pkg_dependencies
|
||||
|
@ -93,7 +93,7 @@ ynh_install_nodejs --nodejs_version=10
|
|||
#=================================================
|
||||
# CONFIGURE FIREWALL
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring firewall..." --time --weight=1
|
||||
ynh_print_info --message="Configuring firewall..."
|
||||
|
||||
# Open this 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
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring metronome..." --time --weight=1
|
||||
ynh_print_info --message="Configuring metronome..."
|
||||
|
||||
# Create additional domains
|
||||
if [[ $domain == *"domain.tld"* ]]; then
|
||||
|
@ -135,7 +135,7 @@ ynh_systemd_action --service_name=metronome --action=restart
|
|||
#=================================================
|
||||
# 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"
|
||||
systemctl enable $app-videobridge.service
|
||||
|
@ -152,7 +152,7 @@ yunohost service add $app-jicofo --log "/var/log/$app/$app-jicofo.log"
|
|||
#=================================================
|
||||
# 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-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
|
||||
#=================================================
|
||||
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
|
||||
|
||||
|
@ -176,4 +176,4 @@ ynh_systemd_action --service_name=nginx --action=reload
|
|||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Restoration completed for $app" --time --last
|
||||
ynh_print_info --message="Restoration completed for $app"
|
||||
|
|
|
@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers
|
|||
#=================================================
|
||||
# LOAD SETTINGS
|
||||
#=================================================
|
||||
ynh_script_progression --message="Loading installation settings..." --time --weight=1
|
||||
ynh_print_info --message="Loading installation settings..."
|
||||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
|
@ -36,7 +36,7 @@ upgrade_type=$(ynh_check_app_version_changed)
|
|||
#=================================================
|
||||
# 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 [ -z "$final_path" ]; then
|
||||
|
@ -47,7 +47,7 @@ fi
|
|||
#=================================================
|
||||
# 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
|
||||
ynh_backup_before_upgrade
|
||||
|
@ -63,7 +63,7 @@ ynh_abort_if_errors
|
|||
#=================================================
|
||||
# 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-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" ]
|
||||
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
|
||||
ynh_setup_source --dest_dir="$final_path/jitsi-videobridge" --source_id=jitsi-videobridge
|
||||
|
@ -85,7 +85,7 @@ fi
|
|||
#=================================================
|
||||
# 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
|
||||
ynh_add_nginx_config
|
||||
|
@ -93,7 +93,7 @@ ynh_add_nginx_config
|
|||
#=================================================
|
||||
# UPGRADE DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Upgrading dependencies..." --time --weight=1
|
||||
ynh_print_info --message="Upgrading dependencies..."
|
||||
|
||||
ynh_install_app_dependencies $pkg_dependencies
|
||||
|
||||
|
@ -102,7 +102,7 @@ ynh_install_nodejs --nodejs_version=10
|
|||
#=================================================
|
||||
# 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)
|
||||
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
|
||||
#=================================================
|
||||
ynh_script_progression --message="Building Jitsi-Videobridge..." --time --weight=1
|
||||
ynh_print_info --message="Building Jitsi-Videobridge..."
|
||||
|
||||
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||
then
|
||||
|
@ -124,7 +124,7 @@ fi
|
|||
#=================================================
|
||||
# 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" ]
|
||||
then
|
||||
|
@ -144,7 +144,7 @@ fi
|
|||
#=================================================
|
||||
# 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" ]
|
||||
|
@ -171,7 +171,7 @@ fi
|
|||
#=================================================
|
||||
# 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)
|
||||
ynh_use_logrotate --non-append
|
||||
|
@ -179,7 +179,7 @@ ynh_use_logrotate --non-append
|
|||
#=================================================
|
||||
# SETUP SYSTEMD
|
||||
#=================================================
|
||||
ynh_script_progression --message="Upgrading systemd configuration..." --time --weight=1
|
||||
ynh_print_info --message="Upgrading systemd configuration..."
|
||||
|
||||
# Create a dedicated systemd config
|
||||
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
|
||||
#=================================================
|
||||
ynh_script_progression --message="Upgrading SSOwat configuration..." --time --weight=1
|
||||
ynh_print_info --message="Upgrading SSOwat configuration..."
|
||||
|
||||
# Make app public
|
||||
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
|
||||
#=================================================
|
||||
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-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
|
||||
#=================================================
|
||||
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
|
||||
|
||||
|
@ -229,4 +229,4 @@ ynh_systemd_action --service_name=nginx --action=reload
|
|||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Upgrade of $app completed" --time --last
|
||||
ynh_print_info --message="Upgrade of $app completed"
|
||||
|
|
Loading…
Add table
Reference in a new issue