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

Merge pull request #155 from YunoHost-Apps/testing

Testing
This commit is contained in:
Éric Gaspar 2023-08-13 12:34:52 +02:00 committed by GitHub
commit f83d457997
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 38 additions and 48 deletions

View file

@ -19,7 +19,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
Hubzilla is a social networking platform built with control of your privacy at center stage. Your online communications can be as public as you wish or as private as you require. Private conversations, private photos, private videos. Your media isn't hidden behind an obscure URL which can be guessed, it is protected by state-of-the-art cross-domain authentication.
**Shipped version:** 8.6.1~ynh1
**Shipped version:** 8.6.1~ynh2
## Screenshots

View file

@ -19,7 +19,7 @@ Si vous navez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po
Hubzilla est une plate-forme de réseau social conçue avec le contrôle de votre vie privée au centre de la scène. Vos communications en ligne peuvent être aussi publiques que vous le souhaitez ou aussi privées que vous le souhaitez. Conversations privées, photos privées, vidéos privées. Votre média n'est pas caché derrière une URL obscure qui peut être devinée, il est protégé par une authentification interdomaine de pointe.
**Version incluse :** 8.6.1~ynh1
**Version incluse :** 8.6.1~ynh2
## Captures décran

View file

@ -5,9 +5,9 @@ name = "Hubzilla"
description.en = "Decentralized publication platform and social network"
description.fr = "Plateforme de publication décentralisée et un réseau social"
version = "8.6.1~ynh1"
version = "8.6.1~ynh2"
maintainers = ["Anmol Sharma"]
maintainers = [""]
[upstream]
license = "MIT"

View file

@ -69,14 +69,13 @@ touch "$install_dir/php.log"
mkdir -p "$install_dir/store"
mkdir -p "$install_dir/cache/smarty3"
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
chmod -R 775 $install_dir/store $install_dir/cache
#=================================================
# PHP-FPM CONFIGURATION
# SYSTEM CONFIGURATION
#=================================================
ynh_script_progression --message="Configuring PHP-FPM..." --weight=1
ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
# Create a dedicated PHP-FPM config
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint
@ -84,6 +83,17 @@ ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint
# Create a dedicated NGINX config
ynh_add_nginx_config
# Use logrotate to manage application logfile(s)
ynh_use_logrotate "$install_dir/php.log"
# Create a dedicated Fail2Ban config
ynh_add_fail2ban_config --logpath="$install_dir/php.log" --failregex="^.*auth\.php.*failed login attempt.*from IP <HOST>.*$" --max_retry="5"
# Set up cron job
ynh_add_config --template="../conf/poller-cron" --destination="/etc/cron.d/$app"
chown root: "/etc/cron.d/$app"
chmod 644 "/etc/cron.d/$app"
#=================================================
# SPECIFIC SETUP
#=================================================
@ -109,34 +119,6 @@ ynh_store_file_checksum --file=$install_dir/.htconfig.php
chmod 600 "$install_dir/.htconfig.php"
chown $app:$app "$install_dir/.htconfig.php"
#=================================================
# SET CRON JOB
#=================================================
ynh_script_progression --message="Setuping cron job..." --weight=1
# Set up cron job
ynh_add_config --template="../conf/poller-cron" --destination="/etc/cron.d/$app"
chown root: "/etc/cron.d/$app"
chmod 644 "/etc/cron.d/$app"
#=================================================
# GENERIC FINALIZATION
#=================================================
# SETUP LOGROTATE
#=================================================
ynh_script_progression --message="Configuring log rotation..." --weight=1
# Use logrotate to manage application logfile(s)
ynh_use_logrotate "$install_dir/php.log"
#=================================================
# SETUP FAIL2BAN
#=================================================
ynh_script_progression --message="Configuring Fail2Ban..." --weight=1
# Create a dedicated Fail2Ban config
ynh_add_fail2ban_config --logpath="$install_dir/php.log" --failregex="^.*auth\.php.*failed login attempt.*from IP <HOST>.*$" --max_retry="5"
#=================================================
# END OF SCRIPT
#=================================================

View file

@ -22,9 +22,11 @@ elif [ $database = "postgresql" ]; then
fi
#=================================================
# REMOVE NGINX CONFIGURATION
# REMOVE SYSTEM CONFIGURATIONS
#=================================================
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1
# REMOVE SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Removing system configurations related to $app..." --weight=1
# Remove the dedicated NGINX config
ynh_remove_nginx_config

View file

@ -17,7 +17,6 @@ ynh_script_progression --message="Restoring the app main directory..." --weight=
ynh_restore_file --origin_path="$install_dir"
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
#=================================================
@ -38,28 +37,30 @@ elif [ $database = "postgresql" ]; then
fi
#=================================================
# RESTORE FAIL2BAN CONFIGURATION
# RESTORE SYSTEM CONFIGURATIONS
#=================================================
ynh_script_progression --message="Restoring the Fail2Ban configuration..." --weight=1
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
# 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/cron.d/$app"
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
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
ynh_restore_file --origin_path="/etc/cron.d/$app"
#=================================================
# GENERIC FINALIZATION
#=================================================
# RELOAD NGINX AND PHP-FPM
# RELOAD NGINX AND PHP-FPM OR THE APP SERVICE
#=================================================
ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." --weight=1
ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1
ynh_systemd_action --service_name=php$phpversion-fpm --action=reload
ynh_systemd_action --service_name=nginx --action=reload

View file

@ -29,6 +29,11 @@ upgrade_type=$(ynh_check_app_version_changed)
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
# If random_string doesn't exist, create it
if [ -z "$random_string" ]; then
random_string="$(ynh_string_random --length=48)"
ynh_app_setting_set --app=$app --key=random_string --value=$random_string
fi
# If fpm_footprint doesn't exist, create it
if [ -z "$fpm_footprint" ]; then