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

Merge pull request #1 from YunoHost-Apps/max_memory

Max memory simplification
This commit is contained in:
rosbeef andino 2022-04-05 22:12:05 -04:00 committed by GitHub
commit 2aa6752e9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 30 additions and 146 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

@ -1,7 +1,6 @@
;; Test complet
; Manifest
domain="domain.tld"
maxmembers=50
; Checks
pkg_linter=1
setup_sub_dir=0

View file

@ -1,133 +1,14 @@
## Config panel are available from webadmin > Apps > YOUR_APP > Config Panel Button
## Those panels let user configure some params on their apps using a friendly interface,
## and remove the need to manually edit files from the command line.
## From a packager perspective, this .toml is coupled to the scripts/config script,
## which may be used to define custom getters/setters. However, most use cases
## should be covered automagically by the core, thus it may not be necessary
## to define a scripts/config at all!
## -----------------------------------------------------------------------------
## IMPORTANT: In accordance with YunoHost's spirit, please keep things simple and
## do not overwhelm the admin with tons of misunderstandable or advanced settings.
## -----------------------------------------------------------------------------
## The top level describe the entire config panels screen.
## The version is a required property.
## Here a small reminder to associate config panel version with YunoHost version
## | Config | YNH | Config panel small change log |
## | ------ | --- | ------------------------------------------------------- |
## | 0.1 | 3.x | 0.1 config script not compatible with YNH >= 4.3 |
## | 1.0 | 4.3.x | The new config panel system with 'bind' property |
version = "1.0"
## (optional) i18n property let you internationalize questions, however this feature
## is only available in core configuration panel (like yunohost domain config).
## So in app config panel this key is ignored for now, but you can internationalize
## by using a lang dictionary (see property name bellow)
# i18n = "prefix_translation_key"
################################################################################
#### ABOUT PANELS
################################################################################
## The next level describes web admin panels
## You have to choose an ID for each panel, in this example the ID is "main"
## Keep in mind this ID will be used in CLI to refer to your question, so choose
## something short and meaningfull.
## In the webadmin, each panel corresponds to a distinct tab / form
[main]
## Define the label for your panel
## Internationalization works similarly to the 'description' and 'ask' questions in the manifest
name = "Main configuration"
#name.en = "Main configuration"
#name.fr = "Configuration principale"
#name.es = "Configuración principal"
## (optional) If you need to trigger a service reload-or-restart after the user
# change a question in this panel, you can add your service in the list.
services = ["__APP__-jicofo","__APP__-videobridge"]
# or services = ["nginx", "__APP__"] to also reload-or-restart nginx
## (optional) This help properties is a short help displayed on the same line
## than the panel title but not displayed in the tab.
# help = ""
############################################################################
#### ABOUT SECTIONS
############################################################################
## A panel is composed of one or several sections.
##
## Sections are meant to group questions together when they correspond to
## a same subtopic. This impacts the rendering in terms of CLI prompts
## and HTML forms
##
## You should choose an ID for your section, and prefix it with the panel ID
## (Be sure to not make a typo in the panel ID, which would implicitly create
## an other entire panel)
##
## We use the context of pepettes_ynh as an example,
## which is a simple donation form app written in python,
## and for which the admin will want to edit the configuration
[main.config]
## (optional) Defining a proper title for sections is not mandatory
## and depends on the exact rendering you're aiming for the CLI / webadmin
name = "Global configurations"
#name.en = "Domains configurations"
#name.fr = "Configuratin des domaines"
#name.es = "Configuración de dominios"
## (optional) This help properties is a short help displayed on the same line
## than the section title, meant to provide additional details
#help = "Domains are the name which appear in your browther navigation bar (eg: sub.domain.tld)"
#help.en = "Domains are the name which appear in your browther navigation bar (eg: sub.domain.tld)"
#help.fr = "Les domaines sont les noms qui apparaissent dans la barre de nvigation de votre navigateur (ex : sub.domain.tld)"
#help.es = "los dominios son los nombres que apparecent en la barra de navegación de su navegador (ex: sub.domain.tld)"
## (optional) As for panel, you can specify to trigger a service
## reload-or-restart after the user change a question in this section.
## This property is added to the panel property, it doesn't deactivate it.
## So no need to replicate, the service list from panel services property.
# services = []
## (optional) By default all questions are optionals, but you can specify a
## default behaviour for question in the section
#optional = true
## (optional) It's also possible with the 'visible' property to only
## display the section depending on the user's answers to previous questions.
##
## Be careful that the 'visible' property should only refer to **previous** questions
## Hence, it should not make sense to have a "visible" property on the very first section.
##
## Also, keep in mind that this feature only works in the webadmin and not in CLI
## (therefore a user could be prompted in CLI for a question that may not be relevant)
# visible = true
########################################################################
#### ABOUT QUESTIONS
########################################################################
[main.config.max_memory]
bind = "null"
ask.en = "Max memory to use for VM"
#ask.fr = "Utilisateurs simultanés maximum"
#ask.es = "Maximo de usuario simultaneo"
type = "number"
#example = "domain.tld or sub.domain.tld"
#example.en = "domain.tld or sub.domain.tld"
#example.fr = "domain.tld ou sub.domain.tld"
#example.es = "domain.tld o sub.domain.tld"
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"
#help.en = "Fill the domain name of the users identifiers if different to the server domain"
#help.fr = "Saisissez le nom de domaine des identifiants utilisateurs si différent au domaine du serveur"
#help.es = "Ingresa el nombre de dominio del nombre de usuario si diferente del dominio del servidor"
#pattern.regexp = '^(\w{3,30})(\.(\w{3,30}))*$'
#pattern.error = "The domain should be at least like domain.tld or better sub.domain.tld"
#pattern.error.en = "The domain should be at least like domain.tld or better sub.domain.tld"
#pattern.error.fr = "Le domaine doit etre au moind du type domain.tld ou mieux sub.domain.tld"
#pattern.error.es = "El dominio debe estar al menos del typo domain.tld o mejor sub.domain.tld"

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

