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:
Éric Gaspar 2023-07-09 19:06:26 +02:00
parent ab2fd3bca4
commit 177acf31f5
11 changed files with 19 additions and 229 deletions

View file

@ -1,24 +0,0 @@
;; Test complet
; Manifest
domain="domain.tld"
admin="john"
; Checks
pkg_linter=1
setup_sub_dir=0
setup_root=0
setup_nourl=1
setup_private=0
setup_public=0
upgrade=1
# 8.3~ynh1
upgrade=1 from_commit=6596c7e12e17a2b9149b20739e916184e71fdfbd
backup_restore=1
multi_instance=0
port_already_use=1 (113)
change_url=0
;;; Options
Email=pitchum@gramaton.org
Notification=none
;;; Upgrade options
; commit=6596c7e12e17a2b9149b20739e916184e71fdfbd
name=8.3~ynh1.

1
doc/DESCRIPTION.md Normal file
View file

@ -0,0 +1 @@
XMPP gateway for the IRC network

View file

@ -1,41 +0,0 @@
{
"name": "Biboumi",
"id": "biboumi",
"packaging_format": 1,
"description": {
"en": "XMPP gateway for the IRC network",
"fr": "Passerelle XMPP pour le réseau IRC"
},
"version": "8.3~ynh2",
"url": "https://biboumi.louiz.org/",
"upstream": {
"license": "Zlib",
"website": "https://biboumi.louiz.org/",
"admindoc": "https://lab.louiz.org/louiz/biboumi/blob/8.3/doc/biboumi.1.rst",
"code": "https://lab.louiz.org/louiz/biboumi"
},
"license": "Zlib",
"maintainer": {
"name": "pitchum",
"email": "pitchum@yunohost.org"
},
"requirements": {
"yunohost": ">= 11.0.9"
},
"multi_instance": false,
"services": [
"metronome"
],
"arguments": {
"install" : [
{
"name": "domain",
"type": "domain"
},
{
"name": "admin",
"type": "user"
}
]
}
}

View file

@ -14,32 +14,35 @@ license = "Zlib"
website = "https://biboumi.louiz.org/"
admindoc = "https://lab.louiz.org/louiz/biboumi/blob/8.3/doc/biboumi.1.rst"
code = "https://lab.louiz.org/louiz/biboumi"
cpe = "???" # FIXME: optional but recommended if relevant, this is meant to contain the Common Platform Enumeration, which is sort of a standard id for applications defined by the NIST. In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps. The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number)
fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin.
[integration]
yunohost = ">= 11.0.9"
architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64), for example: ["amd64", "i386"]
yunohost = ">= 11.1.21"
architectures = "all"
multi_instance = false
ldap = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "sso" key : the "ldap" key corresponds to wether or not a user *can* login on the app using its YunoHost credentials.
sso = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "ldap" key : the "sso" key corresponds to wether or not a user is *automatically logged-in* on the app when logged-in on the YunoHost portal.
disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ...
ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ...
ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ...
ldap = false
sso = false
disk = "50M"
ram.build = "50M"
ram.runtime = "50M"
[install]
[install.domain]
# this is a generic question - ask strings are automatically handled by Yunohost's core
type = "domain"
full_domain = true
[install.admin]
# this is a generic question - ask strings are automatically handled by Yunohost's core
type = "user"
[resources]
[resources.ports]
main.default = 113
[resources.system_user]
[resources.install_dir]
[resources.permissions]
[resources.apt]
packages = "metronome biboumi"

View file

@ -4,9 +4,6 @@
# COMMON VARIABLES
#=================================================
# dependencies used by the app
#REMOVEME? pkg_dependencies="metronome biboumi"
#=================================================
# PERSONAL HELPERS
#=================================================

View file

@ -10,22 +10,6 @@
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
# Exit if an error occurs during the execution of the script
#REMOVEME? ynh_abort_if_errors
#=================================================
# LOAD SETTINGS
#=================================================
#REMOVEME? ynh_print_info --message="Loading installation settings..."
#REMOVEME? app=$YNH_APP_INSTANCE_NAME
#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain)
#=================================================
# DECLARE DATA AND CONF FILES TO BACKUP
#=================================================

View file

@ -9,25 +9,10 @@
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
#REMOVEME? ynh_clean_setup () {
ynh_clean_check_starting
}
# Exit if an error occurs during the execution of the script
#REMOVEME? ynh_abort_if_errors
#=================================================
# RETRIEVE ARGUMENTS FROM THE MANIFEST
#=================================================
#REMOVEME? domain=$YNH_APP_ARG_DOMAIN
#REMOVEME? admin=$YNH_APP_ARG_ADMIN
#REMOVEME? app=$YNH_APP_INSTANCE_NAME
shared_secret="$(ynh_string_random 25)"
admin_jid="${admin}@$app.${domain}"
@ -44,30 +29,15 @@ fi
#=================================================
# STORE SETTINGS FROM MANIFEST
#=================================================
#REMOVEME? ynh_script_progression --message="Storing installation settings..."
ynh_script_progression --message="Storing installation settings..."
#REMOVEME? ynh_app_setting_set --app=$app --key=domain --value=$domain
#REMOVEME? ynh_app_setting_set --app=$app --key=admin --value=$admin
ynh_app_setting_set --app=$app --key=shared_secret --value=$shared_secret
#REMOVEME? ynh_app_setting_set --app=$app --key=admin_jid --value=$admin_jid
#=================================================
# STANDARD MODIFICATIONS
#=================================================
# FIND AND OPEN A PORT
#=================================================
#REMOVEME? ynh_script_progression --message="Finding an available port..."
# Find an available port
#REMOVEME? port=$(ynh_find_port --port=113)
#REMOVEME? ynh_app_setting_set --app=$app --key=port --value=$port
ynh_app_setting_set --app=$app --key=admin_jid --value=$admin_jid
#=================================================
# INSTALL DEPENDENCIES
#=================================================
#REMOVEME? ynh_script_progression --message="Installing dependencies..."
#REMOVEME? ynh_install_app_dependencies $pkg_dependencies
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
#=================================================
@ -144,7 +114,7 @@ ynh_systemd_action --service_name=$app --action="start" --line_match="Started Bi
#=================================================
# SETUP SSOWAT
#=================================================
#REMOVEME? ynh_script_progression --message="Configuring permissions..."
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

