1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/dotclear2_ynh.git synced 2024-09-03 18:26:29 +02:00

Merge branch 'packaging-v2' into pr/71

This commit is contained in:
Éric Gaspar 2023-11-12 10:35:14 +01:00
commit c17d8b2575
8 changed files with 32 additions and 62 deletions

View file

@ -35,6 +35,7 @@ Dotclear project's purpose is to provide a user-friendly tool allowing anyone to
* Official app website: <https://dotclear.org> * Official app website: <https://dotclear.org>
* Official admin documentation: <https://dotclear.org/documentation/2.0> * Official admin documentation: <https://dotclear.org/documentation/2.0>
* Upstream app code repository: <https://git.dotclear.org/dev/dotclear> * Upstream app code repository: <https://git.dotclear.org/dev/dotclear>
* YunoHost Store: <https://apps.yunohost.org/app/dotclear2>
* Report a bug: <https://github.com/YunoHost-Apps/dotclear2_ynh/issues> * Report a bug: <https://github.com/YunoHost-Apps/dotclear2_ynh/issues>
## Developer info ## Developer info

View file

@ -35,6 +35,7 @@ Dotclear project's purpose is to provide a user-friendly tool allowing anyone to
* Site officiel de lapp : <https://dotclear.org> * Site officiel de lapp : <https://dotclear.org>
* Documentation officielle de ladmin : <https://dotclear.org/documentation/2.0> * Documentation officielle de ladmin : <https://dotclear.org/documentation/2.0>
* Dépôt de code officiel de lapp : <https://git.dotclear.org/dev/dotclear> * Dépôt de code officiel de lapp : <https://git.dotclear.org/dev/dotclear>
* YunoHost Store: <https://apps.yunohost.org/app/dotclear2>
* Signaler un bug : <https://github.com/YunoHost-Apps/dotclear2_ynh/issues> * Signaler un bug : <https://github.com/YunoHost-Apps/dotclear2_ynh/issues>
## Informations pour les développeurs ## Informations pour les développeurs

View file

