1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/movim_ynh.git synced 2024-09-03 19:46:19 +02:00

Merge branch 'manifestv2' into version-2

This commit is contained in:
Salamandar 2024-01-29 17:41:35 +01:00
commit b652aafa75
11 changed files with 82 additions and 106 deletions

View file

@ -47,4 +47,4 @@ ou
sudo yunohost app upgrade movim -u https://github.com/YunoHost-Apps/movim_ynh/tree/testing --debug
```
**Plus dinfos sur le packaging dapplications :** <https://yunohost.org/packaging_apps>
**Plus dinfos sur le packaging dapplications :** <https://yunohost.org/packaging_apps>

View file

@ -1 +1 @@
After installing the app, it can be configured at https://__DOMAIN__/movim/?admin using the username and password defined during the installation.
The app can be configured at <https://__DOMAIN____PATH__/?admin> using the username and password defined during the installation.

View file

@ -1 +1 @@
Après l'installation, l'application peut être configurée sur https://__DOMAIN__/movim/?admin en utilisant le nom d'utilisateur et le mot de passe définis lors de l'installation.
L'application peut être configurée sur <https://__DOMAIN____PATH__/?admin> en utilisant le nom d'utilisateur et le mot de passe définis lors de l'installation.

View file

@ -1,3 +1,5 @@
#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/manifest.v2.schema.json
packaging_format = 2
id = "movim"
@ -45,13 +47,13 @@ ram.runtime = "50M"
type = "password"
[resources]
[resources.sources.main]
url = "https://github.com/movim/movim/archive/v0.22.5.tar.gz"
sha256 = "fcf0ae66fb48b013f277f39f7bebdc8a0a0b0312a4c3ecb8c23a8ed956a87c77"
autoupdate.strategy = "latest_github_tag"
[resources.sources.main]
url = "https://github.com/movim/movim/archive/v0.22.5.tar.gz"
sha256 = "fcf0ae66fb48b013f277f39f7bebdc8a0a0b0312a4c3ecb8c23a8ed956a87c77"
autoupdate.strategy = "latest_github_tag"
[resources.ports]
[resources.system_user]
[resources.install_dir]
@ -60,7 +62,18 @@ ram.runtime = "50M"
main.url = "/"
[resources.apt]
packages = "postgresql, php8.2-dom, php8.2-curl, php8.2-mbstring, php8.2-imagick, php8.2-gd, php8.2-pgsql, php8.2-xml"
packages = [
"php8.2-curl",
"php8.2-mbstring",
"php8.2-imagick",
"php8.2-gd",
"php8.2-dom",
"php8.2-pgsql",
"php8.2-xml",
"postgresql",
"postgresql-contrib",
"apt-transport-https",
]
[resources.database]
type = "postgresql"

View file

@ -22,21 +22,13 @@ ynh_print_info --message="Declaring files to be backed up..."
ynh_backup --src_path="$install_dir"
#=================================================
# BACKUP THE NGINX CONFIGURATION
# SYSTEM CONFIGURATION
#=================================================
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# BACKUP THE PHP-FPM CONFIGURATION
#=================================================
ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
#=================================================
# BACKUP SYSTEMD
#=================================================
ynh_backup --src_path="/etc/systemd/system/$app.service"
#=================================================

View file

@ -16,7 +16,7 @@ source /usr/share/yunohost/helpers
#=================================================
ynh_script_progression --message="Stopping a systemd service..."
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --line_match="Stopped"
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
#=================================================
# MODIFY URL IN NGINX CONF
@ -28,23 +28,16 @@ ynh_change_url_nginx_config
#=================================================
# SPECIFIC MODIFICATIONS
#=================================================
# SETUP SYSTEMD
#=================================================
ynh_script_progression --message="Configuring a systemd service..."
domain=$new_domain
path=$new_path
ynh_add_systemd_config
#=================================================
# GENERIC FINALISATION
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting a systemd service..."
ynh_script_progression --message="Starting a systemd service..." --weight=1
# Start a systemd service
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Movim daemon launched"
ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="Movim daemon launched"
#=================================================
# END OF SCRIPT

View file

@ -8,18 +8,12 @@
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# RETRIEVE ARGUMENTS FROM THE MANIFEST
#=================================================
timezone=$(cat /etc/timezone)
#=================================================
# STORE SETTINGS FROM MANIFEST
#=================================================
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
@ -29,23 +23,7 @@ ynh_script_progression --message="Setting up source files..."
ynh_setup_source --dest_dir="$install_dir"
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
#=================================================
# PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression --message="Configuring PHP-FPM..."
# Create a dedicated PHP-FPM config
ynh_add_fpm_config --usage=low --footprint=low
# Create a dedicated NGINX config
ynh_add_nginx_config
# Create a dedicated systemd config
ynh_add_systemd_config
yunohost service add $app --description="Responsive web-based XMPP client" --log="/var/log/$app/$app.log"
chown -R "$app:www-data" "$install_dir"
#=================================================
# SPECIFIC SETUP
@ -57,7 +35,7 @@ ynh_script_progression --message="Adding a configuration file..."
ynh_add_config --template="../conf/.env" --destination="$install_dir/.env"
chmod 650 "$install_dir/.env"
chown $app:$app "$install_dir/.env"
chown "$app:$app" "$install_dir/.env"
#=================================================
# BUILD MOVIM
@ -71,13 +49,28 @@ ynh_install_composer
#ynh_exec_warn_less ynh_exec_as "$app" ynh_composer_exec --commands="movim:migrate"
ynh_composer_exec --commands="movim:migrate"
#=================================================
# PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression --message="Configuring PHP-FPM..."
# Create a dedicated PHP-FPM config
ynh_add_fpm_config --usage=low --footprint=low
# Create a dedicated NGINX config
ynh_add_nginx_config
# Create a dedicated systemd config
ynh_add_systemd_config
yunohost service add $app --description="Responsive web-based XMPP client" --log="/var/log/$app/$app.log"
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting a systemd service..."
# Start a systemd service
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Movim daemon launched"
ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="Movim daemon launched"
#=================================================
# END OF SCRIPT

View file

@ -12,15 +12,11 @@ source /usr/share/yunohost/helpers
#=================================================
# REMOVE SYSTEM CONFIGURATIONS
#=================================================
# REMOVE SYSTEMD SERVICE
#=================================================
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`)
if ynh_exec_warn_less yunohost service status $app >/dev/null
then
ynh_script_progression --message="Removing $app service integration..."
yunohost service remove $app
if ynh_exec_warn_less yunohost service status "$app" >/dev/null; then
yunohost service remove "$app"
fi
# Remove the dedicated systemd config

