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

Fix typos and translate French comments

This commit is contained in:
Jimmy Monin 2018-03-24 19:31:47 +01:00
parent 9292a65948
commit 8a8f06e0b2
4 changed files with 61 additions and 62 deletions

View file

@ -44,7 +44,7 @@ app=$YNH_APP_INSTANCE_NAME
ynh_print_OFF
if [ "${#password}" -lt 8 ] || [ "${#password}" -gt 30 ]
then
ynh_die "The password must be between 8 and 30 characters."
ynh_die "The password must have between 8 and 30 characters."
fi
ynh_print_ON
@ -79,7 +79,7 @@ ynh_app_setting_set $app useldap $useldap
# FIND AND OPEN A PORT
#=================================================
port=$(ynh_find_port 9001) # Cherche un port libre.
port=$(ynh_find_port 9001) # Look for an available port
ynh_app_setting_set $app port $port
#=================================================
@ -99,7 +99,7 @@ fi
ynh_install_nodejs $nodejs_version
#=================================================
# CREATE A SQL BDD
# CREATE A SQL DB
#=================================================
db_name=$(ynh_sanitize_dbid $app)
@ -111,7 +111,7 @@ ynh_mysql_setup_db $db_name $db_name
#=================================================
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
ynh_setup_source "$final_path" # Download, check integrity and uncompress the source from app.src
#=================================================
# NGINX CONFIGURATION
@ -128,7 +128,7 @@ ynh_add_nginx_config
# CREATE DEDICATED USER
#=================================================
ynh_system_user_create $app $final_path # Créer un utilisateur système dédié à l'app
ynh_system_user_create $app $final_path # Create a dedicated system user
#=================================================
# SPECIFIC SETUP
@ -136,21 +136,21 @@ ynh_system_user_create $app $final_path # Créer un utilisateur système dédié
# HANDLE LOG FILES AND LOGROTATE
#=================================================
# Créer le dossier de log
# Create log directory
mkdir -p /var/log/$app
touch /var/log/$app/etherpad.log
install_log=/var/log/$app/installation.log
touch $install_log
chown $app -R /var/log/$app
# Configuration de logrotate
# Setup logrotate
ynh_use_logrotate
#=================================================
# INSTALL ETHERPAD
#=================================================
# Installe les dépendances de etherpad et procède à l'intallation.
# Install dependencies and proceed with the installation
ynh_use_nodejs
"$final_path/bin/installDeps.sh" > $install_log 2>&1
npm install forever -g >> $install_log 2>&1
@ -168,11 +168,11 @@ ynh_replace_string "__ADMIN__" "$admin" "$final_path/credentials.json"
ynh_print_OFF; ynh_replace_special_string "__PASSWD__" "$password" "$final_path/credentials.json"; ynh_print_ON
if [ "$export" = "abiword" ]
then
abiword_path=`which abiword` # Récupère l'emplacement de l'exécutable de abiword
abiword_path=`which abiword` # Get abiword binary path
ynh_replace_string "\"abiword\" : null" "\"abiword\" : \"$abiword_path\"" "$final_path/settings.json" # Renseigne l'emplacement de abiword dans la config de etherpad
elif [ "$export" = "libreoffice" ]
then
soffice_path=`which soffice` # Récupère l'emplacement de l'exécutable de abiword
soffice_path=`which soffice` # Get soffice binary path
ynh_replace_string "\"soffice\" : null" "\"soffice\" : \"$soffice_path\"" "$final_path/settings.json" # Renseigne l'emplacement de abiword dans la config de etherpad
fi
ynh_replace_string "__LANGUAGE__" "$language" "$final_path/settings.json"
@ -183,16 +183,16 @@ then
ynh_replace_string "//noldap" "" "$final_path/settings.json"
fi
ynh_store_file_checksum "$final_path/settings.json" # Enregistre la somme de contrôle du fichier de config
ynh_store_file_checksum "$final_path/credentials.json" # Enregistre la somme de contrôle du fichier de config
ynh_store_file_checksum "$final_path/settings.json" # Store config file checksum
ynh_store_file_checksum "$final_path/credentials.json" # Store config file checksum
#=================================================
# SECURING FILES AND DIRECTORIES
#=================================================
# Les fichiers appartiennent à etherpad
# Set files ownership to etherpad
chown -R $app: $final_path
chmod 600 $final_path/credentials.json # Restreint l'accès à credentials.json
chmod 600 $final_path/credentials.json # Restrict access to credentials.json
#=================================================
# SETUP SYSTEMD
@ -206,7 +206,7 @@ ynh_add_systemd_config
# ENABLE SERVICE IN ADMIN PANEL
#=================================================
# Ajoute le service au monitoring de Yunohost.
# Add service to YunoHost monitoring panel
yunohost service add $app --log "/var/log/$app/etherpad.log"
#=================================================
@ -240,10 +240,10 @@ chown -R $app: $final_path/node_modules
if [ $mypads -eq 1 ]
then
# Ajoute un lien vers etherpad pour créer des pads anonymes depuis Mypads.
# Add a link to etherpad to allow anonymous pads creation from Mypads.
ynh_replace_string "^ *\"DESCRIPTION\": .*</ul>" "&<a href=../>Pads anonymes</a>" $final_path/node_modules/ep_mypads/static/l10n/fr.json
ynh_replace_string "^ *\"DESCRIPTION\": .*</ul>" "&<a href=../>Anonymous pads</a>" $final_path/node_modules/ep_mypads/static/l10n/en.json
# Et un lien vers l'admin etherpad depuis Mypads.
# And a link to etherpad admin from Mypads.
ynh_replace_string "^ *\"FOOTER\": .*2.0" "& | <a href='../admin'>Etherpad admin</a>" $final_path/node_modules/ep_mypads/static/l10n/en.json
ynh_replace_string "^ *\"FOOTER\": .*2.0" "& | <a href='../admin'>Etherpad admin</a>" $final_path/node_modules/ep_mypads/static/l10n/fr.json
@ -264,7 +264,7 @@ ynh_add_fail2ban_config "/var/log/nginx/$domain-access.log" "<HOST> .* \"POST /m
if [ $is_public -eq 1 ]; then
ynh_app_setting_set $app skipped_uris "/"
else
ynh_app_setting_set $app skipped_uris "/admin" # La page d'admin etherpad ne supporte pas le sso...
ynh_app_setting_set $app skipped_uris "/admin" # etherpad admin page doesn't support SSO...
fi
#=================================================
@ -277,7 +277,7 @@ systemctl reload nginx
# CHECK ETHERPAD STARTING
#=================================================
# Wait for etherpad fully started
# Wait for etherpad to be fully started
ynh_check_starting "You can access your Etherpad instance at" "/var/log/$app/etherpad.log" "120"
if [ $mypads -eq 1 ]
@ -285,7 +285,7 @@ then
ynh_replace_string "__LANGUAGE__" "$language" "$script_dir/../conf/lang_mypads.sql"
mysql -u $db_name -p$db_pwd $db_name < "$script_dir/../conf/lang_mypads.sql"
# Wait for etherpad fully started
# Wait for etherpad to be fully started
ynh_check_starting "You can access your Etherpad instance at" "/var/log/$app/etherpad.log" "120"
fi
@ -295,14 +295,14 @@ fi
if [ $mypads -eq 1 ]
then
Informations1="You can access to 2 different admin panels, for etherpad by accessing https://$domain${path_url%/}/admin and for mypads by https://$domain${path_url%/}/mypads/?/admin."
Informations1="You can access 2 different admin panels, for etherpad by accessing https://$domain${path_url%/}/admin and for mypads by accessing https://$domain${path_url%/}/mypads/?/admin."
Informations2="
Because there's no ldap support with mypads plugin, no user is created at the installation.
Because there's no LDAP support with mypads plugin, no user is created at the installation.
You have to connect to the admin panel to create the first users.
"
else
Informations1="You can access to the admin panel, by accessing https://$domain${path_url%/}/admin."
Informations1="You can access the admin panel by accessing https://$domain${path_url%/}/admin."
Informations2=""
fi
@ -315,7 +315,7 @@ Your credentials for the admin panel are:
- login : $admin
- password : $password
$Informations2
If you facing an issue or want to improve this app, please open a new issue in this project: https://github.com/YunoHost-Apps/etherpad_mypads_ynh"
If you are facing an issue or want to improve this app, please open a new issue in this project: https://github.com/YunoHost-Apps/etherpad_mypads_ynh"
ynh_send_readme_to_admin "$message" "$admin"
ynh_print_ON

