mirror of
https://github.com/YunoHost-Apps/garradin_ynh.git
synced 2024-09-03 18:36:17 +02:00
upgrades
This commit is contained in:
parent
76d0ed0a80
commit
f5661c7c5b
8 changed files with 46 additions and 42 deletions
|
@ -1,6 +1,6 @@
|
||||||
# Garradin for YunoHost
|
# Garradin for YunoHost
|
||||||
|
|
||||||
[![Integration level](https://dash.yunohost.org/integration/garradin.svg)](https://dash.yunohost.org/appci/app/garradin) ![](https://ci-apps.yunohost.org/ci/badges/garradin.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/garradin.maintain.svg)
|
[![Integration level](https://dash.yunohost.org/integration/garradin.svg)](https://dash.yunohost.org/appci/app/garradin) ![](https://ci-apps.yunohost.org/ci/badges/garradin.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/garradin.maintain.svg)
|
||||||
[![Install Garradin with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=garradin)
|
[![Install Garradin with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=garradin)
|
||||||
|
|
||||||
*[Lire ce readme en français.](./README_fr.md)*
|
*[Lire ce readme en français.](./README_fr.md)*
|
||||||
|
|
10
README_fr.md
10
README_fr.md
|
@ -1,12 +1,12 @@
|
||||||
# Garradin pour YunoHost
|
# Garradin pour YunoHost
|
||||||
|
|
||||||
[![Niveau d'intégration](https://dash.yunohost.org/integration/garradin.svg)](https://dash.yunohost.org/appci/app/garradin) ![](https://ci-apps.yunohost.org/ci/badges/garradin.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/garradin.maintain.svg)
|
[![Niveau d'intégration](https://dash.yunohost.org/integration/garradin.svg)](https://dash.yunohost.org/appci/app/garradin) ![](https://ci-apps.yunohost.org/ci/badges/garradin.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/garradin.maintain.svg)
|
||||||
[![Installer Garradin avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=garradin)
|
[![Installer Garradin avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=garradin)
|
||||||
|
|
||||||
*[Read this readme in english.](./README.md)*
|
*[Read this readme in english.](./README.md)*
|
||||||
|
|
||||||
> *Ce package vous permet d'installer Garradin rapidement et simplement sur un serveur YunoHost.
|
> *Ce package vous permet d'installer Garradin rapidement et simplement sur un serveur YunoHost.
|
||||||
Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/#/install) pour apprendre comment l'installer.*
|
Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/install) pour apprendre comment l'installer.*
|
||||||
|
|
||||||
## Vue d'ensemble
|
## Vue d'ensemble
|
||||||
Garradin est un logiciel libre de gestion associative. il permet de gérer des membres.
|
Garradin est un logiciel libre de gestion associative. il permet de gérer des membres.
|
||||||
|
@ -37,8 +37,8 @@ Garradin est un logiciel libre de gestion associative. il permet de gérer des m
|
||||||
|
|
||||||
#### Architectures supportées
|
#### Architectures supportées
|
||||||
|
|
||||||
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/garradin%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/garradin/)
|
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/garradin.svg)](https://ci-apps.yunohost.org/ci/apps/garradin/)
|
||||||
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/garradin%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/garradin/)
|
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/garradin.svg)](https://ci-apps-arm.yunohost.org/ci/apps/garradin/)
|
||||||
|
|
||||||
## Limitations
|
## Limitations
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,4 @@
|
||||||
upgrade=1
|
upgrade=1
|
||||||
backup_restore=1
|
backup_restore=1
|
||||||
multi_instance=1
|
multi_instance=1
|
||||||
incorrect_path=1
|
|
||||||
port_already_use=0
|
|
||||||
change_url=1
|
change_url=1
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
"email": "win10@tutanota.com"
|
"email": "win10@tutanota.com"
|
||||||
},
|
},
|
||||||
"requirements": {
|
"requirements": {
|
||||||
"yunohost": ">=4.0"
|
"yunohost": ">=4.1.7"
|
||||||
},
|
},
|
||||||
"multi_instance": true,
|
"multi_instance": true,
|
||||||
"services": [
|
"services": [
|
||||||
|
|
|
@ -13,6 +13,4 @@
|
||||||
|
|
||||||
## Package_check results
|
## Package_check results
|
||||||
---
|
---
|
||||||
*If you have access to [App Continuous Integration for packagers](https://yunohost.org/#/packaging_apps_ci) you can provide a link to the package_check results like below, replacing '-NUM-' in this link by the PR number and USERNAME by your username on the ci-apps-dev. Or you provide a screenshot or a pastebin of the results*
|
* An automatic package_check will be launch at https://ci-apps-dev.yunohost.org/, when you add a specific comment to your Pull Request: "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!"*
|
||||||
|
|
||||||
[![Build Status](https://ci-apps-dev.yunohost.org/jenkins/job/garradin_ynh%20PR-NUM-%20(USERNAME)/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/garradin_ynh%20PR-NUM-%20(USERNAME)/)
|
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
|
|
||||||
source _common.sh
|
source _common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
ynh_abort_if_errors
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RETRIEVE ARGUMENTS
|
# RETRIEVE ARGUMENTS
|
||||||
|
@ -30,6 +29,23 @@ ynh_script_progression --message="Loading installation settings..." --weight=1
|
||||||
# Needed for helper "ynh_add_nginx_config"
|
# Needed for helper "ynh_add_nginx_config"
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=1
|
||||||
|
|
||||||
|
# Backup the current version of the app
|
||||||
|
ynh_backup_before_upgrade
|
||||||
|
ynh_clean_setup () {
|
||||||
|
# Remove the new domain config file, the remove script won't do it as it doesn't know yet its location.
|
||||||
|
ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
|
||||||
|
|
||||||
|
# Restore it if the upgrade fails
|
||||||
|
ynh_restore_upgradebackup
|
||||||
|
}
|
||||||
|
# Exit if an error occurs during the execution of the script
|
||||||
|
ynh_abort_if_errors
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK WHICH PARTS SHOULD BE CHANGED
|
# CHECK WHICH PARTS SHOULD BE CHANGED
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -23,6 +23,7 @@ ynh_abort_if_errors
|
||||||
domain=$YNH_APP_ARG_DOMAIN
|
domain=$YNH_APP_ARG_DOMAIN
|
||||||
path_url=$YNH_APP_ARG_PATH
|
path_url=$YNH_APP_ARG_PATH
|
||||||
is_public=$YNH_APP_ARG_IS_PUBLIC
|
is_public=$YNH_APP_ARG_IS_PUBLIC
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -84,11 +85,9 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||||
# Files owned by user app
|
# Files owned by user app
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
chown $app:$app $final_path -R
|
chown -R $app:$app $final_path
|
||||||
chmod 755 $final_path -R
|
chmod 755 $final_path
|
||||||
|
|
||||||
# Remove the public access
|
|
||||||
ynh_app_setting_delete --app=$app --key=skipped_uris
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SSOWAT
|
# SETUP SSOWAT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -97,12 +96,8 @@ ynh_script_progression --message="Configuring permissions..." --weight=8
|
||||||
# Make app public if necessary
|
# Make app public if necessary
|
||||||
if [ $is_public -eq 1 ]
|
if [ $is_public -eq 1 ]
|
||||||
then
|
then
|
||||||
# Everyone can access the app.
|
ynh_permission_update --permission="main" --add="visitors"
|
||||||
# The "main" permission is automatically created before the install script.
|
|
||||||
ynh_permission_update --permission "main" --add "visitors"
|
|
||||||
fi
|
fi
|
||||||
# Only the users can access to the panel of the app
|
|
||||||
# ynh_permission_update --permission="main" --add "all_users"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# MODIFY A CONFIG FILE
|
# MODIFY A CONFIG FILE
|
||||||
|
@ -130,4 +125,4 @@ ynh_systemd_action --service_name=nginx --action=reload
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Installation of Garradin completed" --last
|
ynh_script_progression --message="Installation of Garradin completed" --last
|
||||||
|
|
|
@ -31,7 +31,6 @@ else
|
||||||
upgrade_type=$(ynh_check_app_version_changed)
|
upgrade_type=$(ynh_check_app_version_changed)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# ENSURE DOWNWARD COMPATIBILITY
|
# ENSURE DOWNWARD COMPATIBILITY
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -43,6 +42,13 @@ if [ -z "$final_path" ]; then
|
||||||
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Cleaning legacy permissions
|
||||||
|
if ynh_legacy_permissions_exists; then
|
||||||
|
ynh_legacy_permissions_delete_all
|
||||||
|
|
||||||
|
ynh_app_setting_delete --app=$app --key=is_public
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# Backup Data
|
# Backup Data
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -113,11 +119,12 @@ then
|
||||||
else
|
else
|
||||||
ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url/';" --target_file="$final_path/config.local.php"
|
ynh_replace_string --match_string="//const WWW_URI = '/asso/';" --replace_string="const WWW_URI = '$path_url/';" --target_file="$final_path/config.local.php"
|
||||||
fi
|
fi
|
||||||
chown $app:$app $final_path -R
|
chown -R $app:$app $final_path
|
||||||
chmod 755 $final_path -R
|
chmod 755 $final_path
|
||||||
# Create the visitors permission if needed
|
# Create the visitors permission if needed
|
||||||
if ! ynh_permission_exists --permission "visitors"; then
|
if [ $is_public -eq 1 ]
|
||||||
ynh_permission_create --permission "visitors"
|
then
|
||||||
|
ynh_permission_update --permission="main" --add="visitors"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ynh_systemd_action --service_name=nginx --action=reload
|
ynh_systemd_action --service_name=nginx --action=reload
|
||||||
|
@ -164,6 +171,7 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2
|
||||||
# Create a dedicated PHP-FPM config
|
# Create a dedicated PHP-FPM config
|
||||||
ynh_add_fpm_config --package="$extra_php_dependencies"
|
ynh_add_fpm_config --package="$extra_php_dependencies"
|
||||||
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||||
|
|
||||||
#=======================================================
|
#=======================================================
|
||||||
# backup bdd, squelettes directory and config.local.php
|
# backup bdd, squelettes directory and config.local.php
|
||||||
#=======================================================
|
#=======================================================
|
||||||
|
@ -198,18 +206,8 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Set permissions on app files
|
# Set permissions on app files
|
||||||
chown $app:$app $final_path -R
|
chown -R $app:$app $final_path
|
||||||
chmod 755 $final_path -R
|
chmod 755 $final_path
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SETUP SSOWAT
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Upgrading permissions configuration..." --weight=2
|
|
||||||
|
|
||||||
# Create the visitors permission if needed
|
|
||||||
if ! ynh_permission_exists --permission "visitors"; then
|
|
||||||
ynh_permission_create --permission "visitors"
|
|
||||||
fi
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
|
@ -221,7 +219,6 @@ ynh_systemd_action --service_name=nginx --action=reload
|
||||||
#=================================================
|
#=================================================
|
||||||
# Finalise Upgrade
|
# Finalise Upgrade
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Finalise upgrade" --weight=1
|
ynh_script_progression --message="Finalise upgrade" --weight=1
|
||||||
|
|
||||||
ynh_local_curl "/admin/index.php"
|
ynh_local_curl "/admin/index.php"
|
||||||
|
@ -230,4 +227,4 @@ ynh_local_curl "/admin/index.php"
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Upgrade of Garradin completed" --last
|
ynh_script_progression --message="Upgrade of Garradin completed" --last
|
||||||
|
|
Loading…
Reference in a new issue