View file

@ -24,33 +24,30 @@ ynh_script_progression --message="Restoring the app main directory..."
ynh_restore_file --origin_path="$install_dir"
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
chown -R "$app:www-data" "$install_dir"
#=================================================
# RESTORE THE POSTGRESQL DATABASE
#=================================================
ynh_script_progression --message="Restoring the PostgreSQL database..."
ynh_psql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql
ynh_psql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" < ./db.sql
#=================================================
# RESTORE SYSTEM CONFIGURATIONS
#=================================================
# RESTORE THE PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
# Recreate a dedicated PHP-FPM config
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint
#FIXME: ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --phpversion=$phpversion
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
systemctl enable $app.service --quiet
yunohost service add $app --description="Responsive web-based XMPP client" --log="/var/log/$app/$app.log"
systemctl enable "$app.service" --quiet
yunohost service add "$app" --description="Responsive web-based XMPP client"
#=================================================
# GENERIC FINALIZATION
@ -59,10 +56,10 @@ yunohost service add $app --description="Responsive web-based XMPP client" --log
#=================================================
ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Movim daemon launched"
ynh_systemd_action --service_name=php$phpversion-fpm --action=reload
ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="Movim daemon launched"
ynh_systemd_action --service_name="php$phpversion-fpm" --action=reload
ynh_systemd_action --service_name=nginx --action=reload
ynh_systemd_action --service_name=nginx --action=Reloading
#=================================================
# END OF SCRIPT

