mirror of
https://github.com/YunoHost-Apps/elabftw_ynh.git
synced 2024-09-03 18:26:23 +02:00
Fix
This commit is contained in:
parent
7275eaef02
commit
79ea4f02c0
6 changed files with 21 additions and 38 deletions
|
@ -3,11 +3,6 @@ location / {
|
|||
# Path to source
|
||||
alias __FINALPATH__/web/;
|
||||
|
||||
# Force usage of https
|
||||
if ($scheme = http) {
|
||||
rewrite ^ https://$server_name$request_uri? permanent;
|
||||
}
|
||||
|
||||
index index.php;
|
||||
|
||||
try_files $uri $uri/ __PATH__/__PATH__/index.php?$query_string;
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
"website": "https://www.elabftw.net",
|
||||
"demo": "https://demo.elabftw.net/login.php",
|
||||
"admindoc": "https://doc.elabftw.net/",
|
||||
"userdoc": "https://yunohost.org/apps",
|
||||
"code": "https://github.com/elabftw/elabftw"
|
||||
},
|
||||
"license": "AGPL-3.0-only",
|
||||
|
@ -22,7 +21,7 @@
|
|||
"email": ""
|
||||
},
|
||||
"requirements": {
|
||||
"yunohost": ">= 4.2.4"
|
||||
"yunohost": ">= 4.3.0"
|
||||
},
|
||||
"multi_instance": true,
|
||||
"services": [
|
||||
|
@ -33,8 +32,7 @@
|
|||
"arguments": {
|
||||
"install": [{
|
||||
"name": "domain",
|
||||
"type": "domain",
|
||||
"example": "example.com"
|
||||
"type": "domain"
|
||||
},
|
||||
{
|
||||
"name": "is_public",
|
||||
|
|
|
@ -10,7 +10,7 @@ nodejs_version=14
|
|||
YNH_PHP_VERSION="8.0"
|
||||
|
||||
# dependencies used by the app
|
||||
extra_php_dependencies="php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-exif php${YNH_PHP_VERSION}-fileinfo php${YNH_PHP_VERSION}-gettext php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-fileinfo php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-ldap php${YNH_PHP_VERSION}-xml"
|
||||
pkg_dependencies="php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-exif php${YNH_PHP_VERSION}-fileinfo php${YNH_PHP_VERSION}-gettext php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-fileinfo php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-ldap php${YNH_PHP_VERSION}-xml"
|
||||
|
||||
YNH_COMPOSER_VERSION="2.1.5"
|
||||
|
||||
|
|
|
@ -107,7 +107,7 @@ ynh_add_nginx_config
|
|||
ynh_script_progression --message="Configuring PHP-FPM..." --weight=2
|
||||
|
||||
# Create a dedicated PHP-FPM config
|
||||
ynh_add_fpm_config --package="$extra_php_dependencies"
|
||||
ynh_add_fpm_config
|
||||
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -69,11 +69,10 @@ chown -R $app:www-data "$final_path"
|
|||
#=================================================
|
||||
# RESTORE THE PHP-FPM CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weight=1
|
||||
|
||||
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
|
||||
|
||||
ynh_add_fpm_config --package="$extra_php_dependencies"
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE MYSQL DATABASE
|
||||
#=================================================
|
||||
|
|
|
@ -30,6 +30,20 @@ secret_key=$(ynh_app_setting_get --app=$app --key=secret_key)
|
|||
|
||||
upgrade_type=$(ynh_check_app_version_changed)
|
||||
|
||||
#=================================================
|
||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||
#=================================================
|
||||
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=7
|
||||
|
||||
# Backup the current version of the app
|
||||
ynh_backup_before_upgrade
|
||||
ynh_clean_setup () {
|
||||
# restore it if the upgrade fails
|
||||
ynh_restore_upgradebackup
|
||||
}
|
||||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
||||
#=================================================
|
||||
# ENSURE DOWNWARD COMPATIBILITY
|
||||
#=================================================
|
||||
|
@ -54,20 +68,6 @@ if ynh_legacy_permissions_exists; then
|
|||
ynh_app_setting_delete --app=$app --key=is_public
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||
#=================================================
|
||||
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=7
|
||||
|
||||
# Backup the current version of the app
|
||||
ynh_backup_before_upgrade
|
||||
ynh_clean_setup () {
|
||||
# restore it if the upgrade fails
|
||||
ynh_restore_upgradebackup
|
||||
}
|
||||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
||||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
#=================================================
|
||||
|
@ -87,7 +87,7 @@ then
|
|||
ynh_script_progression --message="Upgrading source files..." --weight=7
|
||||
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source --dest_dir="$final_path"
|
||||
ynh_setup_source --dest_dir="$final_path" --keep="$final_path/config.php"
|
||||
fi
|
||||
|
||||
chmod 750 "$final_path"
|
||||
|
@ -108,16 +108,7 @@ ynh_add_nginx_config
|
|||
ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2
|
||||
|
||||
# Create a dedicated PHP-FPM config
|
||||
ynh_add_fpm_config --package="$extra_php_dependencies"
|
||||
|
||||
#=================================================
|
||||
# MODIFY A CONFIG FILE
|
||||
#=================================================
|
||||
|
||||
ynh_add_config --template="../conf/config.php" --destination="$final_path/config.php"
|
||||
|
||||
chmod 400 "$final_path/config.php"
|
||||
chown $app "$final_path/config.php"
|
||||
ynh_add_fpm_config
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
|
|
Loading…
Reference in a new issue