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

English translation and typo

This commit is contained in:
Maniack Crudelis 2019-01-19 12:13:45 +01:00
parent 92d36df30a
commit 4095ffde07
6 changed files with 76 additions and 52 deletions

View file

@ -42,7 +42,7 @@ fi
if [ $is_public -eq 0 ] if [ $is_public -eq 0 ]
then then
ynh_app_setting_delete $app unprotected_uris ynh_app_setting_delete $app unprotected_uris
# Rend la page d'actualisation accessible pour le script cron. # Set the action.php script public for the cron task
ynh_app_setting_set $app skipped_uris "/action.php" ynh_app_setting_set $app skipped_uris "/action.php"
else else
ynh_app_setting_delete $app skipped_uris ynh_app_setting_delete $app skipped_uris

View file

@ -30,26 +30,26 @@ db_pwd=$(ynh_app_setting_get "$app" mysqlpwd)
#================================================= #=================================================
# STANDARD BACKUP STEPS # STANDARD BACKUP STEPS
#================================================= #=================================================
# BACKUP OF THE MAIN DIR OF THE APP # BACKUP THE APP MAIN DIR
#================================================= #=================================================
CHECK_SIZE "$final_path" CHECK_SIZE "$final_path"
ynh_backup "$final_path" ynh_backup "$final_path"
#================================================= #=================================================
# BACKUP OF THE NGINX CONFIGURATION # BACKUP NGINX CONFIGURATION
#================================================= #=================================================
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
#================================================= #=================================================
# BACKUP OF THE PHP-FPM CONFIGURATION # BACKUP PHP-FPM CONFIGURATION
#================================================= #=================================================
ynh_backup "/etc/php5/fpm/pool.d/$app.conf" ynh_backup "/etc/php5/fpm/pool.d/$app.conf"
#================================================= #=================================================
# BACKUP OF THE SQL BDD # BACKUP THE MYSQL DATABASE
#================================================= #=================================================
ynh_mysql_dump_db "$db_name" > db.sql ynh_mysql_dump_db "$db_name" > db.sql
@ -65,7 +65,7 @@ ynh_backup "/etc/fail2ban/filter.d/$app.conf"
#================================================= #=================================================
# SPECIFIC BACKUP # SPECIFIC BACKUP
#================================================= #=================================================
# BACKUP OF THE CRON FILE # BACKUP THE CRON FILE
#================================================= #=================================================
ynh_backup "/etc/cron.d/$app" ynh_backup "/etc/cron.d/$app"

View file