View file

@ -32,7 +32,7 @@ ynh_remove_systemd_config
# DISABLE SERVICE IN ADMIN PANEL
#=================================================
if yunohost service status | grep -q $app # Test l'existence du service dans Yunohost
if yunohost service status | grep -q $app # Check if service is declared in YunoHost
then
ynh_print_info "Remove $app service" >&2
yunohost service remove $app
@ -54,28 +54,28 @@ fi
ynh_remove_nodejs
#=================================================
# REMOVE THE SQL BDD
# REMOVE THE SQL DB
#=================================================
ynh_mysql_remove_db $db_name $db_name # Suppression de la base de donnée et de l'utilisateur associé.
ynh_mysql_remove_db $db_name $db_name # Remove the database along with the associated user
#=================================================
# REMOVE THE MAIN DIR OF THE APP
#=================================================
ynh_secure_remove "/var/www/$app" # Suppression du dossier de l'application
ynh_secure_remove "/var/www/$app" # Remove the app directory securely
#=================================================
# REMOVE THE NGINX CONFIGURATION
#=================================================
ynh_remove_nginx_config # Suppression de la configuration nginx
ynh_remove_nginx_config # Remove the dedicated nginx config
#=================================================
# REMOVE THE LOGROTATE CONFIG
#=================================================
ynh_remove_logrotate # Suppression de la configuration de logrotate
ynh_remove_logrotate # Remove the app-specific logrotate config
#=================================================
# REMOVE FAIL2BAN CONFIGURATION
@ -84,7 +84,7 @@ ynh_remove_logrotate # Suppression de la configuration de logrotate
ynh_remove_fail2ban_config
#=================================================
# GENERIC FINALISATION
# GENERIC FINALIZATION
#=================================================
# REMOVE DEDICATED USER
#=================================================

