1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/prosody_ynh.git synced 2024-09-03 20:15:57 +02:00
This commit is contained in:
Éric Gaspar 2023-11-02 22:13:46 +01:00
parent cda88f357d
commit fc2da623ee
9 changed files with 113 additions and 77 deletions

View file

@ -1,7 +0,0 @@
SOURCE_URL=https://prosody.im/downloads/source/prosody-0.12.3.tar.gz
SOURCE_SUM=35da0d031ff46040a2d638e004d4255e249b6323fe6212db9ddd76b401db2101
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true
SOURCE_FILENAME=
SOURCE_EXTRACT=true

View file

@ -27,7 +27,7 @@ NonBlocking=true
### See man systemd.exec ###
WorkingDirectory=__DATADIR__
WorkingDirectory=__DATA_DIR__
User=__APP__
Group=__APP__

43
manifest.toml Normal file
View file

@ -0,0 +1,43 @@
packaging_format = 2
id = "prosody"
name = "Prosody"
description.en = "a modern XMPP communication server"
version = "0.12.3~ynh2"
maintainers = ["yalh76"]
[upstream]
license = "MIT"
website = "https://prosody.im/"
admindoc = "https://prosody.im/doc"
code = "https://hg.prosody.im/"
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 = ">= 4.3.0"
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"]
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, ...
[install]
[resources]
[resources.sources.main]
url = "https://prosody.im/downloads/source/prosody-0.12.3.tar.gz"
sha256 = "35da0d031ff46040a2d638e004d4255e249b6323fe6212db9ddd76b401db2101"
[resources.system_user]
[resources.install_dir]
[resources.data_dir]
[resources.permissions]

View file

@ -11,7 +11,7 @@ else
fi
# dependencies used by the app
pkg_dependencies="libicu-dev libidn11-dev|libidn-dev liblua${luaversion}-dev libssl-dev lua-busted lua${luaversion} lua${luaversion}-expat lua${luaversion}-socket openssl txt2man lua${luaversion}-sec lua${luaversion}-unbound"
#REMOVEME? pkg_dependencies="libicu-dev libidn11-dev|libidn-dev liblua${luaversion}-dev libssl-dev lua-busted lua${luaversion} lua${luaversion}-expat lua${luaversion}-socket openssl txt2man lua${luaversion}-sec lua${luaversion}-unbound"
#=================================================
# PERSONAL HELPERS

View file