@ -13,7 +13,8 @@ source /usr/share/yunohost/helpers
# MANAGE FAILURE OF THE SCRIPT # MANAGE FAILURE OF THE SCRIPT
#================================================= #=================================================
ynh_abort_if_errors # Active trap pour arrêter le script si une erreur est détectée. # Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#================================================= #=================================================
# RETRIEVE ARGUMENTS FROM THE MANIFEST # RETRIEVE ARGUMENTS FROM THE MANIFEST
@ -54,7 +55,7 @@ ynh_app_setting_set $app overwrite_phpfpm "1"
#================================================= #=================================================
# STANDARD MODIFICATIONS # STANDARD MODIFICATIONS
#================================================= #=================================================
# CREATE A SQL BDD # CREATE A MYSQL DATABASE
#================================================= #=================================================
db_name=$(ynh_sanitize_dbid $app) db_name=$(ynh_sanitize_dbid $app)
@ -66,25 +67,29 @@ ynh_mysql_setup_db $db_name $db_name
#================================================= #=================================================
ynh_app_setting_set $app final_path $final_path ynh_app_setting_set $app final_path $final_path
ynh_setup_source "$final_path" # Télécharge la source, décompresse et copie dans $final_path # Download, check integrity and uncompress the source from app.src
ynh_setup_source "$final_path"
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
# Create a dedicated nginx config
ynh_add_nginx_config ynh_add_nginx_config
#================================================= #=================================================
# CREATE DEDICATED USER # CREATE DEDICATED USER
#================================================= #=================================================
ynh_system_user_create $app # Créer un utilisateur système dédié à l'app # Create a dedicated system user
ynh_system_user_create $app
#================================================= #=================================================
# PHP-FPM CONFIGURATION # PHP-FPM CONFIGURATION
#================================================= #=================================================
ynh_add_fpm_config # Créer le fichier de configuration du pool php-fpm et le configure. # Create a dedicated php-fpm config
ynh_add_fpm_config
#================================================= #=================================================
# SPECIFIC SETUP # SPECIFIC SETUP
@ -95,8 +100,9 @@ ynh_add_fpm_config # Créer le fichier de configuration du pool php-fpm et le co
# Set right permissions for curl install # Set right permissions for curl install
chown -R $app: $final_path chown -R $app: $final_path
# Rend la page d'install publique pour curl # Set the app as temporarily public for curl call
ynh_app_setting_set $app unprotected_uris "/" #L'usage de unprotected_uris a la place de skipped_uris permet de passer le header d'auth http ynh_app_setting_set $app unprotected_uris "/"
# Regen SSOwat configuration
yunohost app ssowatconf yunohost app ssowatconf
# Reload Nginx # Reload Nginx
@ -129,9 +135,9 @@ cp ../conf/cron_leed /etc/cron.d/$app
# SECURING FILES AND DIRECTORIES # SECURING FILES AND DIRECTORIES
#================================================= #=================================================
# Les fichiers appartiennent à root # Set permissions to app files
chown -R root: $final_path chown -R root: $final_path
# $app doit avoir les droits d'écriture dans plugins, cache et updates # $app need write permissions in plugins, cache and updates
mkdir $final_path/cache mkdir $final_path/cache
chown -R $app $final_path/cache $final_path/plugins $final_path/updates chown -R $app $final_path/cache $final_path/plugins $final_path/updates
@ -139,6 +145,7 @@ chown -R $app $final_path/cache $final_path/plugins $final_path/updates
# SETUP FAIL2BAN # SETUP FAIL2BAN
#================================================= #=================================================
# Create a dedicated fail2ban config
ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="PHP message: Leed: wrong login for .* client: <HOST>" --max_retry=5 ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="PHP message: Leed: wrong login for .* client: <HOST>" --max_retry=5
#================================================= #=================================================
@ -149,9 +156,9 @@ ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failreg
ynh_app_setting_set $app is_public "$is_public" ynh_app_setting_set $app is_public "$is_public"
if [ $is_public -eq 0 ]; if [ $is_public -eq 0 ];
then then
# Retire l'autorisation d'accès de la page d'install. # Remove the public access
ynh_app_setting_delete $app unprotected_uris ynh_app_setting_delete $app unprotected_uris
# Rend la page d'actualisation accessible pour le script cron. # Set the action.php script public for the cron task
ynh_app_setting_set $app skipped_uris "/action.php" ynh_app_setting_set $app skipped_uris "/action.php"
fi fi
@ -168,7 +175,7 @@ ynh_systemd_action --action=reload --service_name=nginx
ynh_print_OFF ynh_print_OFF
message="Please take note of your password for this application: '$user_pwd'. message="Please take note of your password for this application: '$user_pwd'.
If you facing an issue or want to improve this app, please open a new issue in this project: https://github.com/YunoHost-Apps/leed_ynh" If you're facing an issue or want to improve this app, please open a new issue in this project: https://github.com/YunoHost-Apps/leed_ynh"
ynh_send_readme_to_admin --app_message="$message" --recipients="$admin" ynh_send_readme_to_admin --app_message="$message" --recipients="$admin"
ynh_print_ON ynh_print_ON

View file