@ -2,7 +2,7 @@
location __PATH__/ { location __PATH__/ {
# Path to source # Path to source
alias __INSTALL_DIR__/ ; alias __INSTALL_DIR__/;
index index.php; index index.php;

View file

@ -21,11 +21,14 @@ cpe = "cpe:2.3:a:dotclear:dotclear"
fund = "https://dotclear.org/donate" fund = "https://dotclear.org/donate"
[integration] [integration]
yunohost = ">= 11.0.0" yunohost = ">= 11.2"
architectures = "all" architectures = "all"
multi_instance = true multi_instance = true
ldap = true ldap = true
sso = false sso = false
disk = "50M" disk = "50M"
ram.build = "200M" ram.build = "200M"
ram.runtime = "50M" ram.runtime = "50M"
@ -69,7 +72,7 @@ ram.runtime = "50M"
admin.show_tile = false admin.show_tile = false
[resources.apt] [resources.apt]
packages = "mariadb-server, php8.2, php8.2-fpm, php8.2-mbstring, php8.2-mysql, php-iconv, php8.2-xml, php8.2-cli, php8.2-intl, php8.2-ldap" packages = "mariadb-server, php8.2, php8.2-fpm, php8.2-mbstring, php8.2-mysql, php-iconv, php8.2-xml, php8.2-cli, php8.2-intl, php8.2-ldap, php8.2-gd"
[resources.database] [resources.database]
type = "mysql" type = "mysql"

View file

@ -47,18 +47,13 @@ mkdir -p "$install_dir/"{cache,public}
setfacl -m d:u:www-data:rwx "$install_dir/"{cache,public} setfacl -m d:u:www-data:rwx "$install_dir/"{cache,public}
#================================================= #=================================================
# NGINX CONFIGURATION # SYSTEM CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Configuring NGINX web server..." ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
# Create a dedicated NGINX config # Create a dedicated NGINX config
ynh_add_nginx_config ynh_add_nginx_config
#=================================================
# PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression --message="Configuring PHP-FPM..." --weight=2
# Create a dedicated PHP-FPM config # Create a dedicated PHP-FPM config
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint

View file

@ -10,26 +10,16 @@ source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#================================================= #=================================================
# REMOVE NGINX CONFIGURATION # REMOVE SYSTEM CONFIGURATIONS
#================================================= #=================================================
ynh_script_progression --message="Removing NGINX web server configuration..." ynh_script_progression --message="Removing system configurations related to $app..." --weight=1
# Remove the dedicated NGINX config # Remove the dedicated NGINX config
ynh_remove_nginx_config ynh_remove_nginx_config
#=================================================
# REMOVE PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression --message="Removing PHP-FPM configuration..."
# Remove the dedicated PHP-FPM config # Remove the dedicated PHP-FPM config
ynh_remove_fpm_config ynh_remove_fpm_config
#=================================================
# REMOVE FAIL2BAN CONFIGURATION
#=================================================
ynh_script_progression --message="Removing Fail2Ban configuration..."
# Remove the dedicated Fail2Ban config # Remove the dedicated Fail2Ban config
ynh_remove_fail2ban_config ynh_remove_fail2ban_config

View file

@ -10,15 +10,6 @@
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#=================================================
# STANDARD RESTORATION STEPS
#=================================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the NGINX configuration..."
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#================================================= #=================================================
# RESTORE THE APP MAIN DIR # RESTORE THE APP MAIN DIR
#================================================= #=================================================
@ -26,7 +17,6 @@ ynh_script_progression --message="Restoring the app main directory..."
ynh_restore_file --origin_path="$install_dir" ynh_restore_file --origin_path="$install_dir"
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir" chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir" chown -R $app:www-data "$install_dir"
@ -34,24 +24,6 @@ chown -R $app:www-data "$install_dir"
mkdir -p "$install_dir/"{cache,public} mkdir -p "$install_dir/"{cache,public}
setfacl -m d:u:www-data:rwx "$install_dir/"{cache,public} setfacl -m d:u:www-data:rwx "$install_dir/"{cache,public}
#=================================================
# RESTORE THE PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the PHP-FPM configuration..."
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
#=================================================
# RESTORE FAIL2BAN CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the Fail2Ban configuration..."
ynh_restore_file --origin_path="/etc/fail2ban/jail.d/$app.conf"
ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf"
ynh_systemd_action --action=restart --service_name=fail2ban
#=================================================
# SPECIFIC RESTORATION
#================================================= #=================================================
# RESTORE THE MYSQL DATABASE # RESTORE THE MYSQL DATABASE
#================================================= #=================================================
@ -59,6 +31,21 @@ ynh_script_progression --message="Restoring the MySQL database..." --weight=3
ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql ynh_mysql_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"
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_restore_file --origin_path="/etc/fail2ban/jail.d/$app.conf"
ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf"
ynh_systemd_action --action=restart --service_name=fail2ban
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
#================================================= #=================================================

View file

@ -12,7 +12,6 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
# CHECK VERSION # CHECK VERSION
#================================================= #=================================================
ynh_script_progression --message="Checking version..."
upgrade_type=$(ynh_check_app_version_changed) upgrade_type=$(ynh_check_app_version_changed)
@ -21,7 +20,7 @@ upgrade_type=$(ynh_check_app_version_changed)
#================================================= #=================================================
# ENSURE DOWNWARD COMPATIBILITY # ENSURE DOWNWARD COMPATIBILITY
#================================================= #=================================================
ynh_script_progression --message="Ensuring downward compatibility..." ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
if [ -z "${blog_admin:-}" ] || if [ -z "${blog_admin:-}" ] ||
[ -z "$blog_contentadmin" ] || [ -z "$blog_contentadmin" ] ||
@ -91,7 +90,6 @@ then
fi fi
fi fi
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir" chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir" chown -R $app:www-data "$install_dir"
@ -100,18 +98,13 @@ mkdir -p "$install_dir/"{cache,public}
setfacl -m d:u:www-data:rwx "$install_dir/"{cache,public} setfacl -m d:u:www-data:rwx "$install_dir/"{cache,public}
#================================================= #=================================================
# NGINX CONFIGURATION # REAPPLY SYSTEM CONFIGURATIONS
#================================================= #=================================================
ynh_script_progression --message="Upgrading NGINX web server configuration..." ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1
# Create a dedicated NGINX config # Create a dedicated NGINX config
ynh_add_nginx_config ynh_add_nginx_config
#=================================================
# PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2
# Create a dedicated PHP-FPM config # Create a dedicated PHP-FPM config
ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint
@ -120,7 +113,7 @@ ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_
#================================================= #=================================================
# UPDATE A CONFIG FILE # UPDATE A CONFIG FILE
#================================================= #=================================================
ynh_script_progression --message="Updating a configuration file..." ynh_script_progression --message="Updating a configuration file..." --weight=1
php_config=$install_dir/inc/config.php php_config=$install_dir/inc/config.php
@ -171,7 +164,7 @@ ynh_local_curl $adminUrl
#================================================= #=================================================
# UPGRADE FAIL2BAN # UPGRADE FAIL2BAN
#================================================= #=================================================
ynh_script_progression --message="Reconfiguring Fail2Ban..." ynh_script_progression --message="Reconfiguring Fail2Ban..." --weight=1
# Create a dedicated Fail2Ban config # Create a dedicated Fail2Ban config
ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="Invalid credentials in $install_dir/inc/class.auth.ldap.php .* client: <HOST>, .*https://$domain${path%/}/admin/auth.php" ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="Invalid credentials in $install_dir/inc/class.auth.ldap.php .* client: <HOST>, .*https://$domain${path%/}/admin/auth.php"