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

Merge pull request #16 from YunoHost-Apps/testing

Testing
This commit is contained in:
Éric Gaspar 2021-09-10 09:30:21 +02:00 committed by GitHub
commit ee37175b15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 34 additions and 15 deletions

View file

@ -17,7 +17,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
A simple, fast and flexible wiki. A simple, fast and flexible wiki.
**Shipped version:** 2.0~ynh1 **Shipped version:** 2.0~ynh2
**Demo:** http://chuwiki.genezys.net/wiki/Bac%20%C3%A0%20sable **Demo:** http://chuwiki.genezys.net/wiki/Bac%20%C3%A0%20sable

View file

@ -13,7 +13,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour
Un wiki simple, rapide et flexible. Un wiki simple, rapide et flexible.
**Version incluse :** 2.0~ynh1 **Version incluse :** 2.0~ynh2
**Démo :** http://chuwiki.genezys.net/wiki/Bac%20%C3%A0%20sable **Démo :** http://chuwiki.genezys.net/wiki/Bac%20%C3%A0%20sable

View file

@ -10,7 +10,7 @@ UsePathInfo = false
; Vous devez posséder le droit d'écriture sur ce répertoire ; Vous devez posséder le droit d'écriture sur ce répertoire
; S'il n'existe pas, il sera créé par ChuWiki mais devrez dans ce cas ; S'il n'existe pas, il sera créé par ChuWiki mais devrez dans ce cas
; avoir les droits d'écriture dans le répertoire ; avoir les droits d'écriture dans le répertoire
PagePath = __CONTENT_PATH__/pages PagePath = __DATADIR__/pages
; Noms des scripts ; Noms des scripts
; Vous devrez peut-être ajouter ".php" si votre serveur ne gère pas MultiViews ; Vous devrez peut-être ajouter ".php" si votre serveur ne gère pas MultiViews

View file

@ -6,7 +6,7 @@
"en": "A simple, fast and flexible wiki.", "en": "A simple, fast and flexible wiki.",
"fr": "Un wiki simple, rapide et flexible." "fr": "Un wiki simple, rapide et flexible."
}, },
"version": "2.0~ynh1", "version": "2.0~ynh2",
"url": "http://chuwiki.genezys.net/", "url": "http://chuwiki.genezys.net/",
"upstream": { "upstream": {
"license": "AGPL-3.0-only", "license": "AGPL-3.0-only",

View file

@ -27,6 +27,7 @@ app=$YNH_APP_INSTANCE_NAME
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
domain=$(ynh_app_setting_get --app=$app --key=domain) domain=$(ynh_app_setting_get --app=$app --key=domain)
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
#================================================= #=================================================
# DECLARE DATA AND CONF FILES TO BACKUP # DECLARE DATA AND CONF FILES TO BACKUP
@ -43,7 +44,7 @@ ynh_backup --src_path="$final_path"
# BACKUP CONTENT DIR # BACKUP CONTENT DIR
#================================================= #=================================================
ynh_backup --src_path="/home/yunohost.app/$app" ynh_backup --src_path="$datadir" --is_big
#================================================= #=================================================
# BACKUP THE NGINX CONFIGURATION # BACKUP THE NGINX CONFIGURATION

View file

@ -89,14 +89,18 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=1
ynh_add_fpm_config ynh_add_fpm_config
#================================================= #=================================================
# CONTENT PATH CONFIGURATION # CREATE DATA DIRECTORY
#================================================= #=================================================
ynh_script_progression --message="Creating a data directory..." --weight=1
content_path=/home/yunohost.app/$app datadir=/home/yunohost.app/$app
mkdir -p $content_path ynh_app_setting_set --app=$app --key=datadir --value=$datadir
ynh_app_setting_set --app=$app --key=content_path --value=$content_path
chmod -R 750 $content_path mkdir -p $datadir
chown -R $app $content_path
chmod 750 "$datadir"
chmod -R o-rwx "$datadir"
chown -R $app:www-data "$datadir"
#================================================= #=================================================
# ADD A CONFIGURATION # ADD A CONFIGURATION

View file

@ -28,6 +28,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path) path_url=$(ynh_app_setting_get --app=$app --key=path)
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
#================================================= #=================================================
# CHECK IF THE APP CAN BE RESTORED # CHECK IF THE APP CAN BE RESTORED
@ -67,12 +68,18 @@ chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path" chown -R $app:www-data "$final_path"
#================================================= #=================================================
# RESTORE CONTENT DIR # RESTORE THE DATA DIRECTORY
#================================================= #=================================================
ynh_script_progression --message="Restoring the data directory..." --weight=1
ynh_restore_file --origin_path="/home/yunohost.app/$app" ynh_restore_file --origin_path="$datadir" --not_mandatory
chmod -R 750 "/home/yunohost.app/$app"
chown -R $app "/home/yunohost.app/$app" mkdir -p $datadir
# this will be treated as a security issue.
chmod 750 "$datadir"
chmod -R o-rwx "$datadir"
chown -R $app:www-data "$datadir"
#================================================= #=================================================
# RESTORE THE PHP-FPM CONFIGURATION # RESTORE THE PHP-FPM CONFIGURATION

View file

@ -19,6 +19,7 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain) domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path) path_url=$(ynh_app_setting_get --app=$app --key=path)
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
datadir=$(ynh_app_setting_get --app=$app --key=datadir)
#================================================= #=================================================
# CHECK VERSION # CHECK VERSION
@ -45,6 +46,12 @@ ynh_abort_if_errors
#================================================= #=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
# If datadir doesn't exist, create it
if [ -z "$datadir" ]; then
datadir=/home/yunohost.app/$app
ynh_app_setting_set --app=$app --key=datadir --value=$datadir
fi
# Cleaning legacy permissions # Cleaning legacy permissions
if ynh_legacy_permissions_exists; then if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all ynh_legacy_permissions_delete_all