@ -21,33 +21,38 @@ db_name=$(ynh_app_setting_get $app db_name)
#================================================= #=================================================
# STANDARD REMOVE # STANDARD REMOVE
#================================================= #=================================================
# REMOVE THE SQL BDD # REMOVE THE MYSQL DATABASE
#================================================= #=================================================
ynh_mysql_remove_db $db_name $db_name # Suppression de la base de donnée et de l'utilisateur associé. # Remove a database if it exists, along with the associated user
ynh_mysql_remove_db $db_name $db_name
#================================================= #=================================================
# REMOVE THE MAIN DIR OF THE APP # REMOVE APP MAIN DIR
#================================================= #=================================================
ynh_secure_remove "/var/www/$app" # Suppression du dossier de l'application # Remove the app directory securely
ynh_secure_remove "/var/www/$app"
#================================================= #=================================================
# REMOVE THE NGINX CONFIGURATION # REMOVE NGINX CONFIGURATION
#================================================= #=================================================
ynh_remove_nginx_config # Suppression de la configuration nginx # Remove the dedicated nginx config
ynh_remove_nginx_config
#================================================= #=================================================
# REMOVE THE PHP-FPM CONFIGURATION # REMOVE PHP-FPM CONFIGURATION
#================================================= #=================================================
ynh_remove_fpm_config # Suppression de la configuration du pool php-fpm # Remove the dedicated php-fpm config
ynh_remove_fpm_config
#================================================= #=================================================
# REMOVE FAIL2BAN CONFIGURATION # REMOVE FAIL2BAN CONFIGURATION
#================================================= #=================================================
# Remove the dedicated fail2ban config
ynh_remove_fail2ban_config ynh_remove_fail2ban_config
#================================================= #=================================================
@ -64,4 +69,5 @@ ynh_secure_remove "/etc/cron.d/$app"
# REMOVE DEDICATED USER # REMOVE DEDICATED USER
#================================================= #=================================================
# Delete dedicated system user
ynh_system_user_delete $app ynh_system_user_delete $app

View file

@ -46,19 +46,19 @@ ynh_maintenance_mode_ON
#================================================= #=================================================
# STANDARD RESTORE STEPS # STANDARD RESTORE STEPS
#================================================= #=================================================
# RESTORE OF THE NGINX CONFIGURATION # RESTORE THE NGINX CONFIGURATION
#================================================= #=================================================
ynh_restore_file "/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file "/etc/nginx/conf.d/$domain.d/$app.conf"
#================================================= #=================================================
# RESTORE OF THE MAIN DIR OF THE APP # RESTORE THE APP MAIN DIR
#================================================= #=================================================
ynh_restore_file "$final_path" ynh_restore_file "$final_path"
#================================================= #=================================================
# RESTORE OF THE SQL BDD # RESTORE THE MYSQL DATABASE
#================================================= #=================================================
db_pwd=$(ynh_app_setting_get $app mysqlpwd) db_pwd=$(ynh_app_setting_get $app mysqlpwd)
@ -69,10 +69,11 @@ ynh_mysql_connect_as $db_name $db_pwd $db_name < ./db.sql
# RECREATE THE DEDICATED USER # RECREATE THE DEDICATED USER
#================================================= #=================================================
ynh_system_user_create $app # Recreate the dedicated user, if not exist # Create the dedicated user (if not existing)
ynh_system_user_create $app
#================================================= #=================================================
# RESTORE OF THE PHP-FPM CONFIGURATION # RESTORE THE PHP-FPM CONFIGURATION
#================================================= #=================================================
ynh_restore_file "/etc/php5/fpm/pool.d/$app.conf" ynh_restore_file "/etc/php5/fpm/pool.d/$app.conf"
@ -88,7 +89,7 @@ ynh_systemd_action --action=restart --service_name=fail2ban
#================================================= #=================================================
# SPECIFIC RESTORE # SPECIFIC RESTORE
#================================================= #=================================================
# RESTORE OF THE CRON FILE # RESTORE THE CRON FILE
#================================================= #=================================================
ynh_restore_file "/etc/cron.d/$app" ynh_restore_file "/etc/cron.d/$app"
@ -118,6 +119,6 @@ ynh_maintenance_mode_OFF
# SEND A README FOR THE ADMIN # SEND A README FOR THE ADMIN
#================================================= #=================================================
message="If you facing an issue or want to improve this app, please open a new issue in this project: https://github.com/YunoHost-Apps/leed_ynh" message="If you're facing an issue or want to improve this app, please open a new issue in this project: https://github.com/YunoHost-Apps/leed_ynh"
ynh_send_readme_to_admin --app_message="$message" --recipients="$admin" ynh_send_readme_to_admin --app_message="$message" --recipients="$admin"