View file

@ -66,7 +66,7 @@ ynh_restore_file "/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_restore_file "$final_path"
#=================================================
# RESTORE OF THE SQL BDD
# RESTORE THE SQL DB
#=================================================
db_pwd=$(ynh_app_setting_get $app mysqlpwd)
@ -74,10 +74,10 @@ ynh_mysql_setup_db $db_name $db_name $db_pwd
ynh_mysql_connect_as $db_name $db_pwd $db_name < ./db.sql
#=================================================
# RECREATE OF THE DEDICATED USER
# RECREATE THE DEDICATED USER
#=================================================
ynh_system_user_create $app $final_path # Recreate the dedicated user, if not exist
ynh_system_user_create $app $final_path # Recreate the dedicated user, if it doesn't exist
#=================================================
# SPECIFIC RESTORE
@ -92,7 +92,7 @@ touch $install_log
chown $app -R /var/log/$app
chown admin -R $install_log
# Restaure la configuration de logrotate
# Restore logrotate configuration
ynh_restore_file "/etc/logrotate.d/$app"
#=================================================
@ -151,7 +151,7 @@ systemctl reload nginx
# CHECK ETHERPAD STARTING
#=================================================
# Wait for etherpad fully started
# Wait for etherpad to be fully started
ynh_check_starting "You can access your Etherpad instance at" "/var/log/$app/etherpad.log" "120"
#=================================================
@ -160,7 +160,7 @@ ynh_check_starting "You can access your Etherpad instance at" "/var/log/$app/eth
if [ $mypads -eq 1 ]
then
Informations1="You can access to 2 different admin panels, for etherpad by accessing https://$domain${path_url%/}/admin and for mypads by https://$domain${path_url%/}/mypads/?/admin."
Informations1="You can access 2 different admin panels, for etherpad by accessing https://$domain${path_url%/}/admin and for mypads by accessing https://$domain${path_url%/}/mypads/?/admin."
Informations2="
Because there's no ldap support with mypads plugin, no user is created at the installation.
@ -180,7 +180,7 @@ Your credentials for the admin panel are:
- login : $admin
- password : $password
$Informations2
If you facing an issue or want to improve this app, please open a new issue in this project: https://github.com/YunoHost-Apps/etherpad_mypads_ynh"
If you are facing an issue or want to improve this app, please open a new issue in this project: https://github.com/YunoHost-Apps/etherpad_mypads_ynh"
ynh_send_readme_to_admin "$message" "$admin"
ynh_print_ON

