1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/elabftw_ynh.git synced 2024-09-03 18:26:23 +02:00
This commit is contained in:
ericgaspar 2021-11-20 09:38:07 +01:00
parent 7275eaef02
commit 79ea4f02c0
6 changed files with 21 additions and 38 deletions

View file

@ -3,11 +3,6 @@ location / {
# Path to source # Path to source
alias __FINALPATH__/web/; alias __FINALPATH__/web/;
# Force usage of https
if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent;
}
index index.php; index index.php;
try_files $uri $uri/ __PATH__/__PATH__/index.php?$query_string; try_files $uri $uri/ __PATH__/__PATH__/index.php?$query_string;

View file

@ -13,7 +13,6 @@
"website": "https://www.elabftw.net", "website": "https://www.elabftw.net",
"demo": "https://demo.elabftw.net/login.php", "demo": "https://demo.elabftw.net/login.php",
"admindoc": "https://doc.elabftw.net/", "admindoc": "https://doc.elabftw.net/",
"userdoc": "https://yunohost.org/apps",
"code": "https://github.com/elabftw/elabftw" "code": "https://github.com/elabftw/elabftw"
}, },
"license": "AGPL-3.0-only", "license": "AGPL-3.0-only",
@ -22,7 +21,7 @@
"email": "" "email": ""
}, },
"requirements": { "requirements": {
"yunohost": ">= 4.2.4" "yunohost": ">= 4.3.0"
}, },
"multi_instance": true, "multi_instance": true,
"services": [ "services": [
@ -33,8 +32,7 @@
"arguments": { "arguments": {
"install": [{ "install": [{
"name": "domain", "name": "domain",
"type": "domain", "type": "domain"
"example": "example.com"
}, },
{ {
"name": "is_public", "name": "is_public",

View file

@ -10,7 +10,7 @@ nodejs_version=14
YNH_PHP_VERSION="8.0" YNH_PHP_VERSION="8.0"
# dependencies used by the app # 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" YNH_COMPOSER_VERSION="2.1.5"

View file

@ -107,7 +107,7 @@ ynh_add_nginx_config
ynh_script_progression --message="Configuring PHP-FPM..." --weight=2 ynh_script_progression --message="Configuring PHP-FPM..." --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
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#================================================= #=================================================

View file

@ -69,11 +69,10 @@ chown -R $app:www-data "$final_path"
#================================================= #=================================================
# RESTORE THE PHP-FPM CONFIGURATION # 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_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
ynh_add_fpm_config --package="$extra_php_dependencies"
#================================================= #=================================================
# RESTORE THE MYSQL DATABASE # RESTORE THE MYSQL DATABASE
#================================================= #=================================================

View file

@ -30,6 +30,20 @@ secret_key=$(ynh_app_setting_get --app=$app --key=secret_key)
upgrade_type=$(ynh_check_app_version_changed) 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 # ENSURE DOWNWARD COMPATIBILITY
#================================================= #=================================================
@ -54,20 +68,6 @@ if ynh_legacy_permissions_exists; then
ynh_app_setting_delete --app=$app --key=is_public ynh_app_setting_delete --app=$app --key=is_public
fi 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 # CREATE DEDICATED USER
#================================================= #=================================================
@ -87,7 +87,7 @@ then
ynh_script_progression --message="Upgrading source files..." --weight=7 ynh_script_progression --message="Upgrading source files..." --weight=7
# Download, check integrity, uncompress and patch the source from app.src # 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 fi
chmod 750 "$final_path" chmod 750 "$final_path"
@ -108,16 +108,7 @@ ynh_add_nginx_config
ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2 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
#=================================================
# 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"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION