From aa1ce5a3bc9f390deb9a43b39d230a31772a08d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 9 Jan 2024 19:10:09 +0100 Subject: [PATCH 01/17] v2 --- conf/jitsi-jicofo.service | 4 +- conf/jitsi-jicofo.src | 7 --- conf/jitsi-meet-prosody.src | 7 --- conf/jitsi-meet-web.src | 7 --- conf/jitsi-sctp.src | 6 --- conf/jitsi-videobridge.service | 4 +- conf/jitsi-videobridge.src | 7 --- conf/mod_auth_ldap.src | 7 --- conf/nginx.conf | 6 +-- conf/prosody.cfg.lua | 2 +- conf/usrsctp.src | 6 --- manifest.toml | 86 ++++++++++++++++++++++++++++++++++ scripts/_common.sh | 14 +++--- scripts/backup | 12 ++--- scripts/install | 72 ++++++++++++++-------------- scripts/remove | 28 +++++------ scripts/restore | 54 ++++++++++----------- scripts/upgrade | 82 ++++++++++++++++---------------- 18 files changed, 225 insertions(+), 186 deletions(-) delete mode 100644 conf/jitsi-jicofo.src delete mode 100644 conf/jitsi-meet-prosody.src delete mode 100644 conf/jitsi-meet-web.src delete mode 100644 conf/jitsi-sctp.src delete mode 100644 conf/jitsi-videobridge.src delete mode 100644 conf/mod_auth_ldap.src delete mode 100644 conf/usrsctp.src create mode 100644 manifest.toml diff --git a/conf/jitsi-jicofo.service b/conf/jitsi-jicofo.service index ab64bd9..b21c3fc 100644 --- a/conf/jitsi-jicofo.service +++ b/conf/jitsi-jicofo.service @@ -6,8 +6,8 @@ After=network.target EnvironmentFile=/etc/__APP__/jicofo/config Environment=LOGFILE=/var/log/__APP__/jitsi-jicofo.log User=__APP__ -WorkingDirectory=__FINALPATH__/jitsi-jicofo/ -ExecStart=/bin/bash -c "exec __FINALPATH__/jitsi-jicofo/jicofo.sh --host=${JICOFO_HOST} --domain=${JICOFO_HOSTNAME} --user_name=${JICOFO_AUTH_USER} --user_domain=${JICOFO_AUTH_DOMAIN} --user_password=${JICOFO_AUTH_PASSWORD} ${JICOFO_OPTS} < /dev/null >> ${LOGFILE} 2>&1" +WorkingDirectory=__INSTALL_DIR__/jitsi-jicofo/ +ExecStart=/bin/bash -c "exec __INSTALL_DIR__/jitsi-jicofo/jicofo.sh --host=${JICOFO_HOST} --domain=${JICOFO_HOSTNAME} --user_name=${JICOFO_AUTH_USER} --user_domain=${JICOFO_AUTH_DOMAIN} --user_password=${JICOFO_AUTH_PASSWORD} ${JICOFO_OPTS} < /dev/null >> ${LOGFILE} 2>&1" [Install] WantedBy=multi-user.target diff --git a/conf/jitsi-jicofo.src b/conf/jitsi-jicofo.src deleted file mode 100644 index 317712b..0000000 --- a/conf/jitsi-jicofo.src +++ /dev/null @@ -1,7 +0,0 @@ -SOURCE_URL=https://download.jitsi.org/stable/jicofo_1.0-1059-1_all.deb -SOURCE_SUM=365051508e23ff99e3152fd3b414ec695ff920b16da9677a485f85aa91a9d549 -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=deb -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=jitsi-jicofo.deb -SOURCE_EXTRACT=false diff --git a/conf/jitsi-meet-prosody.src b/conf/jitsi-meet-prosody.src deleted file mode 100644 index 268fc1f..0000000 --- a/conf/jitsi-meet-prosody.src +++ /dev/null @@ -1,7 +0,0 @@ -SOURCE_URL=https://download.jitsi.org/stable/jitsi-meet-prosody_1.0.7712-1_all.deb -SOURCE_SUM=30e360d42c4badf07e7269979b8af71eac05d689febc367420e0ca4abecfb16a -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=deb -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=jitsi-meet-prosody.deb -SOURCE_EXTRACT=false diff --git a/conf/jitsi-meet-web.src b/conf/jitsi-meet-web.src deleted file mode 100644 index dc7f23b..0000000 --- a/conf/jitsi-meet-web.src +++ /dev/null @@ -1,7 +0,0 @@ -SOURCE_URL=https://download.jitsi.org/stable/jitsi-meet-web_1.0.7712-1_all.deb -SOURCE_SUM=43917b5d3fd003823933d84beaf822a8a9edaa8f06f897e13b6b575bba3f3c18 -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=deb -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=jitsi-meet-web.deb -SOURCE_EXTRACT=false diff --git a/conf/jitsi-sctp.src b/conf/jitsi-sctp.src deleted file mode 100644 index efc66c1..0000000 --- a/conf/jitsi-sctp.src +++ /dev/null @@ -1,6 +0,0 @@ -SOURCE_URL=https://github.com/jitsi/jitsi-sctp/archive/45bf9f296167f79a52cdc1b0e93bbfa4dc8c4976.tar.gz -SOURCE_SUM=1eead17b10d059bafe8e1b06a8351936b608e7514b131588deac61d24b859397 -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.gz -SOURCE_IN_SUBDIR=true -SOURCE_EXTRACT=true diff --git a/conf/jitsi-videobridge.service b/conf/jitsi-videobridge.service index 4341d1a..1d40f04 100644 --- a/conf/jitsi-videobridge.service +++ b/conf/jitsi-videobridge.service @@ -17,8 +17,8 @@ TasksMax=65000 # allow more open files for this process LimitNPROC=65000 LimitNOFILE=65000 -WorkingDirectory=__FINALPATH__/jitsi-videobridge/ -ExecStart=/bin/bash -c "exec __FINALPATH__/jitsi-videobridge/jvb.sh --host=${JVB_HOST} --domain=${JVB_HOSTNAME} --port=${JVB_PORT} --secret=${JVB_SECRET} ${JVB_OPTS} < /dev/null >> ${LOGFILE} 2>&1" +WorkingDirectory=__INSTALL_DIR__/jitsi-videobridge/ +ExecStart=/bin/bash -c "exec __INSTALL_DIR__/jitsi-videobridge/jvb.sh --host=${JVB_HOST} --domain=${JVB_HOSTNAME} --port=${JVB_PORT} --secret=${JVB_SECRET} ${JVB_OPTS} < /dev/null >> ${LOGFILE} 2>&1" ExecStartPost=/bin/bash -c "echo $MAINPID > /var/run/jitsi-videobridge/jitsi-videobridge.pid" [Install] diff --git a/conf/jitsi-videobridge.src b/conf/jitsi-videobridge.src deleted file mode 100644 index d4c934d..0000000 --- a/conf/jitsi-videobridge.src +++ /dev/null @@ -1,7 +0,0 @@ -SOURCE_URL=https://download.jitsi.org/stable/jitsi-videobridge2_2.3-64-g719465d1-1_all.deb -SOURCE_SUM=cd960148768c846cc97ce37211490f5026a5c4bc81fc48ea2ea22024f83667ca -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=deb -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=jitsi-videobridge.deb -SOURCE_EXTRACT=false diff --git a/conf/mod_auth_ldap.src b/conf/mod_auth_ldap.src deleted file mode 100644 index 6fed26c..0000000 --- a/conf/mod_auth_ldap.src +++ /dev/null @@ -1,7 +0,0 @@ -SOURCE_URL=https://hg.prosody.im/prosody-modules/raw-file/tip/mod_auth_ldap/mod_auth_ldap.lua -SOURCE_SUM=49c67ec86ec75ac8de93803be2ac7f907d1e9d3d22cd4c88fd48aaeed7a411e3 -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=lua -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=mod_auth_ldap.lua -SOURCE_EXTRACT=false diff --git a/conf/nginx.conf b/conf/nginx.conf index 6d3f6f6..f19975c 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,4 +1,4 @@ -root __FINALPATH__/jitsi-meet-web; +root __INSTALL_DIR__/jitsi-meet-web; # fix https://github.com/YunoHost-Apps/jitsi_ynh/issues/113 more_set_headers "Content-Security-Policy: frame-ancestors 'self'"; @@ -15,14 +15,14 @@ location = /config.js { } location = /external_api.js { - alias __FINALPATH__/jitsi-meet-web/libs/external_api.min.js; + alias __INSTALL_DIR__/jitsi-meet-web/libs/external_api.min.js; } # ensure all static content can always be found first location ~ ^/(libs|css|static|images|fonts|lang|sounds|connection_optimization|.well-known)/(.*)$ { more_set_headers "Access-Control-Allow-Origin: *"; - alias __FINALPATH__/jitsi-meet-web/$1/$2; + alias __INSTALL_DIR__/jitsi-meet-web/$1/$2; # cache all versioned files if ($arg_v) { diff --git a/conf/prosody.cfg.lua b/conf/prosody.cfg.lua index 8e270ed..aad671d 100644 --- a/conf/prosody.cfg.lua +++ b/conf/prosody.cfg.lua @@ -1,4 +1,4 @@ -plugin_paths = { "__FINALPATH__/jitsi-meet-prosody/" } +plugin_paths = { "__INSTALL_DIR__/jitsi-meet-prosody/" } -- domain mapper options, must at least have domain base set to use the mapper muc_mapper_domain_base = "__DOMAIN__"; diff --git a/conf/usrsctp.src b/conf/usrsctp.src deleted file mode 100644 index 2d232cd..0000000 --- a/conf/usrsctp.src +++ /dev/null @@ -1,6 +0,0 @@ -SOURCE_URL=https://github.com/sctplab/usrsctp/archive/8e12cd9e01fc94d2e84ea1afa351c845966e116e.tar.gz -SOURCE_SUM=0574a31fecca543cf8e46c1bff441a3048ccf7d403da0543639db334e9a09b2f -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.gz -SOURCE_IN_SUBDIR=true -SOURCE_EXTRACT=true diff --git a/manifest.toml b/manifest.toml new file mode 100644 index 0000000..8b66151 --- /dev/null +++ b/manifest.toml @@ -0,0 +1,86 @@ +packaging_format = 2 + +id = "jitsi" +name = "Jitsi Meet" +description.en = "Video conferencing web application" +description.fr = "Application web de conférence vidéo" + +version = "2.0.9164~ynh1" + +maintainers = ["yalh76"] + +[upstream] +license = "Apache-2.0" +website = "https://jitsi.org/" +demo = "https://meet.jit.si/" +userdoc = "https://jitsi.org/user-faq/" +code = "https://github.com/jitsi/jitsi-meet" +cpe = "???" # FIXME: optional but recommended if relevant, this is meant to contain the Common Platform Enumeration, which is sort of a standard id for applications defined by the NIST. In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps. The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number) +fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin. + +[integration] +yunohost = ">= 11.0.8" +architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64), for example: ["amd64", "i386"] +multi_instance = false +ldap = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "sso" key : the "ldap" key corresponds to wether or not a user *can* login on the app using its YunoHost credentials. +sso = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "ldap" key : the "sso" key corresponds to wether or not a user is *automatically logged-in* on the app when logged-in on the YunoHost portal. +disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... +ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... +ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... + + [install.domain] + # this is a generic question - ask strings are automatically handled by Yunohost's core + type = "domain" + full_domain = true + +[resources] + [resources.sources] + [resources.sources.jitsi-meet-web] + url = "https://download.jitsi.org/stable/jitsi-meet-web_1.0.7712-1_all.deb" + sha256 = "43917b5d3fd003823933d84beaf822a8a9edaa8f06f897e13b6b575bba3f3c18" + format = "deb" + rename = "jitsi-meet-web.deb" + + [resources.sources.jitsi-sctp] + url = "https://github.com/jitsi/jitsi-sctp/archive/45bf9f296167f79a52cdc1b0e93bbfa4dc8c4976.tar.gz" + sha256 = "1eead17b10d059bafe8e1b06a8351936b608e7514b131588deac61d24b859397" + + [resources.sources.jitsi-jicofo] + url = "https://download.jitsi.org/stable/jicofo_1.0-1059-1_all.deb" + sha256 = "365051508e23ff99e3152fd3b414ec695ff920b16da9677a485f85aa91a9d549" + format = "deb" + rename = "jitsi-jicofo.deb" + + [resources.sources.jitsi-videobridge] + url = "https://download.jitsi.org/stable/jitsi-videobridge2_2.3-64-g719465d1-1_all.deb" + sha256 = "cd960148768c846cc97ce37211490f5026a5c4bc81fc48ea2ea22024f83667ca" + format = "deb" + rename = "jitsi-videobridge.deb" + + [resources.sources.usrsctp] + url = "https://github.com/sctplab/usrsctp/archive/8e12cd9e01fc94d2e84ea1afa351c845966e116e.tar.gz" + sha256 = "0574a31fecca543cf8e46c1bff441a3048ccf7d403da0543639db334e9a09b2f" + + [resources.sources.jitsi-meet-prosody] + url = "https://download.jitsi.org/stable/jitsi-meet-prosody_1.0.7712-1_all.deb" + sha256 = "30e360d42c4badf07e7269979b8af71eac05d689febc367420e0ca4abecfb16a" + format = "deb" + rename = "jitsi-meet-prosody.deb" + + [resources.sources.mod_auth_ldap] + url = "https://hg.prosody.im/prosody-modules/raw-file/tip/mod_auth_ldap/mod_auth_ldap.lua" + sha256 = "49c67ec86ec75ac8de93803be2ac7f907d1e9d3d22cd4c88fd48aaeed7a411e3" + format = "lua" + rename = "mod_auth_ldap.lua" + + + [resources.system_user] + + [resources.install_dir] + + [resources.permissions] + main.url = "/" + [[resources.apt.extras]] + repo = "deb http://security.debian.org/debian-security stretch/updates main" + key = "https://ftp-master.debian.org/keys/archive-key-9-security.asc" + packages = "#FIXME#$pkg_extra_depedencies_arm" diff --git a/scripts/_common.sh b/scripts/_common.sh index 03a6585..5f159ea 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,14 +5,14 @@ #================================================= # dependencies used by the app -pkg_dependencies="openjdk-8-jre-headless|openjdk-11-jre-headless|openjdk-17-jre-headless debconf|debconf-2.0 procps uuid-runtime lua-ldap" +#REMOVEME? pkg_dependencies="openjdk-8-jre-headless|openjdk-11-jre-headless|openjdk-17-jre-headless debconf|debconf-2.0 procps uuid-runtime lua-ldap" -ynh_app_dependencies="prosody" +#REMOVEME? ynh_app_dependencies="prosody" if [ $YNH_ARCH == "armhf" ] then pkg_dependencies_arm="automake autoconf build-essential libtool git maven m4" - pkg_dependencies="$pkg_dependencies $pkg_dependencies_arm" +#REMOVEME? pkg_dependencies="$pkg_dependencies $pkg_dependencies_arm" pkg_extra_depedencies_arm="openjdk-8-jre|openjdk-11-jre|openjdk-17-jre openjdk-8-jre-headless|openjdk-11-jre-headless|openjdk-17-jre-headless openjdk-8-jdk|openjdk-11-jdk|openjdk-17-jdk openjdk-8-jdk-headless|openjdk-11-jdk-headless|openjdk-17-jdk-headless" fi @@ -56,13 +56,13 @@ ynh_jniwrapper_armhf () popd # rm official jniwrapper to copy - original_jniwrapper=$(ls $final_path/jitsi-videobridge/lib/jniwrapper-native-*.jar) + original_jniwrapper=$(ls $install_dir/jitsi-videobridge/lib/jniwrapper-native-*.jar) ynh_secure_remove --file="$original_jniwrapper" - mv "$tempdir/jitsi-sctp/jniwrapper/native/target/jniwrapper-native-1.0-SNAPSHOT.jar" "$final_path/jitsi-videobridge/lib/" + mv "$tempdir/jitsi-sctp/jniwrapper/native/target/jniwrapper-native-1.0-SNAPSHOT.jar" "$install_dir/jitsi-videobridge/lib/" - chmod 640 "$final_path/jitsi-videobridge/lib/jniwrapper-native-1.0-SNAPSHOT.jar" - chown -R $app:$app "$final_path/jitsi-videobridge/lib/jniwrapper-native-1.0-SNAPSHOT.jar" + chmod 640 "$install_dir/jitsi-videobridge/lib/jniwrapper-native-1.0-SNAPSHOT.jar" + chown -R $app:$app "$install_dir/jitsi-videobridge/lib/jniwrapper-native-1.0-SNAPSHOT.jar" ynh_secure_remove --file="$tempdir" } diff --git a/scripts/backup b/scripts/backup index 392e32c..6fa3f6c 100644 --- a/scripts/backup +++ b/scripts/backup @@ -14,21 +14,21 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { +#REMOVEME? ynh_clean_setup () { true } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= ynh_print_info --message="Loading settings..." -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) #================================================= # DECLARE DATA AND CONF FILES TO BACKUP @@ -39,7 +39,7 @@ ynh_print_info --message="Declaring files to be backed up..." # BACKUP THE APP MAIN DIR #================================================= -ynh_backup --src_path="$final_path" +ynh_backup --src_path="$install_dir" #================================================= # BACKUP THE NGINX CONFIGURATION diff --git a/scripts/install b/scripts/install index d4d4759..d5a7b81 100644 --- a/scripts/install +++ b/scripts/install @@ -13,20 +13,20 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { +#REMOVEME? ynh_clean_setup () { true } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= -domain=$YNH_APP_ARG_DOMAIN -path_url="/" +#REMOVEME? domain=$YNH_APP_ARG_DOMAIN +path="/" -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME #YOURSECRET3 focus_password=$(ynh_string_random --length=8) @@ -47,24 +47,24 @@ max_memory=200 #125 mib with no user +1,5*50 users=75 mib #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= -ynh_script_progression --message="Validating installation parameters..." --weight=1 +#REMOVEME? ynh_script_progression --message="Validating installation parameters..." --weight=1 -final_path=/var/www/$app -test ! -e "$final_path" || ynh_die --message="This path already contains a folder" +#REMOVEME? install_dir=/var/www/$app +#REMOVEME? test ! -e "$install_dir" || ynh_die --message="This path already contains a folder" # Register (book) web path -ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url +#REMOVEME? ynh_webpath_register --app=$app --domain=$domain --path=$path #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -ynh_script_progression --message="Storing installation settings..." --weight=1 +#REMOVEME? ynh_script_progression --message="Storing installation settings..." --weight=1 -ynh_app_setting_set --app=$app --key=domain --value=$domain -ynh_app_setting_set --app=$app --key=path --value=$path_url +#REMOVEME? ynh_app_setting_set --app=$app --key=domain --value=$domain +#REMOVEME? ynh_app_setting_set --app=$app --key=path --value=$path ynh_app_setting_set --app=$app --key=max_memory --value=$max_memory ynh_app_setting_set --app=$app --key=focus_user --value=$focus_user -ynh_app_setting_set --app=$app --key=focus_password --value=$focus_password +#REMOVEME? ynh_app_setting_set --app=$app --key=focus_password --value=$focus_password ynh_app_setting_set --app=$app --key=focus_secret --value=$focus_secret ynh_app_setting_set --app=$app --key=videobridge_user --value=$videobridge_user ynh_app_setting_set --app=$app --key=videobridge_secret --value=$videobridge_secret @@ -75,45 +75,45 @@ ynh_app_setting_set --app=$app --key=turn_secret --value=$turn_secret #================================================= # FIND AND OPEN A PORT #================================================= -ynh_script_progression --message="Finding an available port..." --weight=1 +#REMOVEME? ynh_script_progression --message="Finding an available port..." --weight=1 # Find an available port port=4443 # Open this port ynh_exec_warn_less yunohost firewall allow TCP $port -ynh_app_setting_set --app=$app --key=port --value=$port +#REMOVEME? ynh_app_setting_set --app=$app --key=port --value=$port # Find an available port port_videobridge=10000 # Open this port ynh_exec_warn_less yunohost firewall allow UDP $port_videobridge -ynh_app_setting_set --app=$app --key=port_videobridge --value=$port_videobridge +#REMOVEME? ynh_app_setting_set --app=$app --key=port_videobridge --value=$port_videobridge # Find an available port port_component=5347 -ynh_app_setting_set --app=$app --key=port_component --value=$port_component +#REMOVEME? ynh_app_setting_set --app=$app --key=port_component --value=$port_component #================================================= # INSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Installing dependencies..." --weight=1 +#REMOVEME? ynh_script_progression --message="Installing dependencies..." --weight=1 ynh_install_apps --apps="$ynh_app_dependencies" -ynh_install_app_dependencies $pkg_dependencies +#REMOVEME? ynh_install_app_dependencies $pkg_dependencies if [ $YNH_ARCH == "armhf" ] then - ynh_script_progression --message="Installing specific arm dependencies..." - ynh_install_extra_app_dependencies --repo="deb http://security.debian.org/debian-security stretch/updates main" --package="$pkg_extra_depedencies_arm" --key="https://ftp-master.debian.org/keys/archive-key-9-security.asc" +#REMOVEME? ynh_script_progression --message="Installing specific arm dependencies..." +#REMOVEME? ynh_install_extra_app_dependencies --repo="deb http://security.debian.org/debian-security stretch/updates main" --package="$pkg_extra_depedencies_arm" --key="https://ftp-master.debian.org/keys/archive-key-9-security.asc" fi #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Configuring system user..." --weight=1 +#REMOVEME? ynh_script_progression --message="Configuring system user..." --weight=1 # Create a system user -ynh_system_user_create --username=$app --home_dir="$final_path" +#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" gpasswd --add prosody $app gpasswd --add www-data $app @@ -122,7 +122,7 @@ gpasswd --add www-data $app #================================================= ynh_script_progression --message="Setting up source files..." --weight=1 -ynh_app_setting_set --app=$app --key=final_path --value=$final_path +#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir # Download, check integrity, uncompress and patch the source from app.src declare -A packages packages[jitsi-jicofo]="jicofo" @@ -132,21 +132,21 @@ 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" + ynh_setup_source --dest_dir="$install_dir/${package}_temp" --source_id=$package + pushd "$install_dir/${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}/" - ynh_secure_remove --file="$final_path/${package}_temp" + mv "$install_dir/${package}_temp/usr/share/${packages[$package]}/" "$install_dir/${package}/" +#REMOVEME? ynh_secure_remove --file="$install_dir/${package}_temp" done -ynh_setup_source --dest_dir="$final_path/jitsi-meet-prosody" --source_id=mod_auth_ldap +ynh_setup_source --dest_dir="$install_dir/jitsi-meet-prosody" --source_id=mod_auth_ldap -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:$app "$final_path" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:$app "$install_dir" #================================================= # NGINX CONFIGURATION @@ -300,17 +300,17 @@ ynh_systemd_action --service_name=$app-videobridge --action="start" --log_path=" #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring permissions..." --weight=1 +#REMOVEME? ynh_script_progression --message="Configuring permissions..." --weight=1 # Make app public -ynh_permission_update --permission="main" --add="visitors" +#REMOVEME? ynh_permission_update --permission="main" --add="visitors" #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 +#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 -ynh_systemd_action --service_name=nginx --action=reload +#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT diff --git a/scripts/remove b/scripts/remove index ea7b87c..a5d51b8 100644 --- a/scripts/remove +++ b/scripts/remove @@ -14,15 +14,15 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression --message="Loading settings..." --weight=1 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -port=$(ynh_app_setting_get --app=$app --key=port) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -port_videobridge=$(ynh_app_setting_get --app=$app --key=port_videobridge) -port_component=$(ynh_app_setting_get --app=$app --key=port_component) -focus_user=$(ynh_app_setting_get --app=$app --key=focus_user) -videobridge_user=$(ynh_app_setting_get --app=$app --key=videobridge_user) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? port_videobridge=$(ynh_app_setting_get --app=$app --key=port_videobridge) +#REMOVEME? port_component=$(ynh_app_setting_get --app=$app --key=port_component) +#REMOVEME? focus_user=$(ynh_app_setting_get --app=$app --key=focus_user) +#REMOVEME? videobridge_user=$(ynh_app_setting_get --app=$app --key=videobridge_user) #================================================= # STANDARD REMOVE @@ -90,10 +90,10 @@ ynh_systemd_action --service_name=prosody --action=restart #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory..." --weight=1 +#REMOVEME? ynh_script_progression --message="Removing app main directory..." --weight=1 # Remove the app directory securely -ynh_secure_remove --file="$final_path" +#REMOVEME? ynh_secure_remove --file="$install_dir" #================================================= # REMOVE NGINX CONFIGURATION @@ -106,10 +106,10 @@ ynh_remove_nginx_config #================================================= # REMOVE DEPENDENCIES #================================================= -ynh_script_progression --message="Removing dependencies..." --weight=1 +#REMOVEME? ynh_script_progression --message="Removing dependencies..." --weight=1 # Remove metapackage and its dependencies -ynh_remove_app_dependencies +#REMOVEME? ynh_remove_app_dependencies # Remove Prosody ynh_app_setting_delete --app=$app --key=require_prosody @@ -151,11 +151,11 @@ ynh_secure_remove --file="/var/log/$app" #================================================= # REMOVE DEDICATED USER #================================================= -ynh_script_progression --message="Removing the dedicated system user..." --weight=1 +#REMOVEME? ynh_script_progression --message="Removing the dedicated system user..." --weight=1 gpasswd --delete www-data $app # Delete a system user -ynh_system_user_delete --username=$app +#REMOVEME? ynh_system_user_delete --username=$app #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index 5aed508..9dea477 100644 --- a/scripts/restore +++ b/scripts/restore @@ -14,51 +14,51 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { +#REMOVEME? ynh_clean_setup () { true } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= ynh_script_progression --message="Loading settings..." --weight=1 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -path_url=$(ynh_app_setting_get --app=$app --key=path) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -focus_user=$(ynh_app_setting_get --app=$app --key=focus_user) -focus_password=$(ynh_app_setting_get --app=$app --key=focus_password) -focus_secret=$(ynh_app_setting_get --app=$app --key=focus_secret) +#REMOVEME? focus_user=$(ynh_app_setting_get --app=$app --key=focus_user) +#REMOVEME? focus_password=$(ynh_app_setting_get --app=$app --key=focus_password) +#REMOVEME? focus_secret=$(ynh_app_setting_get --app=$app --key=focus_secret) -videobridge_user=$(ynh_app_setting_get --app=$app --key=videobridge_user) -videobridge_secret=$(ynh_app_setting_get --app=$app --key=videobridge_secret) +#REMOVEME? videobridge_user=$(ynh_app_setting_get --app=$app --key=videobridge_user) +#REMOVEME? videobridge_secret=$(ynh_app_setting_get --app=$app --key=videobridge_secret) -port=$(ynh_app_setting_get --app=$app --key=port) -port_videobridge=$(ynh_app_setting_get --app=$app --key=port_videobridge) -port_component=$(ynh_app_setting_get --app=$app --key=port_component) +#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) +#REMOVEME? port_videobridge=$(ynh_app_setting_get --app=$app --key=port_videobridge) +#REMOVEME? 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..." --weight=1 +#REMOVEME? ynh_script_progression --message="Validating restoration parameters..." --weight=1 -test ! -d $final_path \ - || ynh_die --message="There is already a directory: $final_path " +#REMOVEME? test ! -d $install_dir \ + || ynh_die --message="There is already a directory: $install_dir " #================================================= # STANDARD RESTORATION STEPS #================================================= # RECREATE THE DEDICATED USER #================================================= -ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 +#REMOVEME? ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 # Create the dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir="$final_path" +#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" gpasswd --add www-data $app #================================================= @@ -66,27 +66,27 @@ gpasswd --add www-data $app #================================================= ynh_script_progression --message="Restoring the app main directory..." --weight=1 -ynh_restore_file --origin_path="$final_path" +ynh_restore_file --origin_path="$install_dir" -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:$app "$final_path" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:$app "$install_dir" #================================================= # SPECIFIC RESTORATION #================================================= # REINSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Reinstalling dependencies..." --weight=1 +#REMOVEME? ynh_script_progression --message="Reinstalling dependencies..." --weight=1 # Define and install dependencies ynh_install_apps --apps="$ynh_app_dependencies" -ynh_install_app_dependencies $pkg_dependencies +#REMOVEME? ynh_install_app_dependencies $pkg_dependencies if [ $YNH_ARCH == "armhf" ] then - ynh_script_progression --message="Installing specific arm dependencies..." --weight=1 - ynh_install_extra_app_dependencies --repo="deb http://security.debian.org/debian-security stretch/updates main" --package="$pkg_extra_depedencies_arm" --key="https://ftp-master.debian.org/keys/archive-key-9-security.asc" +#REMOVEME? ynh_script_progression --message="Installing specific arm dependencies..." --weight=1 +#REMOVEME? ynh_install_extra_app_dependencies --repo="deb http://security.debian.org/debian-security stretch/updates main" --package="$pkg_extra_depedencies_arm" --key="https://ftp-master.debian.org/keys/archive-key-9-security.asc" fi gpasswd --add prosody $app diff --git a/scripts/upgrade b/scripts/upgrade index 9b31041..8e6e57c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -14,27 +14,27 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression --message="Loading settings..." --weight=1 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -path_url=$(ynh_app_setting_get --app=$app --key=path) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -max_memory=$(ynh_app_setting_get --app=$app --key=max_memory) +#REMOVEME? max_memory=$(ynh_app_setting_get --app=$app --key=max_memory) -focus_user=$(ynh_app_setting_get --app=$app --key=focus_user) -focus_password=$(ynh_app_setting_get --app=$app --key=focus_password) -focus_secret=$(ynh_app_setting_get --app=$app --key=focus_secret) +#REMOVEME? focus_user=$(ynh_app_setting_get --app=$app --key=focus_user) +#REMOVEME? focus_password=$(ynh_app_setting_get --app=$app --key=focus_password) +#REMOVEME? focus_secret=$(ynh_app_setting_get --app=$app --key=focus_secret) -videobridge_user=$(ynh_app_setting_get --app=$app --key=videobridge_user) -videobridge_secret=$(ynh_app_setting_get --app=$app --key=videobridge_secret) +#REMOVEME? videobridge_user=$(ynh_app_setting_get --app=$app --key=videobridge_user) +#REMOVEME? videobridge_secret=$(ynh_app_setting_get --app=$app --key=videobridge_secret) -turn_secret=$(ynh_app_setting_get --app=$app --key=turn_secret) -muc_nickname=$(ynh_app_setting_get --app=$app --key=muc_nickname) +#REMOVEME? turn_secret=$(ynh_app_setting_get --app=$app --key=turn_secret) +#REMOVEME? muc_nickname=$(ynh_app_setting_get --app=$app --key=muc_nickname) -port=$(ynh_app_setting_get --app=$app --key=port) -port_videobridge=$(ynh_app_setting_get --app=$app --key=port_videobridge) -port_component=$(ynh_app_setting_get --app=$app --key=port_component) +#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) +#REMOVEME? port_videobridge=$(ynh_app_setting_get --app=$app --key=port_videobridge) +#REMOVEME? port_component=$(ynh_app_setting_get --app=$app --key=port_component) #================================================= # CHECK VERSION @@ -47,16 +47,16 @@ current_version=$(ynh_read_manifest --manifest="/etc/yunohost/apps/$app/manifest #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." +#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." # Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { +#REMOVEME? ynh_backup_before_upgrade +#REMOVEME? ynh_clean_setup () { # Restore it if the upgrade fails - ynh_restore_upgradebackup +#REMOVEME? ynh_restore_upgradebackup } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # STANDARD UPGRADE STEPS @@ -73,10 +73,10 @@ ynh_systemd_action --service_name=$app-jicofo --action="stop" --log_path="/var/l #================================================= ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 -# If final_path doesn't exist, create it -if [ -z "$final_path" ]; then - final_path=/var/www/$app - ynh_app_setting_set --app=$app --key=final_path --value=$final_path +# If install_dir doesn't exist, create it +if [ -z "$install_dir" ]; then +#REMOVEME? install_dir=/var/www/$app +#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir fi # If max_memory doesn't exist, create it and set to default 75 mb value @@ -88,10 +88,10 @@ fi #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 +#REMOVEME? ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 # Create a dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir="$final_path" +#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" gpasswd --add www-data $app #================================================= @@ -111,36 +111,36 @@ then for package in "${!packages[@]}" do - ynh_secure_remove --file="$final_path/${package}" - ynh_setup_source --dest_dir="$final_path/${package}_temp" --source_id=$package - pushd "$final_path/${package}_temp" +#REMOVEME? ynh_secure_remove --file="$install_dir/${package}" + ynh_setup_source --dest_dir="$install_dir/${package}_temp" --source_id=$package + pushd "$install_dir/${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}/" - ynh_secure_remove --file="$final_path/${package}_temp" + mv "$install_dir/${package}_temp/usr/share/${packages[$package]}/" "$install_dir/${package}/" +#REMOVEME? ynh_secure_remove --file="$install_dir/${package}_temp" done - ynh_setup_source --dest_dir="$final_path/jitsi-meet-prosody" --source_id=mod_auth_ldap + ynh_setup_source --dest_dir="$install_dir/jitsi-meet-prosody" --source_id=mod_auth_ldap fi -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:$app "$final_path" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:$app "$install_dir" #================================================= # UPGRADE DEPENDENCIES #================================================= -ynh_script_progression --message="Upgrading dependencies..." --weight=1 +#REMOVEME? ynh_script_progression --message="Upgrading dependencies..." --weight=1 ynh_install_apps --apps="$ynh_app_dependencies" -ynh_install_app_dependencies $pkg_dependencies +#REMOVEME? ynh_install_app_dependencies $pkg_dependencies if [ $YNH_ARCH == "armhf" ] then - ynh_script_progression --message="Installing specific arm dependencies..." --weight=1 - ynh_install_extra_app_dependencies --repo="deb http://security.debian.org/debian-security stretch/updates main" --package="$pkg_extra_depedencies_arm" --key="https://ftp-master.debian.org/keys/archive-key-9-security.asc" +#REMOVEME? ynh_script_progression --message="Installing specific arm dependencies..." --weight=1 +#REMOVEME? ynh_install_extra_app_dependencies --repo="deb http://security.debian.org/debian-security stretch/updates main" --package="$pkg_extra_depedencies_arm" --key="https://ftp-master.debian.org/keys/archive-key-9-security.asc" fi gpasswd --add prosody $app @@ -288,9 +288,9 @@ ynh_systemd_action --service_name=$app-videobridge --action="start" --log_path=" #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 +#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 -ynh_systemd_action --service_name=nginx --action=reload +#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT From 196d5216ad0bc8f48b79dc2aff6416d4d24dfa61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 9 Jan 2024 19:23:08 +0100 Subject: [PATCH 02/17] v2 --- manifest.toml | 32 ++++++++++----- scripts/backup | 20 --------- scripts/install | 106 ++++++++---------------------------------------- scripts/remove | 58 +------------------------- scripts/restore | 49 ++-------------------- 5 files changed, 44 insertions(+), 221 deletions(-) diff --git a/manifest.toml b/manifest.toml index 8b66151..0a27dfb 100644 --- a/manifest.toml +++ b/manifest.toml @@ -15,23 +15,22 @@ website = "https://jitsi.org/" demo = "https://meet.jit.si/" userdoc = "https://jitsi.org/user-faq/" code = "https://github.com/jitsi/jitsi-meet" -cpe = "???" # FIXME: optional but recommended if relevant, this is meant to contain the Common Platform Enumeration, which is sort of a standard id for applications defined by the NIST. In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps. The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number) -fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin. [integration] -yunohost = ">= 11.0.8" -architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64), for example: ["amd64", "i386"] +yunohost = ">= 11.2" +architectures = "all" multi_instance = false -ldap = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "sso" key : the "ldap" key corresponds to wether or not a user *can* login on the app using its YunoHost credentials. -sso = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "ldap" key : the "sso" key corresponds to wether or not a user is *automatically logged-in* on the app when logged-in on the YunoHost portal. -disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... -ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... -ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... + +ldap = true + +sso = false + +disk = "50M" +ram.build = "50M" +ram.runtime = "50M" [install.domain] - # this is a generic question - ask strings are automatically handled by Yunohost's core type = "domain" - full_domain = true [resources] [resources.sources] @@ -78,8 +77,19 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen [resources.install_dir] + [resources.ports] + main.default = 4443 + main.exposed = "TCP" + videobridge.default = 10000 + videobridge.exposed = "UDP" + component.default = 5347 + [resources.permissions] main.url = "/" + + [resources.apt] + packages = "openjdk-8-jre-headless|openjdk-11-jre-headless|openjdk-17-jre-headless debconf|debconf-2.0 procps uuid-runtime lua-ldap prosody" + [[resources.apt.extras]] repo = "deb http://security.debian.org/debian-security stretch/updates main" key = "https://ftp-master.debian.org/keys/archive-key-9-security.asc" diff --git a/scripts/backup b/scripts/backup index 6fa3f6c..686d212 100644 --- a/scripts/backup +++ b/scripts/backup @@ -10,26 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -#REMOVEME? ynh_clean_setup () { - true -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -ynh_print_info --message="Loading settings..." - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) - #================================================= # DECLARE DATA AND CONF FILES TO BACKUP #================================================= diff --git a/scripts/install b/scripts/install index d5a7b81..0e6924d 100644 --- a/scripts/install +++ b/scripts/install @@ -9,25 +9,10 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -#REMOVEME? ynh_clean_setup () { - true -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= -#REMOVEME? domain=$YNH_APP_ARG_DOMAIN -path="/" - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - #YOURSECRET3 focus_password=$(ynh_string_random --length=8) #YOURSECRET1 @@ -44,76 +29,36 @@ videobridge_user="jvb" max_memory=200 #125 mib with no user +1,5*50 users=75 mib -#================================================= -# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS -#================================================= -#REMOVEME? ynh_script_progression --message="Validating installation parameters..." --weight=1 - -#REMOVEME? install_dir=/var/www/$app -#REMOVEME? test ! -e "$install_dir" || ynh_die --message="This path already contains a folder" - -# Register (book) web path -#REMOVEME? ynh_webpath_register --app=$app --domain=$domain --path=$path - #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -#REMOVEME? ynh_script_progression --message="Storing installation settings..." --weight=1 +ynh_script_progression --message="Storing installation settings..." --weight=1 -#REMOVEME? ynh_app_setting_set --app=$app --key=domain --value=$domain -#REMOVEME? ynh_app_setting_set --app=$app --key=path --value=$path ynh_app_setting_set --app=$app --key=max_memory --value=$max_memory ynh_app_setting_set --app=$app --key=focus_user --value=$focus_user -#REMOVEME? ynh_app_setting_set --app=$app --key=focus_password --value=$focus_password +ynh_app_setting_set --app=$app --key=focus_password --value=$focus_password ynh_app_setting_set --app=$app --key=focus_secret --value=$focus_secret ynh_app_setting_set --app=$app --key=videobridge_user --value=$videobridge_user ynh_app_setting_set --app=$app --key=videobridge_secret --value=$videobridge_secret ynh_app_setting_set --app=$app --key=turn_secret --value=$turn_secret -#================================================= -# STANDARD MODIFICATIONS -#================================================= -# FIND AND OPEN A PORT -#================================================= -#REMOVEME? ynh_script_progression --message="Finding an available port..." --weight=1 - -# Find an available port -port=4443 -# Open this port -ynh_exec_warn_less yunohost firewall allow TCP $port -#REMOVEME? ynh_app_setting_set --app=$app --key=port --value=$port - -# Find an available port -port_videobridge=10000 -# Open this port -ynh_exec_warn_less yunohost firewall allow UDP $port_videobridge -#REMOVEME? ynh_app_setting_set --app=$app --key=port_videobridge --value=$port_videobridge - -# Find an available port -port_component=5347 -#REMOVEME? ynh_app_setting_set --app=$app --key=port_component --value=$port_component - #================================================= # INSTALL DEPENDENCIES #================================================= -#REMOVEME? ynh_script_progression --message="Installing dependencies..." --weight=1 - -ynh_install_apps --apps="$ynh_app_dependencies" -#REMOVEME? ynh_install_app_dependencies $pkg_dependencies +ynh_script_progression --message="Installing dependencies..." --weight=1 if [ $YNH_ARCH == "armhf" ] then -#REMOVEME? ynh_script_progression --message="Installing specific arm dependencies..." -#REMOVEME? ynh_install_extra_app_dependencies --repo="deb http://security.debian.org/debian-security stretch/updates main" --package="$pkg_extra_depedencies_arm" --key="https://ftp-master.debian.org/keys/archive-key-9-security.asc" + ynh_script_progression --message="Installing specific arm dependencies..." + ynh_install_extra_app_dependencies --repo="deb http://security.debian.org/debian-security stretch/updates main" --package="$pkg_extra_depedencies_arm" --key="https://ftp-master.debian.org/keys/archive-key-9-security.asc" fi #================================================= # CREATE DEDICATED USER #================================================= -#REMOVEME? ynh_script_progression --message="Configuring system user..." --weight=1 +ynh_script_progression --message="Configuring system user..." --weight=1 # Create a system user -#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" gpasswd --add prosody $app gpasswd --add www-data $app @@ -122,7 +67,6 @@ gpasswd --add www-data $app #================================================= ynh_script_progression --message="Setting up source files..." --weight=1 -#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir # Download, check integrity, uncompress and patch the source from app.src declare -A packages packages[jitsi-jicofo]="jicofo" @@ -139,7 +83,7 @@ do popd mv "$install_dir/${package}_temp/usr/share/${packages[$package]}/" "$install_dir/${package}/" -#REMOVEME? ynh_secure_remove --file="$install_dir/${package}_temp" + ynh_secure_remove --file="$install_dir/${package}_temp" done ynh_setup_source --dest_dir="$install_dir/jitsi-meet-prosody" --source_id=mod_auth_ldap @@ -163,7 +107,7 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Configuring prosody..." --weight=1 -ynh_add_config --template="../conf/prosody.cfg.lua" --destination="/etc/prosody/conf.avail/$domain.cfg.lua" +ynh_add_config --template="prosody.cfg.lua" --destination="/etc/prosody/conf.avail/$domain.cfg.lua" chmod 644 "/etc/prosody/conf.avail/$domain.cfg.lua" ln -s "/etc/prosody/conf.avail/$domain.cfg.lua" "/etc/prosody/conf.d/$domain.cfg.lua" @@ -200,15 +144,15 @@ ynh_app_setting_set --app=$app --key=muc_nickname --value=$muc_nickname mkdir -p "/etc/$app/videobridge" -ynh_add_config --template="../conf/jitsi-videobridge-callstats-java-sdk.properties" --destination="/etc/$app/videobridge/callstats-java-sdk.properties" +ynh_add_config --template="jitsi-videobridge-callstats-java-sdk.properties" --destination="/etc/$app/videobridge/callstats-java-sdk.properties" -ynh_add_config --template="../conf/jitsi-videobridge-jvb.conf" --destination="/etc/$app/videobridge/jvb.conf" +ynh_add_config --template="jitsi-videobridge-jvb.conf" --destination="/etc/$app/videobridge/jvb.conf" -ynh_add_config --template="../conf/jitsi-videobridge-logging.properties" --destination="/etc/$app/videobridge/logging.properties" +ynh_add_config --template="jitsi-videobridge-logging.properties" --destination="/etc/$app/videobridge/logging.properties" -ynh_add_config --template="../conf/jitsi-videobridge-sip-communicator.properties" --destination="/etc/$app/videobridge/sip-communicator.properties" +ynh_add_config --template="jitsi-videobridge-sip-communicator.properties" --destination="/etc/$app/videobridge/sip-communicator.properties" -ynh_add_config --template="../conf/jitsi-videobridge.config" --destination="/etc/$app/videobridge/config" +ynh_add_config --template="jitsi-videobridge.config" --destination="/etc/$app/videobridge/config" #================================================= # REPLACE JNIWRAPPER FOR ARMHF ARCHITECTURE IN JITSI-VIDEOBRIDGE @@ -218,7 +162,6 @@ if [ $YNH_ARCH == "armhf" ] then ynh_script_progression --message="Configuring jniwrapper for armhf ..." --weight=1 ynh_jniwrapper_armhf - fi #================================================= @@ -228,11 +171,11 @@ ynh_script_progression --message="Configuring Jitsi-Jicofo..." --weight=1 mkdir -p "/etc/$app/jicofo" -ynh_add_config --template="../conf/jitsi-jicofo-config" --destination="/etc/$app/jicofo/config" +ynh_add_config --template="jitsi-jicofo-config" --destination="/etc/$app/jicofo/config" -ynh_add_config --template="../conf/jitsi-jicofo-jicofo.conf" --destination="/etc/$app/jicofo/jicofo.conf" +ynh_add_config --template="jitsi-jicofo-jicofo.conf" --destination="/etc/$app/jicofo/jicofo.conf" -ynh_add_config --template="../conf/jitsi-jicofo-logging.properties" --destination="/etc/$app/jicofo/logging.properties" +ynh_add_config --template="jitsi-jicofo-logging.properties" --destination="/etc/$app/jicofo/logging.properties" #================================================= # CONFIGURE JITSI-MEET @@ -241,7 +184,7 @@ ynh_script_progression --message="Configuring Jitsi-Meet..." --weight=1 mkdir -p "/etc/$app/meet" -ynh_add_config --template="../conf/jitsi-meet-config.js" --destination="/etc/$app/meet/$domain-config.js" +ynh_add_config --template="jitsi-meet-config.js" --destination="/etc/$app/meet/$domain-config.js" chmod 644 "/etc/$app/meet/$domain-config.js" #================================================= @@ -297,21 +240,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name=$app-jicofo --action="start" --log_path="/var/log/$app/$app-jicofo.log" ynh_systemd_action --service_name=$app-videobridge --action="start" --log_path="/var/log/$app/$app-videobridge.log" -#================================================= -# SETUP SSOWAT -#================================================= -#REMOVEME? ynh_script_progression --message="Configuring permissions..." --weight=1 - -# Make app public -#REMOVEME? ynh_permission_update --permission="main" --add="visitors" - -#================================================= -# RELOAD NGINX -#================================================= -#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/remove b/scripts/remove index a5d51b8..980dd59 100644 --- a/scripts/remove +++ b/scripts/remove @@ -9,21 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -ynh_script_progression --message="Loading settings..." --weight=1 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? port_videobridge=$(ynh_app_setting_get --app=$app --key=port_videobridge) -#REMOVEME? port_component=$(ynh_app_setting_get --app=$app --key=port_component) -#REMOVEME? focus_user=$(ynh_app_setting_get --app=$app --key=focus_user) -#REMOVEME? videobridge_user=$(ynh_app_setting_get --app=$app --key=videobridge_user) - #================================================= # STANDARD REMOVE #================================================= @@ -43,20 +28,10 @@ then yunohost service remove $app-jicofo fi -#================================================= -# STOP AND REMOVE SERVICE -#================================================= -ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1 - # Remove the dedicated systemd config ynh_remove_systemd_config --service=$app-videobridge ynh_remove_systemd_config --service=$app-jicofo -#================================================= -# REMOVE LOGROTATE CONFIGURATION -#================================================= -ynh_script_progression --message="Removing logrotate configuration..." --weight=1 - # Remove the app-specific logrotate config ynh_remove_logrotate @@ -87,14 +62,6 @@ update-ca-certificates -f ynh_systemd_action --service_name=prosody --action=restart -#================================================= -# REMOVE APP MAIN DIR -#================================================= -#REMOVEME? ynh_script_progression --message="Removing app main directory..." --weight=1 - -# Remove the app directory securely -#REMOVEME? ynh_secure_remove --file="$install_dir" - #================================================= # REMOVE NGINX CONFIGURATION #================================================= @@ -106,10 +73,7 @@ ynh_remove_nginx_config #================================================= # REMOVE DEPENDENCIES #================================================= -#REMOVEME? ynh_script_progression --message="Removing dependencies..." --weight=1 - -# Remove metapackage and its dependencies -#REMOVEME? ynh_remove_app_dependencies +ynh_script_progression --message="Removing dependencies..." --weight=1 # Remove Prosody ynh_app_setting_delete --app=$app --key=require_prosody @@ -117,22 +81,6 @@ gpasswd --delete prosody $app ynh_remove_apps -#================================================= -# CLOSE A PORT -#================================================= - -if yunohost firewall list | grep -q "\- $port$" -then - ynh_script_progression --message="Closing port $port..." --weight=1 - 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..." --weight=1 - ynh_exec_warn_less yunohost firewall disallow UDP $port_videobridge -fi - #================================================= # SPECIFIC REMOVE #================================================= @@ -151,11 +99,9 @@ ynh_secure_remove --file="/var/log/$app" #================================================= # REMOVE DEDICATED USER #================================================= -#REMOVEME? ynh_script_progression --message="Removing the dedicated system user..." --weight=1 +ynh_script_progression --message="Removing the dedicated system user..." --weight=1 gpasswd --delete www-data $app -# Delete a system user -#REMOVEME? ynh_system_user_delete --username=$app #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index 9dea477..44a0e08 100644 --- a/scripts/restore +++ b/scripts/restore @@ -10,55 +10,14 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -#REMOVEME? ynh_clean_setup () { - true -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -ynh_script_progression --message="Loading settings..." --weight=1 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) - -#REMOVEME? focus_user=$(ynh_app_setting_get --app=$app --key=focus_user) -#REMOVEME? focus_password=$(ynh_app_setting_get --app=$app --key=focus_password) -#REMOVEME? focus_secret=$(ynh_app_setting_get --app=$app --key=focus_secret) - -#REMOVEME? videobridge_user=$(ynh_app_setting_get --app=$app --key=videobridge_user) -#REMOVEME? videobridge_secret=$(ynh_app_setting_get --app=$app --key=videobridge_secret) - -#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) -#REMOVEME? port_videobridge=$(ynh_app_setting_get --app=$app --key=port_videobridge) -#REMOVEME? port_component=$(ynh_app_setting_get --app=$app --key=port_component) - -#================================================= -# CHECK IF THE APP CAN BE RESTORED -#================================================= -#REMOVEME? ynh_script_progression --message="Validating restoration parameters..." --weight=1 - -#REMOVEME? test ! -d $install_dir \ - || ynh_die --message="There is already a directory: $install_dir " - #================================================= # STANDARD RESTORATION STEPS #================================================= # RECREATE THE DEDICATED USER #================================================= -#REMOVEME? ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 +ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 # Create the dedicated user (if not existing) -#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" gpasswd --add www-data $app #================================================= @@ -81,12 +40,12 @@ chown -R $app:$app "$install_dir" # Define and install dependencies ynh_install_apps --apps="$ynh_app_dependencies" -#REMOVEME? ynh_install_app_dependencies $pkg_dependencies + ynh_install_app_dependencies $pkg_dependencies if [ $YNH_ARCH == "armhf" ] then -#REMOVEME? ynh_script_progression --message="Installing specific arm dependencies..." --weight=1 -#REMOVEME? ynh_install_extra_app_dependencies --repo="deb http://security.debian.org/debian-security stretch/updates main" --package="$pkg_extra_depedencies_arm" --key="https://ftp-master.debian.org/keys/archive-key-9-security.asc" + ynh_script_progression --message="Installing specific arm dependencies..." --weight=1 + ynh_install_extra_app_dependencies --repo="deb http://security.debian.org/debian-security stretch/updates main" --package="$pkg_extra_depedencies_arm" --key="https://ftp-master.debian.org/keys/archive-key-9-security.asc" fi gpasswd --add prosody $app From d1ca660bf2fd8c50ea28b6a2df21fb637efdcd95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Thu, 18 Jan 2024 14:34:56 +0100 Subject: [PATCH 03/17] Continue manifestv2 --- .github/workflows/updater.sh | 156 ---------------------------------- .github/workflows/updater.yml | 49 ----------- check_process | 28 ------ manifest.json | 44 ---------- manifest.toml | 85 ++++++++++-------- scripts/_common.sh | 20 +---- tests.toml | 15 ++++ 7 files changed, 67 insertions(+), 330 deletions(-) delete mode 100644 .github/workflows/updater.sh delete mode 100644 .github/workflows/updater.yml delete mode 100644 check_process delete mode 100644 manifest.json create mode 100644 tests.toml diff --git a/.github/workflows/updater.sh b/.github/workflows/updater.sh deleted file mode 100644 index 90b5e7c..0000000 --- a/.github/workflows/updater.sh +++ /dev/null @@ -1,156 +0,0 @@ -#!/bin/bash - -#================================================= -# PACKAGE UPDATING HELPER -#================================================= - -# This script is meant to be run by GitHub Actions -# The YunoHost-Apps organisation offers a template Action to run this script periodically -# Since each app is different, maintainers can adapt its contents so as to perform -# automatic actions when a new upstream release is detected. - -#================================================= -# FETCHING LATEST RELEASE AND ITS ASSETS -#================================================= - -# Fetching information -current_version=$(cat manifest.json | jq -j '.version|split("~")[0]') -repo=$(cat manifest.json | jq -j '.upstream.code|split("https://github.com/")[1]') -# Some jq magic is needed, because the latest upstream release is not always the latest version (e.g. security patches for older versions) -version=$(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '.[] | select( .prerelease != true ) | .name' | sort -V | tail -1) - -package_repository="https://download.jitsi.org/stable" - -tempdir="$(mktemp -d)" -curl -o $tempdir/Release "$package_repository/Packages" -dependencies=$(sed -n '/Version: '$version'*/,/Package:/p' $tempdir/Release | grep "^Pre-Depends:" | cut -d " " -f2-) -dependencies="$dependencies, $(sed -n '/Version: '$version'*/,/Package:/p' $tempdir/Release | grep "^Depends:" | cut -d " " -f2-)" -IFS=',' read -ra dependencies_array <<< "$dependencies" -assets=() -for onedependency in "${dependencies_array[@]}" -do - app=$(echo $onedependency | cut -d " " -f1) - appversion=$(echo $onedependency | grep -oP "(?<== ).*(?=\))") - assets+=("$package_repository/${app}_${appversion}_all.deb") -done -rm -rf $tempdir - -# Later down the script, we assume the version has only digits and dots -# Sometimes the release name starts with a "v", so let's filter it out. -# You may need more tweaks here if the upstream repository has different naming conventions. -if [[ ${version:0:1} == "v" || ${version:0:1} == "V" ]]; then - version=${version:1} -fi - -# Setting up the environment variables -echo "Current version: $current_version" -echo "Latest release from upstream: $version" -echo "VERSION=$version" >> $GITHUB_ENV -echo "REPO=$repo" >> $GITHUB_ENV -# For the time being, let's assume the script will fail -echo "PROCEED=false" >> $GITHUB_ENV - -# Proceed only if the retrieved version is greater than the current one -if ! dpkg --compare-versions "$current_version" "lt" "$version" ; then - echo "::warning ::No new version available" - exit 0 -# Proceed only if a PR for this new version does not already exist -elif git ls-remote -q --exit-code --heads https://github.com/$GITHUB_REPOSITORY.git ci-auto-update-v$version ; then - echo "::warning ::A branch already exists for this update" - exit 0 -fi - -# Each release can hold multiple assets (e.g. binaries for different architectures, source code, etc.) -echo "${#assets[@]} available asset(s)" - -#================================================= -# UPDATE SOURCE FILES -#================================================= - -# Here we use the $assets variable to get the resources published in the upstream release. -# Here is an example for Grav, it has to be adapted in accordance with how the upstream releases look like. - -# Let's loop over the array of assets URLs -for asset_url in ${assets[@]}; do - - echo "Handling asset at $asset_url" - - # Assign the asset to a source file in conf/ directory - # Here we base the source file name upon a unique keyword in the assets url (admin vs. update) - # Leave $src empty to ignore the asset - case $asset_url in - *"jitsi-videobridge"*) - src="jitsi-videobridge" - ;; - *"jicofo"*) - src="jitsi-jicofo" - ;; - *"jitsi-meet-web_"*) - src="jitsi-meet-web" - ;; - *"jitsi-meet-prosody"*) - src="jitsi-meet-prosody" - ;; - *) - src="" - ;; - esac - - # If $src is not empty, let's process the asset - if [ ! -z "$src" ]; then - - # Create the temporary directory - tempdir="$(mktemp -d)" - - # Download sources and calculate checksum - filename=${asset_url##*/} - curl --silent -4 -L $asset_url -o "$tempdir/$filename" - checksum=$(sha256sum "$tempdir/$filename" | head -c 64) - - # Delete temporary directory - rm -rf $tempdir - - # Get extension - if [[ $filename == *.tar.gz ]]; then - extension=tar.gz - else - extension=${filename##*.} - fi - - # Rewrite source file - cat < conf/$src.src -SOURCE_URL=$asset_url -SOURCE_SUM=$checksum -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=deb -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=$src.deb -SOURCE_EXTRACT=false -EOT - echo "... conf/$src.src updated" - - else - echo "... asset ignored" - fi - -done - -#================================================= -# SPECIFIC UPDATE STEPS -#================================================= - -# Any action on the app's source code can be done. -# The GitHub Action workflow takes care of committing all changes after this script ends. - -#================================================= -# GENERIC FINALIZATION -#================================================= - -# Replace new version in manifest -echo "$(jq -s --indent 4 ".[] | .version = \"$version~ynh1\"" manifest.json)" > manifest.json - -# No need to update the README, yunohost-bot takes care of it - -# The Action will proceed only if the PROCEED environment variable is set to true -echo "PROCEED=true" >> $GITHUB_ENV -exit 0 diff --git a/.github/workflows/updater.yml b/.github/workflows/updater.yml deleted file mode 100644 index a56d7cb..0000000 --- a/.github/workflows/updater.yml +++ /dev/null @@ -1,49 +0,0 @@ -# This workflow allows GitHub Actions to automagically update your app whenever a new upstream release is detected. -# You need to enable Actions in your repository settings, and fetch this Action from the YunoHost-Apps organization. -# This file should be enough by itself, but feel free to tune it to your needs. -# It calls updater.sh, which is where you should put the app-specific update steps. -name: Check for new upstream releases -on: - # Allow to manually trigger the workflow - workflow_dispatch: - # Run it every day at 6:00 UTC - schedule: - - cron: '0 6 * * *' -jobs: - updater: - runs-on: ubuntu-latest - steps: - - name: Fetch the source code - uses: actions/checkout@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: Run the updater script - id: run_updater - run: | - # Setting up Git user - git config --global user.name 'yunohost-bot' - git config --global user.email 'yunohost-bot@users.noreply.github.com' - # Run the updater script - /bin/bash .github/workflows/updater.sh - - name: Commit changes - id: commit - if: ${{ env.PROCEED == 'true' }} - run: | - git commit -am "Upgrade to v$VERSION" - - name: Create Pull Request - id: cpr - if: ${{ env.PROCEED == 'true' }} - uses: peter-evans/create-pull-request@v4 - with: - token: ${{ secrets.GITHUB_TOKEN }} - commit-message: Update to version ${{ env.VERSION }} - committer: 'yunohost-bot ' - author: 'yunohost-bot ' - signoff: false - base: testing - branch: ci-auto-update-v${{ env.VERSION }} - delete-branch: true - title: 'Upgrade to version ${{ env.VERSION }}' - body: | - Upgrade to v${{ env.VERSION }} - draft: false diff --git a/check_process b/check_process deleted file mode 100644 index c33fe9d..0000000 --- a/check_process +++ /dev/null @@ -1,28 +0,0 @@ -;; Test complet - ; Manifest - domain="domain.tld" - ; Checks - pkg_linter=1 - setup_sub_dir=0 - setup_root=1 - setup_nourl=0 - setup_private=0 - setup_public=1 - upgrade=1 - # 1.0.4466~ynh1 - upgrade=1 from_commit=f967b101803c49655e460bdb2c1b0fb73320d0e3 - # 1.0.4466~ynh2 - upgrade=1 from_commit=ba635a58f8184b5dd4a6682b8da96909d3d31060 - # 1.0.5913~ynh1 - upgrade=1 from_commit=12d4758ea7582c9d15d0bd80e2eb5f03ccac8484 - # 1.0.5913~ynh3 - upgrade=1 from_commit=afbc84d313452267cd97b9df44801d0ae085b1f2 - # 2.0.8719~ynh2 - upgrade=1 from_commit=4a043dfd46acc078e6c222a83958b2f64f16a79f - backup_restore=1 - multi_instance=0 - port_already_use=0 - change_url=0 -;;; Options -Email=yalh@yahoo.com -Notification=all diff --git a/manifest.json b/manifest.json deleted file mode 100644 index 54f07dc..0000000 --- a/manifest.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "Jitsi Meet", - "id": "jitsi", - "packaging_format": 1, - "description": { - "en": "Video conferencing web application", - "fr": "Application web de conférence vidéo" - }, - "version": "2.0.9164~ynh1", - "url": "https://jitsi.org/Projects/JitMeet", - "upstream": { - "license": "Apache-2.0", - "website": "https://jitsi.org/", - "demo": "https://meet.jit.si/", - "userdoc": "https://jitsi.org/user-faq/", - "code": "https://github.com/jitsi/jitsi-meet", - "cpe": "cpe:2.3:a:jitsi:jitsi" - }, - "license": "Apache-2.0", - "maintainer": { - "name": "yalh76" - }, - "previous_maintainers": [ - { - "name": "ju", - "email": "julien.malik@paraiso.me" - } - ], - "requirements": { - "yunohost": ">= 11.0.8" - }, - "multi_instance": false, - "services": [ - "nginx" - ], - "arguments": { - "install": [ - { - "name": "domain", - "type": "domain" - } - ] - } -} diff --git a/manifest.toml b/manifest.toml index 0a27dfb..9408ba7 100644 --- a/manifest.toml +++ b/manifest.toml @@ -1,3 +1,5 @@ +#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/manifest.v2.schema.json + packaging_format = 2 id = "jitsi" @@ -29,48 +31,49 @@ disk = "50M" ram.build = "50M" ram.runtime = "50M" +[install] [install.domain] type = "domain" [resources] [resources.sources] - [resources.sources.jitsi-meet-web] - url = "https://download.jitsi.org/stable/jitsi-meet-web_1.0.7712-1_all.deb" - sha256 = "43917b5d3fd003823933d84beaf822a8a9edaa8f06f897e13b6b575bba3f3c18" - format = "deb" - rename = "jitsi-meet-web.deb" + [resources.sources.jitsi-meet-web] + url = "https://download.jitsi.org/stable/jitsi-meet-web_1.0.7712-1_all.deb" + sha256 = "43917b5d3fd003823933d84beaf822a8a9edaa8f06f897e13b6b575bba3f3c18" + format = "whatever" + rename = "jitsi-meet-web.deb" - [resources.sources.jitsi-sctp] - url = "https://github.com/jitsi/jitsi-sctp/archive/45bf9f296167f79a52cdc1b0e93bbfa4dc8c4976.tar.gz" - sha256 = "1eead17b10d059bafe8e1b06a8351936b608e7514b131588deac61d24b859397" + [resources.sources.jitsi-sctp] + url = "https://github.com/jitsi/jitsi-sctp/archive/45bf9f296167f79a52cdc1b0e93bbfa4dc8c4976.tar.gz" + sha256 = "1eead17b10d059bafe8e1b06a8351936b608e7514b131588deac61d24b859397" - [resources.sources.jitsi-jicofo] - url = "https://download.jitsi.org/stable/jicofo_1.0-1059-1_all.deb" - sha256 = "365051508e23ff99e3152fd3b414ec695ff920b16da9677a485f85aa91a9d549" - format = "deb" - rename = "jitsi-jicofo.deb" + [resources.sources.jitsi-jicofo] + url = "https://download.jitsi.org/stable/jicofo_1.0-1059-1_all.deb" + sha256 = "365051508e23ff99e3152fd3b414ec695ff920b16da9677a485f85aa91a9d549" + format = "whatever" + rename = "jitsi-jicofo.deb" - [resources.sources.jitsi-videobridge] - url = "https://download.jitsi.org/stable/jitsi-videobridge2_2.3-64-g719465d1-1_all.deb" - sha256 = "cd960148768c846cc97ce37211490f5026a5c4bc81fc48ea2ea22024f83667ca" - format = "deb" - rename = "jitsi-videobridge.deb" + [resources.sources.jitsi-videobridge] + url = "https://download.jitsi.org/stable/jitsi-videobridge2_2.3-64-g719465d1-1_all.deb" + sha256 = "cd960148768c846cc97ce37211490f5026a5c4bc81fc48ea2ea22024f83667ca" + format = "whatever" + rename = "jitsi-videobridge.deb" - [resources.sources.usrsctp] - url = "https://github.com/sctplab/usrsctp/archive/8e12cd9e01fc94d2e84ea1afa351c845966e116e.tar.gz" - sha256 = "0574a31fecca543cf8e46c1bff441a3048ccf7d403da0543639db334e9a09b2f" + [resources.sources.usrsctp] + url = "https://github.com/sctplab/usrsctp/archive/8e12cd9e01fc94d2e84ea1afa351c845966e116e.tar.gz" + sha256 = "0574a31fecca543cf8e46c1bff441a3048ccf7d403da0543639db334e9a09b2f" - [resources.sources.jitsi-meet-prosody] - url = "https://download.jitsi.org/stable/jitsi-meet-prosody_1.0.7712-1_all.deb" - sha256 = "30e360d42c4badf07e7269979b8af71eac05d689febc367420e0ca4abecfb16a" - format = "deb" - rename = "jitsi-meet-prosody.deb" + [resources.sources.jitsi-meet-prosody] + url = "https://download.jitsi.org/stable/jitsi-meet-prosody_1.0.7712-1_all.deb" + sha256 = "30e360d42c4badf07e7269979b8af71eac05d689febc367420e0ca4abecfb16a" + format = "whatever" + rename = "jitsi-meet-prosody.deb" - [resources.sources.mod_auth_ldap] - url = "https://hg.prosody.im/prosody-modules/raw-file/tip/mod_auth_ldap/mod_auth_ldap.lua" - sha256 = "49c67ec86ec75ac8de93803be2ac7f907d1e9d3d22cd4c88fd48aaeed7a411e3" - format = "lua" - rename = "mod_auth_ldap.lua" + [resources.sources.mod_auth_ldap] + url = "https://hg.prosody.im/prosody-modules/raw-file/tip/mod_auth_ldap/mod_auth_ldap.lua" + sha256 = "49c67ec86ec75ac8de93803be2ac7f907d1e9d3d22cd4c88fd48aaeed7a411e3" + format = "whatever" + rename = "mod_auth_ldap.lua" [resources.system_user] @@ -88,9 +91,17 @@ ram.runtime = "50M" main.url = "/" [resources.apt] - packages = "openjdk-8-jre-headless|openjdk-11-jre-headless|openjdk-17-jre-headless debconf|debconf-2.0 procps uuid-runtime lua-ldap prosody" - - [[resources.apt.extras]] - repo = "deb http://security.debian.org/debian-security stretch/updates main" - key = "https://ftp-master.debian.org/keys/archive-key-9-security.asc" - packages = "#FIXME#$pkg_extra_depedencies_arm" + packages = [ + "openjdk-17-jre-headless", + "debconf|debconf-2.0", + "procps", + "uuid-runtime", + "lua-ldap", + "prosody", + ] + + packages_from_raw_bash = """ + if [[ "$YNH_ARCH" == "armhf" ]] || [[ "$YNH_ARCH" == "arm64" ]]; then + echo automake autoconf build-essential libtool git maven m4 + fi + """ diff --git a/scripts/_common.sh b/scripts/_common.sh index 5f159ea..900dd62 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,18 +4,6 @@ # COMMON VARIABLES #================================================= -# dependencies used by the app -#REMOVEME? pkg_dependencies="openjdk-8-jre-headless|openjdk-11-jre-headless|openjdk-17-jre-headless debconf|debconf-2.0 procps uuid-runtime lua-ldap" - -#REMOVEME? ynh_app_dependencies="prosody" - -if [ $YNH_ARCH == "armhf" ] -then - pkg_dependencies_arm="automake autoconf build-essential libtool git maven m4" -#REMOVEME? pkg_dependencies="$pkg_dependencies $pkg_dependencies_arm" - - pkg_extra_depedencies_arm="openjdk-8-jre|openjdk-11-jre|openjdk-17-jre openjdk-8-jre-headless|openjdk-11-jre-headless|openjdk-17-jre-headless openjdk-8-jdk|openjdk-11-jdk|openjdk-17-jdk openjdk-8-jdk-headless|openjdk-11-jdk-headless|openjdk-17-jdk-headless" -fi #================================================= # PERSONAL HELPERS #================================================= @@ -27,8 +15,8 @@ ynh_version_gt () ynh_jniwrapper_armhf () { - - # set openjdk-8 as default + + # set openjdk-8 as default # update-alternatives --set java /usr/lib/jvm/java-8-openjdk-armhf/jre/bin/java tempdir="$(mktemp -d)" @@ -52,10 +40,10 @@ ynh_jniwrapper_armhf () pushd "$tempdir/jitsi-sctp" mvn package -DbuildSctp -DbuildNativeWrapper -DdeployNewJnilib -DskipTests - mvn package + mvn package popd - # rm official jniwrapper to copy + # rm official jniwrapper to copy original_jniwrapper=$(ls $install_dir/jitsi-videobridge/lib/jniwrapper-native-*.jar) ynh_secure_remove --file="$original_jniwrapper" diff --git a/tests.toml b/tests.toml new file mode 100644 index 0000000..f6653ca --- /dev/null +++ b/tests.toml @@ -0,0 +1,15 @@ +#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/tests.v1.schema.json + +test_format = 1.0 + +[default] + + # ------------ + # Tests to run + # ------------ + + test_upgrade_from.f967b101.name = "1.0.4466~ynh1" + test_upgrade_from.ba635a58.name = "1.0.4466~ynh2" + test_upgrade_from.12d4758e.name = "1.0.5913~ynh1" + test_upgrade_from.afbc84d3.name = "1.0.5913~ynh3" + test_upgrade_from.4a043dfd.name = "2.0.8719~ynh2" From 437e73f28b45207208b10863ec7111cc9ef20010 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Thu, 18 Jan 2024 14:46:53 +0100 Subject: [PATCH 04/17] Fix, install debconf-2.0 --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 9408ba7..d684776 100644 --- a/manifest.toml +++ b/manifest.toml @@ -93,7 +93,7 @@ ram.runtime = "50M" [resources.apt] packages = [ "openjdk-17-jre-headless", - "debconf|debconf-2.0", + "debconf-2.0", "procps", "uuid-runtime", "lua-ldap", From a48325836f935bfbd7c9b5fc2260ca45a11eb293 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Thu, 18 Jan 2024 14:47:34 +0100 Subject: [PATCH 05/17] fix apt dependency --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index d684776..7156240 100644 --- a/manifest.toml +++ b/manifest.toml @@ -93,7 +93,7 @@ ram.runtime = "50M" [resources.apt] packages = [ "openjdk-17-jre-headless", - "debconf-2.0", + "debconf", "procps", "uuid-runtime", "lua-ldap", From b7f9e1ab9fc6ef946a680d866a912f0557a65e70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Thu, 18 Jan 2024 15:17:07 +0100 Subject: [PATCH 06/17] fix resources extract = false --- manifest.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/manifest.toml b/manifest.toml index 7156240..947342c 100644 --- a/manifest.toml +++ b/manifest.toml @@ -41,6 +41,7 @@ ram.runtime = "50M" url = "https://download.jitsi.org/stable/jitsi-meet-web_1.0.7712-1_all.deb" sha256 = "43917b5d3fd003823933d84beaf822a8a9edaa8f06f897e13b6b575bba3f3c18" format = "whatever" + extract = false rename = "jitsi-meet-web.deb" [resources.sources.jitsi-sctp] @@ -51,12 +52,14 @@ ram.runtime = "50M" url = "https://download.jitsi.org/stable/jicofo_1.0-1059-1_all.deb" sha256 = "365051508e23ff99e3152fd3b414ec695ff920b16da9677a485f85aa91a9d549" format = "whatever" + extract = false rename = "jitsi-jicofo.deb" [resources.sources.jitsi-videobridge] url = "https://download.jitsi.org/stable/jitsi-videobridge2_2.3-64-g719465d1-1_all.deb" sha256 = "cd960148768c846cc97ce37211490f5026a5c4bc81fc48ea2ea22024f83667ca" format = "whatever" + extract = false rename = "jitsi-videobridge.deb" [resources.sources.usrsctp] @@ -67,12 +70,14 @@ ram.runtime = "50M" url = "https://download.jitsi.org/stable/jitsi-meet-prosody_1.0.7712-1_all.deb" sha256 = "30e360d42c4badf07e7269979b8af71eac05d689febc367420e0ca4abecfb16a" format = "whatever" + extract = false rename = "jitsi-meet-prosody.deb" [resources.sources.mod_auth_ldap] url = "https://hg.prosody.im/prosody-modules/raw-file/tip/mod_auth_ldap/mod_auth_ldap.lua" sha256 = "49c67ec86ec75ac8de93803be2ac7f907d1e9d3d22cd4c88fd48aaeed7a411e3" format = "whatever" + extract = false rename = "mod_auth_ldap.lua" From 1e3108a85ae3560ebf0422114bd59c1e7afed899 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Thu, 18 Jan 2024 16:39:14 +0100 Subject: [PATCH 07/17] Update manifestv2 --- scripts/_common.sh | 39 ++++++-- scripts/backup | 26 ++--- scripts/install | 156 ++++++++--------------------- scripts/remove | 51 +++------- scripts/restore | 108 +++++--------------- scripts/upgrade | 245 ++++++++------------------------------------- 6 files changed, 164 insertions(+), 461 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 900dd62..f3cb8e5 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -8,11 +8,30 @@ # PERSONAL HELPERS #================================================= -ynh_version_gt () -{ - dpkg --compare-versions "$1" gt "$2" +_setup_sources() { + # Download, check integrity, uncompress and patch the source from app.src + declare -A packages=( + [jitsi-jicofo]="jicofo" + [jitsi-meet-prosody]="jitsi-meet/prosody-plugins" + [jitsi-meet-web]="jitsi-meet" + [jitsi-videobridge]="jitsi-videobridge" + ) + + for package in "${!packages[@]}"; do + ynh_setup_source --dest_dir="$install_dir/temp" --source_id="$package" + pushd "$install_dir/temp" + ar x "$package.deb" data.tar.xz + tar xf data.tar.xz + popd + + mv "$install_dir/temp/usr/share/${packages[$package]}/" "$install_dir/$package/" + ynh_secure_remove --file="$install_dir/temp" + done + + ynh_setup_source --dest_dir="$install_dir/jitsi-meet-prosody" --source_id=mod_auth_ldap } + ynh_jniwrapper_armhf () { @@ -27,20 +46,18 @@ ynh_jniwrapper_armhf () packages_arm[jitsi-sctp]="jitsi-sctp" packages_arm[usrsctp]="jitsi-sctp/usrsctp/usrsctp" - for package_arm in "${!packages_arm[@]}" - do - ynh_setup_source --dest_dir="$tempdir/${packages_arm[$package_arm]}" --source_id=$package_arm + for package_arm in "${!packages_arm[@]}"; do + ynh_setup_source --dest_dir="$tempdir/${packages_arm[$package_arm]}" --source_id=$package_arm done # needed to make compile works - if [ ! -d "$tempdir/jitsi-sctp/jniwrapper/native/src/main/resources/lib/linux-arm/" ] - then - mkdir -p $tempdir/jitsi-sctp/jniwrapper/native/src/main/resources/lib/linux-arm/ + if [ ! -d "$tempdir/jitsi-sctp/jniwrapper/native/src/main/resources/lib/linux-arm/" ]; then + mkdir -p $tempdir/jitsi-sctp/jniwrapper/native/src/main/resources/lib/linux-arm/ fi pushd "$tempdir/jitsi-sctp" - mvn package -DbuildSctp -DbuildNativeWrapper -DdeployNewJnilib -DskipTests - mvn package + mvn package -DbuildSctp -DbuildNativeWrapper -DdeployNewJnilib -DskipTests + mvn package popd # rm official jniwrapper to copy diff --git a/scripts/backup b/scripts/backup index 686d212..3a167ba 100644 --- a/scripts/backup +++ b/scripts/backup @@ -22,26 +22,24 @@ ynh_print_info --message="Declaring files to be backed up..." ynh_backup --src_path="$install_dir" #================================================= -# BACKUP THE NGINX CONFIGURATION +# SYSTEM CONFIGURATION #================================================= +# Backup the nginx configuration ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# SPECIFIC BACKUP -#================================================= -# BACKUP LOGROTATE -#================================================= - -ynh_backup --src_path="/etc/logrotate.d/$app" - -#================================================= -# BACKUP SYSTEMD -#================================================= - +# Backup the systemd service units ynh_backup --src_path="/etc/systemd/system/$app-videobridge.service" ynh_backup --src_path="/etc/systemd/system/$app-jicofo.service" +# Backup the logrotate configuration +ynh_backup --src_path="/etc/logrotate.d/$app" + +# Backup the Fail2Ban config +ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf" +ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf" + + #================================================= # BACKUP VARIOUS FILES #================================================= @@ -50,6 +48,8 @@ ynh_backup --src_path="/etc/$app/" ynh_backup --src_path="/etc/prosody/conf.avail/$domain.cfg.lua" +ynh_backup --src_path="/var/log/$app/" + #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/install b/scripts/install index 0e6924d..bcf914a 100644 --- a/scripts/install +++ b/scripts/install @@ -10,95 +10,57 @@ source _common.sh source /usr/share/yunohost/helpers #================================================= -# RETRIEVE ARGUMENTS FROM THE MANIFEST +# INITIALIZE AND STORE SETTINGS #================================================= -#YOURSECRET3 -focus_password=$(ynh_string_random --length=8) -#YOURSECRET1 -videobridge_secret=$(ynh_string_random --length=8) -#YOURSECRET2 -focus_secret=$(ynh_string_random --length=8) - -#OTHER SECRET -turn_secret=$(ynh_string_random --length=8) - focus_user="focus" +focus_password=$(ynh_string_random --length=8) +ynh_app_setting_set --app="$app" --key=focus_user --value="$focus_user" +ynh_app_setting_set --app="$app" --key=focus_password --value="$focus_password" videobridge_user="jvb" +videobridge_secret=$(ynh_string_random --length=8) +ynh_app_setting_set --app="$app" --key=videobridge_user --value="$videobridge_user" +ynh_app_setting_set --app="$app" --key=videobridge_secret --value="$videobridge_secret" + +focus_secret=$(ynh_string_random --length=8) +turn_secret=$(ynh_string_random --length=8) +ynh_app_setting_set --app="$app" --key=focus_secret --value="$focus_secret" +ynh_app_setting_set --app="$app" --key=turn_secret --value="$turn_secret" max_memory=200 #125 mib with no user +1,5*50 users=75 mib +ynh_app_setting_set --app="$app" --key=max_memory --value="$max_memory" -#================================================= -# STORE SETTINGS FROM MANIFEST -#================================================= -ynh_script_progression --message="Storing installation settings..." --weight=1 - -ynh_app_setting_set --app=$app --key=max_memory --value=$max_memory -ynh_app_setting_set --app=$app --key=focus_user --value=$focus_user -ynh_app_setting_set --app=$app --key=focus_password --value=$focus_password -ynh_app_setting_set --app=$app --key=focus_secret --value=$focus_secret -ynh_app_setting_set --app=$app --key=videobridge_user --value=$videobridge_user -ynh_app_setting_set --app=$app --key=videobridge_secret --value=$videobridge_secret -ynh_app_setting_set --app=$app --key=turn_secret --value=$turn_secret - -#================================================= -# INSTALL DEPENDENCIES -#================================================= -ynh_script_progression --message="Installing dependencies..." --weight=1 - -if [ $YNH_ARCH == "armhf" ] -then - ynh_script_progression --message="Installing specific arm dependencies..." - ynh_install_extra_app_dependencies --repo="deb http://security.debian.org/debian-security stretch/updates main" --package="$pkg_extra_depedencies_arm" --key="https://ftp-master.debian.org/keys/archive-key-9-security.asc" -fi +muc_nickname=$(uuidgen) +ynh_app_setting_set --app="$app" --key=muc_nickname --value="$muc_nickname" #================================================= # CREATE DEDICATED USER #================================================= ynh_script_progression --message="Configuring system user..." --weight=1 -# Create a system user -gpasswd --add prosody $app -gpasswd --add www-data $app +gpasswd --add prosody "$app" +gpasswd --add www-data "$app" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= ynh_script_progression --message="Setting up source files..." --weight=1 -# Download, check integrity, uncompress and patch the source from app.src -declare -A packages -packages[jitsi-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="$install_dir/${package}_temp" --source_id=$package - pushd "$install_dir/${package}_temp" - ar x $package.deb data.tar.xz - tar xf data.tar.xz - popd - - mv "$install_dir/${package}_temp/usr/share/${packages[$package]}/" "$install_dir/${package}/" - ynh_secure_remove --file="$install_dir/${package}_temp" -done - -ynh_setup_source --dest_dir="$install_dir/jitsi-meet-prosody" --source_id=mod_auth_ldap +_setup_sources chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" -chown -R $app:$app "$install_dir" +chown -R "$app:$app" "$install_dir" #================================================= -# NGINX CONFIGURATION +# REPLACE JNIWRAPPER FOR ARMHF ARCHITECTURE IN JITSI-VIDEOBRIDGE #================================================= -ynh_script_progression --message="Configuring NGINX web server..." --weight=1 -# Create a dedicated NGINX config -ynh_add_nginx_config +if [ "$YNH_ARCH" == "armhf" ]; then + ynh_script_progression --message="Configuring jniwrapper for armhf ..." --weight=1 + ynh_jniwrapper_armhf +fi #================================================= # SPECIFIC SETUP @@ -111,12 +73,12 @@ ynh_add_config --template="prosody.cfg.lua" --destination="/etc/prosody/conf.ava chmod 644 "/etc/prosody/conf.avail/$domain.cfg.lua" ln -s "/etc/prosody/conf.avail/$domain.cfg.lua" "/etc/prosody/conf.d/$domain.cfg.lua" -echo | prosodyctl cert generate $domain +ynh_exec_warn_less prosodyctl cert generate "$domain" ln -sf "/var/lib/prosody/$domain.key" "/etc/prosody/certs/$domain.key" ln -sf "/var/lib/prosody/$domain.crt" "/etc/prosody/certs/$domain.crt" ln -sf "/var/lib/prosody/$domain.crt" "/usr/local/share/ca-certificates/$domain.crt" -echo | prosodyctl cert generate "auth.$domain" +ynh_exec_warn_less prosodyctl cert generate "auth.$domain" ln -sf "/var/lib/prosody/auth.$domain.key" "/etc/prosody/certs/auth.$domain.key" ln -sf "/var/lib/prosody/auth.$domain.crt" "/etc/prosody/certs/auth.$domain.crt" ln -sf "/var/lib/prosody/auth.$domain.crt" "/usr/local/share/ca-certificates/auth.$domain.crt" @@ -126,10 +88,8 @@ update-ca-certificates -f ynh_systemd_action --service_name="prosody" --action="restart" prosodyctl register "$focus_user" "auth.$domain" "$focus_password" - prosodyctl register "$videobridge_user" "auth.$domain" "$videobridge_secret" - -prosodyctl mod_roster_command subscribe $focus_user.$domain $focus_user@auth.$domain +prosodyctl mod_roster_command subscribe "$focus_user.$domain" "$focus_user@auth.$domain" #================================================= # CONFIGURE JITSI-VIDEOBRIDGE @@ -139,31 +99,14 @@ ynh_script_progression --message="Configuring Jitsi-Videobridge..." --weight=1 public_ipv4="$(curl ip.yunohost.org)" || true private_ipv4="$(ip route get 1 | sed -n 's/^.*src \([0-9.]*\) .*$/\1/p')" || true -muc_nickname=$(uuidgen) -ynh_app_setting_set --app=$app --key=muc_nickname --value=$muc_nickname - mkdir -p "/etc/$app/videobridge" ynh_add_config --template="jitsi-videobridge-callstats-java-sdk.properties" --destination="/etc/$app/videobridge/callstats-java-sdk.properties" - ynh_add_config --template="jitsi-videobridge-jvb.conf" --destination="/etc/$app/videobridge/jvb.conf" - ynh_add_config --template="jitsi-videobridge-logging.properties" --destination="/etc/$app/videobridge/logging.properties" - ynh_add_config --template="jitsi-videobridge-sip-communicator.properties" --destination="/etc/$app/videobridge/sip-communicator.properties" - ynh_add_config --template="jitsi-videobridge.config" --destination="/etc/$app/videobridge/config" -#================================================= -# REPLACE JNIWRAPPER FOR ARMHF ARCHITECTURE IN JITSI-VIDEOBRIDGE -#================================================= - -if [ $YNH_ARCH == "armhf" ] -then - ynh_script_progression --message="Configuring jniwrapper for armhf ..." --weight=1 - ynh_jniwrapper_armhf -fi - #================================================= # CONFIGURE JITSI-JICOFO #================================================= @@ -172,9 +115,7 @@ ynh_script_progression --message="Configuring Jitsi-Jicofo..." --weight=1 mkdir -p "/etc/$app/jicofo" ynh_add_config --template="jitsi-jicofo-config" --destination="/etc/$app/jicofo/config" - ynh_add_config --template="jitsi-jicofo-jicofo.conf" --destination="/etc/$app/jicofo/jicofo.conf" - ynh_add_config --template="jitsi-jicofo-logging.properties" --destination="/etc/$app/jicofo/logging.properties" #================================================= @@ -187,49 +128,34 @@ mkdir -p "/etc/$app/meet" ynh_add_config --template="jitsi-meet-config.js" --destination="/etc/$app/meet/$domain-config.js" chmod 644 "/etc/$app/meet/$domain-config.js" -#================================================= -# CREATE LOG DIR -#================================================= -ynh_script_progression --message="Creating log dir..." --weight=1 - -mkdir -p "/var/log/$app" -chown -R $app: /var/log/$app -chmod -R 770 /var/log/$app - #================================================= # SECURE FILES AND DIRECTORIES #================================================= ynh_script_progression --message="Securing files and directories..." --weight=1 # Set permissions to app files -chown -R $app: /etc/$app +chown -R "$app:" "/etc/$app" #================================================= -# SETUP SYSTEMD +# SYSTEM CONFIGURATION #================================================= -ynh_script_progression --message="Configuring a systemd service..." --weight=1 +ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 + +# Create a dedicated NGINX config +ynh_add_nginx_config # Create a dedicated systemd config -ynh_add_systemd_config --service=$app-videobridge --template="jitsi-videobridge.service" -ynh_add_systemd_config --service=$app-jicofo --template="jitsi-jicofo.service" +ynh_add_systemd_config --service="$app-videobridge" --template="jitsi-videobridge.service" +yunohost service add "$app-videobridge" --log "/var/log/$app/$app-videobridge.log" --needs_exposed_ports "$port" "$port_videobridge" -#================================================= -# GENERIC FINALIZATION -#================================================= -# SETUP LOGROTATE -#================================================= -ynh_script_progression --message="Configuring log rotation..." --weight=1 +ynh_add_systemd_config --service="$app-jicofo" --template="jitsi-jicofo.service" +yunohost service add "$app-jicofo" --log "/var/log/$app/$app-jicofo.log" # Use logrotate to manage application logfile(s) ynh_use_logrotate -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - -yunohost service add $app-videobridge --log "/var/log/$app/$app-videobridge.log" --needs_exposed_ports $port $port_videobridge -yunohost service add $app-jicofo --log "/var/log/$app/$app-jicofo.log" +chown -R "$app:" "/var/log/$app" +chmod -R 770 "/var/log/$app" #================================================= # START SYSTEMD SERVICE @@ -237,8 +163,8 @@ yunohost service add $app-jicofo --log "/var/log/$app/$app-jicofo.log" ynh_script_progression --message="Starting a systemd service..." --weight=1 # Start a systemd service -ynh_systemd_action --service_name=$app-jicofo --action="start" --log_path="/var/log/$app/$app-jicofo.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-videobridge" --action="start" --log_path="/var/log/$app/$app-videobridge.log" #================================================= # END OF SCRIPT diff --git a/scripts/remove b/scripts/remove index 980dd59..d7a6509 100644 --- a/scripts/remove +++ b/scripts/remove @@ -10,38 +10,36 @@ source _common.sh source /usr/share/yunohost/helpers #================================================= -# STANDARD REMOVE -#================================================= -# REMOVE SERVICE INTEGRATION IN YUNOHOST +# REMOVE SYSTEM CONFIGURATIONS #================================================= +ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 # Remove the service from the list of services known by YunoHost (added from `yunohost service add`) -if ynh_exec_warn_less yunohost service status $app-videobridge >/dev/null -then - ynh_script_progression --message="Removing $app-videobridge service..." --weight=1 - yunohost service remove $app-videobridge +if ynh_exec_warn_less yunohost service status "$app-videobridge" >/dev/null; then + 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..." --weight=1 - yunohost service remove $app-jicofo +if ynh_exec_warn_less yunohost service status "$app-jicofo" >/dev/null; then + yunohost service remove "$app-jicofo" fi # Remove the dedicated systemd config -ynh_remove_systemd_config --service=$app-videobridge -ynh_remove_systemd_config --service=$app-jicofo +ynh_remove_systemd_config --service="$app-videobridge" +ynh_remove_systemd_config --service="$app-jicofo" # Remove the app-specific logrotate config ynh_remove_logrotate +# Remove the dedicated NGINX config +ynh_remove_nginx_config + #================================================= # RECONFIGURE PROSODY #================================================= ynh_script_progression --message="Reconfiguring Prosody..." --weight=1 -prosodyctl deluser $focus_user@auth.$domain || true -prosodyctl deluser $videobridge_user@auth.$domain || true +prosodyctl deluser "$focus_user@auth.$domain" || true +prosodyctl deluser "$videobridge_user@auth.$domain" || true # Remove domain conf template ynh_secure_remove --file="/etc/prosody/conf.d/$domain.cfg.lua" @@ -60,24 +58,16 @@ ynh_secure_remove --file="/usr/local/share/ca-certificates/auth.$domain.crt" update-ca-certificates -f +gpasswd --delete prosody "$app" + ynh_systemd_action --service_name=prosody --action=restart -#================================================= -# REMOVE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 - -# Remove the dedicated NGINX config -ynh_remove_nginx_config - #================================================= # REMOVE DEPENDENCIES #================================================= ynh_script_progression --message="Removing dependencies..." --weight=1 -# Remove Prosody -ynh_app_setting_delete --app=$app --key=require_prosody -gpasswd --delete prosody $app +ynh_app_setting_delete --app="$app" --key=require_prosody ynh_remove_apps @@ -94,15 +84,6 @@ ynh_secure_remove --file="/etc/$app" # Remove the log files ynh_secure_remove --file="/var/log/$app" -#================================================= -# GENERIC FINALIZATION -#================================================= -# REMOVE DEDICATED USER -#================================================= -ynh_script_progression --message="Removing the dedicated system user..." --weight=1 - -gpasswd --delete www-data $app - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index 44a0e08..86e41fe 100644 --- a/scripts/restore +++ b/scripts/restore @@ -15,10 +15,10 @@ source /usr/share/yunohost/helpers #================================================= # RECREATE THE DEDICATED USER #================================================= -ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 +ynh_script_progression --message="Reconfiguring the dedicated system user..." --weight=1 -# Create the dedicated user (if not existing) -gpasswd --add www-data $app +gpasswd --add prosody "$app" +gpasswd --add www-data "$app" #================================================= # RESTORE THE APP MAIN DIR @@ -29,42 +29,7 @@ ynh_restore_file --origin_path="$install_dir" chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" -chown -R $app:$app "$install_dir" - -#================================================= -# SPECIFIC RESTORATION -#================================================= -# REINSTALL DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Reinstalling dependencies..." --weight=1 - -# Define and install dependencies -ynh_install_apps --apps="$ynh_app_dependencies" - ynh_install_app_dependencies $pkg_dependencies - -if [ $YNH_ARCH == "armhf" ] -then - ynh_script_progression --message="Installing specific arm dependencies..." --weight=1 - ynh_install_extra_app_dependencies --repo="deb http://security.debian.org/debian-security stretch/updates main" --package="$pkg_extra_depedencies_arm" --key="https://ftp-master.debian.org/keys/archive-key-9-security.asc" -fi - -gpasswd --add prosody $app - -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1 - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - -#================================================= -# CONFIGURE FIREWALL -#================================================= -ynh_script_progression --message="Configuring firewall..." --weight=1 - -# Open this port -ynh_exec_warn_less yunohost firewall allow TCP $port -ynh_exec_warn_less yunohost firewall allow UDP $port_videobridge +chown -R "$app:$app" "$install_dir" #================================================= # CONFIGURE PROSODY @@ -75,9 +40,11 @@ ynh_restore_file --origin_path="/etc/prosody/conf.avail/$domain.cfg.lua" chmod 644 "/etc/prosody/conf.avail/$domain.cfg.lua" ln -s "/etc/prosody/conf.avail/$domain.cfg.lua" "/etc/prosody/conf.d/$domain.cfg.lua" -ln -sf /var/lib/prosody/$domain.key /etc/prosody/certs/$domain.key -ln -sf /var/lib/prosody/$domain.crt /etc/prosody/certs/$domain.crt +ynh_exec_warn_less prosodyctl cert generate "$domain" +ln -sf "/var/lib/prosody/$domain.key" "/etc/prosody/certs/$domain.key" +ln -sf "/var/lib/prosody/$domain.crt" "/etc/prosody/certs/$domain.crt" +ynh_exec_warn_less prosodyctl cert generate "auth.$domain" ln -sf "/var/lib/prosody/auth.$domain.key" "/etc/prosody/certs/auth.$domain.key" ln -sf "/var/lib/prosody/auth.$domain.crt" "/etc/prosody/certs/auth.$domain.crt" ln -sf "/var/lib/prosody/auth.$domain.crt" "/usr/local/share/ca-certificates/auth.$domain.crt" @@ -87,67 +54,42 @@ update-ca-certificates -f ynh_systemd_action --service_name="prosody" --action="restart" prosodyctl register "$focus_user" "auth.$domain" "$focus_password" - prosodyctl register "$videobridge_user" "auth.$domain" "$videobridge_secret" - -prosodyctl mod_roster_command subscribe $focus_user.$domain $focus_user@auth.$domain +prosodyctl mod_roster_command subscribe "$focus_user.$domain" "$focus_user@auth.$domain" #================================================= -# RESTORE THE APP CONFIG +# RESTORE SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Restoring the app config..." --weight=1 +ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 -ynh_restore_file --origin_path="/etc/$app" - -chmod 644 "/etc/$app/meet/$domain-config.js" - -#================================================= -# CREATE LOG DIR -#================================================= -ynh_script_progression --message="Creating log dir..." --weight=1 - -mkdir -p "/var/log/$app" -chown -R $app: /var/log/$app - -#================================================= -# RESTORE SYSTEMD -#================================================= -ynh_script_progression --message="Restoring the systemd configuration..." --weight=1 +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/systemd/system/$app-videobridge.service" -systemctl enable $app-videobridge.service --quiet -ynh_restore_file --origin_path="/etc/systemd/system/$app-jicofo.service" -systemctl enable $app-jicofo.service --quiet +systemctl enable "$app-videobridge.service" --quiet +yunohost service add "$app-videobridge" --log "/var/log/$app/$app-videobridge.log" --needs_exposed_ports $port $port_videobridge -#================================================= -# RESTORE THE LOGROTATE CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the logrotate configuration..." --weight=1 +ynh_restore_file --origin_path="/etc/systemd/system/$app-jicofo.service" +systemctl enable "$app-jicofo.service" --quiet +yunohost service add "$app-jicofo" --log "/var/log/$app/$app-jicofo.log" ynh_restore_file --origin_path="/etc/logrotate.d/$app" #================================================= -# INTEGRATE SERVICE IN YUNOHOST +# RESTORE VARIOUS FILES #================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add $app-videobridge --log "/var/log/$app/$app-videobridge.log" --needs_exposed_ports $port $port_videobridge -yunohost service add $app-jicofo --log "/var/log/$app/$app-jicofo.log" +ynh_restore_file --origin_path="/etc/$app/" +chmod 644 "/etc/$app/meet/$domain-config.js" + +ynh_restore_file --origin_path="/var/log/$app/" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=1 +ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 -ynh_systemd_action --service_name=$app-jicofo --action="start" --log_path="/var/log/$app/$app-jicofo.log" -ynh_systemd_action --service_name=$app-videobridge --action="start" --log_path="/var/log/$app/$app-videobridge.log" - -#================================================= -# GENERIC FINALIZATION -#================================================= -# RELOAD NGINX AND PHP-FPM -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 +ynh_systemd_action --service_name="$app-jicofo" --action="start" --log_path="/var/log/$app/$app-jicofo.log" +ynh_systemd_action --service_name="$app-videobridge" --action="start" --log_path="/var/log/$app/$app-videobridge.log" ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index 8e6e57c..f19a956 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,55 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -ynh_script_progression --message="Loading settings..." --weight=1 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) - -#REMOVEME? max_memory=$(ynh_app_setting_get --app=$app --key=max_memory) - -#REMOVEME? focus_user=$(ynh_app_setting_get --app=$app --key=focus_user) -#REMOVEME? focus_password=$(ynh_app_setting_get --app=$app --key=focus_password) -#REMOVEME? focus_secret=$(ynh_app_setting_get --app=$app --key=focus_secret) - -#REMOVEME? videobridge_user=$(ynh_app_setting_get --app=$app --key=videobridge_user) -#REMOVEME? videobridge_secret=$(ynh_app_setting_get --app=$app --key=videobridge_secret) - -#REMOVEME? turn_secret=$(ynh_app_setting_get --app=$app --key=turn_secret) -#REMOVEME? muc_nickname=$(ynh_app_setting_get --app=$app --key=muc_nickname) - -#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) -#REMOVEME? port_videobridge=$(ynh_app_setting_get --app=$app --key=port_videobridge) -#REMOVEME? port_component=$(ynh_app_setting_get --app=$app --key=port_component) - -#================================================= -# CHECK VERSION -#================================================= -ynh_script_progression --message="Checking version..." --weight=1 - -upgrade_type=$(ynh_check_app_version_changed) -current_version=$(ynh_read_manifest --manifest="/etc/yunohost/apps/$app/manifest.json" --manifest_key="version" || echo 1.0) - -#================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP -#================================================= -#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." - -# Backup the current version of the app -#REMOVEME? ynh_backup_before_upgrade -#REMOVEME? ynh_clean_setup () { - # Restore it if the upgrade fails -#REMOVEME? ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -65,182 +16,81 @@ current_version=$(ynh_read_manifest --manifest="/etc/yunohost/apps/$app/manifest #================================================= ynh_script_progression --message="Stopping a systemd service..." --weight=1 -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-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" #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 -# If install_dir doesn't exist, create it -if [ -z "$install_dir" ]; then -#REMOVEME? install_dir=/var/www/$app -#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir -fi - # If max_memory doesn't exist, create it and set to default 75 mb value if [ -z "$max_memory" ]; then - max_memory=200 - ynh_app_setting_set --app=$app --key=max_memory --value=$max_memory + max_memory=200 + ynh_app_setting_set --app="$app" --key=max_memory --value="$max_memory" fi -#================================================= -# CREATE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 - -# Create a dedicated user (if not existing) -#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" -gpasswd --add www-data $app +gpasswd --add prosody "$app" +gpasswd --add www-data "$app" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= +ynh_script_progression --message="Upgrading source files..." --weight=1 -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - ynh_script_progression --message="Upgrading source files..." --weight=1 - - # Download, check integrity, uncompress and patch the source from app.src - declare -A packages - packages[jitsi-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 -#REMOVEME? ynh_secure_remove --file="$install_dir/${package}" - ynh_setup_source --dest_dir="$install_dir/${package}_temp" --source_id=$package - pushd "$install_dir/${package}_temp" - ar x $package.deb data.tar.xz - tar xf data.tar.xz - popd - - mv "$install_dir/${package}_temp/usr/share/${packages[$package]}/" "$install_dir/${package}/" -#REMOVEME? ynh_secure_remove --file="$install_dir/${package}_temp" - done - - ynh_setup_source --dest_dir="$install_dir/jitsi-meet-prosody" --source_id=mod_auth_ldap -fi +_setup_sources chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" -chown -R $app:$app "$install_dir" +chown -R "$app:$app" "$install_dir" #================================================= -# UPGRADE DEPENDENCIES +# REPLACE JNIWRAPPER FOR ARMHF ARCHITECTURE IN JITSI-VIDEOBRIDGE #================================================= -#REMOVEME? ynh_script_progression --message="Upgrading dependencies..." --weight=1 -ynh_install_apps --apps="$ynh_app_dependencies" -#REMOVEME? ynh_install_app_dependencies $pkg_dependencies - -if [ $YNH_ARCH == "armhf" ] -then -#REMOVEME? ynh_script_progression --message="Installing specific arm dependencies..." --weight=1 -#REMOVEME? ynh_install_extra_app_dependencies --repo="deb http://security.debian.org/debian-security stretch/updates main" --package="$pkg_extra_depedencies_arm" --key="https://ftp-master.debian.org/keys/archive-key-9-security.asc" +if [ "$YNH_ARCH" == "armhf" ]; then + ynh_script_progression --message="Configuring jniwrapper for armhf ..." --weight=1 + ynh_jniwrapper_armhf fi -gpasswd --add prosody $app - -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1 - -# Create a dedicated NGINX config -ynh_add_nginx_config - -#================================================= -# SPECIFIC UPGRADE -#================================================= -# CONFIGURE FIREWALL -#================================================= -ynh_script_progression --message="Configuring firewall..." --weight=1 - -# Open this port -ynh_exec_warn_less yunohost firewall allow TCP $port -ynh_exec_warn_less yunohost firewall allow UDP $port_videobridge - #================================================= # CONFIGURE PROSODY #================================================= ynh_script_progression --message="Configuring Prosody..." --weight=1 -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - ynh_add_config --template="../conf/prosody.cfg.lua" --destination="/etc/prosody/conf.avail/$domain.cfg.lua" - chmod 644 "/etc/prosody/conf.avail/$domain.cfg.lua" -fi +ynh_add_config --template="../conf/prosody.cfg.lua" --destination="/etc/prosody/conf.avail/$domain.cfg.lua" +chmod 644 "/etc/prosody/conf.avail/$domain.cfg.lua" #================================================= # CONFIGURE JITSI-VIDEOBRIDGE #================================================= ynh_script_progression --message="Configuring Jitsi-Videobridge..." --weight=1 -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - public_ipv4="$(curl ip.yunohost.org)" || true - private_ipv4="$(ip route get 1 | sed -n 's/^.*src \([0-9.]*\) .*$/\1/p')" || true +public_ipv4="$(curl ip.yunohost.org)" || true +private_ipv4="$(ip route get 1 | sed -n 's/^.*src \([0-9.]*\) .*$/\1/p')" || true - ynh_add_config --template="../conf/jitsi-videobridge-callstats-java-sdk.properties" --destination="/etc/$app/videobridge/callstats-java-sdk.properties" - - ynh_add_config --template="../conf/jitsi-videobridge-jvb.conf" --destination="/etc/$app/videobridge/jvb.conf" - - ynh_add_config --template="../conf/jitsi-videobridge-logging.properties" --destination="/etc/$app/videobridge/logging.properties" - - ynh_add_config --template="../conf/jitsi-videobridge-sip-communicator.properties" --destination="/etc/$app/videobridge/sip-communicator.properties" - - ynh_add_config --template="../conf/jitsi-videobridge.config" --destination="/etc/$app/videobridge/config" -fi - - -#================================================= -# REPLACE JNIWRAPPER FOR ARMHF ARCHITECTURE IN JITSI-VIDEOBRIDGE -#================================================= - -if [ $YNH_ARCH == "armhf" ] -then - ynh_script_progression --message="Configuring jniwrapper for armhf ..." --weight=1 - ynh_jniwrapper_armhf - -fi +ynh_add_config --template="../conf/jitsi-videobridge-callstats-java-sdk.properties" --destination="/etc/$app/videobridge/callstats-java-sdk.properties" +ynh_add_config --template="../conf/jitsi-videobridge-jvb.conf" --destination="/etc/$app/videobridge/jvb.conf" +ynh_add_config --template="../conf/jitsi-videobridge-logging.properties" --destination="/etc/$app/videobridge/logging.properties" +ynh_add_config --template="../conf/jitsi-videobridge-sip-communicator.properties" --destination="/etc/$app/videobridge/sip-communicator.properties" +ynh_add_config --template="../conf/jitsi-videobridge.config" --destination="/etc/$app/videobridge/config" #================================================= # CONFIGURE JITSI-JICOFO #================================================= ynh_script_progression --message="configuring Jitsi-Jicofo..." --weight=1 -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - ynh_add_config --template="../conf/jitsi-jicofo-config" --destination="/etc/$app/jicofo/config" - - ynh_add_config --template="../conf/jitsi-jicofo-jicofo.conf" --destination="/etc/$app/jicofo/jicofo.conf" - - ynh_add_config --template="../conf/jitsi-jicofo-logging.properties" --destination="/etc/$app/jicofo/logging.properties" -fi +ynh_add_config --template="../conf/jitsi-jicofo-config" --destination="/etc/$app/jicofo/config" +ynh_add_config --template="../conf/jitsi-jicofo-jicofo.conf" --destination="/etc/$app/jicofo/jicofo.conf" +ynh_add_config --template="../conf/jitsi-jicofo-logging.properties" --destination="/etc/$app/jicofo/logging.properties" #================================================= # CONFIGURE JITSI-MEET #================================================= ynh_script_progression --message="Configuring Jitsi-Meet..." --weight=1 -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - ynh_add_config --template="../conf/jitsi-meet-config.js" --destination="/etc/$app/meet/$domain-config.js" - chmod 644 "/etc/$app/meet/$domain-config.js" -fi - -#================================================= -# CREATE LOG DIR -#================================================= -ynh_script_progression --message="Creating log dir..." --weight=1 - -mkdir -p "/var/log/$app" -chown -R $app: /var/log/$app -chmod -R 770 /var/log/$app +ynh_add_config --template="../conf/jitsi-meet-config.js" --destination="/etc/$app/meet/$domain-config.js" +chmod 644 "/etc/$app/meet/$domain-config.js" #================================================= # SECURE FILES AND DIRECTORIES @@ -248,49 +98,36 @@ chmod -R 770 /var/log/$app ynh_script_progression --message="Securing files and directories..." --weight=1 # Set permissions on app files -chown -R $app: /etc/$app +chown -R "$app:" "/etc/$app" #================================================= -# SETUP SYSTEMD +# REAPPLY SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 +ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 + +# Create a dedicated NGINX config +ynh_add_nginx_config # Create a dedicated systemd config -ynh_add_systemd_config --service=$app-videobridge --template="jitsi-videobridge.service" -ynh_add_systemd_config --service=$app-jicofo --template="jitsi-jicofo.service" +ynh_add_systemd_config --service="$app-videobridge" --template="jitsi-videobridge.service" +yunohost service add "$app-videobridge" --log "/var/log/$app/$app-videobridge.log" --needs_exposed_ports "$port" "$port_videobridge" -#================================================= -# GENERIC FINALIZATION -#================================================= -# SETUP LOGROTATE -#================================================= -ynh_script_progression --message="Upgrading logrotate configuration..." --weight=1 +ynh_add_systemd_config --service="$app-jicofo" --template="jitsi-jicofo.service" +yunohost service add "$app-jicofo" --log "/var/log/$app/$app-jicofo.log" # Use logrotate to manage app-specific logfile(s) ynh_use_logrotate --non-append -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - -yunohost service add $app-videobridge --log "/var/log/$app/$app-videobridge.log" --needs_exposed_ports $port $port_videobridge -yunohost service add $app-jicofo --log "/var/log/$app/$app-jicofo.log" +chown -R "$app:" "/var/log/$app" +chmod -R 770 "/var/log/$app" #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app-jicofo --action="start" --log_path="/var/log/$app/$app-jicofo.log" -ynh_systemd_action --service_name=$app-videobridge --action="start" --log_path="/var/log/$app/$app-videobridge.log" - -#================================================= -# RELOAD NGINX -#================================================= -#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload +ynh_systemd_action --service_name="$app-jicofo" --action="start" --log_path="/var/log/$app/$app-jicofo.log" +ynh_systemd_action --service_name="$app-videobridge" --action="start" --log_path="/var/log/$app/$app-videobridge.log" #================================================= # END OF SCRIPT From a67d26af5b13e03abd9bdb5b8b4676864b1ab517 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Thu, 18 Jan 2024 16:42:42 +0100 Subject: [PATCH 08/17] Fix doc linter --- doc/{DISCLAIMER.md => PRE_INSTALL.md} | 2 +- doc/{DISCLAIMER_fr.md => PRE_INSTALL_fr.md} | 0 manifest.toml | 5 ++++- 3 files changed, 5 insertions(+), 2 deletions(-) rename doc/{DISCLAIMER.md => PRE_INSTALL.md} (93%) rename doc/{DISCLAIMER_fr.md => PRE_INSTALL_fr.md} (100%) diff --git a/doc/DISCLAIMER.md b/doc/PRE_INSTALL.md similarity index 93% rename from doc/DISCLAIMER.md rename to doc/PRE_INSTALL.md index b033633..671c74b 100644 --- a/doc/DISCLAIMER.md +++ b/doc/PRE_INSTALL.md @@ -4,4 +4,4 @@ 2. **Jitsi** requires the ports TCP/4443 and UDP/10000 to be forwarded to your YunoHost (The same way you forwarded 80 (HTTP), 443 (HTTPS), etc... https://yunohost.org/#/isp_box_config) 3. **Jitsi** will stop and disable Metronome XMPP. 4. LDAP authentication is activated, only authenticated users to create new conference rooms. Whenever a new room is about to be created, Jitsi Meet will prompt for a user name and password. After the room is created, others will be able to join from anonymous domain. -5. **Jitsi** is configured for 50 users maximum, this number can be increase going to the Yunohost config panel +5. **Jitsi** is configured for 50 users maximum, this number can be increased in the Yunohost config panel diff --git a/doc/DISCLAIMER_fr.md b/doc/PRE_INSTALL_fr.md similarity index 100% rename from doc/DISCLAIMER_fr.md rename to doc/PRE_INSTALL_fr.md diff --git a/manifest.toml b/manifest.toml index 947342c..dfd7ff8 100644 --- a/manifest.toml +++ b/manifest.toml @@ -24,7 +24,6 @@ architectures = "all" multi_instance = false ldap = true - sso = false disk = "50M" @@ -35,6 +34,10 @@ ram.runtime = "50M" [install.domain] type = "domain" + [install.init_main_permission] + type = "group" + default = "visitors" + [resources] [resources.sources] [resources.sources.jitsi-meet-web] From f5fd2889bcc7414fcb2351f74a8e10c71fcbcf83 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Thu, 18 Jan 2024 15:43:03 +0000 Subject: [PATCH 09/17] Auto-update README --- README.md | 10 ---------- README_fr.md | 10 ---------- 2 files changed, 20 deletions(-) diff --git a/README.md b/README.md index 5be805f..1c544c4 100644 --- a/README.md +++ b/README.md @@ -27,16 +27,6 @@ Jitsi Meet is a libre software (Apache) WebRTC JavaScript app that uses Jitsi Vi ![Screenshot of Jitsi Meet](./doc/screenshots/screenshot.png) -## Disclaimers / important information - -## Important points before installing - -1. **Jitsi** requires a dedicated **root domain**, eg. jitsi.domain.tld -2. **Jitsi** requires the ports TCP/4443 and UDP/10000 to be forwarded to your YunoHost (The same way you forwarded 80 (HTTP), 443 (HTTPS), etc... https://yunohost.org/#/isp_box_config) -3. **Jitsi** will stop and disable Metronome XMPP. -4. LDAP authentication is activated, only authenticated users to create new conference rooms. Whenever a new room is about to be created, Jitsi Meet will prompt for a user name and password. After the room is created, others will be able to join from anonymous domain. -5. **Jitsi** is configured for 50 users maximum, this number can be increase going to the Yunohost config panel - ## Documentation and resources * Official app website: diff --git a/README_fr.md b/README_fr.md index 92d24fd..5af2429 100644 --- a/README_fr.md +++ b/README_fr.md @@ -27,16 +27,6 @@ Jitsi Meet est un logiciel libre (Apache) dont Jitsi Videobridge, avec WebRTC Ja ![Capture d’écran de Jitsi Meet](./doc/screenshots/screenshot.png) -## Avertissements / informations importantes - -## Points importants à préparer avant l'installation - -1. **Jitsi** a besoin d'un **domaine racine** dédié, par exemple : jitsi.domain.tld -2. **Jitsi** demande que les ports TCP/4443 et UDP/10000 soient routés vers votre YunoHost (De la même manière que le sont les ports 80 (HTTP), 443 (HTTPS), etc... https://yunohost.org/#/isp_box_config) -3. **Jitsi** va arréter et désactiver le service XMPP Metronome. -4. L'authentification LDAP est activée, seuls les utilisateurs authentifiés peuvent créer de nouvelles salles de conférence. Chaque fois qu'une nouvelle salle est sur le point d'être créée, Jitsi Meet vous demandera un nom d'utilisateur et un mot de passe. Une fois la salle créée, d'autres personnes pourront la rejoindre à partir d'un domaine anonyme. -5. **Jitsi** est configuré pour 50 utilisateurs maximum, ce nombre peut être augmenté en allant dans le panneau de configuration Yunohost - ## Documentations et ressources * Site officiel de l’app : From 5920dac4dc1a0dfd462f4de154ce9571314005cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Thu, 18 Jan 2024 18:21:24 +0100 Subject: [PATCH 10/17] debug --- scripts/install | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/install b/scripts/install index bcf914a..cff43bd 100644 --- a/scripts/install +++ b/scripts/install @@ -83,12 +83,17 @@ ln -sf "/var/lib/prosody/auth.$domain.key" "/etc/prosody/certs/auth.$domain.key" ln -sf "/var/lib/prosody/auth.$domain.crt" "/etc/prosody/certs/auth.$domain.crt" ln -sf "/var/lib/prosody/auth.$domain.crt" "/usr/local/share/ca-certificates/auth.$domain.crt" +ynh_script_progression --message="Updating ca-certificates..." --weight=1 update-ca-certificates -f +ynh_script_progression --message="Restarting prosody..." --weight=1 ynh_systemd_action --service_name="prosody" --action="restart" +ynh_script_progression --message="prosodyctl register..." --weight=1 prosodyctl register "$focus_user" "auth.$domain" "$focus_password" +ynh_script_progression --message="prosodyctl register..." --weight=1 prosodyctl register "$videobridge_user" "auth.$domain" "$videobridge_secret" +ynh_script_progression --message="prosodyctl mod_roster_command..." --weight=1 prosodyctl mod_roster_command subscribe "$focus_user.$domain" "$focus_user@auth.$domain" #================================================= From 5839f041b0efded59b7367c340f1edc025c7c899 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Thu, 18 Jan 2024 18:33:46 +0100 Subject: [PATCH 11/17] =?UTF-8?q?debug=C2=A02?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/install | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index cff43bd..c9f62d3 100644 --- a/scripts/install +++ b/scripts/install @@ -73,12 +73,13 @@ ynh_add_config --template="prosody.cfg.lua" --destination="/etc/prosody/conf.ava chmod 644 "/etc/prosody/conf.avail/$domain.cfg.lua" ln -s "/etc/prosody/conf.avail/$domain.cfg.lua" "/etc/prosody/conf.d/$domain.cfg.lua" -ynh_exec_warn_less prosodyctl cert generate "$domain" + prosodyctl cert generate "$domain" ln -sf "/var/lib/prosody/$domain.key" "/etc/prosody/certs/$domain.key" ln -sf "/var/lib/prosody/$domain.crt" "/etc/prosody/certs/$domain.crt" ln -sf "/var/lib/prosody/$domain.crt" "/usr/local/share/ca-certificates/$domain.crt" +ynh_script_progression --message="Configuring prosody 2..." --weight=1 -ynh_exec_warn_less prosodyctl cert generate "auth.$domain" + prosodyctl cert generate "auth.$domain" ln -sf "/var/lib/prosody/auth.$domain.key" "/etc/prosody/certs/auth.$domain.key" ln -sf "/var/lib/prosody/auth.$domain.crt" "/etc/prosody/certs/auth.$domain.crt" ln -sf "/var/lib/prosody/auth.$domain.crt" "/usr/local/share/ca-certificates/auth.$domain.crt" From cd2aca057d38e63fccfc739d270d423c5c6401bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Thu, 18 Jan 2024 18:47:01 +0100 Subject: [PATCH 12/17] try to fix prosodyctl call --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index c9f62d3..ee6df63 100644 --- a/scripts/install +++ b/scripts/install @@ -73,13 +73,13 @@ ynh_add_config --template="prosody.cfg.lua" --destination="/etc/prosody/conf.ava chmod 644 "/etc/prosody/conf.avail/$domain.cfg.lua" ln -s "/etc/prosody/conf.avail/$domain.cfg.lua" "/etc/prosody/conf.d/$domain.cfg.lua" - prosodyctl cert generate "$domain" +echo | prosodyctl cert generate "$domain" ln -sf "/var/lib/prosody/$domain.key" "/etc/prosody/certs/$domain.key" ln -sf "/var/lib/prosody/$domain.crt" "/etc/prosody/certs/$domain.crt" ln -sf "/var/lib/prosody/$domain.crt" "/usr/local/share/ca-certificates/$domain.crt" ynh_script_progression --message="Configuring prosody 2..." --weight=1 - prosodyctl cert generate "auth.$domain" +echo | prosodyctl cert generate "auth.$domain" ln -sf "/var/lib/prosody/auth.$domain.key" "/etc/prosody/certs/auth.$domain.key" ln -sf "/var/lib/prosody/auth.$domain.crt" "/etc/prosody/certs/auth.$domain.crt" ln -sf "/var/lib/prosody/auth.$domain.crt" "/usr/local/share/ca-certificates/auth.$domain.crt" From aaa7a2870dd441af3dac1143c0d076a22fb88ff7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Thu, 18 Jan 2024 18:53:03 +0100 Subject: [PATCH 13/17] Remove debugging --- scripts/install | 6 ------ 1 file changed, 6 deletions(-) diff --git a/scripts/install b/scripts/install index ee6df63..e8bd685 100644 --- a/scripts/install +++ b/scripts/install @@ -77,24 +77,18 @@ echo | prosodyctl cert generate "$domain" ln -sf "/var/lib/prosody/$domain.key" "/etc/prosody/certs/$domain.key" ln -sf "/var/lib/prosody/$domain.crt" "/etc/prosody/certs/$domain.crt" ln -sf "/var/lib/prosody/$domain.crt" "/usr/local/share/ca-certificates/$domain.crt" -ynh_script_progression --message="Configuring prosody 2..." --weight=1 echo | prosodyctl cert generate "auth.$domain" ln -sf "/var/lib/prosody/auth.$domain.key" "/etc/prosody/certs/auth.$domain.key" ln -sf "/var/lib/prosody/auth.$domain.crt" "/etc/prosody/certs/auth.$domain.crt" ln -sf "/var/lib/prosody/auth.$domain.crt" "/usr/local/share/ca-certificates/auth.$domain.crt" -ynh_script_progression --message="Updating ca-certificates..." --weight=1 update-ca-certificates -f -ynh_script_progression --message="Restarting prosody..." --weight=1 ynh_systemd_action --service_name="prosody" --action="restart" -ynh_script_progression --message="prosodyctl register..." --weight=1 prosodyctl register "$focus_user" "auth.$domain" "$focus_password" -ynh_script_progression --message="prosodyctl register..." --weight=1 prosodyctl register "$videobridge_user" "auth.$domain" "$videobridge_secret" -ynh_script_progression --message="prosodyctl mod_roster_command..." --weight=1 prosodyctl mod_roster_command subscribe "$focus_user.$domain" "$focus_user@auth.$domain" #================================================= From c32df5ab7c1edb1b0629697078e2fdcd469f9e6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Thu, 18 Jan 2024 19:40:03 +0100 Subject: [PATCH 14/17] fix prosody cert --- scripts/restore | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/restore b/scripts/restore index 86e41fe..9998f39 100644 --- a/scripts/restore +++ b/scripts/restore @@ -40,11 +40,11 @@ ynh_restore_file --origin_path="/etc/prosody/conf.avail/$domain.cfg.lua" chmod 644 "/etc/prosody/conf.avail/$domain.cfg.lua" ln -s "/etc/prosody/conf.avail/$domain.cfg.lua" "/etc/prosody/conf.d/$domain.cfg.lua" -ynh_exec_warn_less prosodyctl cert generate "$domain" +echo | prosodyctl cert generate "$domain" ln -sf "/var/lib/prosody/$domain.key" "/etc/prosody/certs/$domain.key" ln -sf "/var/lib/prosody/$domain.crt" "/etc/prosody/certs/$domain.crt" -ynh_exec_warn_less prosodyctl cert generate "auth.$domain" +echo | prosodyctl cert generate "auth.$domain" ln -sf "/var/lib/prosody/auth.$domain.key" "/etc/prosody/certs/auth.$domain.key" ln -sf "/var/lib/prosody/auth.$domain.crt" "/etc/prosody/certs/auth.$domain.crt" ln -sf "/var/lib/prosody/auth.$domain.crt" "/usr/local/share/ca-certificates/auth.$domain.crt" From dd4a2ee7e5dcb4477b68a92772f4c884fb07eb11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Thu, 18 Jan 2024 19:40:44 +0100 Subject: [PATCH 15/17] ynh_exec_warn_less --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index e8bd685..0b5d6ac 100644 --- a/scripts/install +++ b/scripts/install @@ -73,12 +73,12 @@ ynh_add_config --template="prosody.cfg.lua" --destination="/etc/prosody/conf.ava chmod 644 "/etc/prosody/conf.avail/$domain.cfg.lua" ln -s "/etc/prosody/conf.avail/$domain.cfg.lua" "/etc/prosody/conf.d/$domain.cfg.lua" -echo | prosodyctl cert generate "$domain" +echo | ynh_exec_warn_less prosodyctl cert generate "$domain" ln -sf "/var/lib/prosody/$domain.key" "/etc/prosody/certs/$domain.key" ln -sf "/var/lib/prosody/$domain.crt" "/etc/prosody/certs/$domain.crt" ln -sf "/var/lib/prosody/$domain.crt" "/usr/local/share/ca-certificates/$domain.crt" -echo | prosodyctl cert generate "auth.$domain" +echo | ynh_exec_warn_less prosodyctl cert generate "auth.$domain" ln -sf "/var/lib/prosody/auth.$domain.key" "/etc/prosody/certs/auth.$domain.key" ln -sf "/var/lib/prosody/auth.$domain.crt" "/etc/prosody/certs/auth.$domain.crt" ln -sf "/var/lib/prosody/auth.$domain.crt" "/usr/local/share/ca-certificates/auth.$domain.crt" From 89c0b895eec5b18e1c6dbe5b61e684a46c746ba9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Thu, 18 Jan 2024 20:07:19 +0100 Subject: [PATCH 16/17] silent curl --- scripts/install | 2 +- scripts/restore | 4 ++-- scripts/upgrade | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index 0b5d6ac..96472cd 100644 --- a/scripts/install +++ b/scripts/install @@ -96,7 +96,7 @@ prosodyctl mod_roster_command subscribe "$focus_user.$domain" "$focus_user@auth. #================================================= ynh_script_progression --message="Configuring Jitsi-Videobridge..." --weight=1 -public_ipv4="$(curl ip.yunohost.org)" || true +public_ipv4="$(curl --no-progress-meter ip.yunohost.org)" || true private_ipv4="$(ip route get 1 | sed -n 's/^.*src \([0-9.]*\) .*$/\1/p')" || true mkdir -p "/etc/$app/videobridge" diff --git a/scripts/restore b/scripts/restore index 9998f39..1915a16 100644 --- a/scripts/restore +++ b/scripts/restore @@ -40,11 +40,11 @@ ynh_restore_file --origin_path="/etc/prosody/conf.avail/$domain.cfg.lua" chmod 644 "/etc/prosody/conf.avail/$domain.cfg.lua" ln -s "/etc/prosody/conf.avail/$domain.cfg.lua" "/etc/prosody/conf.d/$domain.cfg.lua" -echo | prosodyctl cert generate "$domain" +echo | ynh_exec_warn_less prosodyctl cert generate "$domain" ln -sf "/var/lib/prosody/$domain.key" "/etc/prosody/certs/$domain.key" ln -sf "/var/lib/prosody/$domain.crt" "/etc/prosody/certs/$domain.crt" -echo | prosodyctl cert generate "auth.$domain" +echo | ynh_exec_warn_less prosodyctl cert generate "auth.$domain" ln -sf "/var/lib/prosody/auth.$domain.key" "/etc/prosody/certs/auth.$domain.key" ln -sf "/var/lib/prosody/auth.$domain.crt" "/etc/prosody/certs/auth.$domain.crt" ln -sf "/var/lib/prosody/auth.$domain.crt" "/usr/local/share/ca-certificates/auth.$domain.crt" diff --git a/scripts/upgrade b/scripts/upgrade index f19a956..c25873a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -66,7 +66,7 @@ chmod 644 "/etc/prosody/conf.avail/$domain.cfg.lua" #================================================= ynh_script_progression --message="Configuring Jitsi-Videobridge..." --weight=1 -public_ipv4="$(curl ip.yunohost.org)" || true +public_ipv4="$(curl --no-progress-meter ip.yunohost.org)" || true private_ipv4="$(ip route get 1 | sed -n 's/^.*src \([0-9.]*\) .*$/\1/p')" || true ynh_add_config --template="../conf/jitsi-videobridge-callstats-java-sdk.properties" --destination="/etc/$app/videobridge/callstats-java-sdk.properties" From 7dac3fa399ab5deb3c9436512d07d9ca2ec440e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Thu, 18 Jan 2024 20:10:57 +0100 Subject: [PATCH 17/17] fix upgrade undef var --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index c25873a..791d617 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -25,7 +25,7 @@ ynh_systemd_action --service_name="$app-jicofo" --action="stop" --log_path="/var ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 # If max_memory doesn't exist, create it and set to default 75 mb value -if [ -z "$max_memory" ]; then +if [ -z "${max_memory:-}" ]; then max_memory=200 ynh_app_setting_set --app="$app" --key=max_memory --value="$max_memory" fi