1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/biboumi_ynh.git synced 2024-09-03 18:15:58 +02:00
This commit is contained in:
ericgaspar 2020-10-08 10:13:41 +02:00
parent 4150644c5f
commit b34ef82de5
No known key found for this signature in database
GPG key ID: 574F281483054D44
6 changed files with 70 additions and 49 deletions

View file

@ -1,7 +1,7 @@
# Biboumi app for Yunohost # Biboumi for YunoHost
[![Integration level](https://dash.yunohost.org/integration/biboumi.svg)](https://dash.yunohost.org/appci/app/biboumi) [![Integration level](https://dash.yunohost.org/integration/biboumi.svg)](https://dash.yunohost.org/appci/app/biboumi) ![](https://ci-apps.yunohost.org/ci/badges/biboumi.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/biboumi.maintain.svg)
[![Install Biboumi with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=biboumi) [![Install biboumi with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=biboumi)
> *This package allows you to install Biboumi quickly and simply on a YunoHost server. > *This package allows you to install Biboumi quickly and simply on a YunoHost server.
If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.* If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.*
@ -10,20 +10,16 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to
Biboumi is an XMPP gateway for the IRC network. Biboumi is an XMPP gateway for the IRC network.
Once biboumi_ynh is installed you can use any XMMP client software to Once biboumi_ynh is installed you can use any XMMP client software to join IRC channels. Any IRC channel is seen as a standard XMMP chatroom (aka MUC) with a special name.
join IRC channels. Any IRC channel is seen as a standard XMMP chatroom
(aka MUC) with a special name.
The the name is formatted like this: `#channelname%ircservername@biboumi.yourdomain.tld`. The the name is formatted like this: `#channelname%ircservername@biboumi.yourdomain.tld`.
For example, if you have a yunohost server hosting domain *example.net* For example, if you have a yunohost server hosting domain *example.net* and you want to join the channel *#yunohost* on *irc.freenode.net* you simply need to join the MUC `#yunohost%irc.freenode.net@biboumi.example.net`.
and you want to join the channel *#yunohost* on *irc.freenode.net* you
simply need to join the MUC `#yunohost%irc.freenode.net@biboumi.example.net`.
**Shipped version:** 8.3 **Shipped version:** 8.3
## Configuration ## Configuration
You can configure this app by the file `/etc/biboumi/biboumi.cfg`. You can configure Biboumi with the file `/etc/biboumi/biboumi.cfg`.
## Documentation ## Documentation
@ -31,7 +27,7 @@ You can configure this app by the file `/etc/biboumi/biboumi.cfg`.
#### Supported architectures #### Supported architectures
* x86-64b - [![](https://ci-apps.yunohost.org/ci/logs/biboumi%20%28Community%29.svg)](https://ci-apps.yunohost.org/ci/apps/biboumi/) * x86-64 - [![](https://ci-apps.yunohost.org/ci/logs/biboumi%20%28Community%29.svg)](https://ci-apps.yunohost.org/ci/apps/biboumi/)
* ARMv8-A - [![](https://ci-apps-arm.yunohost.org/ci/logs/biboumi%20%28Community%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/biboumi/) * ARMv8-A - [![](https://ci-apps-arm.yunohost.org/ci/logs/biboumi%20%28Community%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/biboumi/)
## Limitations ## Limitations
@ -40,6 +36,20 @@ You can configure this app by the file `/etc/biboumi/biboumi.cfg`.
## Links ## Links
* Report a bug: https://github.com/pitchum/biboumi_ynh * Report a bug: https://github.com/YunoHost-Apps/biboumi_ynh/issues
* App website: https://biboumi.louiz.org/ * App website: https://biboumi.louiz.org/
* Upstream app repository: https://lab.louiz.org/louiz/biboumi/-/issues
* YunoHost website: https://yunohost.org/ * YunoHost website: https://yunohost.org/
---
## Developer info
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/biboumi_ynh/tree/testing).
To try the testing branch, please proceed like that.
```
sudo yunohost app install https://github.com/YunoHost-Apps/biboumi_ynh/tree/testing --debug
or
sudo yunohost app upgrade biboumi -u https://github.com/YunoHost-Apps/biboumi_ynh/tree/testing --debug
```

View file

@ -53,4 +53,4 @@ ynh_backup "/etc/metronome/conf.d/biboumi.cfg.lua"
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." ynh_print_info --message="Backup script completed for Biboumi. (YunoHost will then actually copy those files to the archive)."

View file

@ -37,7 +37,7 @@ fi
#================================================= #=================================================
# STORE SETTINGS FROM MANIFEST # STORE SETTINGS FROM MANIFEST
#================================================= #=================================================
ynh_script_progression --message="Storing installation settings..." --time --weight=1 ynh_script_progression --message="Storing installation settings..." --weight=1
ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=admin --value=admin ynh_app_setting_set --app=$app --key=admin --value=admin
@ -47,7 +47,7 @@ ynh_app_setting_set --app=$app --key=admin --value=admin
#================================================= #=================================================
# FIND AND OPEN A PORT # FIND AND OPEN A PORT
#================================================= #=================================================
ynh_script_progression --message="Configuring firewall..." --time --weight=1 ynh_script_progression --message="Configuring firewall..." --weight=2
# Find a free port # Find a free port
port=$(ynh_find_port --port=113) port=$(ynh_find_port --port=113)
@ -56,14 +56,7 @@ ynh_app_setting_set --app=$app --key=port --value=$port
#================================================= #=================================================
# INSTALL DEPENDENCIES # INSTALL DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Installing dependencies..." --time --weight=1 ynh_script_progression --message="Installing dependencies..." --weight=9
# Make sure that stretch-backports is enabled
# if ! apt-cache policy | grep 'stretch-backports/main'
# then
# echo "deb http://ftp.fr.debian.org/debian/ stretch-backports main" | sudo tee /etc/apt/sources.list.d/${app}_needs_stretch-backports.list
# echo "Adding stretch-backports repository..."
# fi
ynh_install_app_dependencies $pkg_dependencies ynh_install_app_dependencies $pkg_dependencies
@ -112,6 +105,7 @@ chown _biboumi /var/log/biboumi /var/lib/biboumi /etc/biboumi
#================================================= #=================================================
# SETUP LOGROTATE # SETUP LOGROTATE
#================================================= #=================================================
ynh_script_progression --message="Configuring log rotation..." --weight=1
# Use logrotate to manage application logfile(s) # Use logrotate to manage application logfile(s)
ynh_use_logrotate /var/log/biboumi/ ynh_use_logrotate /var/log/biboumi/
@ -120,14 +114,14 @@ ynh_use_logrotate /var/log/biboumi/
# ADVERTISE SERVICE IN ADMIN PANEL # ADVERTISE SERVICE IN ADMIN PANEL
#================================================= #=================================================
yunohost service add biboumi --log "/var/log/biboumi/biboumi.log" yunohost service add biboumi --description "XMPP gateway for the IRC network" --log "/var/log/biboumi/biboumi.log"
#================================================= #=================================================
# SET THE APP AS NOT USING THE SSO # SET THE APP AS NOT USING THE SSO
#================================================= #=================================================
# Prevent conflict with other apps on the same domain # Prevent conflict with other apps on the same domain
ynh_app_setting_set $app no_sso 1 ynh_app_setting_set --app=$app --key=no_sso --value=1
#================================================= #=================================================
# RELOAD SERVICES # RELOAD SERVICES
@ -140,4 +134,4 @@ ynh_systemd_action --action=restart --service_name=biboumi
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Installation of $app completed" --time --last ynh_script_progression --message="Installation of Biboumi completed" --last

View file

@ -12,6 +12,7 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
# LOAD SETTINGS # LOAD SETTINGS
#================================================= #=================================================
ynh_script_progression --message="Loading installation settings..." --weight=1
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
@ -24,13 +25,14 @@ app=$YNH_APP_INSTANCE_NAME
# Remove a service from the admin panel, added by `yunohost service add` # Remove a service from the admin panel, added by `yunohost service add`
if yunohost service status | grep -q $app if yunohost service status | grep -q $app
then then
echo "Remove $app service" ynh_script_progression --message="Removing $app service integration..." --time --weight=1
yunohost service remove $app yunohost service remove $app
fi fi
#================================================= #=================================================
# REMOVE DEPENDENCIES # REMOVE DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Removing dependencies..." --weight=3
# Remove metapackage and its dependencies # Remove metapackage and its dependencies
ynh_remove_app_dependencies ynh_remove_app_dependencies
@ -38,6 +40,7 @@ ynh_remove_app_dependencies
#================================================= #=================================================
# REMOVE APP MAIN DIR # REMOVE APP MAIN DIR
#================================================= #=================================================
ynh_script_progression --message="Removing Biboumi directory..." --weight=2
# Remove the app directory securely # Remove the app directory securely
ynh_secure_remove "/etc/biboumi" ynh_secure_remove "/etc/biboumi"
@ -46,6 +49,7 @@ ynh_secure_remove "/var/lib/biboumi"
#================================================= #=================================================
# REMOVE LOGROTATE CONFIGURATION # REMOVE LOGROTATE CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Removing logrotate configuration..." --weight=1
# Remove the app-specific logrotate config # Remove the app-specific logrotate config
ynh_remove_logrotate ynh_remove_logrotate
@ -58,14 +62,14 @@ ynh_remove_logrotate
ynh_secure_remove "/var/log/biboumi" ynh_secure_remove "/var/log/biboumi"
#=================================================
# REMOVE BACKPORTS LIST
#=================================================
ynh_secure_remove "/etc/apt/sources.list.d/${app}_needs_stretch-backports.list"
#================================================= #=================================================
# REMOVE METRONOME COMPONENT # REMOVE METRONOME COMPONENT
#================================================= #=================================================
ynh_secure_remove "/etc/metronome/conf.d/biboumi.cfg.lua" ynh_secure_remove "/etc/metronome/conf.d/biboumi.cfg.lua"
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Removal of $app completed" --last

View file

@ -19,6 +19,7 @@ ynh_abort_if_errors
#================================================= #=================================================
# LOAD SETTINGS # LOAD SETTINGS
#================================================= #=================================================
ynh_script_progression --message="Loading installation settings..." --weight=1
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
@ -27,6 +28,7 @@ domain=$(ynh_app_setting_get $app domain)
#================================================= #=================================================
# CHECK IF THE APP CAN BE RESTORED # CHECK IF THE APP CAN BE RESTORED
#================================================= #=================================================
ynh_script_progression --message="Validating restoration parameters..." --weight=1
if dpkg --compare-versions "$(uname -r)" "<=" "4.0" if dpkg --compare-versions "$(uname -r)" "<=" "4.0"
then then
@ -38,15 +40,10 @@ fi
#================================================= #=================================================
# REINSTALL DEPENDENCIES # REINSTALL DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Reinstalling dependencies..." --weight=9
# Make sure that stretch-backports is enabled # Make sure that stretch-backports is enabled
if ! apt-cache policy | grep 'stretch-backports/main' ynh_install_app_dependencies $pkg_dependencies
then
echo "deb http://ftp.fr.debian.org/debian/ stretch-backports main" | sudo tee /etc/apt/sources.list.d/${app}_needs_stretch-backports.list
echo "Adding stretch-backports repository..."
fi
ynh_install_app_dependencies biboumi
#================================================= #=================================================
# RESTORE THE APP MAIN DIR # RESTORE THE APP MAIN DIR
@ -59,7 +56,7 @@ ynh_restore_file "/var/lib/biboumi"
# ADVERTISE SERVICE IN ADMIN PANEL # ADVERTISE SERVICE IN ADMIN PANEL
#================================================= #=================================================
yunohost service add biboumi --log "/var/log/biboumi/biboumi.log" yunohost service add biboumi --description "XMPP gateway for the IRC network" --log "/var/log/biboumi/biboumi.log"
#================================================= #=================================================
# RESTORE THE LOGROTATE CONFIGURATION # RESTORE THE LOGROTATE CONFIGURATION
@ -89,3 +86,9 @@ ynh_restore_file "/etc/metronome/conf.d/biboumi.cfg.lua"
ynh_systemd_action --action=restart --service_name=metronome ynh_systemd_action --action=restart --service_name=metronome
ynh_systemd_action --action=restart --service_name=biboumi ynh_systemd_action --action=restart --service_name=biboumi
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Restoration completed for Biboumi" --last

View file

@ -12,6 +12,7 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
# LOAD SETTINGS # LOAD SETTINGS
#================================================= #=================================================
ynh_script_progression --message="Loading installation settings..." --weight=1
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
@ -28,9 +29,10 @@ upgrade_type=$(ynh_check_app_version_changed)
#================================================= #=================================================
# ENSURE DOWNWARD COMPATIBILITY # ENSURE DOWNWARD COMPATIBILITY
#================================================= #=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
# Prevent conflict with other apps on the same domain # Prevent conflict with other apps on the same domain
ynh_app_setting_set $app no_sso 1 ynh_app_setting_set --app=$app --key=no_sso --value=1
#================================================= #=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
@ -50,8 +52,9 @@ ynh_abort_if_errors
#================================================= #=================================================
# UPGRADE DEPENDENCIES # UPGRADE DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Upgrading dependencies..." --weight=9
ynh_install_app_dependencies biboumi ynh_install_app_dependencies $pkg_dependencies
#================================================= #=================================================
# SPECIFIC UPGRADE # SPECIFIC UPGRADE
@ -72,10 +75,10 @@ admin_jid="${admin}@biboumi.${domain}"
# Create the biboumi config file. # Create the biboumi config file.
cp ../conf/biboumi.cfg /etc/biboumi/ cp ../conf/biboumi.cfg /etc/biboumi/
ynh_replace_string __DOMAIN__ "${domain}" "$biboumi_config_file" ynh_replace_string --match_string="__DOMAIN__" --replace_string="${domain}" --target_file="$biboumi_config_file"
ynh_replace_string __SECRET__ "${shared_secret}" "$biboumi_config_file" ynh_replace_string --match_string="__SECRET__" --replace_string="${shared_secret}" --target_file="$biboumi_config_file"
ynh_replace_string __PORT__ "${port}" "$biboumi_config_file" ynh_replace_string --match_string="__PORT__" --replace_string="${port}" --target_file="$biboumi_config_file"
ynh_replace_string __ADMIN_JID__ "${admin_jid}" "$biboumi_config_file" ynh_replace_string --match_string="__ADMIN_JID__" --replace_string="${admin_jid}" --target_file="$biboumi_config_file"
# Recalculate and store the checksum of the file for the next upgrade. # Recalculate and store the checksum of the file for the next upgrade.
ynh_store_file_checksum "$biboumi_config_file" ynh_store_file_checksum "$biboumi_config_file"
@ -86,12 +89,13 @@ ynh_store_file_checksum "$biboumi_config_file"
# Upgrade metronome component # Upgrade metronome component
cp ../conf/biboumi.cfg.lua /etc/metronome/conf.d/ cp ../conf/biboumi.cfg.lua /etc/metronome/conf.d/
ynh_replace_string __DOMAIN__ "${domain}" /etc/metronome/conf.d/biboumi.cfg.lua ynh_replace_string --match_string="__DOMAIN__" --replace_string="${domain}" --target_file="/etc/metronome/conf.d/biboumi.cfg.lua"
ynh_replace_string __SECRET__ "${shared_secret}" /etc/metronome/conf.d/biboumi.cfg.lua ynh_replace_string --match_string="__SECRET__" --replace_string="${shared_secret}" --target_file="/etc/metronome/conf.d/biboumi.cfg.lua"
#================================================= #=================================================
# SETUP LOGROTATE # SETUP LOGROTATE
#================================================= #=================================================
ynh_script_progression --message="Upgrading logrotate configuration..." --weight=1
# Use logrotate to manage app-specific logfile(s) # Use logrotate to manage app-specific logfile(s)
ynh_use_logrotate /var/log/biboumi/ --non-append ynh_use_logrotate /var/log/biboumi/ --non-append
@ -111,3 +115,9 @@ chown _biboumi /var/log/biboumi /var/lib/biboumi /etc/biboumi
ynh_systemd_action --action=restart --service_name=metronome ynh_systemd_action --action=restart --service_name=metronome
ynh_systemd_action --action=restart --service_name=biboumi ynh_systemd_action --action=restart --service_name=biboumi
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Upgrade of Biboumi completed" --last