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

Apply example_ynh

This commit is contained in:
yalh76 2020-01-15 21:40:17 +01:00
parent 5af56b9929
commit 2c04b6039d
6 changed files with 25 additions and 12 deletions

View file

@ -43,7 +43,6 @@ How to configure this app: Via the admin panel, a plain file with SSH, or any ot
* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/jitsi%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/jitsi/) * x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/jitsi%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/jitsi/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/jitsi%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/jitsi/) * ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/jitsi%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/jitsi/)
* Jessie x86-64b - [![Build Status](https://ci-stretch.nohost.me/ci/logs/jitsi%20%28Apps%29.svg)](https://ci-stretch.nohost.me/ci/apps/jitsi/)
## Links ## Links
@ -57,9 +56,9 @@ How to configure this app: Via the admin panel, a plain file with SSH, or any ot
Developer info Developer info
---------------- ----------------
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/jitsi_ynh/tree/testing). Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/jitsi_ynh/tree/testing).
To try the testing branch, do this: To try the testing branch, please proceed like that.
``` ```
sudo yunohost app install https://github.com/YunoHost-Apps/jitsi_ynh/tree/testing --debug sudo yunohost app install https://github.com/YunoHost-Apps/jitsi_ynh/tree/testing --debug
or or

View file

@ -13,6 +13,7 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
# MANAGE SCRIPT FAILURE # MANAGE SCRIPT FAILURE
#================================================= #=================================================
ynh_print_info --message="Managing script failure..."
ynh_clean_setup () { ynh_clean_setup () {
ynh_clean_check_starting ynh_clean_check_starting
@ -76,6 +77,8 @@ ynh_backup --src_path="/usr/lib/metronome/modules/mod_carbons.lua"
ynh_backup --src_path="/usr/lib/metronome/modules/mod_http_altconnect.lua" ynh_backup --src_path="/usr/lib/metronome/modules/mod_http_altconnect.lua"
ynh_backup --src_path="/usr/lib/metronome/modules/mod_smacks.lua" ynh_backup --src_path="/usr/lib/metronome/modules/mod_smacks.lua"
#=================================================
# SPECIFIC BACKUP
#================================================= #=================================================
# BACKUP LOGROTATE # BACKUP LOGROTATE
#================================================= #=================================================

View file

@ -12,6 +12,7 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
# MANAGE SCRIPT FAILURE # MANAGE SCRIPT FAILURE
#================================================= #=================================================
ynh_print_info --message="Managing script failure..."
ynh_clean_setup () { ynh_clean_setup () {
ynh_clean_check_starting ynh_clean_check_starting
@ -22,6 +23,7 @@ ynh_abort_if_errors
#================================================= #=================================================
# RETRIEVE ARGUMENTS FROM THE MANIFEST # RETRIEVE ARGUMENTS FROM THE MANIFEST
#================================================= #=================================================
ynh_print_info --message="Retrieving arguments from the manifest..."
domain=$YNH_APP_ARG_DOMAIN domain=$YNH_APP_ARG_DOMAIN
path_url="/" path_url="/"
@ -67,19 +69,19 @@ ynh_app_setting_set --app=$app --key=focus_user --value=$focus_user
#================================================= #=================================================
ynh_print_info --message="Configuring firewall..." ynh_print_info --message="Configuring firewall..."
# Find a free port # Find an available port
port=$(ynh_find_port --port=4443) port=$(ynh_find_port --port=4443)
# Open this port # Open this port
ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port
ynh_app_setting_set --app=$app --key=port --value=$port ynh_app_setting_set --app=$app --key=port --value=$port
# Find a free port # Find an available port
port_videobridge=$(ynh_find_port --port=10000) port_videobridge=$(ynh_find_port --port=10000)
# Open this port # Open this port
ynh_exec_warn_less yunohost firewall allow --no-upnp UDP $port_videobridge ynh_exec_warn_less yunohost firewall allow --no-upnp UDP $port_videobridge
ynh_app_setting_set --app=$app --key=port_videobridge --value=$port_videobridge ynh_app_setting_set --app=$app --key=port_videobridge --value=$port_videobridge
# Find a free port # Find an available port
port_component=$(ynh_find_port --port=5347) port_component=$(ynh_find_port --port=5347)
# Open this port # Open this port
ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port_component ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port_component
@ -228,6 +230,7 @@ ynh_add_systemd_config --service=$app-jicofo --template="jitsi-jicofo.service"
#================================================= #=================================================
# STORE THE CONFIG FILE CHECKSUM # STORE THE CONFIG FILE CHECKSUM
#================================================= #=================================================
ynh_print_info --message="Storing the config file checksum..."
# Calculate and store the config file checksum into the app settings # Calculate and store the config file checksum into the app settings
ynh_store_file_checksum --file="$config" ynh_store_file_checksum --file="$config"
@ -237,6 +240,7 @@ ynh_store_file_checksum --file="$config"
#================================================= #=================================================
# SECURE FILES AND DIRECTORIES # SECURE FILES AND DIRECTORIES
#================================================= #=================================================
ynh_print_info --message="Securing files and directories..."
# Set permissions to app files # Set permissions to app files
chown -R $app: $final_path chown -R $app: $final_path
@ -250,10 +254,10 @@ ynh_print_info --message="Configuring log rotation..."
ynh_use_logrotate ynh_use_logrotate
#================================================= #=================================================
# ADVERTISE SERVICE IN ADMIN PANEL # INTEGRATE SERVICE IN YUNOHOST
#================================================= #=================================================
ynh_print_info --message="Integrating service in YunoHost..."
# if using yunohost version 3.2 or more in the 'manifest.json', a description can be added
yunohost service add $app-videobridge --description "$app jitsi-videobridge for jitsi" --log "/var/log/$app/$app-videobridge.log" yunohost service add $app-videobridge --description "$app jitsi-videobridge for jitsi" --log "/var/log/$app/$app-videobridge.log"
yunohost service add $app-jicofo --description "$app jitsi-jicofo for jitsi" --log "/var/log/$app/$app-jicofo.log" yunohost service add $app-jicofo --description "$app jitsi-jicofo for jitsi" --log "/var/log/$app/$app-jicofo.log"

View file

@ -26,10 +26,11 @@ focus_user=$(ynh_app_setting_get --app=$app --key=focus_user)
#================================================= #=================================================
# STANDARD REMOVE # STANDARD REMOVE
#================================================= #=================================================
# REMOVE SERVICE FROM ADMIN PANEL # REMOVE SERVICE INTEGRATION IN YUNOHOST
#================================================= #=================================================
ynh_print_info --message="Removing service integration in YunoHost..."
# Remove a service from the admin panel, added by `yunohost service add` # 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 if ynh_exec_warn_less yunohost service status $app-videobridge >/dev/null
then then
ynh_print_info --message="Removing $app-videobridge service..." ynh_print_info --message="Removing $app-videobridge service..."
@ -88,6 +89,7 @@ ynh_remove_logrotate
#================================================= #=================================================
# CLOSE A PORT # CLOSE A PORT
#================================================= #=================================================
ynh_print_info --message="Closing a port..."
if yunohost firewall list | grep -q "\- $port$" if yunohost firewall list | grep -q "\- $port$"
then then
@ -149,7 +151,7 @@ if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then
fi fi
#================================================= #=================================================
# REMOVE THE CRON FILE # REMOVE THE LOG FILES
#================================================= #=================================================
# Remove the log files # Remove the log files

View file

@ -13,6 +13,7 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
# MANAGE SCRIPT FAILURE # MANAGE SCRIPT FAILURE
#================================================= #=================================================
ynh_print_info --message="Managing script failure..."
ynh_clean_setup () { ynh_clean_setup () {
ynh_clean_check_starting ynh_clean_check_starting
@ -53,6 +54,7 @@ test ! -d $final_path \
#================================================= #=================================================
# RESTORE THE NGINX CONFIGURATION # RESTORE THE NGINX CONFIGURATION
#================================================= #=================================================
ynh_print_info --message="Restoring the nginx configuration..."
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
@ -74,6 +76,7 @@ ynh_system_user_create --username=$app --home_dir=$final_path
#================================================= #=================================================
# RESTORE USER RIGHTS # RESTORE USER RIGHTS
#================================================= #=================================================
ynh_print_info --message="Restoring user rights..."
# Restore permissions on app files # Restore permissions on app files
chown -R root: $final_path chown -R root: $final_path
@ -146,8 +149,9 @@ ynh_restore_file --origin_path="/etc/systemd/system/$app-jicofo.service"
systemctl enable $app-jicofo.service systemctl enable $app-jicofo.service
#================================================= #=================================================
# ADVERTISE SERVICE IN ADMIN PANEL # INTEGRATE SERVICE IN YUNOHOST
#================================================= #=================================================
ynh_print_info --message="Integrating service in YunoHost..."
yunohost service add $app-videobridge --log "/var/log/$app/$app-videobridge.log" yunohost service add $app-videobridge --log "/var/log/$app/$app-videobridge.log"
yunohost service add $app-jicofo --log "/var/log/$app/$app-jicofo.log" yunohost service add $app-jicofo --log "/var/log/$app/$app-jicofo.log"

View file

@ -221,6 +221,7 @@ ynh_add_systemd_config --service=$app-jicofo --template="jitsi-jicofo.service"
#================================================= #=================================================
# SECURE FILES AND DIRECTORIES # SECURE FILES AND DIRECTORIES
#================================================= #=================================================
ynh_print_info --message="Securing files and directories..."
# Set permissions on app files # Set permissions on app files
chown -R root: $final_path chown -R root: $final_path