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:
parent
5af56b9929
commit
2c04b6039d
6 changed files with 25 additions and 12 deletions
|
@ -43,7 +43,6 @@ How to configure this app: Via the admin panel, a plain file with SSH, or any ot
|
|||
|
||||
* x86-64b - [](https://ci-apps.yunohost.org/ci/apps/jitsi/)
|
||||
* ARMv8-A - [](https://ci-apps-arm.yunohost.org/ci/apps/jitsi/)
|
||||
* Jessie x86-64b - [](https://ci-stretch.nohost.me/ci/apps/jitsi/)
|
||||
|
||||
## Links
|
||||
|
||||
|
@ -57,9 +56,9 @@ How to configure this app: Via the admin panel, a plain file with SSH, or any ot
|
|||
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
|
||||
or
|
||||
|
|
|
@ -13,6 +13,7 @@ source /usr/share/yunohost/helpers
|
|||
#=================================================
|
||||
# MANAGE SCRIPT FAILURE
|
||||
#=================================================
|
||||
ynh_print_info --message="Managing script failure..."
|
||||
|
||||
ynh_clean_setup () {
|
||||
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_smacks.lua"
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC BACKUP
|
||||
#=================================================
|
||||
# BACKUP LOGROTATE
|
||||
#=================================================
|
||||
|
|
|
@ -12,6 +12,7 @@ source /usr/share/yunohost/helpers
|
|||
#=================================================
|
||||
# MANAGE SCRIPT FAILURE
|
||||
#=================================================
|
||||
ynh_print_info --message="Managing script failure..."
|
||||
|
||||
ynh_clean_setup () {
|
||||
ynh_clean_check_starting
|
||||
|
@ -22,6 +23,7 @@ ynh_abort_if_errors
|
|||
#=================================================
|
||||
# RETRIEVE ARGUMENTS FROM THE MANIFEST
|
||||
#=================================================
|
||||
ynh_print_info --message="Retrieving arguments from the manifest..."
|
||||
|
||||
domain=$YNH_APP_ARG_DOMAIN
|
||||
path_url="/"
|
||||
|
@ -67,19 +69,19 @@ ynh_app_setting_set --app=$app --key=focus_user --value=$focus_user
|
|||
#=================================================
|
||||
ynh_print_info --message="Configuring firewall..."
|
||||
|
||||
# Find a free port
|
||||
# Find an available port
|
||||
port=$(ynh_find_port --port=4443)
|
||||
# Open this port
|
||||
ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port
|
||||
ynh_app_setting_set --app=$app --key=port --value=$port
|
||||
|
||||
# Find a free port
|
||||
# Find an available port
|
||||
port_videobridge=$(ynh_find_port --port=10000)
|
||||
# Open this port
|
||||
ynh_exec_warn_less yunohost firewall allow --no-upnp UDP $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)
|
||||
# Open this port
|
||||
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
|
||||
#=================================================
|
||||
ynh_print_info --message="Storing the config file checksum..."
|
||||
|
||||
# Calculate and store the config file checksum into the app settings
|
||||
ynh_store_file_checksum --file="$config"
|
||||
|
@ -237,6 +240,7 @@ ynh_store_file_checksum --file="$config"
|
|||
#=================================================
|
||||
# SECURE FILES AND DIRECTORIES
|
||||
#=================================================
|
||||
ynh_print_info --message="Securing files and directories..."
|
||||
|
||||
# Set permissions to app files
|
||||
chown -R $app: $final_path
|
||||
|
@ -250,10 +254,10 @@ ynh_print_info --message="Configuring log rotation..."
|
|||
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-jicofo --description "$app jitsi-jicofo for jitsi" --log "/var/log/$app/$app-jicofo.log"
|
||||
|
||||
|
|
|
@ -26,10 +26,11 @@ focus_user=$(ynh_app_setting_get --app=$app --key=focus_user)
|
|||
#=================================================
|
||||
# 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
|
||||
then
|
||||
ynh_print_info --message="Removing $app-videobridge service..."
|
||||
|
@ -88,6 +89,7 @@ ynh_remove_logrotate
|
|||
#=================================================
|
||||
# CLOSE A PORT
|
||||
#=================================================
|
||||
ynh_print_info --message="Closing a port..."
|
||||
|
||||
if yunohost firewall list | grep -q "\- $port$"
|
||||
then
|
||||
|
@ -149,7 +151,7 @@ if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then
|
|||
fi
|
||||
|
||||
#=================================================
|
||||
# REMOVE THE CRON FILE
|
||||
# REMOVE THE LOG FILES
|
||||
#=================================================
|
||||
|
||||
# Remove the log files
|
||||
|
|
|
@ -13,6 +13,7 @@ source /usr/share/yunohost/helpers
|
|||
#=================================================
|
||||
# MANAGE SCRIPT FAILURE
|
||||
#=================================================
|
||||
ynh_print_info --message="Managing script failure..."
|
||||
|
||||
ynh_clean_setup () {
|
||||
ynh_clean_check_starting
|
||||
|
@ -53,6 +54,7 @@ test ! -d $final_path \
|
|||
#=================================================
|
||||
# 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"
|
||||
|
||||
|
@ -74,6 +76,7 @@ ynh_system_user_create --username=$app --home_dir=$final_path
|
|||
#=================================================
|
||||
# RESTORE USER RIGHTS
|
||||
#=================================================
|
||||
ynh_print_info --message="Restoring user rights..."
|
||||
|
||||
# Restore permissions on app files
|
||||
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
|
||||
|
||||
#=================================================
|
||||
# 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-jicofo --log "/var/log/$app/$app-jicofo.log"
|
||||
|
|
|
@ -221,6 +221,7 @@ ynh_add_systemd_config --service=$app-jicofo --template="jitsi-jicofo.service"
|
|||
#=================================================
|
||||
# SECURE FILES AND DIRECTORIES
|
||||
#=================================================
|
||||
ynh_print_info --message="Securing files and directories..."
|
||||
|
||||
# Set permissions on app files
|
||||
chown -R root: $final_path
|
||||
|
|
Loading…
Add table
Reference in a new issue