mirror of
https://github.com/YunoHost-Apps/biboumi_ynh.git
synced 2024-09-03 18:15:58 +02:00
commit
5a33253bcc
16 changed files with 148 additions and 215 deletions
|
@ -16,14 +16,15 @@ It shall NOT be edited by hand.
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
XMPP gateway for the IRC network
|
XMPP gateway for the IRC network. Needs Metronome.
|
||||||
|
|
||||||
|
|
||||||
**Shipped version:** 8.3~ynh3
|
**Shipped version:** 8.3~ynh3
|
||||||
## Documentation and resources
|
## Documentation and resources
|
||||||
|
|
||||||
- Official app website: <https://biboumi.louiz.org/>
|
- Official app website: <https://biboumi.louiz.org>
|
||||||
- Official admin documentation: <https://lab.louiz.org/louiz/biboumi/blob/8.3/doc/biboumi.1.rst>
|
- Official admin documentation: <https://doc.biboumi.louiz.org>
|
||||||
- Upstream app code repository: <https://lab.louiz.org/louiz/biboumi>
|
- Upstream app code repository: <https://github.com/louiz/biboumi>
|
||||||
- YunoHost Store: <https://apps.yunohost.org/app/biboumi>
|
- YunoHost Store: <https://apps.yunohost.org/app/biboumi>
|
||||||
- Report a bug: <https://github.com/YunoHost-Apps/biboumi_ynh/issues>
|
- Report a bug: <https://github.com/YunoHost-Apps/biboumi_ynh/issues>
|
||||||
|
|
||||||
|
|
|
@ -16,14 +16,15 @@ No se debe editar a mano.
|
||||||
|
|
||||||
## Descripción general
|
## Descripción general
|
||||||
|
|
||||||
XMPP gateway for the IRC network
|
XMPP gateway for the IRC network. Needs Metronome.
|
||||||
|
|
||||||
|
|
||||||
**Versión actual:** 8.3~ynh3
|
**Versión actual:** 8.3~ynh3
|
||||||
## Documentaciones y recursos
|
## Documentaciones y recursos
|
||||||
|
|
||||||
- Sitio web oficial: <https://biboumi.louiz.org/>
|
- Sitio web oficial: <https://biboumi.louiz.org>
|
||||||
- Documentación administrador oficial: <https://lab.louiz.org/louiz/biboumi/blob/8.3/doc/biboumi.1.rst>
|
- Documentación administrador oficial: <https://doc.biboumi.louiz.org>
|
||||||
- Repositorio del código fuente oficial de la aplicación : <https://lab.louiz.org/louiz/biboumi>
|
- Repositorio del código fuente oficial de la aplicación : <https://github.com/louiz/biboumi>
|
||||||
- Catálogo YunoHost: <https://apps.yunohost.org/app/biboumi>
|
- Catálogo YunoHost: <https://apps.yunohost.org/app/biboumi>
|
||||||
- Reportar un error: <https://github.com/YunoHost-Apps/biboumi_ynh/issues>
|
- Reportar un error: <https://github.com/YunoHost-Apps/biboumi_ynh/issues>
|
||||||
|
|
||||||
|
|
|
@ -16,14 +16,15 @@ EZ editatu eskuz.
|
||||||
|
|
||||||
## Aurreikuspena
|
## Aurreikuspena
|
||||||
|
|
||||||
XMPP gateway for the IRC network
|
XMPP gateway for the IRC network. Needs Metronome.
|
||||||
|
|
||||||
|
|
||||||
**Paketatutako bertsioa:** 8.3~ynh3
|
**Paketatutako bertsioa:** 8.3~ynh3
|
||||||
## Dokumentazioa eta baliabideak
|
## Dokumentazioa eta baliabideak
|
||||||
|
|
||||||
- Aplikazioaren webgune ofiziala: <https://biboumi.louiz.org/>
|
- Aplikazioaren webgune ofiziala: <https://biboumi.louiz.org>
|
||||||
- Administratzaileen dokumentazio ofiziala: <https://lab.louiz.org/louiz/biboumi/blob/8.3/doc/biboumi.1.rst>
|
- Administratzaileen dokumentazio ofiziala: <https://doc.biboumi.louiz.org>
|
||||||
- Jatorrizko aplikazioaren kode-gordailua: <https://lab.louiz.org/louiz/biboumi>
|
- Jatorrizko aplikazioaren kode-gordailua: <https://github.com/louiz/biboumi>
|
||||||
- YunoHost Denda: <https://apps.yunohost.org/app/biboumi>
|
- YunoHost Denda: <https://apps.yunohost.org/app/biboumi>
|
||||||
- Eman errore baten berri: <https://github.com/YunoHost-Apps/biboumi_ynh/issues>
|
- Eman errore baten berri: <https://github.com/YunoHost-Apps/biboumi_ynh/issues>
|
||||||
|
|
||||||
|
|
|
@ -16,14 +16,15 @@ Il NE doit PAS être modifié à la main.
|
||||||
|
|
||||||
## Vue d’ensemble
|
## Vue d’ensemble
|
||||||
|
|
||||||
XMPP gateway for the IRC network
|
XMPP gateway for the IRC network. Needs Metronome.
|
||||||
|
|
||||||
|
|
||||||
**Version incluse :** 8.3~ynh3
|
**Version incluse :** 8.3~ynh3
|
||||||
## Documentations et ressources
|
## Documentations et ressources
|
||||||
|
|
||||||
- Site officiel de l’app : <https://biboumi.louiz.org/>
|
- Site officiel de l’app : <https://biboumi.louiz.org>
|
||||||
- Documentation officielle de l’admin : <https://lab.louiz.org/louiz/biboumi/blob/8.3/doc/biboumi.1.rst>
|
- Documentation officielle de l’admin : <https://doc.biboumi.louiz.org>
|
||||||
- Dépôt de code officiel de l’app : <https://lab.louiz.org/louiz/biboumi>
|
- Dépôt de code officiel de l’app : <https://github.com/louiz/biboumi>
|
||||||
- YunoHost Store : <https://apps.yunohost.org/app/biboumi>
|
- YunoHost Store : <https://apps.yunohost.org/app/biboumi>
|
||||||
- Signaler un bug : <https://github.com/YunoHost-Apps/biboumi_ynh/issues>
|
- Signaler un bug : <https://github.com/YunoHost-Apps/biboumi_ynh/issues>
|
||||||
|
|
||||||
|
|
|
@ -16,14 +16,15 @@ NON debe editarse manualmente.
|
||||||
|
|
||||||
## Vista xeral
|
## Vista xeral
|
||||||
|
|
||||||
XMPP gateway for the IRC network
|
XMPP gateway for the IRC network. Needs Metronome.
|
||||||
|
|
||||||
|
|
||||||
**Versión proporcionada:** 8.3~ynh3
|
**Versión proporcionada:** 8.3~ynh3
|
||||||
## Documentación e recursos
|
## Documentación e recursos
|
||||||
|
|
||||||
- Web oficial da app: <https://biboumi.louiz.org/>
|
- Web oficial da app: <https://biboumi.louiz.org>
|
||||||
- Documentación oficial para admin: <https://lab.louiz.org/louiz/biboumi/blob/8.3/doc/biboumi.1.rst>
|
- Documentación oficial para admin: <https://doc.biboumi.louiz.org>
|
||||||
- Repositorio de orixe do código: <https://lab.louiz.org/louiz/biboumi>
|
- Repositorio de orixe do código: <https://github.com/louiz/biboumi>
|
||||||
- Tenda YunoHost: <https://apps.yunohost.org/app/biboumi>
|
- Tenda YunoHost: <https://apps.yunohost.org/app/biboumi>
|
||||||
- Informar dun problema: <https://github.com/YunoHost-Apps/biboumi_ynh/issues>
|
- Informar dun problema: <https://github.com/YunoHost-Apps/biboumi_ynh/issues>
|
||||||
|
|
||||||
|
|
|
@ -16,14 +16,15 @@
|
||||||
|
|
||||||
## 概况
|
## 概况
|
||||||
|
|
||||||
XMPP gateway for the IRC network
|
XMPP gateway for the IRC network. Needs Metronome.
|
||||||
|
|
||||||
|
|
||||||
**分发版本:** 8.3~ynh3
|
**分发版本:** 8.3~ynh3
|
||||||
## 文档与资源
|
## 文档与资源
|
||||||
|
|
||||||
- 官方应用网站: <https://biboumi.louiz.org/>
|
- 官方应用网站: <https://biboumi.louiz.org>
|
||||||
- 官方管理文档: <https://lab.louiz.org/louiz/biboumi/blob/8.3/doc/biboumi.1.rst>
|
- 官方管理文档: <https://doc.biboumi.louiz.org>
|
||||||
- 上游应用代码库: <https://lab.louiz.org/louiz/biboumi>
|
- 上游应用代码库: <https://github.com/louiz/biboumi>
|
||||||
- YunoHost 商店: <https://apps.yunohost.org/app/biboumi>
|
- YunoHost 商店: <https://apps.yunohost.org/app/biboumi>
|
||||||
- 报告 bug: <https://github.com/YunoHost-Apps/biboumi_ynh/issues>
|
- 报告 bug: <https://github.com/YunoHost-Apps/biboumi_ynh/issues>
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
XMPP gateway for the IRC network
|
XMPP gateway for the IRC network. Needs Metronome.
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/manifest.v2.schema.json
|
||||||
|
|
||||||
packaging_format = 2
|
packaging_format = 2
|
||||||
|
|
||||||
id = "biboumi"
|
id = "biboumi"
|
||||||
|
@ -11,9 +13,9 @@ maintainers = ["pitchum"]
|
||||||
|
|
||||||
[upstream]
|
[upstream]
|
||||||
license = "Zlib"
|
license = "Zlib"
|
||||||
website = "https://biboumi.louiz.org/"
|
website = "https://biboumi.louiz.org"
|
||||||
admindoc = "https://lab.louiz.org/louiz/biboumi/blob/8.3/doc/biboumi.1.rst"
|
admindoc = "https://doc.biboumi.louiz.org"
|
||||||
code = "https://lab.louiz.org/louiz/biboumi"
|
code = "https://github.com/louiz/biboumi"
|
||||||
|
|
||||||
[integration]
|
[integration]
|
||||||
yunohost = ">= 11.2"
|
yunohost = ">= 11.2"
|
||||||
|
@ -45,7 +47,16 @@ ram.runtime = "50M"
|
||||||
|
|
||||||
[resources.install_dir]
|
[resources.install_dir]
|
||||||
|
|
||||||
|
[resources.data_dir]
|
||||||
|
dir = "/var/lib/__APP__"
|
||||||
|
|
||||||
[resources.permissions]
|
[resources.permissions]
|
||||||
|
|
||||||
[resources.apt]
|
[resources.apt]
|
||||||
packages = "metronome, biboumi"
|
packages = [ "biboumi", ]
|
||||||
|
|
||||||
|
packages_from_raw_bash = """
|
||||||
|
if [[ $YNH_DEBIAN_VERSION == "bullseye" ]]; then
|
||||||
|
echo "metronome";
|
||||||
|
fi
|
||||||
|
"""
|
||||||
|
|
|
@ -8,6 +8,22 @@
|
||||||
# PERSONAL HELPERS
|
# PERSONAL HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
|
_get_metronome_config_dir() {
|
||||||
|
if [[ $YNH_DEBIAN_VERSION == "bullseye" ]]; then
|
||||||
|
echo "/etc/metronome/conf.d"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# multi_instance=false, there's only one
|
||||||
|
metronome_app=$(yunohost app list --json | jq -r '.apps[] | select(.id == "metronome") | .id')
|
||||||
|
if [[ -z "${metronome_app:-}" ]]; then
|
||||||
|
ynh_print_warn --message="Could not find any metronome app!"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$(ynh_app_setting_get --app="$metronome_app" --key="install_dir")/conf/conf.d"
|
||||||
|
}
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# EXPERIMENTAL HELPERS
|
# EXPERIMENTAL HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# GENERIC START
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# IMPORT GENERIC HELPERS
|
# IMPORT GENERIC HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -29,7 +27,9 @@ ynh_backup --src_path="/etc/$app"
|
||||||
|
|
||||||
ynh_backup --src_path="/var/lib/$app"
|
ynh_backup --src_path="/var/lib/$app"
|
||||||
|
|
||||||
ynh_backup --src_path="/etc/metronome/conf.d/$app.cfg.lua"
|
ynh_backup --src_path="$(_get_metronome_config_dir)/$app.cfg.lua"
|
||||||
|
|
||||||
|
ynh_backup --src_path="/var/log/$app/"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
|
|
100
scripts/install
100
scripts/install
|
@ -1,7 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# GENERIC START
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# IMPORT GENERIC HELPERS
|
# IMPORT GENERIC HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -9,115 +7,71 @@
|
||||||
source _common.sh
|
source _common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# RETRIEVE ARGUMENTS FROM THE MANIFEST
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
shared_secret="$(ynh_string_random 25)"
|
|
||||||
admin_jid="${admin}@$app.${domain}"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
|
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
|
||||||
#=================================================
|
#=================================================
|
||||||
#REMOVEME? ynh_script_progression --message="Validating installation parameters..."
|
|
||||||
|
|
||||||
if dpkg --compare-versions "$(uname -r)" "<=" "4.0"
|
if dpkg --compare-versions "$(uname -r)" "<=" "4.0"; then
|
||||||
then
|
|
||||||
ynh_die "Upgrade your kernel first. Unsupported version: $(uname -r)"
|
ynh_die "Upgrade your kernel first. Unsupported version: $(uname -r)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STORE SETTINGS FROM MANIFEST
|
# INITIALIZE AND STORE SETTINGS
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Storing installation settings..."
|
|
||||||
|
|
||||||
ynh_app_setting_set --app=$app --key=shared_secret --value=$shared_secret
|
|
||||||
ynh_app_setting_set --app=$app --key=admin_jid --value=$admin_jid
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# INSTALL DEPENDENCIES
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
|
shared_secret="$(ynh_string_random 25)"
|
||||||
|
ynh_app_setting_set --app="$app" --key="shared_secret" --value="$shared_secret"
|
||||||
|
|
||||||
#=================================================
|
admin_jid="${admin}@${app}.${domain}"
|
||||||
# SPECIFIC SETUP
|
ynh_app_setting_set --app="$app" --key="admin_jid" --value="$admin_jid"
|
||||||
#=================================================
|
|
||||||
# CONFIGURE METRONOME
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Configuring Metronome..."
|
|
||||||
|
|
||||||
# Add metronome component
|
|
||||||
ynh_add_config --template="../conf/biboumi.cfg.lua" --destination="/etc/metronome/conf.d/$app.cfg.lua"
|
|
||||||
|
|
||||||
chown metronome:metronome "/etc/metronome/conf.d/$app.cfg.lua"
|
|
||||||
|
|
||||||
ynh_systemd_action --service_name=metronome --action="restart"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE DATA DIRECTORY
|
# CREATE DATA DIRECTORY
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Creating a data directory..."
|
ynh_script_progression --message="Setting up the data directory..."
|
||||||
|
|
||||||
mkdir -p /var/lib/$app
|
|
||||||
|
|
||||||
# Set permissions to app files
|
# Set permissions to app files
|
||||||
chown -R _biboumi:_biboumi "/var/lib/$app"
|
chown -R _biboumi:_biboumi "/var/lib/$app"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# ADD A CONFIGURATION
|
# APP INITIAL CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Adding a configuration file..."
|
ynh_script_progression --message="Adding $app's configuration files..." --weight=1
|
||||||
|
|
||||||
|
# Stop the service started by apt install
|
||||||
|
ynh_systemd_action --service_name="$app" --action="stop" --log_path="systemd"
|
||||||
|
|
||||||
|
# Add metronome component
|
||||||
|
metronome_config_dir=$(_get_metronome_config_dir)
|
||||||
|
ynh_add_config --template="metronome.cfg.lua" --destination="$metronome_config_dir/$app.cfg.lua"
|
||||||
|
chown metronome:metronome "$metronome_config_dir/$app.cfg.lua"
|
||||||
|
ynh_systemd_action --service_name="metronome" --action="restart"
|
||||||
|
|
||||||
|
# Add biboumi configuration
|
||||||
mkdir -p "/etc/$app/"
|
mkdir -p "/etc/$app/"
|
||||||
|
ynh_add_config --template="biboumi.cfg" --destination="/etc/$app/$app.cfg"
|
||||||
ynh_add_config --template="../conf/biboumi.cfg" --destination="/etc/$app/$app.cfg"
|
|
||||||
|
|
||||||
chown -R _biboumi:_biboumi "/etc/$app/$app.cfg"
|
chown -R _biboumi:_biboumi "/etc/$app/$app.cfg"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SYSTEMD
|
# SYSTEM CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Configuring a systemd service..."
|
ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
|
||||||
|
|
||||||
# Create a dedicated systemd config
|
# Create a dedicated systemd config
|
||||||
systemctl enable $app.service --quiet
|
systemctl enable "$app.service" --quiet
|
||||||
|
yunohost service add "$app" --description="XMPP gateway for the IRC network" --log="/var/log/$app/$app.log"
|
||||||
#=================================================
|
|
||||||
# GENERIC FINALIZATION
|
|
||||||
#=================================================
|
|
||||||
# SETUP LOGROTATE
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Configuring log rotation..."
|
|
||||||
|
|
||||||
mkdir -p /var/log/$app
|
|
||||||
chown -R _biboumi:_biboumi "/var/log/$app"
|
|
||||||
|
|
||||||
# Use logrotate to manage application logfile(s)
|
# Use logrotate to manage application logfile(s)
|
||||||
ynh_use_logrotate
|
ynh_use_logrotate
|
||||||
|
chown -R _biboumi:_biboumi "/var/log/$app"
|
||||||
#=================================================
|
|
||||||
# INTEGRATE SERVICE IN YUNOHOST
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Integrating service in YunoHost..."
|
|
||||||
|
|
||||||
yunohost service add $app --description="XMPP gateway for the IRC network" --log="/var/log/$app/$app.log"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SYSTEMD SERVICE
|
# START SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Starting a systemd service..."
|
ynh_script_progression --message="Starting $app's systemd service..." --weight=1
|
||||||
|
|
||||||
# Start a systemd service
|
# Start a systemd service
|
||||||
ynh_systemd_action --service_name=$app --action="start" --line_match="Started Biboumi" --log_path="systemd"
|
ynh_systemd_action --service_name="$app" --action="start" --line_match="Authenticated with the XMPP server" --log_path="/var/log/$app/$app.log"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SETUP SSOWAT
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Configuring permissions..."
|
|
||||||
|
|
||||||
# Prevent conflict with other apps on the same domain
|
|
||||||
ynh_app_setting_set --app=$app --key=no_sso --value=1
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# GENERIC START
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# IMPORT GENERIC HELPERS
|
# IMPORT GENERIC HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -10,37 +8,22 @@ source _common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD REMOVE
|
# REMOVE SYSTEM CONFIGURATIONS
|
||||||
#=================================================
|
|
||||||
# REMOVE SERVICE INTEGRATION IN YUNOHOST
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
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`)
|
# 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 >/dev/null
|
if ynh_exec_warn_less yunohost service status "$app" >/dev/null; then
|
||||||
then
|
yunohost service remove "$app"
|
||||||
ynh_script_progression --message="Removing $app service integration..."
|
|
||||||
yunohost service remove $app
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# STOP AND REMOVE SERVICE
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Stopping and removing the systemd service..."
|
|
||||||
|
|
||||||
# Remove the dedicated systemd config
|
# Remove the dedicated systemd config
|
||||||
ynh_systemd_action --service_name=$app --action="stop" --line_match="Stopped Biboumi" --log_path="systemd"
|
ynh_systemd_action --service_name="$app" --action="stop" --log_path="systemd"
|
||||||
systemctl disable $app.service --quiet
|
systemctl disable "$app.service" --quiet
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# REMOVE LOGROTATE CONFIGURATION
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Removing logrotate configuration..."
|
|
||||||
|
|
||||||
# Remove the app-specific logrotate config
|
# Remove the app-specific logrotate config
|
||||||
ynh_remove_logrotate
|
ynh_remove_logrotate
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SPECIFIC REMOVE
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE VARIOUS FILES
|
# REMOVE VARIOUS FILES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -52,10 +35,8 @@ ynh_secure_remove --file="/var/lib/$app"
|
||||||
# Remove a directory securely
|
# Remove a directory securely
|
||||||
ynh_secure_remove --file="/etc/$app"
|
ynh_secure_remove --file="/etc/$app"
|
||||||
|
|
||||||
# Remove the log files
|
|
||||||
|
|
||||||
# Remove Metronome component
|
# Remove Metronome component
|
||||||
ynh_secure_remove --file="/etc/metronome/conf.d/$app.cfg.lua"
|
ynh_secure_remove --file="$(_get_metronome_config_dir)/$app.cfg.lua"
|
||||||
ynh_systemd_action --action=restart --service_name=metronome
|
ynh_systemd_action --action=restart --service_name=metronome
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# GENERIC START
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# IMPORT GENERIC HELPERS
|
# IMPORT GENERIC HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -15,56 +13,50 @@ source /usr/share/yunohost/helpers
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Validating restoration parameters..."
|
ynh_script_progression --message="Validating restoration parameters..."
|
||||||
|
|
||||||
if dpkg --compare-versions "$(uname -r)" "<=" "4.0"
|
if dpkg --compare-versions "$(uname -r)" "<=" "4.0"; then
|
||||||
then
|
|
||||||
ynh_die "Upgrade your kernel first. Unsupported version: $(uname -r)"
|
ynh_die "Upgrade your kernel first. Unsupported version: $(uname -r)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# RESTORE THE DATA DIRECTORY
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Restoring the data directory..." --weight=1
|
||||||
|
|
||||||
|
ynh_restore_file --origin_path="/var/lib/$app"
|
||||||
|
chown -R _biboumi:_biboumi "/var/lib/$app"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE VARIOUS FILES
|
# RESTORE VARIOUS FILES
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Restoring various files..."
|
ynh_script_progression --message="Restoring various files..."
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/etc/$app"
|
ynh_restore_file --origin_path="/etc/$app"
|
||||||
chown -R _biboumi:_biboumi /etc/$app
|
chown -R _biboumi:_biboumi "/etc/$app"
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/var/lib/$app"
|
metronome_config_dir=$(_get_metronome_config_dir)
|
||||||
chown -R _biboumi:_biboumi /var/lib/$app
|
ynh_restore_file --origin_path="$metronome_config_dir/$app.cfg.lua"
|
||||||
|
chown metronome:metronome "$metronome_config_dir/$app.cfg.lua"
|
||||||
ynh_restore_file --origin_path="/etc/metronome/conf.d/$app.cfg.lua"
|
|
||||||
chown metronome:metronome "/etc/metronome/conf.d/$app.cfg.lua"
|
|
||||||
ynh_systemd_action --service_name=metronome --action="restart"
|
ynh_systemd_action --service_name=metronome --action="restart"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE SYSTEMD
|
# RESTORE SYSTEM CONFIGURATIONS
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Restoring the systemd configuration..."
|
ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1
|
||||||
|
|
||||||
systemctl enable $app.service --quiet
|
systemctl enable "$app.service" --quiet
|
||||||
|
yunohost service add "$app" --description="XMPP gateway for the IRC network" --log="/var/log/$app/$app.log"
|
||||||
#=================================================
|
|
||||||
# RESTORE THE LOGROTATE CONFIGURATION
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Restoring the logrotate configuration..."
|
|
||||||
|
|
||||||
mkdir -p /var/log/$app
|
|
||||||
chown -R _biboumi:_biboumi "/var/log/$app"
|
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
|
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
|
||||||
|
|
||||||
#=================================================
|
ynh_restore_file --origin_path="/var/log/$app/"
|
||||||
# INTEGRATE SERVICE IN YUNOHOST
|
chown -R _biboumi:_biboumi "/var/log/$app"
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Integrating service in YunoHost..."
|
|
||||||
|
|
||||||
yunohost service add $app --description="XMPP gateway for the IRC network" --log="/var/log/$app/$app.log"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SYSTEMD SERVICE
|
# RELOAD NGINX AND PHP-FPM OR THE APP SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Starting a systemd service..."
|
ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action="start" --line_match="Started Biboumi" --log_path="systemd"
|
ynh_systemd_action --service_name="$app" --action="start" --line_match="Authenticated with the XMPP server" --log_path="/var/log/$app/$app.log"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# GENERIC START
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# IMPORT GENERIC HELPERS
|
# IMPORT GENERIC HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -9,41 +7,17 @@
|
||||||
source _common.sh
|
source _common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# CHECK VERSION
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
upgrade_type=$(ynh_check_app_version_changed)
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# STANDARD UPGRADE STEPS
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STOP SYSTEMD SERVICE
|
# STOP SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Stopping a systemd service..."
|
ynh_script_progression --message="Stopping $app's systemd service..." --weight=1
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action="stop" --line_match="Stopped Biboumi" --log_path="systemd"
|
ynh_systemd_action --service_name="$app" --action="stop" --log_path="systemd"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SPECIFIC UPGRADE
|
|
||||||
#=================================================
|
|
||||||
# UPGRADE METRONOME COMPONENT
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Upgrading Metronome component..."
|
|
||||||
|
|
||||||
# Upgrade metronome component
|
|
||||||
ynh_add_config --template="../conf/biboumi.cfg.lua" --destination="/etc/metronome/conf.d/$app.cfg.lua"
|
|
||||||
|
|
||||||
chown metronome:metronome "/etc/metronome/conf.d/$app.cfg.lua"
|
|
||||||
|
|
||||||
ynh_systemd_action --service_name=metronome --action="restart"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE DIRECTORIES
|
# CREATE DIRECTORIES
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Creating a data directory..."
|
ynh_script_progression --message="Setting up the data directory..."
|
||||||
|
|
||||||
mkdir -p /var/lib/$app
|
|
||||||
|
|
||||||
# Set permissions to app files
|
# Set permissions to app files
|
||||||
chown -R _biboumi:_biboumi "/var/lib/$app"
|
chown -R _biboumi:_biboumi "/var/lib/$app"
|
||||||
|
@ -51,46 +25,37 @@ chown -R _biboumi:_biboumi "/var/lib/$app"
|
||||||
#=================================================
|
#=================================================
|
||||||
# UPDATE A CONFIG FILE
|
# UPDATE A CONFIG FILE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Updating a configuration file..."
|
ynh_script_progression --message="Updating $app's configuration files..." --weight=1
|
||||||
|
|
||||||
ynh_add_config --template="../conf/biboumi.cfg" --destination="/etc/$app/$app.cfg"
|
# Upgrade metronome component
|
||||||
|
metronome_config_dir=$(_get_metronome_config_dir)
|
||||||
|
ynh_add_config --template="metronome.cfg.lua" --destination="$metronome_config_dir/$app.cfg.lua"
|
||||||
|
chown metronome:metronome "$metronome_config_dir/$app.cfg.lua"
|
||||||
|
ynh_systemd_action --service_name=metronome --action="restart"
|
||||||
|
|
||||||
|
# Upgrade biboumi configuration
|
||||||
|
ynh_add_config --template="biboumi.cfg" --destination="/etc/$app/$app.cfg"
|
||||||
chown -R _biboumi:_biboumi "/etc/$app/$app.cfg"
|
chown -R _biboumi:_biboumi "/etc/$app/$app.cfg"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SYSTEMD
|
# REAPPLY SYSTEM CONFIGURATIONS
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Upgrading systemd configuration..."
|
ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1
|
||||||
|
|
||||||
# Create a dedicated systemd config
|
# Create a dedicated systemd config
|
||||||
systemctl enable $app.service --quiet
|
systemctl enable "$app.service" --quiet
|
||||||
|
yunohost service add "$app" --description="XMPP gateway for the IRC network" --log="/var/log/$app/$app.log"
|
||||||
#=================================================
|
|
||||||
# GENERIC FINALIZATION
|
|
||||||
#=================================================
|
|
||||||
# SETUP LOGROTATE
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Upgrading logrotate configuration..."
|
|
||||||
|
|
||||||
mkdir -p /var/log/$app
|
|
||||||
chown -R _biboumi:_biboumi "/var/log/$app"
|
|
||||||
|
|
||||||
# Use logrotate to manage app-specific logfile(s)
|
# Use logrotate to manage app-specific logfile(s)
|
||||||
ynh_use_logrotate --non-append
|
ynh_use_logrotate --non-append
|
||||||
|
chown -R _biboumi:_biboumi "/var/log/$app"
|
||||||
#=================================================
|
|
||||||
# INTEGRATE SERVICE IN YUNOHOST
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Integrating service in YunoHost..."
|
|
||||||
|
|
||||||
yunohost service add $app --description="XMPP gateway for the IRC network" --log="/var/log/$app/$app.log"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SYSTEMD SERVICE
|
# START SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Starting a systemd service..."
|
ynh_script_progression --message="Starting $app's systemd service..." --weight=1
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action="start" --line_match="Started Biboumi" --log_path="systemd"
|
ynh_systemd_action --service_name="$app" --action="start" --line_match="Authenticated with the XMPP server" --log_path="/var/log/$app/$app.log"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
|
#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/tests.v1.schema.json
|
||||||
|
|
||||||
test_format = 1.0
|
test_format = 1.0
|
||||||
|
|
||||||
[default]
|
[default]
|
||||||
|
|
||||||
|
preinstall = """
|
||||||
|
if cat /etc/os-release | grep --quiet bookworm 2>/dev/null; then
|
||||||
|
yunohost app install --force https://github.com/yunoHost-Apps/metronome_ynh/tree/testing -a 'domain=domain.tld&init_main_permission=visitors'
|
||||||
|
fi
|
||||||
|
"""
|
||||||
|
|
Loading…
Add table
Reference in a new issue