@ -14,21 +14,21 @@ source /usr/share/yunohost/helpers
# MANAGE SCRIPT FAILURE
#=================================================
ynh_clean_setup () {
#REMOVEME? ynh_clean_setup () {
true
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#REMOVEME? ynh_abort_if_errors
#=================================================
# LOAD SETTINGS
#=================================================
ynh_print_info --message="Loading installation settings..."
#REMOVEME? ynh_print_info --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME
#REMOVEME? app=$YNH_APP_INSTANCE_NAME
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
config_path=$(ynh_app_setting_get --app=$app --key=config_path)
#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir)
#REMOVEME? config_path=$(ynh_app_setting_get --app=$app --key=config_path)
#=================================================
# DECLARE DATA AND CONF FILES TO BACKUP
@ -45,7 +45,7 @@ ynh_backup --src_path="$config_path"
# BACKUP THE DATA DIR
#=================================================
ynh_backup --src_path="$datadir" --is_big
ynh_backup --src_path="$data_dir" --is_big
#=================================================
# SPECIFIC BACKUP

View file

@ -13,17 +13,17 @@ source /usr/share/yunohost/helpers
# MANAGE SCRIPT FAILURE
#=================================================
ynh_clean_setup () {
#REMOVEME? ynh_clean_setup () {
ynh_clean_check_starting
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#REMOVEME? ynh_abort_if_errors
#=================================================
# RETRIEVE ARGUMENTS FROM THE MANIFEST
#=================================================
app=$YNH_APP_INSTANCE_NAME
#REMOVEME? app=$YNH_APP_INSTANCE_NAME
#=================================================
# DISABLE METRONOME
@ -39,14 +39,14 @@ fi
#=================================================
# STORE SETTINGS FROM MANIFEST
#=================================================
ynh_script_progression --message="Storing installation settings..."
#REMOVEME? ynh_script_progression --message="Storing installation settings..."
#=================================================
# STANDARD MODIFICATIONS
#=================================================
# FIND AND OPEN A PORT
#=================================================
ynh_script_progression --message="Finding an available port..."
#REMOVEME? ynh_script_progression --message="Finding an available port..."
# Find an available port
file_port=5000
@ -56,13 +56,13 @@ http_port=5280
https_port=5281
component_port=5347
telnet_port=5582
ynh_app_setting_set --app=$app --key=file_port --value=$file_port
ynh_app_setting_set --app=$app --key=client_port --value=$client_port
ynh_app_setting_set --app=$app --key=server_port --value=$server_port
ynh_app_setting_set --app=$app --key=http_port --value=$http_port
ynh_app_setting_set --app=$app --key=https_port --value=$https_port
ynh_app_setting_set --app=$app --key=component_port --value=$component_port
ynh_app_setting_set --app=$app --key=telnet_port --value=$telnet_port
#REMOVEME? ynh_app_setting_set --app=$app --key=file_port --value=$file_port
#REMOVEME? ynh_app_setting_set --app=$app --key=client_port --value=$client_port
#REMOVEME? ynh_app_setting_set --app=$app --key=server_port --value=$server_port
#REMOVEME? ynh_app_setting_set --app=$app --key=http_port --value=$http_port
#REMOVEME? ynh_app_setting_set --app=$app --key=https_port --value=$https_port
#REMOVEME? ynh_app_setting_set --app=$app --key=component_port --value=$component_port
#REMOVEME? ynh_app_setting_set --app=$app --key=telnet_port --value=$telnet_port
# Optional: Expose this port publicly
# (N.B.: you only need to do this if the app actually needs to expose the port publicly.
@ -75,17 +75,17 @@ ynh_app_setting_set --app=$app --key=telnet_port --value=$telnet_port
#=================================================
# INSTALL DEPENDENCIES
#=================================================
ynh_script_progression --message="Installing dependencies..."
#REMOVEME? ynh_script_progression --message="Installing dependencies..."
ynh_install_app_dependencies $pkg_dependencies
#REMOVEME? ynh_install_app_dependencies $pkg_dependencies
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Configuring system user..."
#REMOVEME? ynh_script_progression --message="Configuring system user..."
# Create a system user
ynh_system_user_create --username=$app
#REMOVEME? ynh_system_user_create --username=$app
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
@ -118,14 +118,14 @@ ynh_secure_remove --file="$builddir"
#=================================================
ynh_script_progression --message="Creating a data directory..."
datadir=/var/lib/$app
ynh_app_setting_set --app=$app --key=datadir --value=$datadir
#REMOVEME? data_dir=/var/lib/$app
#REMOVEME? ynh_app_setting_set --app=$app --key=data_dir --value=$data_dir
mkdir -p $datadir
mkdir -p $data_dir
chmod 750 "$datadir"
chmod -R o-rwx "$datadir"
chown -R $app:$app "$datadir"
chmod 750 "$data_dir"
chmod -R o-rwx "$data_dir"
chown -R $app:$app "$data_dir"
#=================================================
# ADD A CONFIGURATION
@ -133,7 +133,7 @@ chown -R $app:$app "$datadir"
ynh_script_progression --message="Adding a configuration file..."
config_path=/etc/$app
ynh_app_setting_set --app=$app --key=config_path --value=$config_path
#REMOVEME? ynh_app_setting_set --app=$app --key=config_path --value=$config_path
mkdir -p $config_path
mkdir -p $config_path/{certs,conf.avail,conf.d}

View file

@ -12,13 +12,13 @@ source /usr/share/yunohost/helpers
#=================================================
# LOAD SETTINGS
#=================================================
ynh_script_progression --message="Loading installation settings..."
#REMOVEME? ynh_script_progression --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME
#REMOVEME? app=$YNH_APP_INSTANCE_NAME
port=$(ynh_app_setting_get --app=$app --key=port)
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
config_path=$(ynh_app_setting_get --app=$app --key=config_path)
#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port)
#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir)
#REMOVEME? config_path=$(ynh_app_setting_get --app=$app --key=config_path)
#=================================================
# STANDARD REMOVE
@ -57,16 +57,16 @@ ynh_remove_logrotate
if [ "${YNH_APP_PURGE:-0}" -eq 1 ]
then
ynh_script_progression --message="Removing app data directory..."
ynh_secure_remove --file="$datadir"
#REMOVEME? ynh_secure_remove --file="$data_dir"
fi
#=================================================
# REMOVE DEPENDENCIES
#=================================================
ynh_script_progression --message="Removing dependencies..."
#REMOVEME? ynh_script_progression --message="Removing dependencies..."
# Remove metapackage and its dependencies
ynh_remove_app_dependencies
#REMOVEME? ynh_remove_app_dependencies
#=================================================
# SPECIFIC REMOVE
@ -91,10 +91,10 @@ ynh_secure_remove --file="/usr/bin/prosody-migrator"
#=================================================
# REMOVE DEDICATED USER
#=================================================
ynh_script_progression --message="Removing the dedicated system user..."
#REMOVEME? ynh_script_progression --message="Removing the dedicated system user..."
# Delete a system user
ynh_system_user_delete --username=$app
#REMOVEME? ynh_system_user_delete --username=$app
#=================================================
# ENABLE METRONOME

View file

@ -14,21 +14,21 @@ source /usr/share/yunohost/helpers
# MANAGE SCRIPT FAILURE
#=================================================
ynh_clean_setup () {
#REMOVEME? ynh_clean_setup () {
ynh_clean_check_starting
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#REMOVEME? ynh_abort_if_errors
#=================================================
# LOAD SETTINGS
#=================================================
ynh_script_progression --message="Loading installation settings..."
#REMOVEME? ynh_script_progression --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME
#REMOVEME? app=$YNH_APP_INSTANCE_NAME
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
config_path=$(ynh_app_setting_get --app=$app --key=config_path)
#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir)
#REMOVEME? config_path=$(ynh_app_setting_get --app=$app --key=config_path)
#=================================================
# DISABLE METRONOME
@ -46,10 +46,10 @@ fi
#=================================================
# RECREATE THE DEDICATED USER
#=================================================
ynh_script_progression --message="Recreating the dedicated system user..."
#REMOVEME? ynh_script_progression --message="Recreating the dedicated system user..."
# Create the dedicated user (if not existing)
ynh_system_user_create --username=$app
#REMOVEME? ynh_system_user_create --username=$app
#=================================================
# RESTORE THE CONFIG DIR
@ -80,23 +80,23 @@ chmod 750 "$config_path/certs"
#=================================================
ynh_script_progression --message="Restoring the data directory..."
ynh_restore_file --origin_path="$datadir" --not_mandatory
ynh_restore_file --origin_path="$data_dir" --not_mandatory
mkdir -p $datadir
mkdir -p $data_dir
chmod 750 "$datadir"
chmod -R o-rwx "$datadir"
chown -R $app:$app "$datadir"
chmod 750 "$data_dir"
chmod -R o-rwx "$data_dir"
chown -R $app:$app "$data_dir"
#=================================================
# SPECIFIC RESTORATION
#=================================================
# REINSTALL DEPENDENCIES
#=================================================
ynh_script_progression --message="Reinstalling dependencies..."
#REMOVEME? ynh_script_progression --message="Reinstalling dependencies..."
# Define and install dependencies
ynh_install_app_dependencies $pkg_dependencies
#REMOVEME? ynh_install_app_dependencies $pkg_dependencies
#=================================================
# RESTORE SYSTEMD

View file

@ -12,12 +12,12 @@ source /usr/share/yunohost/helpers
#=================================================
# LOAD SETTINGS
#=================================================
ynh_script_progression --message="Loading installation settings..."
#REMOVEME? ynh_script_progression --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME
#REMOVEME? app=$YNH_APP_INSTANCE_NAME
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
config_path=$(ynh_app_setting_get --app=$app --key=config_path)
#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir)
#REMOVEME? config_path=$(ynh_app_setting_get --app=$app --key=config_path)
#=================================================
# CHECK VERSION
@ -29,17 +29,17 @@ upgrade_type=$(ynh_check_app_version_changed)
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..."
#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..."
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
#REMOVEME? ynh_backup_before_upgrade
#REMOVEME? ynh_clean_setup () {
ynh_clean_check_starting
# Restore it if the upgrade fails
ynh_restore_upgradebackup
#REMOVEME? ynh_restore_upgradebackup
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#REMOVEME? ynh_abort_if_errors
#=================================================
# DISABLE METRONOME
@ -69,10 +69,10 @@ ynh_script_progression --message="Ensuring downward compatibility..."
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Making sure dedicated system user exists..."
#REMOVEME? ynh_script_progression --message="Making sure dedicated system user exists..."
# Create a dedicated user (if not existing)
ynh_system_user_create --username=$app
#REMOVEME? ynh_system_user_create --username=$app
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
@ -90,9 +90,9 @@ fi
#=================================================
# UPGRADE DEPENDENCIES
#=================================================
ynh_script_progression --message="Upgrading dependencies..."
#REMOVEME? ynh_script_progression --message="Upgrading dependencies..."
ynh_install_app_dependencies $pkg_dependencies
#REMOVEME? ynh_install_app_dependencies $pkg_dependencies
#=================================================
# SPECIFIC UPGRADE