View file

@ -37,15 +37,6 @@
{
"name": "domain",
"type": "domain"
},
{
"name": "max_memory",
"ask":{
"en":"Set max memory to use for each javaVM (Each simultaneous user consume around 1,5mb of memory)"
},
"type": "number",
"default": 1500,
"example": "for 50 simultaneous user will consume next to 75 Mb"
}
]
}

View file

@ -1,7 +1,7 @@
#!/bin/bash
#=================================================
# GENERIC START
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
@ -12,14 +12,20 @@ source /usr/share/yunohost/helpers
ynh_abort_if_errors
#=================================================
# SHOW_CONFIG FUNCTION FOR 'SHOW' COMMAND
# 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 3074 mb value
# If max_memory doesn't exist, create it and set to default 75 mb value
if [ -z "$max_memory" ]; then
max_memory=3072
max_memory=75
ynh_app_setting_set --app=$app --key=max_memory --value=$max_memory
fi
@ -28,6 +34,14 @@ value: $max_memory
EOF
}
#=================================================
# SPECIFIC VALIDATORS FOR TOML SHORT KEYS
#=================================================
#=================================================
# SPECIFIC SETTERS FOR TOML SHORT KEYS
#=================================================
set__max_memory(){
#=================================================
@ -54,19 +68,21 @@ set__max_memory(){
#=================================================
# 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="Upgrade of $app completed"
ynh_script_progression -l --message="Configuration of $app updated"
}
#=================================================
# GENERIC FINALIZATION
#=================================================
ynh_app_config_run $1
ynh_app_config_run $1

View file

@ -24,7 +24,6 @@ ynh_abort_if_errors
#=================================================
domain=$YNH_APP_ARG_DOMAIN
max_memory=$YNH_APP_ARG_MAX_MEMORY
path_url="/"
app=$YNH_APP_INSTANCE_NAME
@ -43,6 +42,8 @@ focus_user="focus"
videobridge_user="jvb"
max_memory=75
#=================================================
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
#=================================================

View file

@ -31,8 +31,6 @@ 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)
@ -52,12 +50,6 @@ ynh_script_progression --message="Validating restoration parameters..."
test ! -d $final_path \
|| ynh_die --message="There is already a directory: $final_path "
# If max_memory doesn't exist, create it and set to default 3074 mb value
if [ -z "$max_memory" ]; then
max_memory=3072
ynh_app_setting_set --app=$app --key=final_path --value=$max_memory
fi
#=================================================
# STANDARD RESTORATION STEPS
#=================================================

View file

@ -80,9 +80,9 @@ 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 3074 mb value
# If max_memory doesn't exist, create it and set to default 75 mb value
if [ -z "$max_memory" ]; then
max_memory=3072
max_memory=75
ynh_app_setting_set --app=$app --key=max_memory --value=$max_memory
fi