mirror of
https://github.com/YunoHost-Apps/spip_ynh.git
synced 2024-09-03 20:25:59 +02:00
Correction qualité check_process
This commit is contained in:
parent
b5456e7632
commit
5215fb4ded
6 changed files with 68 additions and 31 deletions
|
@ -1,14 +1,12 @@
|
||||||
;; spip
|
;; Test complet sans multisite
|
||||||
auto_remove=1
|
auto_remove=1
|
||||||
# Commentaire ignoré
|
|
||||||
; Manifest
|
; Manifest
|
||||||
domain="$DOMAIN" (DOMAIN)
|
domain="domain.tld" (DOMAIN)
|
||||||
path="$PATH" (PATH)
|
path="/path" (PATH)
|
||||||
admin="$USER" (USER)
|
admin="john" (USER)
|
||||||
language="fr"
|
language="fr_FR"
|
||||||
is_public=1 (PUBLIC|public=1|private=0)
|
multisite="No"
|
||||||
password="$PASSWORD" (PASSWORD)
|
is_public="Yes" (PUBLIC|public=Yes|private=No)
|
||||||
port="666" (PORT)
|
|
||||||
; Checks
|
; Checks
|
||||||
pkg_linter=1
|
pkg_linter=1
|
||||||
setup_sub_dir=1
|
setup_sub_dir=1
|
||||||
|
@ -24,16 +22,41 @@
|
||||||
incorrect_path=1
|
incorrect_path=1
|
||||||
corrupt_source=0
|
corrupt_source=0
|
||||||
fail_download_source=0
|
fail_download_source=0
|
||||||
port_already_use=1 (XXXX)
|
port_already_use=0
|
||||||
|
final_path_already_use=0
|
||||||
|
;; Test avec multisite
|
||||||
|
auto_remove=1
|
||||||
|
; Manifest
|
||||||
|
domain="domain.tld" (DOMAIN)
|
||||||
|
path="/path" (PATH)
|
||||||
|
admin="john" (USER)
|
||||||
|
language="fr_FR"
|
||||||
|
multisite="Yes"
|
||||||
|
is_public="Yes" (PUBLIC|public=Yes|private=No)
|
||||||
|
; Checks
|
||||||
|
setup_sub_dir=1
|
||||||
|
setup_root=0
|
||||||
|
setup_nourl=0
|
||||||
|
setup_private=1
|
||||||
|
setup_public=1
|
||||||
|
upgrade=1
|
||||||
|
backup_restore=1
|
||||||
|
multi_instance=1
|
||||||
|
wrong_user=0
|
||||||
|
wrong_path=0
|
||||||
|
incorrect_path=0
|
||||||
|
corrupt_source=0
|
||||||
|
fail_download_source=0
|
||||||
|
port_already_use=0
|
||||||
final_path_already_use=0
|
final_path_already_use=0
|
||||||
;;; Levels
|
;;; Levels
|
||||||
Level 1=auto
|
Level 1=auto
|
||||||
Level 2=auto
|
Level 2=auto
|
||||||
Level 3=auto
|
Level 3=auto
|
||||||
Level 4=0
|
Level 4=1
|
||||||
Level 5=auto
|
Level 5=1
|
||||||
Level 6=auto
|
Level 6=auto
|
||||||
Level 7=auto
|
Level 7=auto
|
||||||
Level 8=0
|
Level 8=0
|
||||||
Level 9=0
|
Level 9=0
|
||||||
Level 10=0
|
Level 10=0
|
|
@ -75,8 +75,8 @@ GENERATE_DB () { # Créer une base de données et un utilisateur dédié au nom
|
||||||
CHECK_VAR "$db_pwd" "db_pwd empty"
|
CHECK_VAR "$db_pwd" "db_pwd empty"
|
||||||
# Utilise '$app' comme nom d'utilisateur et de base de donnée
|
# 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.
|
# Initialise la base de donnée et stocke le mot de passe mysql.
|
||||||
ynh_mysql_create_db $db_user $db_user $db_pwd
|
ynh_mysql_create_db "$db_user" "$db_user" $db_pwd
|
||||||
sudo yunohost app setting $app mysqlpwd -v $db_pwd
|
ynh_app_setting_set $app mysqlpwd $db_pwd
|
||||||
}
|
}
|
||||||
|
|
||||||
SETUP_SOURCE () { # Télécharge la source, décompresse et copie dans $final_path
|
SETUP_SOURCE () { # Télécharge la source, décompresse et copie dans $final_path
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Exit on command errors and treat unset variables as an error
|
||||||
|
set -eu
|
||||||
|
|
||||||
# The parameter $1 is the backup directory location dedicated to the app
|
# The parameter $1 is the backup directory location dedicated to the app
|
||||||
backup_dir=$1
|
backup_dir=$1
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,19 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
source .fonctions
|
source .fonctions # Charge les fonctions génériques habituellement utilisées dans le script
|
||||||
|
|
||||||
CLEAN_SETUP () {
|
CLEAN_SETUP () {
|
||||||
echo ""
|
# Nettoyage des résidus d'installation non pris en charge par le script remove.
|
||||||
|
# Clean hosts
|
||||||
|
sudo sed -i '/#SPIP/d' /etc/hosts
|
||||||
}
|
}
|
||||||
TRAP_ON
|
TRAP_ON # Active trap pour arrêter le script si une erreur est détectée.
|
||||||
|
|
||||||
domain=$YNH_APP_ARG_DOMAIN
|
domain=$YNH_APP_ARG_DOMAIN
|
||||||
path=$YNH_APP_ARG_PATH
|
path=$YNH_APP_ARG_PATH
|
||||||
admin=$YNH_APP_ARG_ADMIN
|
admin_wordpress=$YNH_APP_ARG_ADMIN
|
||||||
language=$YNH_APP_ARG_LANGUAGE
|
language=$YNH_APP_ARG_LANGUAGE
|
||||||
|
multisite=$YNH_APP_ARG_MULTISITE
|
||||||
is_public=$YNH_APP_ARG_IS_PUBLIC
|
is_public=$YNH_APP_ARG_IS_PUBLIC
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
@ -28,17 +31,18 @@ CHECK_DOMAINPATH
|
||||||
|
|
||||||
CHECK_FINALPATH
|
CHECK_FINALPATH
|
||||||
|
|
||||||
sudo yunohost app setting $app domain -v $domain
|
ynh_app_setting_set $app domain $domain
|
||||||
sudo yunohost app setting $app path -v $path
|
ynh_app_setting_set $app path $path
|
||||||
sudo yunohost app setting $app admin -v $admin
|
ynh_app_setting_set $app admin $admin_spip
|
||||||
sudo yunohost app setting $app is_public -v $is_public
|
ynh_app_setting_set $app is_public $is_public
|
||||||
sudo yunohost app setting $app language -v $language
|
ynh_app_setting_set $app language $language
|
||||||
|
ynh_app_setting_set $app multisite $multisite
|
||||||
|
|
||||||
GENERATE_DB $app # Créer une base de données et un utilisateur dédié au nom de l'app.
|
GENERATE_DB $app # Créer une base de données et un utilisateur dédié au nom de l'app.
|
||||||
|
|
||||||
# Crée le repertoire de destination et stocke son emplacement.
|
# Crée le repertoire de destination et stocke son emplacement.
|
||||||
sudo mkdir "$final_path"
|
sudo mkdir "$final_path"
|
||||||
sudo yunohost app setting $app final_path -v $final_path
|
ynh_app_setting_set $app final_path -v $final_path
|
||||||
|
|
||||||
SETUP_SOURCE "spip-3.1.zip"
|
SETUP_SOURCE "spip-3.1.zip"
|
||||||
|
|
||||||
|
@ -55,5 +59,13 @@ POOL_FPM
|
||||||
# Reload Nginx and regenerate SSOwat conf
|
# Reload Nginx and regenerate SSOwat conf
|
||||||
sudo service php5-fpm restart
|
sudo service php5-fpm restart
|
||||||
sudo service nginx reload
|
sudo service nginx reload
|
||||||
sudo yunohost app setting spip skipped_uris -v "/"
|
|
||||||
sudo yunohost app ssowatconf
|
if [ "$is_public" = "No" ];
|
||||||
|
then
|
||||||
|
# Retire l'accès public
|
||||||
|
ynh_app_setting_delete $app unprotected_uris
|
||||||
|
sudo yunohost app ssowatconf
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Nettoyer hosts
|
||||||
|
sudo sed -i '/#SPIP/d' /etc/hosts
|
|
@ -7,7 +7,7 @@ source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
# Récupère les infos de l'application.
|
# Récupère les infos de l'application.
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
domain=$(sudo yunohost app setting $app domain)
|
domain=$(ynh_app_setting_set $app domain)
|
||||||
|
|
||||||
REMOVE_BDD $app # Suppression de la base de donnée et de l'utilisateur associé.
|
REMOVE_BDD $app # Suppression de la base de donnée et de l'utilisateur associé.
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ CHECK_PATH # Vérifie et corrige la syntaxe du path.
|
||||||
# Check if admin is not null
|
# Check if admin is not null
|
||||||
if [[ "$admin" = "" || "$is_public" = "" || "$language" = "" ]]; then
|
if [[ "$admin" = "" || "$is_public" = "" || "$language" = "" ]]; then
|
||||||
echo "Unable to upgrade, please contact support"
|
echo "Unable to upgrade, please contact support"
|
||||||
exit 1
|
ynh_die
|
||||||
fi
|
fi
|
||||||
|
|
||||||
root_pwd=$(sudo cat /etc/yunohost/mysql)
|
root_pwd=$(sudo cat /etc/yunohost/mysql)
|
||||||
|
@ -33,10 +33,9 @@ db_name=$app
|
||||||
# Check if admin is not null
|
# Check if admin is not null
|
||||||
if [[ "$admin_spip" = "" || "$is_public" = "" || "$language" = "" ]]; then
|
if [[ "$admin_spip" = "" || "$is_public" = "" || "$language" = "" ]]; then
|
||||||
echo "Unable to upgrade, please contact support"
|
echo "Unable to upgrade, please contact support"
|
||||||
exit 1
|
ynh_die
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Modify Nginx configuration file and copy it to Nginx conf directory
|
# Modify Nginx configuration file and copy it to Nginx conf directory
|
||||||
sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf*
|
sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf*
|
||||||
sed -i "s@ALIASTOCHANGE@$final_path/@g" ../conf/nginx.conf*
|
sed -i "s@ALIASTOCHANGE@$final_path/@g" ../conf/nginx.conf*
|
||||||
|
|
Loading…
Add table
Reference in a new issue