View file

@ -15,12 +15,6 @@ source /usr/share/yunohost/helpers
timezone=$(cat /etc/timezone)
#=================================================
# CHECK VERSION
#=================================================
upgrade_type=$(ynh_check_app_version_changed)
#=================================================
# STANDARD UPGRADE STEPS
#=================================================
@ -28,7 +22,7 @@ upgrade_type=$(ynh_check_app_version_changed)
#=================================================
ynh_script_progression --message="Stopping a systemd service..."
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" --line_match="Stopped"
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
@ -38,52 +32,32 @@ ynh_script_progression --message="Ensuring downward compatibility..."
# If fpm_footprint doesn't exist, create it
if [ -z "${fpm_footprint:-}" ]; then
fpm_footprint=low
ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint
ynh_app_setting_set --app="$app" --key=fpm_footprint --value="$fpm_footprint"
fi
# If fpm_free_footprint doesn't exist, create it
if [ -z "${fpm_free_footprint:-}" ]; then
fpm_free_footprint=0
ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint
ynh_app_setting_set --app="$app" --key=fpm_free_footprint --value="$fpm_free_footprint"
fi
# If fpm_usage doesn't exist, create it
if [ -z "${fpm_usage:-}" ]; then
fpm_usage=low
ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage
ynh_app_setting_set --app="$app" --key=fpm_usage --value="$fpm_usage"
fi
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression --message="Upgrading source files..."
if [ "$upgrade_type" == "UPGRADE_APP" ]
then
ynh_script_progression --message="Upgrading source files..."
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir"
fi
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir" --full_replace=1
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
chown -R "$app:www-data" "$install_dir"
#=================================================
# PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression --message="Upgrading PHP-FPM configuration..."
# Create a dedicated PHP-FPM config
ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint
# Create a dedicated NGINX config
ynh_add_nginx_config
# Create a dedicated systemd config
ynh_add_systemd_config
yunohost service add $app --description="Responsive web-based XMPP client" --log="/var/log/$app/$app.log"
#=================================================
# SPECIFIC UPGRADE
@ -95,7 +69,7 @@ ynh_script_progression --message="Updating a configuration file..."
ynh_add_config --template="../conf/.env" --destination="$install_dir/.env"
chmod 400 "$install_dir/.env"
chown $app:$app "$install_dir/.env"
chown "$app:$app" "$install_dir/.env"
#=================================================
# BUILD MOVIM
@ -108,12 +82,28 @@ ynh_exec_warn_less ynh_composer_exec --commands="config --global discard-changes
ynh_exec_warn_less ynh_composer_exec --commands="update --no-interaction --quiet"
ynh_exec_warn_less ynh_composer_exec --commands="movim:migrate --quiet"
#=================================================
# REAPPLY SYSTEM CONFIGURATIONS
#=================================================
ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1
# Create a dedicated PHP-FPM config
ynh_add_fpm_config --phpversion="$phpversion" --usage="$fpm_usage" --footprint="$fpm_footprint"
# Create a dedicated NGINX config
ynh_add_nginx_config
# Create a dedicated systemd config
ynh_add_systemd_config
yunohost service add "$app" --description="Responsive web-based XMPP client" --log="/var/log/$app/$app.log"
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting a systemd service..."
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Movim daemon launched"
# Start a systemd service
ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="Movim daemon launched"
#=================================================
# END OF SCRIPT

View file

@ -1,3 +1,5 @@
#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/tests.v1.schema.json
test_format = 1.0
[default]