View file

@ -33,7 +33,7 @@ useldap=$(ynh_app_setting_get $app useldap)
# CHECK VERSION
#=================================================
# Wait for etherpad fully started
# Wait for etherpad to be fully started
ynh_check_starting "You can access your Etherpad instance at" "/var/log/$app/etherpad.log" "120"
ynh_abort_if_up_to_date
@ -43,24 +43,24 @@ ynh_abort_if_up_to_date
#=================================================
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 # Convert is_public to boolean
is_public=1
elif [ "$is_public" = "No" ]; then
ynh_app_setting_set $app is_public 0
is_public=0
fi
if [ -z $db_name ]; then # Si db_name n'est pas renseigné dans app setting
if [ -z $db_name ]; then # If db_name setting doesn't exist
db_name=$(ynh_sanitize_dbid $app)
ynh_app_setting_set $app db_name $db_name
fi
if [ -z $abiword ]; then # Si abiword n'est pas renseigné dans app setting
if [ -z $abiword ]; then # If abiword setting doesn't exist
abiword=0
ynh_app_setting_set $app abiword $abiword
fi
if [ -n $abiword ]; then # Si abiword est renseigné dans app setting
if [ -n $abiword ]; then # If abiword setting exists
if [ $abiword -eq 1 ]; then
export=abiword
fi
@ -68,22 +68,22 @@ if [ -n $abiword ]; then # Si abiword est renseigné dans app setting
ynh_app_setting_delete $app abiword
fi
if [ -z $export ]; then # Si export n'est pas renseigné dans app setting
if [ -z $export ]; then # If export setting doesn't exist
export=none
ynh_app_setting_set $app export $export
fi
if [ -z $mypads ]; then # Si mypads n'est pas renseigné dans app setting
if [ -z $mypads ]; then # If mypads setting doesn't exist
mypads=1
ynh_app_setting_set $app mypads $mypads
fi
if [ -z $useldap ]; then # If useldap doesn't exist yet in settings.yml
if [ -z $useldap ]; then # If useldap setting doesn't exist
useldap=0
ynh_app_setting_set $app useldap $useldap
fi
if [ -z $path_url ]; then # Si path_url n'est pas renseigné dans app setting
if [ -z $path_url ]; then # If path_url setting doesn't exist
path_url="/"
ynh_app_setting_set $app path $path_url
fi
@ -95,7 +95,7 @@ fi
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
# Nettoyage des résidus d'installation non pris en charge par le script remove.
# Cleanup installatioNettoyage des résidus d'installation non pris en charge par le script remove.
ynh_clean_check_starting
# restore it if the upgrade fails
@ -116,7 +116,7 @@ systemctl stop $app
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_setup_source "$final_path" # Télécharge la source, décompresse et copie dans $final_path
ynh_setup_source "$final_path" # Download, check integrity and uncompress the source from app.src
#=================================================
# NGINX CONFIGURATION
@ -155,9 +155,8 @@ npm update
# CONFIGURE ETHERPAD
#=================================================
# Copie ou modification d'un fichier de config
ynh_backup_if_checksum_is_different "$final_path/settings.json" # Créé un backup du fichier de config si il a été modifié.
ynh_backup_if_checksum_is_different "$final_path/credentials.json" # Créé un backup du fichier de config si il a été modifié.
ynh_backup_if_checksum_is_different "$final_path/settings.json" # Verify the checksum and backup the file if it's different
ynh_backup_if_checksum_is_different "$final_path/credentials.json" # Verify the checksum and backup the file if it's different
cp ../conf/settings.json "$final_path/settings.json"
cp ../conf/credentials.json "$final_path/credentials.json"
ynh_replace_string "__PORT__" "$port" "$final_path/settings.json"
@ -169,15 +168,15 @@ ynh_replace_string "__ADMIN__" "$admin" "$final_path/credentials.json"
ynh_print_OFF; ynh_replace_special_string "__PASSWD__" "$password" "$final_path/credentials.json"; ynh_print_ON
if [ "$export" = "abiword" ]
then
abiword_path=`which abiword` # Récupère l'emplacement de l'exécutable de abiword
abiword_path=`which abiword` # Get abiword binary path
ynh_replace_string "\"abiword\" : null" "\"abiword\" : \"$abiword_path\"" "$final_path/settings.json" # Renseigne l'emplacement de abiword dans la config de etherpad
elif [ "$export" = "libreoffice" ]
then
soffice_path=`which soffice` # Récupère l'emplacement de l'exécutable de abiword
soffice_path=`which soffice` # Get soffice binary path
ynh_replace_string "\"soffice\" : null" "\"soffice\" : \"$soffice_path\"" "$final_path/settings.json" # Renseigne l'emplacement de abiword dans la config de etherpad
fi
if test -z $language; then
language=en # En cas d'upgrade d'une version ne gérant pas la langue, la langue est anglais par défaut
language=en # If upgrading from a version which doesn't support translations, set language to English by default
ynh_app_setting_set $app language $language
fi
ynh_replace_string "__LANGUAGE__" "$language" "$final_path/settings.json"
@ -188,22 +187,22 @@ then
ynh_replace_string "//noldap" "" "$final_path/settings.json"
fi
ynh_store_file_checksum "$final_path/settings.json" # Réenregistre la somme de contrôle du fichier de config
ynh_store_file_checksum "$final_path/credentials.json" # Réenregistre la somme de contrôle du fichier de config
ynh_store_file_checksum "$final_path/settings.json" # Recalculate and store the config file checksum into the app settings
ynh_store_file_checksum "$final_path/credentials.json" # Recalculate and store the config file checksum into the app settings
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_system_user_create $app $final_path # Create the dedicated user, if not exist
ynh_system_user_create $app $final_path # Create the dedicated user, if it doesn't exist
#=================================================
# SECURING FILES AND DIRECTORIES
#=================================================
# Les fichiers appartiennent à etherpad
# Set files ownership to etherpad
chown -R $app: $final_path
chmod 600 "$final_path/credentials.json" # Restreint l'accès à credentials.json
chmod 600 "$final_path/credentials.json" # Restrict access to credentials.json
chown $app -R /var/log/$app/etherpad.log
#=================================================
@ -244,7 +243,7 @@ fi
if [ $is_public -eq 1 ]; then
ynh_app_setting_set $app skipped_uris "/"
else
ynh_app_setting_set $app skipped_uris "/admin" # La page d'admin etherpad ne supporte pas le sso...
ynh_app_setting_set $app skipped_uris "/admin" # etherpad admin page doesn't support SSO...
fi
#=================================================
@ -257,5 +256,5 @@ systemctl reload nginx
# CHECK ETHERPAD STARTING
#=================================================
# Wait for etherpad fully started
# Wait for etherpad to be fully started
ynh_check_starting "You can access your Etherpad instance at" "/var/log/$app/etherpad.log" "120"