View file

@ -9,13 +9,6 @@
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# LOAD SETTINGS
#=================================================
#REMOVEME? ynh_script_progression --message="Loading installation settings..."
#REMOVEME? app=$YNH_APP_INSTANCE_NAME
#=================================================
# STANDARD REMOVE
#=================================================
@ -46,14 +39,6 @@ ynh_script_progression --message="Removing logrotate configuration..."
# Remove the app-specific logrotate config
ynh_remove_logrotate
#=================================================
# REMOVE DEPENDENCIES
#=================================================
#REMOVEME? ynh_script_progression --message="Removing dependencies..."
# Remove metapackage and its dependencies
#REMOVEME? ynh_remove_app_dependencies
#=================================================
# SPECIFIC REMOVE
#=================================================

View file

@ -10,46 +10,16 @@
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
#REMOVEME? ynh_clean_setup () {
ynh_clean_check_starting
}
# Exit if an error occurs during the execution of the script
#REMOVEME? ynh_abort_if_errors
#=================================================
# LOAD SETTINGS
#=================================================
#REMOVEME? ynh_script_progression --message="Loading installation settings..."
#REMOVEME? app=$YNH_APP_INSTANCE_NAME
#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain)
#=================================================
# CHECK IF THE APP CAN BE RESTORED
#=================================================
#REMOVEME? ynh_script_progression --message="Validating restoration parameters..."
ynh_script_progression --message="Validating restoration parameters..."
if dpkg --compare-versions "$(uname -r)" "<=" "4.0"
then
ynh_die "Upgrade your kernel first. Unsupported version: $(uname -r)"
fi
#=================================================
# SPECIFIC RESTORATION
#=================================================
# REINSTALL DEPENDENCIES
#=================================================
#REMOVEME? ynh_script_progression --message="Reinstalling dependencies..."
# Define and install dependencies
#REMOVEME? ynh_install_app_dependencies $pkg_dependencies
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
#=================================================
# RESTORE VARIOUS FILES
#=================================================

View file

@ -9,41 +9,12 @@
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# LOAD SETTINGS
#=================================================
#REMOVEME? ynh_script_progression --message="Loading installation settings..."
#REMOVEME? app=$YNH_APP_INSTANCE_NAME
#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain)
#REMOVEME? admin=$(ynh_app_setting_get --app=$app --key=admin)
#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port)
#REMOVEME? shared_secret=$(ynh_app_setting_get --app=$app --key=shared_secret)
#REMOVEME? admin_jid=$(ynh_app_setting_get --app=$app --key=admin_jid)
#=================================================
# CHECK VERSION
#=================================================
ynh_script_progression --message="Checking version..."
upgrade_type=$(ynh_check_app_version_changed)
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..."
# Backup the current version of the app
#REMOVEME? ynh_backup_before_upgrade
#REMOVEME? ynh_clean_setup () {
ynh_clean_check_starting
# Restore it if the upgrade fails
#REMOVEME? ynh_restore_upgradebackup
}
# Exit if an error occurs during the execution of the script
#REMOVEME? ynh_abort_if_errors
#=================================================
# STANDARD UPGRADE STEPS
#=================================================
@ -53,32 +24,6 @@ ynh_script_progression --message="Stopping a systemd service..."
ynh_systemd_action --service_name=$app --action="stop" --line_match="Stopped Biboumi" --log_path="systemd"
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..."
# Prevent conflict with other apps on the same domain
ynh_app_setting_set --app=$app --key=no_sso --value=1
if [ -z "$shared_secret" ]; then
shared_secret="$(grep password "/etc/biboumi/biboumi.cfg" | cut -d= -f2)"
ynh_app_setting_set --app=$app --key=shared_secret --value=$shared_secret
fi
if [ -z "$admin_jid" ]; then
admin_jid="${admin}@$app.${domain}"
#REMOVEME? ynh_app_setting_set --app=$app --key=admin_jid --value=$admin_jid
fi
#=================================================
# UPGRADE DEPENDENCIES
#=================================================
#REMOVEME? ynh_script_progression --message="Upgrading dependencies..."
#REMOVEME? ynh_install_app_dependencies $pkg_dependencies
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
#=================================================
# SPECIFIC UPGRADE
#=================================================