View file

@ -29,34 +29,38 @@ overwrite_phpfpm=$(ynh_app_setting_get $app overwrite_phpfpm)
# CHECK VERSION # CHECK VERSION
#================================================= #=================================================
# ynh_abort_if_up_to_date
upgrade_type=$(ynh_check_app_version_changed) upgrade_type=$(ynh_check_app_version_changed)
#================================================= #=================================================
# FIX OLD THINGS # ENSURE DOWNWARD COMPATIBILITY
#================================================= #=================================================
if [ -z "$final_path" ]; then # Si final_path n'est pas renseigné dans app setting # If final_path doesn't exist, create it
if [ -z "$final_path" ]; then
final_path=/var/www/$app final_path=/var/www/$app
ynh_app_setting_set $app final_path $final_path ynh_app_setting_set $app final_path $final_path
fi fi
if [ -z "$db_name" ]; then # Si db_name n'est pas renseigné dans app setting # If db_name doesn't exist, create it
if [ -z "$db_name" ]; then
db_name=$(ynh_make_valid_dbid $app) db_name=$(ynh_make_valid_dbid $app)
ynh_app_setting_set $app db_name $db_name ynh_app_setting_set $app db_name $db_name
fi fi
if [ -z "$is_public" ]; then # Raté avec get au lieu de set... # If is_public doesn't exist, create it
if [ -z "$is_public" ]; then
public_check=$(ynh_app_setting_get $app skipped_uris) public_check=$(ynh_app_setting_get $app skipped_uris)
if [ -z "$public_check" ]; then # Si skipped_uris est vide, c'était une install publique. # If skipped_uris is empty, that was a public installation.
if [ -z "$public_check" ]; then
is_public=1 is_public=1
else else
is_public=0 is_public=0
fi fi
ynh_app_setting_set $app is_public $is_public ynh_app_setting_set $app is_public $is_public
else else
# Fix is_public as a boolean
if [ "$is_public" = "Yes" ]; then if [ "$is_public" = "Yes" ]; then
ynh_app_setting_set $app is_public 1 # Fixe is_public en booléen ynh_app_setting_set $app is_public 1
is_public=1 is_public=1
elif [ "$is_public" = "No" ]; then elif [ "$is_public" = "No" ]; then
ynh_app_setting_set $app is_public 0 ynh_app_setting_set $app is_public 0
@ -93,7 +97,8 @@ ynh_abort_if_errors
# CHECK THE PATH # CHECK THE PATH
#================================================= #=================================================
path_url=$(ynh_normalize_url_path $path_url) # Vérifie et corrige la syntaxe du path. # Normalize the URL path syntax
path_url=$(ynh_normalize_url_path $path_url)
#================================================= #=================================================
# ACTIVATE MAINTENANCE MODE # ACTIVATE MAINTENANCE MODE
@ -109,7 +114,8 @@ ynh_maintenance_mode_ON
if [ "$upgrade_type" == "UPGRADE_APP" ] if [ "$upgrade_type" == "UPGRADE_APP" ]
then then
ynh_setup_source "$final_path" # Télécharge la source, décompresse et copie dans $final_path # Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source "$final_path"
fi fi
#================================================= #=================================================
@ -119,6 +125,7 @@ fi
# Overwrite the nginx configuration only if it's allowed # Overwrite the nginx configuration only if it's allowed
if [ $overwrite_nginx -eq 1 ] if [ $overwrite_nginx -eq 1 ]
then then
# Create a dedicated nginx config
ynh_add_nginx_config ynh_add_nginx_config
fi fi
@ -126,7 +133,8 @@ fi
# CREATE DEDICATED USER # CREATE DEDICATED USER
#================================================= #=================================================
ynh_system_user_create $app # Create the dedicated user, if not exist # Create a dedicated user (if not existing)
ynh_system_user_create $app
#================================================= #=================================================
# PHP-FPM CONFIGURATION # PHP-FPM CONFIGURATION
@ -135,7 +143,8 @@ ynh_system_user_create $app # Create the dedicated user, if not exist
# Overwrite the php-fpm configuration only if it's allowed # Overwrite the php-fpm configuration only if it's allowed
if [ $overwrite_phpfpm -eq 1 ] if [ $overwrite_phpfpm -eq 1 ]
then then
ynh_add_fpm_config # Créer le fichier de configuration du pool php-fpm et le configure. # Create a dedicated php-fpm config
ynh_add_fpm_config
fi fi
#================================================= #=================================================
@ -160,9 +169,9 @@ cp ../conf/cron_leed /etc/cron.d/$app
# SECURING FILES AND DIRECTORIES # SECURING FILES AND DIRECTORIES
#================================================= #=================================================
# Les fichiers appartiennent à root # Set permissions on app files
chown -R root: $final_path chown -R root: $final_path
# www-data doit avoir les droits d'écriture dans plugins, cache et updates # $app need write permissions in plugins, cache and updates
mkdir -p $final_path/cache mkdir -p $final_path/cache
chown -R $app $final_path/cache $final_path/plugins $final_path/updates chown -R $app $final_path/cache $final_path/plugins $final_path/updates
@ -172,13 +181,13 @@ chown -R $app $final_path/cache $final_path/plugins $final_path/updates
if [ "$upgrade_type" == "UPGRADE_APP" ] if [ "$upgrade_type" == "UPGRADE_APP" ]
then then
# Vide le cache de leed pour la mise à jour # Clear leed cache
ynh_secure_remove $final_path/cache/* ynh_secure_remove $final_path/cache/*
# Laisse un accès libre pour curl. # Set the app as temporarily public for curl call
ynh_app_setting_set $app unprotected_uris "/" ynh_app_setting_set $app unprotected_uris "/"
# Régénère la configuration de SSOwat # Regen SSOwat configuration
yunohost app ssowatconf yunohost app ssowatconf
# Lance la procédure de mise à jour de leed. # Start the upgrade procedure of leed.
ynh_local_curl "/" ynh_local_curl "/"
fi fi
@ -188,6 +197,7 @@ fi
# UPGRADE FAIL2BAN # UPGRADE FAIL2BAN
#================================================= #=================================================
# Create a dedicated fail2ban config
ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="PHP message: Leed: wrong login for .* client: <HOST>" --max_retry=5 ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="PHP message: Leed: wrong login for .* client: <HOST>" --max_retry=5
#================================================= #=================================================
@ -197,9 +207,9 @@ ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failreg
# Make app private if necessary # Make app private if necessary
if [ $is_public -eq 0 ]; if [ $is_public -eq 0 ];
then then
# Retire l'autorisation d'accès à leed # Remove the public access
ynh_app_setting_delete $app unprotected_uris ynh_app_setting_delete $app unprotected_uris
# Rend la page d'actualisation accessible pour le script cron. # Set the action.php script public for the cron task
ynh_app_setting_set $app skipped_uris "/action.php" ynh_app_setting_set $app skipped_uris "/action.php"
fi fi