mirror of
https://github.com/YunoHost-Apps/lufi_ynh.git
synced 2024-09-03 19:36:28 +02:00
[trad] Translate comment french to english
This commit is contained in:
parent
3715ccf19b
commit
a244e5a72f
4 changed files with 69 additions and 119 deletions
|
@ -39,25 +39,25 @@ TRAP_OFF () { # Ignoring signal capture until TRAP_ON
|
||||||
trap '' ERR # Ignoring exit signals
|
trap '' ERR # Ignoring exit signals
|
||||||
}
|
}
|
||||||
|
|
||||||
CHECK_USER () { # Vérifie la validité de l'user admin
|
CHECK_USER () { # Check the validity of the user admin
|
||||||
# $1 = Variable de l'user admin.
|
# $1 = User admin variable
|
||||||
ynh_user_exists "$1" || (echo "Wrong admin" >&2 && false)
|
ynh_user_exists "$1" || (echo "Wrong admin" >&2 && false)
|
||||||
}
|
}
|
||||||
|
|
||||||
CHECK_PATH () { # Vérifie la présence du / en début de path. Et son absence à la fin.
|
CHECK_PATH () { # Checks / at the beginning of the path. And his absence at the end.
|
||||||
if [ "${path:0:1}" != "/" ]; then # Si le premier caractère n'est pas un /
|
if [ "${path:0:1}" != "/" ]; then # If the first character is not /
|
||||||
path="/$path" # Ajoute un / en début de path
|
path="/$path" # Add / at the beginning of path
|
||||||
fi
|
fi
|
||||||
if [ "${path:${#path}-1}" == "/" ] && [ ${#path} -gt 1 ]; then # Si le dernier caractère est un / et que ce n'est pas le seul caractère.
|
if [ "${path:${#path}-1}" == "/" ] && [ ${#path} -gt 1 ]; then # If the last character is a / and it is not the only character.
|
||||||
path="${path:0:${#path}-1}" # Supprime le dernier caractère
|
path="${path:0:${#path}-1}" # Delete last character
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
CHECK_DOMAINPATH () { # Vérifie la disponibilité du path et du domaine.
|
CHECK_DOMAINPATH () { # Checks the availability of the path and domain.
|
||||||
sudo yunohost app checkurl $domain$path -a $app
|
sudo yunohost app checkurl $domain$path -a $app
|
||||||
}
|
}
|
||||||
|
|
||||||
CHECK_FINALPATH () { # Vérifie que le dossier de destination n'est pas déjà utilisé.
|
CHECK_FINALPATH () { # Checks that the destination folder is not already in use.
|
||||||
final_path=/var/www/$app
|
final_path=/var/www/$app
|
||||||
if [ -e "$final_path" ]
|
if [ -e "$final_path" ]
|
||||||
then
|
then
|
||||||
|
@ -66,34 +66,22 @@ CHECK_FINALPATH () { # Vérifie que le dossier de destination n'est pas déjà u
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
GENERATE_DB () { # Créer une base de données et un utilisateur dédié au nom de l'app.
|
SETUP_SOURCE () { # Download source, decompress and copu into $final_path
|
||||||
# $1 = Nom de la base de donnée
|
|
||||||
db_user=$1
|
|
||||||
db_user=${db_user//-/_} # mariadb ne supporte pas les - dans les noms de base de données. Ils sont donc remplacé par des _
|
|
||||||
# Génère un mot de passe aléatoire.
|
|
||||||
# db_pwd=$(head -n20 /dev/urandom | tr -c -d 'A-Za-z0-9' | head -c20)
|
|
||||||
db_pwd=$(ynh_string_random)
|
|
||||||
CHECK_VAR "$db_pwd" "db_pwd empty"
|
|
||||||
# Utilise '$app' comme nom d'utilisateur et de base de donnée
|
|
||||||
# Initialise la base de donnée et stocke le mot de passe mysql.
|
|
||||||
ynh_mysql_create_db "$db_user" "$db_user" $db_pwd
|
|
||||||
ynh_app_setting_set $app mysqlpwd $db_pwd
|
|
||||||
}
|
|
||||||
|
|
||||||
SETUP_SOURCE () { # Télécharge la source, décompresse et copie dans $final_path
|
|
||||||
src=$(cat ../sources/source_md5 | awk -F' ' {'print $2'})
|
src=$(cat ../sources/source_md5 | awk -F' ' {'print $2'})
|
||||||
sudo wget -nv -i ../sources/source_url -O $src
|
sudo wget -nv -i ../sources/source_url -O $src
|
||||||
# Décompresse la source
|
# Checks the checksum of the downloaded source.
|
||||||
if [ "$(echo ${src##*.})" == "gz" ]; then
|
# md5sum -c ../sources/source_md5 --status || ynh_die "Corrupt source"
|
||||||
|
# Decompress source
|
||||||
|
if [ "$(echo ${src##*.})" == "tgz" ]; then
|
||||||
tar -x -f $src
|
tar -x -f $src
|
||||||
elif [ "$(echo ${src##*.})" == "zip" ]; then
|
elif [ "$(echo ${src##*.})" == "zip" ]; then
|
||||||
unzip -q $src
|
unzip -q $src
|
||||||
else
|
else
|
||||||
false # Format d'archive non pris en charge.
|
false # Unsupported archive format.
|
||||||
fi
|
fi
|
||||||
# Copie les fichiers sources
|
# Copy file source
|
||||||
sudo cp -a $(cat ../sources/source_dir)/. "$final_path"
|
sudo cp -a $(cat ../sources/source_dir)/. "$final_path"
|
||||||
# Copie les fichiers additionnels ou modifiés.
|
# Copy additional file and modified
|
||||||
if test -e "../sources/ajouts"; then
|
if test -e "../sources/ajouts"; then
|
||||||
sudo cp -a ../sources/ajouts/. "$final_path"
|
sudo cp -a ../sources/ajouts/. "$final_path"
|
||||||
fi
|
fi
|
||||||
|
@ -106,35 +94,22 @@ ADD_SYS_USER () { # Créer un utilisateur système dédié à l'app
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
POOL_FPM () { # Créer le fichier de configuration du pool php-fpm et le configure.
|
STORE_MD5_CONFIG () { # Saves the checksum of the config file
|
||||||
sed -i "s@__NAMETOCHANGE__@$app@g" ../conf/php-fpm.conf
|
# $1 = Name of the conf file for storage in settings.yml
|
||||||
sed -i "s@__FINALPATH__@$final_path@g" ../conf/php-fpm.conf
|
# $2 = Full name and path of the conf file.
|
||||||
sed -i "s@__USER__@$app@g" ../conf/php-fpm.conf
|
|
||||||
finalphpconf=/etc/php5/fpm/pool.d/$app.conf
|
|
||||||
sudo cp ../conf/php-fpm.conf $finalphpconf
|
|
||||||
sudo chown root: $finalphpconf
|
|
||||||
finalphpini=/etc/php5/fpm/conf.d/20-$app.ini
|
|
||||||
sudo cp ../conf/php-fpm.ini $finalphpini
|
|
||||||
sudo chown root: $finalphpini
|
|
||||||
sudo service php5-fpm reload
|
|
||||||
}
|
|
||||||
|
|
||||||
STORE_MD5_CONFIG () { # Enregistre la somme de contrôle du fichier de config
|
|
||||||
# $1 = Nom du fichier de conf pour le stockage dans settings.yml
|
|
||||||
# $2 = Nom complet et chemin du fichier de conf.
|
|
||||||
ynh_app_setting_set $app $1_file_md5 $(sudo md5sum "$2" | cut -d' ' -f1)
|
ynh_app_setting_set $app $1_file_md5 $(sudo md5sum "$2" | cut -d' ' -f1)
|
||||||
}
|
}
|
||||||
|
|
||||||
CHECK_MD5_CONFIG () { # Créé un backup du fichier de config si il a été modifié.
|
CHECK_MD5_CONFIG () { # Created a backup of the config file if it was changed.
|
||||||
# $1 = Nom du fichier de conf pour le stockage dans settings.yml
|
# $1 = Name of the conf file for storage in settings.yml
|
||||||
# $2 = Nom complet et chemin du fichier de conf.
|
# $2 = Full name and path of the conf file.onf.
|
||||||
if [ "$(ynh_app_setting_get $app $1_file_md5)" != $(sudo md5sum "$2" | cut -d' ' -f1) ]; then
|
if [ "$(ynh_app_setting_get $app $1_file_md5)" != $(sudo md5sum "$2" | cut -d' ' -f1) ]; then
|
||||||
sudo cp -a "$2" "$2.backup.$(date '+%d.%m.%y_%Hh%M,%Ss')" # Si le fichier de config a été modifié, créer un backup.
|
sudo cp -a "$2" "$2.backup.$(date '+%d.%m.%y_%Hh%M,%Ss')" # Si le fichier de config a été modifié, créer un backup.
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
FIND_PORT () { # Cherche un port libre.
|
FIND_PORT () { # Search free port
|
||||||
# $1 = Numéro de port pour débuter la recherche.
|
# $1 = Port number to start the search.
|
||||||
port=$1
|
port=$1
|
||||||
while ! sudo yunohost app checkport $port ; do
|
while ! sudo yunohost app checkport $port ; do
|
||||||
port=$((port+1))
|
port=$((port+1))
|
||||||
|
@ -145,7 +120,7 @@ FIND_PORT () { # Cherche un port libre.
|
||||||
|
|
||||||
### REMOVE SCRIPT
|
### REMOVE SCRIPT
|
||||||
|
|
||||||
REMOVE_NGINX_CONF () { # Suppression de la configuration nginx
|
REMOVE_NGINX_CONF () { # Delete nginx configuration
|
||||||
if [ -e "/etc/nginx/conf.d/$domain.d/$app.conf" ]; then # Delete nginx config
|
if [ -e "/etc/nginx/conf.d/$domain.d/$app.conf" ]; then # Delete nginx config
|
||||||
echo "Delete nginx config"
|
echo "Delete nginx config"
|
||||||
sudo rm "/etc/nginx/conf.d/$domain.d/$app.conf"
|
sudo rm "/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
|
@ -153,39 +128,27 @@ REMOVE_NGINX_CONF () { # Suppression de la configuration nginx
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
REMOVE_FPM_CONF () { # Suppression de la configuration du pool php-fpm
|
REMOVE_LOGROTATE_CONF () { # Delete logrotate configuration
|
||||||
if [ -e "/etc/php5/fpm/pool.d/$app.conf" ]; then # Delete fpm config
|
|
||||||
echo "Delete fpm config"
|
|
||||||
sudo rm "/etc/php5/fpm/pool.d/$app.conf"
|
|
||||||
fi
|
|
||||||
if [ -e "/etc/php5/fpm/conf.d/20-$app.ini" ]; then # Delete php config
|
|
||||||
echo "Delete php config"
|
|
||||||
sudo rm "/etc/php5/fpm/conf.d/20-$app.ini"
|
|
||||||
fi
|
|
||||||
sudo service php5-fpm reload
|
|
||||||
}
|
|
||||||
|
|
||||||
REMOVE_LOGROTATE_CONF () { # Suppression de la configuration de logrotate
|
|
||||||
if [ -e "/etc/logrotate.d/$app" ]; then
|
if [ -e "/etc/logrotate.d/$app" ]; then
|
||||||
echo "Delete logrotate config"
|
echo "Delete logrotate config"
|
||||||
sudo rm "/etc/logrotate.d/$app"
|
sudo rm "/etc/logrotate.d/$app"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
SECURE_REMOVE () { # Suppression de dossier avec vérification des variables
|
SECURE_REMOVE () { # Deleting a folder with variable verification
|
||||||
chaine="$1" # L'argument doit être donné entre quotes simple '', pour éviter d'interpréter les variables.
|
chaine="$1" # The argument must be given between simple quotes '', to avoid interpreting the variables.
|
||||||
no_var=0
|
no_var=0
|
||||||
while (echo "$chaine" | grep -q '\$') # Boucle tant qu'il y a des $ dans la chaine
|
while (echo "$chaine" | grep -q '\$') # Loop as long as there are $ in the string
|
||||||
do
|
do
|
||||||
no_var=1
|
no_var=1
|
||||||
global_var=$(echo "$chaine" | cut -d '$' -f 2) # Isole la première variable trouvée.
|
global_var=$(echo "$chaine" | cut -d '$' -f 2) # Isole the first variable found.
|
||||||
only_var=\$$(expr "$global_var" : '\([A-Za-z0-9_]*\)') # Isole complètement la variable en ajoutant le $ au début et en gardant uniquement le nom de la variable. Se débarrasse surtout du / et d'un éventuel chemin derrière.
|
only_var=\$$(expr "$global_var" : '\([A-Za-z0-9_]*\)') # Isole completely the variable by adding the $ at the beginning and keeping only the name of the variable. Mostly gets rid of / and a possible path behind.
|
||||||
real_var=$(eval "echo ${only_var}") # `eval "echo ${var}` permet d'interpréter une variable contenue dans une variable.
|
real_var=$(eval "echo ${only_var}") # `eval "echo ${var}` Allows to interpret a variable contained in a variable.
|
||||||
if test -z "$real_var" || [ "$real_var" = "/" ]; then
|
if test -z "$real_var" || [ "$real_var" = "/" ]; then
|
||||||
echo "Variable $only_var is empty, suppression of $chaine cancelled." >&2
|
echo "Variable $only_var is empty, suppression of $chaine cancelled." >&2
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
chaine=$(echo "$chaine" | sed "s@$only_var@$real_var@") # remplace la variable par sa valeur dans la chaine.
|
chaine=$(echo "$chaine" | sed "s@$only_var@$real_var@") # Replaces variable with its value in the string.
|
||||||
done
|
done
|
||||||
if [ "$no_var" -eq 1 ]
|
if [ "$no_var" -eq 1 ]
|
||||||
then
|
then
|
||||||
|
@ -200,19 +163,8 @@ SECURE_REMOVE () { # Suppression de dossier avec vérification des variable
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
REMOVE_BDD () { # Suppression de la base de donnée et de l'utilisateur associé.
|
REMOVE_SYS_USER () { # Delete user
|
||||||
# $1 = Nom de la base de donnée
|
if ynh_system_user_exists "$app" # Test user exist
|
||||||
# Utilise '$app' comme nom d'utilisateur et de base de donnée
|
|
||||||
db_user=$1
|
|
||||||
if mysqlshow -u root -p$(sudo cat $MYSQL_ROOT_PWD_FILE) | grep -q "^| $db_user"; then
|
|
||||||
echo "Delete db"
|
|
||||||
ynh_mysql_drop_db $db_user
|
|
||||||
ynh_mysql_drop_user $db_user
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
REMOVE_SYS_USER () { # Supprime l'utilisateur système dédié à l'app
|
|
||||||
if ynh_system_user_exists "$app" # Test l'existence de l'utilisateur
|
|
||||||
then
|
then
|
||||||
sudo userdel $app
|
sudo userdel $app
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -23,37 +23,38 @@ app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
script_dir=$PWD
|
script_dir=$PWD
|
||||||
|
|
||||||
# Vérifie que les variables ne sont pas vides.
|
# Check variable is not empty
|
||||||
CHECK_VAR "$app" "app name not set"
|
CHECK_VAR "$app" "app name not set"
|
||||||
CHECK_VAR "$script_dir" "script_dir not set"
|
CHECK_VAR "$script_dir" "script_dir not set"
|
||||||
|
|
||||||
CHECK_USER "$admin" # Vérifie la validité de l'user admin
|
CHECK_USER "$admin" # Check username
|
||||||
|
|
||||||
CHECK_PATH # Vérifie et corrige la syntaxe du path.
|
CHECK_PATH # Check and fix path syntax
|
||||||
CHECK_DOMAINPATH # Vérifie la disponibilité du path et du domaine.
|
CHECK_DOMAINPATH # Check and fix domain disponibility
|
||||||
|
|
||||||
CHECK_FINALPATH # Vérifie que le dossier de destination n'est pas déjà utilisé.
|
CHECK_FINALPATH # Check final path
|
||||||
|
|
||||||
# Modifie le domaine pour qu'il passe dans une regex
|
# Check domain with regex
|
||||||
domain_regex=$(echo "$domain" | sed 's@-@.@g')
|
domain_regex=$(echo "$domain" | sed 's@-@.@g')
|
||||||
CHECK_VAR "$domain_regex" "domain_regex empty"
|
CHECK_VAR "$domain_regex" "domain_regex empty"
|
||||||
|
|
||||||
FIND_PORT 8095 # Cherche un port libre.
|
FIND_PORT 8095 # Check port availability
|
||||||
|
|
||||||
# Enregistre les infos dans la config YunoHost
|
# Save app settings
|
||||||
ynh_app_setting_set $app admin $admin
|
ynh_app_setting_set $app admin $admin
|
||||||
ynh_app_setting_set $app domain $domain
|
ynh_app_setting_set $app domain $domain
|
||||||
ynh_app_setting_set $app is_public $is_public
|
ynh_app_setting_set $app is_public $is_public
|
||||||
ynh_app_setting_set $app port $port
|
ynh_app_setting_set $app port $port
|
||||||
|
|
||||||
|
|
||||||
# Créer le repertoire de destination et stocke son emplacement.
|
# Copy files to the right place
|
||||||
sudo mkdir "${final_path}"
|
sudo mkdir "${final_path}"
|
||||||
ynh_app_setting_set $app final_path $final_path
|
ynh_app_setting_set $app final_path $final_path
|
||||||
|
|
||||||
SETUP_SOURCE # Télécharge la source, décompresse et copie dans $final_path
|
# Get source
|
||||||
|
SETUP_SOURCE
|
||||||
|
|
||||||
# Copie le fichier de config nginx
|
# Copy it to Nginx conf directory
|
||||||
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf
|
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf
|
||||||
|
|
||||||
if [ "$is_public" = "Yes" ];
|
if [ "$is_public" = "Yes" ];
|
||||||
|
@ -66,39 +67,37 @@ ynh_package_update
|
||||||
ynh_package_install carton
|
ynh_package_install carton
|
||||||
ynh_package_install perlmagick
|
ynh_package_install perlmagick
|
||||||
|
|
||||||
## Copie et configuration du fichier de conf.
|
## Copy and fix variable into lufi config
|
||||||
sudo cp ../conf/lufi.conf.template "${final_path}/lufi.conf"
|
sudo cp ../conf/lufi.conf.template "${final_path}/lufi.conf"
|
||||||
sudo sed -i "s@__DOMAIN__@$domain@g" "${final_path}/lufi.conf"
|
sudo sed -i "s@__DOMAIN__@$domain@g" "${final_path}/lufi.conf"
|
||||||
sudo sed -i "s@__PATH__@$path@g" "${final_path}/lufi.conf"
|
sudo sed -i "s@__PATH__@$path@g" "${final_path}/lufi.conf"
|
||||||
sudo sed -i "s@__PORT__@$port@g" "${final_path}/lufi.conf"
|
sudo sed -i "s@__PORT__@$port@g" "${final_path}/lufi.conf"
|
||||||
|
|
||||||
#sudo sed -i "s@__ENCRYPT__@$always_encrypt@g" "${final_path}/lufi.conf"
|
|
||||||
secret=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d 'A-Za-z0-9' | sed -n 's/\(.\{24\}\).*/\1/p')
|
secret=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d 'A-Za-z0-9' | sed -n 's/\(.\{24\}\).*/\1/p')
|
||||||
CHECK_VAR "$secret" "secret empty"
|
CHECK_VAR "$secret" "secret empty"
|
||||||
sudo sed -i "s@__SECRET__@$secret@g" "${final_path}/lufi.conf"
|
sudo sed -i "s@__SECRET__@$secret@g" "${final_path}/lufi.conf"
|
||||||
STORE_MD5_CONFIG "lufi.conf" "${final_path}/lufi.conf" # Enregistre la somme de contrôle du fichier de config
|
STORE_MD5_CONFIG "lufi.conf" "${final_path}/lufi.conf" # Enregistre la somme de contrôle du fichier de config
|
||||||
|
|
||||||
# Mise en place du script systemd
|
# Install systemd script
|
||||||
sudo cp ../conf/lufi.service /etc/systemd/system/lufi.service
|
sudo cp ../conf/lufi.service /etc/systemd/system/lufi.service
|
||||||
sudo chown root: /etc/systemd/system/lufi.service
|
sudo chown root: /etc/systemd/system/lufi.service
|
||||||
sudo sed -i "s@__FINALPATH__@$final_path/@g" /etc/systemd/system/lufi.service
|
sudo sed -i "s@__FINALPATH__@$final_path/@g" /etc/systemd/system/lufi.service
|
||||||
## Démarrage auto du service
|
## Start service auto
|
||||||
sudo systemctl enable lufi.service
|
sudo systemctl enable lufi.service
|
||||||
|
|
||||||
## Mise en place des crons
|
## Install cron
|
||||||
sudo cp ../conf/cron_lufi /etc/cron.d/$app
|
sudo cp ../conf/cron_lufi /etc/cron.d/$app
|
||||||
sudo sed -i "s@__FINALPATH__@$final_path/@g" /etc/cron.d/$app
|
sudo sed -i "s@__FINALPATH__@$final_path/@g" /etc/cron.d/$app
|
||||||
sudo chmod +x $final_path/script/lufi
|
sudo chmod +x $final_path/script/lufi
|
||||||
|
|
||||||
# Configuration de logrotate
|
# Install logrotate
|
||||||
sed -i "s@__FINALPATH__@$final_path@g" ../conf/logrotate
|
sed -i "s@__FINALPATH__@$final_path@g" ../conf/logrotate
|
||||||
sudo cp ../conf/logrotate /etc/logrotate.d/$app
|
sudo cp ../conf/logrotate /etc/logrotate.d/$app
|
||||||
|
|
||||||
# Installation de lufi via carton
|
# Install lufi via carton
|
||||||
sudo mkdir -p /var/log/$app/
|
sudo mkdir -p /var/log/$app/
|
||||||
cd $final_path
|
cd $final_path
|
||||||
sudo carton install 2>&1 | sudo tee -a "/var/log/$app/setup_carton.log"
|
sudo carton install 2>&1 | sudo tee -a "/var/log/$app/setup_carton.log"
|
||||||
# sudo carton exec hypnotoad script/lufi
|
|
||||||
|
|
||||||
# Configure le path du dossier perl en fonction de l'architecture système
|
# Configure le path du dossier perl en fonction de l'architecture système
|
||||||
arch_dir=$(ls -1 $final_path/local/lib/perl5/ | grep linux-gnu)
|
arch_dir=$(ls -1 $final_path/local/lib/perl5/ | grep linux-gnu)
|
||||||
|
@ -117,9 +116,9 @@ sudo sed -i "s@__PORT__@$port@g" /etc/nginx/conf.d/$domain.d/$app.conf
|
||||||
# Make app public or private
|
# Make app public or private
|
||||||
ynh_app_setting_set $app skipped_uris "/"
|
ynh_app_setting_set $app skipped_uris "/"
|
||||||
if [ "$is_public" = "No" ];
|
if [ "$is_public" = "No" ];
|
||||||
then # Si l'app est privée, seul le visionnage des images reste public
|
then
|
||||||
if [ "$path" == "/" ]; then
|
if [ "$path" == "/" ]; then
|
||||||
path="" # Si path correspond à la racine, supprime le / pour éviter une erreur de la regex.
|
path=""
|
||||||
fi
|
fi
|
||||||
ynh_app_setting_set $app protected_regex "$domain_regex$path/stats$","$domain_regex$path/manifest.webapp$","$domain_regex$path/$","$domain_regex$path/d/.*$","$domain_regex$path/m/.*$"
|
ynh_app_setting_set $app protected_regex "$domain_regex$path/stats$","$domain_regex$path/manifest.webapp$","$domain_regex$path/$","$domain_regex$path/d/.*$","$domain_regex$path/m/.*$"
|
||||||
fi
|
fi
|
||||||
|
@ -129,7 +128,7 @@ sudo touch /var/log/$app/production.log
|
||||||
sudo chown www-data: /var/log/$app/production.log
|
sudo chown www-data: /var/log/$app/production.log
|
||||||
sudo ln -s /var/log/$app/production.log "$final_path/log/production.log"
|
sudo ln -s /var/log/$app/production.log "$final_path/log/production.log"
|
||||||
|
|
||||||
# Configure les droits d'accès au fichiers
|
# Configure owner
|
||||||
sudo chown -R www-data: $final_path
|
sudo chown -R www-data: $final_path
|
||||||
|
|
||||||
# Start lufi
|
# Start lufi
|
||||||
|
@ -145,10 +144,10 @@ sudo yunohost service add lufi -l $final_path/log/production.log
|
||||||
|
|
||||||
if [ "$is_public" = "No" ];
|
if [ "$is_public" = "No" ];
|
||||||
then
|
then
|
||||||
# Retire l'accès public
|
# Delete public access
|
||||||
ynh_app_setting_delete $app unprotected_uris
|
ynh_app_setting_delete $app unprotected_uris
|
||||||
sudo yunohost app ssowatconf
|
sudo yunohost app ssowatconf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Recharge la configuration Nginx
|
# Reload Nginx
|
||||||
sudo service nginx reload
|
sudo service nginx reload
|
|
@ -3,15 +3,15 @@
|
||||||
# Exit on command errors and treat unset variables as an error
|
# Exit on command errors and treat unset variables as an error
|
||||||
set -u
|
set -u
|
||||||
|
|
||||||
source .fonctions # Charge les fonctions génériques habituellement utilisées dans le script
|
source .fonctions # Loads the generic functions usually used in the script
|
||||||
source /usr/share/yunohost/helpers # Source app helpers
|
source /usr/share/yunohost/helpers # Source app helpers
|
||||||
|
|
||||||
# Récupère les infos de l'application.
|
# Get multi-instances specific variables
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
domain=$(ynh_app_setting_get $app domain)
|
domain=$(ynh_app_setting_get $app domain)
|
||||||
|
|
||||||
# Arrêt du service
|
# Stop lufi service
|
||||||
if [ -e "/etc/systemd/system/lufi.service" ]; then
|
if [ -e "/etc/systemd/system/lufi.service" ]; then
|
||||||
echo "Delete systemd script"
|
echo "Delete systemd script"
|
||||||
sudo service lufi stop
|
sudo service lufi stop
|
||||||
|
@ -19,31 +19,31 @@ if [ -e "/etc/systemd/system/lufi.service" ]; then
|
||||||
sudo systemctl disable lufi.service
|
sudo systemctl disable lufi.service
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Retire le service du monitoring de Yunohost.
|
# Remove monitoring service Yunohost.
|
||||||
if sudo yunohost service status | grep -q lufi # Test l'existence du service dans Yunohost
|
if sudo yunohost service status | grep -q lufi # Test l'existence du service dans Yunohost
|
||||||
then
|
then
|
||||||
echo "Remove lufi service"
|
echo "Remove lufi service"
|
||||||
sudo yunohost service remove lufi
|
sudo yunohost service remove lufi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
SECURE_REMOVE '/var/www/$app' # Suppression du dossier de l'application
|
SECURE_REMOVE '/var/www/$app' # Delete directory application
|
||||||
|
|
||||||
REMOVE_NGINX_CONF # Suppression de la configuration nginx
|
REMOVE_NGINX_CONF # Delete nginx configuration
|
||||||
|
|
||||||
# Retirer le cron
|
# Delete cron
|
||||||
if [ -e "/etc/cron.d/$app" ]; then
|
if [ -e "/etc/cron.d/$app" ]; then
|
||||||
echo "Delete cron"
|
echo "Delete cron"
|
||||||
sudo rm "/etc/cron.d/$app"
|
sudo rm "/etc/cron.d/$app"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
SECURE_REMOVE '/var/log/$app/' # Suppression des log
|
SECURE_REMOVE '/var/log/$app/' # Delete log
|
||||||
|
|
||||||
REMOVE_LOGROTATE_CONF # Suppression de la configuration de logrotate
|
REMOVE_LOGROTATE_CONF # Delete logrotate configuration
|
||||||
|
|
||||||
ynh_package_remove carton || echo "Carton already uninstalled"
|
ynh_package_remove carton || echo "Carton already uninstalled"
|
||||||
ynh_package_remove perlmagick || echo "perlmagick already uninstalled"
|
ynh_package_remove perlmagick || echo "perlmagick already uninstalled"
|
||||||
|
|
||||||
# Régénère la configuration de SSOwat
|
# Reload SSOwat configuration
|
||||||
sudo yunohost app ssowatconf
|
sudo yunohost app ssowatconf
|
||||||
|
|
||||||
echo -e "\e[0m" # Restore normal color
|
echo -e "\e[0m" # Restore normal color
|
||||||
|
|
|
@ -39,6 +39,5 @@ then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Reload Nginx
|
# Reload Nginx
|
||||||
sudo systemctl reload php5-fpm
|
|
||||||
sudo systemctl reload nginx
|
sudo systemctl reload nginx
|
||||||
sudo yunohost app ssowatconf
|
sudo yunohost app ssowatconf
|
Loading…
Reference in a new issue