2019-06-06 06:04:22 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# MANAGE SCRIPT FAILURE
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_clean_setup () {
|
2019-08-06 21:18:00 +02:00
|
|
|
ynh_clean_check_starting
|
2019-06-06 06:04:22 +02:00
|
|
|
}
|
|
|
|
# Exit if an error occurs during the execution of the script
|
|
|
|
ynh_abort_if_errors
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# RETRIEVE ARGUMENTS FROM THE MANIFEST
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
domain=$YNH_APP_ARG_DOMAIN
|
|
|
|
path_url="/"
|
|
|
|
|
2019-07-13 14:18:06 +02:00
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
|
2019-06-06 06:04:22 +02:00
|
|
|
#YOURSECRET3
|
|
|
|
focus_password=$(ynh_string_random --length=8)
|
|
|
|
#YOURSECRET1
|
|
|
|
videobridge_secret=$(ynh_string_random --length=8)
|
|
|
|
#YOURSECRET2
|
|
|
|
focus_secret=$(ynh_string_random --length=8)
|
|
|
|
|
2020-04-13 17:16:38 +02:00
|
|
|
focus_user="focus"
|
2019-06-06 06:04:22 +02:00
|
|
|
|
2020-04-13 17:16:38 +02:00
|
|
|
videobridge_user="jvb"
|
2020-04-10 05:21:33 +02:00
|
|
|
|
2019-06-06 06:04:22 +02:00
|
|
|
#=================================================
|
|
|
|
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
|
|
|
|
#=================================================
|
2020-06-18 02:03:31 +02:00
|
|
|
ynh_script_progression --message="Validating installation parameters..."
|
2019-06-06 06:04:22 +02:00
|
|
|
|
|
|
|
final_path=/var/www/$app
|
|
|
|
test ! -e "$final_path" || ynh_die --message="This path already contains a folder"
|
|
|
|
|
|
|
|
# Register (book) web path
|
|
|
|
ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STORE SETTINGS FROM MANIFEST
|
|
|
|
#=================================================
|
2020-06-18 02:03:31 +02:00
|
|
|
ynh_script_progression --message="Storing installation settings..."
|
2019-06-06 06:04:22 +02:00
|
|
|
|
|
|
|
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=focus_password --value=$focus_password
|
|
|
|
ynh_app_setting_set --app=$app --key=videobridge_secret --value=$videobridge_secret
|
|
|
|
ynh_app_setting_set --app=$app --key=focus_secret --value=$focus_secret
|
2019-07-13 14:18:06 +02:00
|
|
|
ynh_app_setting_set --app=$app --key=focus_user --value=$focus_user
|
2020-04-13 17:16:38 +02:00
|
|
|
ynh_app_setting_set --app=$app --key=videobridge_user --value=$videobridge_user
|
2019-06-06 06:04:22 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD MODIFICATIONS
|
|
|
|
#=================================================
|
|
|
|
# FIND AND OPEN A PORT
|
|
|
|
#=================================================
|
2020-06-18 02:03:31 +02:00
|
|
|
ynh_script_progression --message="Configuring firewall..."
|
2019-06-06 06:04:22 +02:00
|
|
|
|
2020-01-15 21:40:17 +01:00
|
|
|
# Find an available port
|
2019-06-06 06:04:22 +02:00
|
|
|
port=$(ynh_find_port --port=4443)
|
|
|
|
# Open this port
|
|
|
|
ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port
|
|
|
|
ynh_app_setting_set --app=$app --key=port --value=$port
|
|
|
|
|
2020-01-15 21:40:17 +01:00
|
|
|
# Find an available port
|
2019-07-14 01:17:46 +02:00
|
|
|
port_videobridge=$(ynh_find_port --port=10000)
|
2019-07-13 14:18:06 +02:00
|
|
|
# Open this port
|
2019-07-14 01:17:46 +02:00
|
|
|
ynh_exec_warn_less yunohost firewall allow --no-upnp UDP $port_videobridge
|
2019-07-13 14:18:06 +02:00
|
|
|
ynh_app_setting_set --app=$app --key=port_videobridge --value=$port_videobridge
|
|
|
|
|
2020-01-15 21:40:17 +01:00
|
|
|
# Find an available port
|
2019-07-14 01:17:46 +02:00
|
|
|
port_component=$(ynh_find_port --port=5347)
|
|
|
|
ynh_app_setting_set --app=$app --key=port_component --value=$port_component
|
|
|
|
|
2019-06-06 06:04:22 +02:00
|
|
|
#=================================================
|
|
|
|
# INSTALL DEPENDENCIES
|
|
|
|
#=================================================
|
2020-06-18 02:03:31 +02:00
|
|
|
ynh_script_progression --message="Installing dependencies..."
|
2019-06-06 06:04:22 +02:00
|
|
|
|
|
|
|
ynh_install_app_dependencies $pkg_dependencies
|
|
|
|
|
2020-04-10 05:21:33 +02:00
|
|
|
#ynh_install_nodejs --nodejs_version=10
|
2019-06-06 06:04:22 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
|
|
|
#=================================================
|
2020-06-18 02:03:31 +02:00
|
|
|
ynh_script_progression --message="Setting up source files..."
|
2019-06-06 06:04:22 +02:00
|
|
|
|
|
|
|
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
2020-04-10 05:21:33 +02:00
|
|
|
|
2019-06-06 06:04:22 +02:00
|
|
|
# Download, check integrity, uncompress and patch the source from app.src
|
2020-04-10 05:21:33 +02:00
|
|
|
declare -A packages
|
|
|
|
packages[jicofo]="jicofo"
|
|
|
|
packages[jitsi-meet-prosody]="jitsi-meet/prosody-plugins"
|
|
|
|
packages[jitsi-meet-web]="jitsi-meet"
|
|
|
|
packages[jitsi-videobridge]="jitsi-videobridge"
|
|
|
|
|
|
|
|
for package in "${!packages[@]}"
|
|
|
|
do
|
|
|
|
ynh_setup_source --dest_dir="$final_path/${package}_temp" --source_id=$package
|
|
|
|
pushd "$final_path/${package}_temp"
|
|
|
|
ar x $package.deb data.tar.xz
|
|
|
|
tar xf data.tar.xz
|
|
|
|
popd
|
|
|
|
|
|
|
|
mv "$final_path/${package}_temp/usr/share/${packages[$package]}/" "$final_path/${package}/"
|
2020-06-18 02:55:00 +02:00
|
|
|
ynh_secure_remove --file="$final_path/${package}_temp"
|
2020-04-13 21:08:04 +02:00
|
|
|
done
|
|
|
|
|
|
|
|
# Adapt prosody module to metronome
|
|
|
|
for file in $final_path/jitsi-meet-prosody/*.lua
|
|
|
|
do
|
|
|
|
ynh_replace_string --match_string="prosody" --replace_string="metronome" --target_file="$file"
|
|
|
|
ynh_replace_string --match_string="Prosody" --replace_string="Metronome" --target_file="$file"
|
|
|
|
done
|
|
|
|
|
|
|
|
for directory in $final_path/jitsi-meet-prosody/*/; do
|
|
|
|
for file in $directory/*.lua
|
|
|
|
do
|
|
|
|
ynh_replace_string --match_string="prosody" --replace_string="metronome" --target_file="$file"
|
|
|
|
ynh_replace_string --match_string="Prosody" --replace_string="Metronome" --target_file="$file"
|
|
|
|
done
|
2020-04-10 05:21:33 +02:00
|
|
|
done
|
2019-06-06 06:04:22 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# NGINX CONFIGURATION
|
|
|
|
#=================================================
|
2020-06-18 02:03:31 +02:00
|
|
|
ynh_script_progression --message="Configuring nginx web server..."
|
2019-06-06 06:04:22 +02:00
|
|
|
|
|
|
|
# Create a dedicated nginx config
|
|
|
|
ynh_add_nginx_config
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# CREATE DEDICATED USER
|
|
|
|
#=================================================
|
2020-06-18 02:03:31 +02:00
|
|
|
ynh_script_progression --message="Configuring system user..."
|
2019-06-06 06:04:22 +02:00
|
|
|
|
|
|
|
# Create a system user
|
|
|
|
ynh_system_user_create --username=$app --home_dir=$final_path
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# SPECIFIC SETUP
|
|
|
|
#=================================================
|
|
|
|
# CONFIGURE METRONOME
|
|
|
|
#=================================================
|
2020-06-18 02:03:31 +02:00
|
|
|
ynh_script_progression --message="Configuring metronome..."
|
2019-06-06 06:04:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
# Create focus user
|
2020-04-10 05:21:33 +02:00
|
|
|
yunohost domain add auth.$domain
|
2020-04-15 08:50:39 +02:00
|
|
|
# yunohost user create $focus_user -f $focus_user -l $focus_user -m ${focus_user}@auth.$domain -p $focus_password -q 0
|
|
|
|
# yunohost user create $videobridge_user -f $videobridge_user -l $videobridge_user -m ${videobridge_user}@auth.$domain -p $videobridge_secret -q 0
|
2019-06-06 06:04:22 +02:00
|
|
|
|
2019-08-25 03:40:54 +02:00
|
|
|
# Add Metronome domain conf template
|
|
|
|
metronome_conf="/usr/share/yunohost/templates/jitsi/$domain.cfg.lua"
|
|
|
|
mkdir -p /usr/share/yunohost/templates/jitsi/
|
|
|
|
cp ../conf/metronome.cfg.lua $metronome_conf
|
2020-04-10 05:21:33 +02:00
|
|
|
ynh_replace_string --match_string="__PORT_COMPONENT__" --replace_string="$port_component" --target_file="$metronome_conf"
|
|
|
|
ynh_replace_string --match_string="__FINAL_PATH__" --replace_string="$final_path" --target_file="$metronome_conf"
|
2019-08-25 03:40:54 +02:00
|
|
|
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$metronome_conf"
|
|
|
|
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$metronome_conf"
|
|
|
|
ynh_replace_string --match_string="__FOCUS_SECRET__" --replace_string="$focus_secret" --target_file="$metronome_conf"
|
2020-04-10 05:21:33 +02:00
|
|
|
ynh_replace_string --match_string="__FOCUS_USER__" --replace_string="$focus_user" --target_file="$metronome_conf"
|
2020-04-13 17:16:38 +02:00
|
|
|
ynh_replace_string --match_string="__VIDEOBRIDGE_USER__" --replace_string="$videobridge_user" --target_file="$metronome_conf"
|
2019-08-25 03:40:54 +02:00
|
|
|
|
|
|
|
touch "/usr/share/yunohost/templates/jitsi/auth.$domain.cfg.lua"
|
|
|
|
|
|
|
|
# Add Metronome hook
|
|
|
|
cp -R ../conf/metronome_regen_conf.hook /usr/share/yunohost/hooks/conf_regen/50-metronome_$app
|
|
|
|
|
2020-06-18 15:03:24 +02:00
|
|
|
yunohost tools regen-conf metronome
|
2019-06-06 06:04:22 +02:00
|
|
|
|
2020-04-15 08:50:39 +02:00
|
|
|
metronomectl adduser $focus_user@auth.$domain $focus_password || true
|
|
|
|
metronomectl adduser $videobridge_user@auth.$domain $videobridge_secret || true
|
|
|
|
|
2019-06-06 06:04:22 +02:00
|
|
|
#=================================================
|
2020-04-10 05:21:33 +02:00
|
|
|
# CONFIGURE JITSI-VIDEOBRIDGE
|
2019-06-06 06:04:22 +02:00
|
|
|
#=================================================
|
2020-06-18 02:03:31 +02:00
|
|
|
ynh_script_progression --message="Configuring Jitsi-Videobridge..."
|
2019-06-06 06:04:22 +02:00
|
|
|
|
2020-03-31 19:56:56 +02:00
|
|
|
public_ipv4="$(curl ip.yunohost.org)" || true
|
|
|
|
private_ipv4="$(ip route get 1 | sed -n 's/^.*src \([0-9.]*\) .*$/\1/p')" || true
|
|
|
|
|
2020-05-01 09:56:02 +02:00
|
|
|
muc_nickname=$(uuidgen)
|
|
|
|
ynh_app_setting_set --app=$app --key=muc_nickname --value=$muc_nickname
|
|
|
|
|
2020-04-11 21:55:05 +02:00
|
|
|
mkdir -p "/etc/$app/videobridge"
|
|
|
|
|
|
|
|
jitsi_videobridge_sip_communicator_conf="/etc/$app/videobridge/sip-communicator.properties"
|
|
|
|
cp ../conf/jitsi-videobridge-sip-communicator.properties "$jitsi_videobridge_sip_communicator_conf"
|
|
|
|
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$jitsi_videobridge_sip_communicator_conf"
|
|
|
|
ynh_replace_string --match_string="__PRIVATE_IPV4__" --replace_string="$private_ipv4" --target_file="$jitsi_videobridge_sip_communicator_conf"
|
|
|
|
ynh_replace_string --match_string="__PUBLIC_IPV4__" --replace_string="$public_ipv4" --target_file="$jitsi_videobridge_sip_communicator_conf"
|
|
|
|
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$jitsi_videobridge_sip_communicator_conf"
|
2020-04-13 17:16:38 +02:00
|
|
|
ynh_replace_string --match_string="__VIDEOBRIDGE_USER__" --replace_string="$videobridge_user" --target_file="$jitsi_videobridge_sip_communicator_conf"
|
|
|
|
ynh_replace_string --match_string="__VIDEOBRIDGE_SECRET__" --replace_string="$videobridge_secret" --target_file="$jitsi_videobridge_sip_communicator_conf"
|
2020-04-11 21:55:05 +02:00
|
|
|
ynh_replace_string --match_string="__MUC_NICKNAME__" --replace_string="$muc_nickname" --target_file="$jitsi_videobridge_sip_communicator_conf"
|
|
|
|
|
|
|
|
jitsi_videobridge_conf="/etc/$app/videobridge/config"
|
|
|
|
cp ../conf/jitsi-videobridge.config "$jitsi_videobridge_conf"
|
|
|
|
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$jitsi_videobridge_conf"
|
|
|
|
ynh_replace_string --match_string="__PORT_COMPONENT__" --replace_string="$port_component" --target_file="$jitsi_videobridge_conf"
|
|
|
|
ynh_replace_string --match_string="__VIDEOBRIDGE_SECRET__" --replace_string="$videobridge_secret" --target_file="$jitsi_videobridge_conf"
|
|
|
|
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$jitsi_videobridge_conf"
|
|
|
|
|
|
|
|
jitsi_videobridge_logging_conf="/etc/$app/videobridge/logging.properties"
|
|
|
|
cp ../conf/jitsi-videobridge-logging.properties "$jitsi_videobridge_logging_conf"
|
|
|
|
|
2020-04-15 08:50:39 +02:00
|
|
|
jitsi_videobridge_callstats_java_sdk_conf="/etc/$app/videobridge/callstats-java-sdk.properties"
|
|
|
|
cp ../conf/jitsi-videobridge-callstats-java-sdk.properties "$jitsi_videobridge_callstats_java_sdk_conf"
|
|
|
|
|
|
|
|
jitsi_videobridge_log4j2_conf="/etc/$app/videobridge/log4j2.xml"
|
|
|
|
cp ../conf/jitsi-videobridge-log4j2.xml "$jitsi_videobridge_log4j2_conf"
|
|
|
|
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$jitsi_videobridge_log4j2_conf"
|
|
|
|
|
|
|
|
jitsi_videobridge_20_jvb_udp_buffers_conf="/etc/sysctl.d/20-jvb-udp-buffers.conf"
|
|
|
|
cp ../conf/jitsi-videobridge-20-jvb-udp-buffers.conf "$jitsi_videobridge_20_jvb_udp_buffers_conf"
|
|
|
|
sysctl --system || true
|
|
|
|
|
2020-04-11 21:55:05 +02:00
|
|
|
#=================================================
|
|
|
|
# CONFIGURE JITSI-JICOFO
|
|
|
|
#=================================================
|
2020-06-18 02:03:31 +02:00
|
|
|
ynh_script_progression --message="Configuring Jitsi-Jicofo..."
|
2020-04-11 21:55:05 +02:00
|
|
|
|
|
|
|
mkdir -p "/etc/$app/jicofo"
|
|
|
|
|
|
|
|
jitsi_jicofo_sip_communicator_conf="/etc/$app/jicofo/sip-communicator.properties"
|
|
|
|
cp ../conf/jitsi-jicofo-sip-communicator.properties "$jitsi_jicofo_sip_communicator_conf"
|
|
|
|
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$jitsi_jicofo_sip_communicator_conf"
|
|
|
|
|
|
|
|
jitsi_jicofo_conf="/etc/$app/jicofo/config"
|
|
|
|
cp ../conf/jitsi-jicofo.config "$jitsi_jicofo_conf"
|
|
|
|
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$jitsi_jicofo_conf"
|
|
|
|
ynh_replace_string --match_string="__PORT_COMPONENT__" --replace_string="$port_component" --target_file="$jitsi_jicofo_conf"
|
|
|
|
ynh_replace_string --match_string="__FOCUS_SECRET__" --replace_string="$focus_secret" --target_file="$jitsi_jicofo_conf"
|
|
|
|
ynh_replace_string --match_string="__FOCUS_USER__" --replace_string="$focus_user" --target_file="$jitsi_jicofo_conf"
|
|
|
|
ynh_replace_string --match_string="__FOCUS_PASSWORD__" --replace_string="$focus_password" --target_file="$jitsi_jicofo_conf"
|
|
|
|
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$jitsi_jicofo_conf"
|
|
|
|
|
|
|
|
jitsi_jicofo_logging_conf="/etc/$app/jicofo/logging.properties"
|
|
|
|
cp ../conf/jitsi-jicofo-logging.properties "$jitsi_jicofo_logging_conf"
|
2019-06-06 06:04:22 +02:00
|
|
|
|
|
|
|
#=================================================
|
2020-04-10 05:21:33 +02:00
|
|
|
# CONFIGURE JITSI-MEET
|
2019-06-06 06:04:22 +02:00
|
|
|
#=================================================
|
2020-06-18 02:03:31 +02:00
|
|
|
ynh_script_progression --message="Configuring Jitsi-Meet..."
|
2019-07-13 23:45:40 +02:00
|
|
|
|
2020-04-11 21:55:05 +02:00
|
|
|
mkdir -p "/etc/$app/meet"
|
|
|
|
|
2020-04-15 08:50:39 +02:00
|
|
|
jitsi_meet_conf="/etc/$app/meet/$domain-config.js"
|
2020-04-11 21:55:05 +02:00
|
|
|
cp ../conf/config.js "$jitsi_meet_conf"
|
|
|
|
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$jitsi_meet_conf"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# CREATE LOG DIR
|
|
|
|
#=================================================
|
2020-06-18 02:03:31 +02:00
|
|
|
ynh_script_progression --message="Creating log dir..."
|
2020-04-11 21:55:05 +02:00
|
|
|
|
|
|
|
mkdir -p "/var/log/$app"
|
2019-06-06 06:04:22 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# SETUP SYSTEMD
|
|
|
|
#=================================================
|
2020-06-18 02:03:31 +02:00
|
|
|
ynh_script_progression --message="Configuring a systemd service..."
|
2019-06-06 06:04:22 +02:00
|
|
|
|
|
|
|
# Create a dedicated systemd config
|
2019-07-13 14:18:06 +02:00
|
|
|
ynh_add_systemd_config --service=$app-videobridge --template="jitsi-videobridge.service"
|
|
|
|
ynh_add_systemd_config --service=$app-jicofo --template="jitsi-jicofo.service"
|
2019-06-06 06:04:22 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STORE THE CONFIG FILE CHECKSUM
|
|
|
|
#=================================================
|
2020-06-18 02:03:31 +02:00
|
|
|
ynh_script_progression --message="Storing the config file checksum..."
|
2019-06-06 06:04:22 +02:00
|
|
|
|
|
|
|
# Calculate and store the config file checksum into the app settings
|
2020-04-11 21:55:05 +02:00
|
|
|
ynh_store_file_checksum --file="$jitsi_videobridge_sip_communicator_conf"
|
|
|
|
ynh_store_file_checksum --file="$jitsi_videobridge_conf"
|
|
|
|
ynh_store_file_checksum --file="$jitsi_videobridge_logging_conf"
|
|
|
|
ynh_store_file_checksum --file="$jitsi_jicofo_sip_communicator_conf"
|
|
|
|
ynh_store_file_checksum --file="$jitsi_jicofo_conf"
|
|
|
|
ynh_store_file_checksum --file="$jitsi_jicofo_logging_conf"
|
|
|
|
ynh_store_file_checksum --file="$jitsi_meet_conf"
|
2019-06-06 06:04:22 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC FINALIZATION
|
|
|
|
#=================================================
|
|
|
|
# SECURE FILES AND DIRECTORIES
|
|
|
|
#=================================================
|
2020-06-18 02:03:31 +02:00
|
|
|
ynh_script_progression --message="Securing files and directories..."
|
2019-06-06 06:04:22 +02:00
|
|
|
|
|
|
|
# Set permissions to app files
|
2019-07-13 14:18:06 +02:00
|
|
|
chown -R $app: $final_path
|
2020-04-11 21:55:05 +02:00
|
|
|
chown -R $app: /etc/$app
|
|
|
|
chown -R $app: /var/log/$app
|
2020-04-15 08:50:39 +02:00
|
|
|
chmod -R 770 /var/log/$app
|
2019-06-06 06:04:22 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# SETUP LOGROTATE
|
|
|
|
#=================================================
|
2020-06-18 02:03:31 +02:00
|
|
|
ynh_script_progression --message="Configuring log rotation..."
|
2019-06-06 06:04:22 +02:00
|
|
|
|
|
|
|
# Use logrotate to manage application logfile(s)
|
|
|
|
ynh_use_logrotate
|
|
|
|
|
|
|
|
#=================================================
|
2020-01-15 21:40:17 +01:00
|
|
|
# INTEGRATE SERVICE IN YUNOHOST
|
2019-06-06 06:04:22 +02:00
|
|
|
#=================================================
|
2020-06-18 02:03:31 +02:00
|
|
|
ynh_script_progression --message="Integrating service in YunoHost..."
|
2019-06-06 06:04:22 +02:00
|
|
|
|
2019-07-13 14:18:06 +02:00
|
|
|
yunohost service add $app-videobridge --description "$app jitsi-videobridge for jitsi" --log "/var/log/$app/$app-videobridge.log"
|
|
|
|
yunohost service add $app-jicofo --description "$app jitsi-jicofo for jitsi" --log "/var/log/$app/$app-jicofo.log"
|
2019-06-06 06:04:22 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# START SYSTEMD SERVICE
|
|
|
|
#=================================================
|
2020-06-18 02:03:31 +02:00
|
|
|
ynh_script_progression --message="Starting a systemd service..."
|
2019-06-06 06:04:22 +02:00
|
|
|
|
|
|
|
# Start a systemd service
|
2019-07-13 14:18:06 +02:00
|
|
|
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"
|
2019-06-06 06:04:22 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# SETUP SSOWAT
|
|
|
|
#=================================================
|
2020-06-18 02:03:31 +02:00
|
|
|
ynh_script_progression --message="Configuring SSOwat..."
|
2019-06-06 06:04:22 +02:00
|
|
|
|
|
|
|
# Make app public
|
|
|
|
ynh_app_setting_set --app=$app --key=unprotected_uris --value="/"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# RELOAD NGINX
|
|
|
|
#=================================================
|
2020-06-18 02:03:31 +02:00
|
|
|
ynh_script_progression --message="Reloading nginx web server..."
|
2019-06-06 06:04:22 +02:00
|
|
|
|
|
|
|
ynh_systemd_action --service_name=nginx --action=reload
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2020-06-18 02:03:31 +02:00
|
|
|
ynh_script_progression --message="Installation of $app completed"
|