mirror of
https://github.com/YunoHost-Apps/mumbleserver_ynh.git
synced 2024-09-03 19:46:03 +02:00
Fix
This commit is contained in:
parent
4d6e373d69
commit
63df56b4de
3 changed files with 71 additions and 32 deletions
|
@ -82,8 +82,6 @@ ynh_exec_warn_less yunohost firewall allow Both $port
|
|||
if [ "$mumbleweb" -eq 1 ] ; then
|
||||
port_web=$(ynh_find_port --port=64737)
|
||||
ynh_app_setting_set --app=$app --key=port_web --value=$port_web
|
||||
# Open port in firewall
|
||||
#ynh_exec_warn_less yunohost firewall allow Both $port_web
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
|
@ -111,9 +109,8 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
|
|||
#=================================================
|
||||
ynh_script_progression --message="Installing Mumble Web..." --weight=4
|
||||
|
||||
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
||||
|
||||
if [ "$mumbleweb" -eq 1 ] ; then
|
||||
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
||||
ynh_setup_source --dest_dir="$final_path"
|
||||
fi
|
||||
|
||||
|
@ -123,7 +120,9 @@ fi
|
|||
ynh_script_progression --message="Configuring NGINX web server..." --weight=1
|
||||
|
||||
# Create a dedicated nginx config
|
||||
if [ "$mumbleweb" -eq 1 ] ; then
|
||||
ynh_add_nginx_config
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC SETUP
|
||||
|
@ -198,7 +197,9 @@ ynh_script_progression --message="Integrating service in YunoHost..."
|
|||
# Add Mumble as a YunoHost service
|
||||
yunohost service add $app --description="Mumble server" --log="/var/log/$app/$app.log" --needs_exposed_ports=$port
|
||||
# Add Mumble as a YunoHost service
|
||||
if [ "$mumbleweb" -eq 1 ] ; then
|
||||
yunohost service add mumble-web --description="Mumble web interface" --log="/var/log/$app/mumble-web.log"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# START SYSTEMD SERVICE
|
||||
|
@ -206,12 +207,15 @@ yunohost service add mumble-web --description="Mumble web interface" --log="/var
|
|||
ynh_script_progression --message="Starting a systemd service..." --weight=3
|
||||
|
||||
ynh_systemd_action --service_name=$app --action=restart --log_path="/var/log/$app/$app.log"
|
||||
|
||||
if [ "$mumbleweb" -eq 1 ] ; then
|
||||
ynh_systemd_action --service_name=mumble-web --action=restart --log_path="/var/log/$app/mumble-web.log"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# SETUP SSOWAT
|
||||
#=================================================
|
||||
|
||||
if [ "$mumbleweb" -eq 1 ] ; then
|
||||
ynh_script_progression --message="Configuring permissions..." --weight=1
|
||||
|
||||
# Make app public if necessary
|
||||
|
@ -219,13 +223,17 @@ if [ $is_public -eq 1 ]
|
|||
then
|
||||
ynh_permission_update --permission="main" --add="visitors"
|
||||
fi
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
|
||||
if [ "$mumbleweb" -eq 1 ] ; then
|
||||
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
|
||||
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# SEND README TO ADMIN
|
||||
|
|
|
@ -26,18 +26,20 @@ 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)
|
||||
port=$(ynh_app_setting_get --app=$app --key=port)
|
||||
mumbleweb=$(ynh_app_setting_get --app=$app --key=mumbleweb)
|
||||
|
||||
#=================================================
|
||||
# CHECK IF THE APP CAN BE RESTORED
|
||||
#=================================================
|
||||
ynh_script_progression --message="Validating restoration parameters..." --weight=1
|
||||
|
||||
if [ "$mumbleweb" -eq 1 ] ; then
|
||||
ynh_script_progression --message="Validating restoration parameters..." --weight=1
|
||||
|
||||
ynh_webpath_available --domain=$domain --path_url=$path_url \
|
||||
|| ynh_die --message="Path not available: ${domain}${path_url}"
|
||||
test ! -d $final_path \
|
||||
|| ynh_die --message="There is already a directory: $final_path "
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# STANDARD RESTORATION STEPS
|
||||
|
@ -45,7 +47,9 @@ test ! -d $final_path \
|
|||
# RESTORE THE NGINX CONFIGURATION
|
||||
#=================================================
|
||||
|
||||
if [ "$mumbleweb" -eq 1 ] ; then
|
||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# RECREATE THE DEDICATED USER
|
||||
|
@ -71,6 +75,10 @@ ynh_script_progression --message="Reinstalling dependencies..." --weight=4
|
|||
# Define and install dependencies
|
||||
ynh_install_app_dependencies $pkg_dependencies
|
||||
|
||||
if [ "$mumbleweb" -eq 1 ] ; then
|
||||
ynh_install_nodejs --nodejs_version=$nodejs_version
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# RESTORE USER RIGHTS
|
||||
#=================================================
|
||||
|
@ -102,7 +110,9 @@ ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
|||
# Add Mumble as a YunoHost service
|
||||
yunohost service add $app --description="Mumble server" --log="/var/log/$app/$app.log" --needs_exposed_ports=$port
|
||||
# Add Mumble as a YunoHost service
|
||||
if [ "$mumbleweb" -eq 1 ] ; then
|
||||
yunohost service add mumble-web --description="Mumble web interface" --log="/var/log/$app/mumble-web.log"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# RESTORE SYSTEMD
|
||||
|
@ -112,8 +122,10 @@ ynh_script_progression --message="Restoring the systemd configuration..." --weig
|
|||
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
|
||||
systemctl enable "$app.service" --quiet
|
||||
|
||||
if [ "$mumbleweb" -eq 1 ] ; then
|
||||
ynh_restore_file --origin_path="/etc/systemd/system/mumble-web.service"
|
||||
systemctl enable "mumble-web.service" --quiet
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# START SYSTEMD SERVICE
|
||||
|
@ -121,16 +133,21 @@ systemctl enable "mumble-web.service" --quiet
|
|||
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
||||
|
||||
ynh_systemd_action --service_name="$app" --action="start" --log_path="/var/log/$app/$app.log"
|
||||
if [ "$mumbleweb" -eq 1 ] ; then
|
||||
ynh_systemd_action --service_name="mumble-web" --action="start" --log_path="/var/log/$app/mumble-web.log"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
# RELOAD NGINX AND PHP-FPM
|
||||
#=================================================
|
||||
|
||||
if [ "$mumbleweb" -eq 1 ] ; then
|
||||
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
|
||||
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
|
|
|
@ -125,7 +125,9 @@ ynh_abort_if_errors
|
|||
ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
||||
|
||||
ynh_systemd_action --service_name="$app" --action="stop"
|
||||
if [ "$mumbleweb" -eq 1 ] ; then
|
||||
ynh_systemd_action --service_name="mumble-web" --action="stop"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
|
@ -152,7 +154,9 @@ fi
|
|||
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=5
|
||||
|
||||
# Create a dedicated nginx config
|
||||
if [ "$mumbleweb" -eq 1 ] ; then
|
||||
ynh_add_nginx_config
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# INSTALL DEPENDENCIES
|
||||
|
@ -162,6 +166,10 @@ ynh_script_progression --message="Upgrading dependencies..." --weight=1
|
|||
# Install Mumble Debian package via apt
|
||||
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
|
||||
|
||||
if [ "$mumbleweb" -eq 1 ] ; then
|
||||
ynh_install_nodejs --nodejs_version=$nodejs_version
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC UPGRADE
|
||||
#=================================================
|
||||
|
@ -222,7 +230,9 @@ systemctl disable mumble-server --quiet
|
|||
# Add Mumble as a YunoHost service
|
||||
yunohost service add $app --description="Mumble server" --log="/var/log/$app/$app.log" --needs_exposed_ports=$port
|
||||
# Add Mumble as a YunoHost service
|
||||
if [ "$mumbleweb" -eq 1 ] ; then
|
||||
yunohost service add mumble-web --description="Mumble web interface" --log="/var/log/$app/mumble-web.log"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# START SYSTEMD SERVICE
|
||||
|
@ -230,21 +240,25 @@ yunohost service add mumble-web --description="Mumble web interface" --log="/var
|
|||
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
||||
|
||||
ynh_systemd_action --service_name="$app" --action="start" --log_path="/var/log/$app/$app.log"
|
||||
if [ "$mumbleweb" -eq 1 ] ; then
|
||||
ynh_systemd_action --service_name="mumble-web" --action="start" --log_path="/var/log/$app/mumble-web.log"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
if [ "$mumbleweb" -eq 1 ] ; then
|
||||
ynh_script_progression --message="Reloading NGINX web server..." --weight=2
|
||||
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# SEND README TO ADMIN
|
||||
#=================================================
|
||||
|
||||
message="
|
||||
Mumble-server was updated!
|
||||
Mumble server was updated!
|
||||
|
||||
Port : $port
|
||||
Password to join server: $server_password
|
||||
|
@ -252,7 +266,7 @@ SuperUser Password : $su_passwd
|
|||
Welcome text : $welcometext
|
||||
Root channel (your mumble server name): $registername
|
||||
Final path (where to find your files) : $final_path
|
||||
Mumble configuration file : ../conf/mumble-server.ini
|
||||
Mumble configuration file : $final_path/mumble-server.ini
|
||||
|
||||
Note about config file: this package will regenerate the config file on upgrade.
|
||||
If you changed it manually and upgrade mumble, you'll find a backup in $final_path.
|
||||
|
|
Loading…
Add table
Reference in a new issue