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

add max memory for vm configuration (#70)

* add max video member parameter

to set max memory usage

* add max memory usage

* add VIDEOBRIDGE_MAX_MEMORY config

* Update manifest.json

* Update manifest.json

* add max_memory parameter

* add max memory unit

* add max memory unit

* add max member test value

* Update manifest.json

* Update manifest.json

* Update jitsi-jicofo-config

* Update jitsi-videobridge.config

* Update install

* Update install

* Update install

* Update upgrade

* Update restore

* Create config_panel.toml

* Update config_panel.toml

* Update config_panel.toml

* fix bug

* Create config

* Update config_panel.toml

* Update config

* fix cannot restart service ""

* Update config

* change max users to max memory

for better undertand

* change max user to max memory 

for better understand

* Update config_panel.toml

edit help text

* Update config

* max_memory not needed during restore

* remove max_memory question during install

* default max_memory reduced

* Cleanup

* adding max_memory informations

* Auto-update README

* typo

Co-authored-by: yalh76 <yalh@yahoo.com>
Co-authored-by: yunohost-bot <yunohost@yunohost.org>
This commit is contained in:
rosbeef andino 2022-04-06 02:28:14 -04:00 committed by GitHub
parent 5fbc1b4226
commit de61d69b31
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 123 additions and 0 deletions

View file

@ -34,6 +34,7 @@ Jitsi Meet is a libre software (Apache) WebRTC JavaScript app that uses Jitsi Vi
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

View file

@ -30,6 +30,7 @@ Jitsi Meet est un logiciel libre (Apache) dont Jitsi Videobridge, avec WebRTC Ja
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

View file

@ -17,5 +17,8 @@ JICOFO_AUTH_PASSWORD=__FOCUS_PASSWORD__
# extra options to pass to the jicofo daemon
JICOFO_OPTS=""
# set the max memory used during VM alocation
JICOFO_MAX_MEMORY=__MAX_MEMORY__m
# adds java system props that are passed to jicofo (default are for home and logging config file)
JAVA_SYS_PROPS="-Dconfig.file=/etc/__APP__/jicofo/jicofo.conf -Dnet.java.sip.communicator.SC_HOME_DIR_LOCATION=/etc/__APP__ -Dnet.java.sip.communicator.SC_HOME_DIR_NAME=jicofo -Dnet.java.sip.communicator.SC_LOG_DIR_LOCATION=/var/log/__APP__ -Djava.util.logging.config.file=/etc/__APP__/jicofo/logging.properties"

View file

@ -12,5 +12,8 @@ JVB_PORT=__PORT_COMPONENT__
# sets the shared secret used to authenticate to the XMPP server
JVB_SECRET=__VIDEOBRIDGE_SECRET__
# add max memory used during VM alocation
VIDEOBRIDGE_MAX_MEMORY=__MAX_MEMORY__m
# adds java system props that are passed to jvb (default are for home and logging config file)
JAVA_SYS_PROPS="-Dconfig.file=/etc/__APP__/videobridge/jvb.conf -Dnet.java.sip.communicator.SC_HOME_DIR_LOCATION=/etc/__APP__ -Dnet.java.sip.communicator.SC_HOME_DIR_NAME=videobridge -Dnet.java.sip.communicator.SC_LOG_DIR_LOCATION=/var/log/__APP__ -Djava.util.logging.config.file=/etc/__APP__/videobridge/logging.properties"

14
config_panel.toml Normal file
View file

@ -0,0 +1,14 @@
version = "1.0"
[main]
name = "Main configuration"
services = ["__APP__-jicofo","__APP__-videobridge"]
[main.config]
name = "Global configurations"
[main.config.max_memory]
bind = "null"
ask.en = "Max memory to use for VM"
type = "number"
help = "One user consume about 1,5 Mib memory, for example if plan to have max 50 simultaneous users this parameter should be set to 75 mb"

View file

@ -4,3 +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

View file

@ -4,3 +4,4 @@
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

88
scripts/config Normal file
View file

@ -0,0 +1,88 @@
#!/bin/bash
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
ynh_abort_if_errors
#=================================================
# RETRIEVE ARGUMENTS
#=================================================
#=================================================
# SPECIFIC GETTERS FOR TOML SHORT KEY
#=================================================
get__max_memory(){
local max_memory=$(ynh_app_setting_get --app=$app --key=max_memory)
# If max_memory doesn't exist, create it and set to default 75 mb value
if [ -z "$max_memory" ]; then
max_memory=75
ynh_app_setting_set --app=$app --key=max_memory --value=$max_memory
fi
cat << EOF
value: $max_memory
EOF
}
#=================================================
# SPECIFIC VALIDATORS FOR TOML SHORT KEYS
#=================================================
#=================================================
# SPECIFIC SETTERS FOR TOML SHORT KEYS
#=================================================
set__max_memory(){
#=================================================
# LOAD SETTINGS
#=================================================
ynh_script_progression --message="Loading installation settings..."
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)
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)
videobridge_user=$(ynh_app_setting_get --app=$app --key=videobridge_user)
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)
#=================================================
# SET SETTINGS
#=================================================
ynh_app_setting_set --app=$app --key=max_memory --value=$max_memory
#=================================================
# UPDATE CONFIG FILES
#=================================================
ynh_add_config --template="../conf/jitsi-videobridge.config" --destination="/etc/$app/videobridge/config"
ynh_add_config --template="../conf/jitsi-jicofo-config" --destination="/etc/$app/jicofo/config"
ynh_script_progression -l --message="Configuration of $app updated"
}
#=================================================
# GENERIC FINALIZATION
#=================================================
ynh_app_config_run $1

View file

@ -42,6 +42,8 @@ focus_user="focus"
videobridge_user="jvb"
max_memory=75
#=================================================
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
#=================================================
@ -60,6 +62,7 @@ ynh_script_progression --message="Storing installation settings..."
ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url
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

View file

@ -20,6 +20,8 @@ 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)
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)
@ -78,6 +80,12 @@ if [ -z "$final_path" ]; then
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
fi
# If max_memory doesn't exist, create it and set to default 75 mb value
if [ -z "$max_memory" ]; then
max_memory=75
ynh_app_setting_set --app=$app --key=max_memory --value=$max_memory
fi
#=================================================
# CREATE DEDICATED USER
#=================================================