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

Merge pull request #15 from YunoHost-Apps/testing

Upgrade to PHP7.3 (also helps for Buster support)
I go YOLO... sorry @zamentur. If you don't agree, let me know, I won't do it next time
This commit is contained in:
yalh76 2020-04-22 00:43:37 +02:00 committed by GitHub
commit b5cb76ba7f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 163 additions and 119 deletions

View file

@ -1,4 +1,6 @@
SOURCE_URL=https://framagit.org/ljf/framaforms/-/archive/19ef353c7d88813d9c404e965b3f86bc8905d06d/framaforms-19ef353c7d88813d9c404e965b3f86bc8905d06d.tar.gz SOURCE_URL=https://framagit.org/framasoft/framaforms/-/archive/v0.1/framaforms-v0.1.tar.gz
SOURCE_SUM=7df7a449a36bb60059b5642cfd86b44422e0bd8bdc182ba71621d90c74bc0967 SOURCE_SUM=7320414b95992f33a8ea1ea8504ed95fb06a637e03118fadf8ed20a121f09f76
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FILENAME=framaforms-1.0.0+190618.tar.gz SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true
SOURCE_FILENAME=

View file

@ -58,7 +58,7 @@ location __PATH__/ {
location ~ '[^/]\.php$|^/update.php' { location ~ '[^/]\.php$|^/update.php' {
fastcgi_split_path_info ^(.+?\.php)(/.*)$; fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_pass unix:/var/run/php/php7.2-fpm-__NAME__.sock; fastcgi_pass unix:/var/run/php/php7.3-fpm-__NAME__.sock;
fastcgi_index index.php; fastcgi_index index.php;
include fastcgi_params; include fastcgi_params;

View file

@ -33,7 +33,7 @@ group = __USER__
; (IPv6 and IPv4-mapped) on a specific port; ; (IPv6 and IPv4-mapped) on a specific port;
; '/path/to/unix/socket' - to listen on a unix socket. ; '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory. ; Note: This value is mandatory.
listen = /var/run/php/php7.2-fpm-__NAMETOCHANGE__.sock listen = /var/run/php/php7.3-fpm-__NAMETOCHANGE__.sock
; Set listen(2) backlog. ; Set listen(2) backlog.
; Default Value: 511 (-1 on FreeBSD and OpenBSD) ; Default Value: 511 (-1 on FreeBSD and OpenBSD)

View file

@ -5,7 +5,7 @@
"description": { "description": {
"en": "Framaforms helps you create online webforms and surveys" "en": "Framaforms helps you create online webforms and surveys"
}, },
"version": "1.0.0+190618-ynh6", "version": "1.0.0+191218-ynh1",
"url": "https://framagit.org/framasoft/framaforms", "url": "https://framagit.org/framasoft/framaforms",
"license": "GPL-2.0-only", "license": "GPL-2.0-only",
"requirements": { "requirements": {

Binary file not shown.

View file

@ -6,7 +6,7 @@
# dependencies used by the app # dependencies used by the app
pkg_dependencies="postgresql curl libzip-dev" pkg_dependencies="postgresql curl libzip-dev"
extra_pkg_dependencies="php7.2-fpm php7.2-cli php7.2-gd php7.2-mysql php7.2-xml php7.2-ldap php7.2-mbstring php7.2-uploadprogress php7.2-pgsql" extra_pkg_dependencies="php7.3-fpm php7.3-cli php7.3-gd php7.3-mysql php7.3-xml php7.3-ldap php7.3-mbstring php7.3-pgsql"
#================================================= #=================================================
# PERSONAL HELPERS # PERSONAL HELPERS

View file

@ -20,7 +20,7 @@ ynh_abort_if_errors
#================================================= #=================================================
# LOAD SETTINGS # LOAD SETTINGS
#================================================= #=================================================
ynh_script_progression --message="Loading installation settings..." --time --weight=1 ynh_script_progression --message="Loading installation settings..." --weight=1
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
@ -33,31 +33,31 @@ db_name=$(ynh_app_setting_get --app=$app --key=db_name)
#================================================= #=================================================
# BACKUP THE APP MAIN DIR # BACKUP THE APP MAIN DIR
#================================================= #=================================================
ynh_script_progression --message="Backing up the main app directory..." --time --weight=1 ynh_script_progression --message="Backing up the main app directory..." --weight=1
ynh_backup --src_path="$final_path" ynh_backup --src_path="$final_path"
ynh_script_progression --message="Backing up the answer files..." --time --weight=1 ynh_script_progression --message="Backing up the answer files..." --weight=1
ynh_backup --src_path="/home/yunohost.app/$app/data" --is_big=1 ynh_backup --src_path="/home/yunohost.app/$app/data" --is_big=1
#================================================= #=================================================
# BACKUP THE NGINX CONFIGURATION # BACKUP THE NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Backing up nginx web server configuration..." --time --weight=1 ynh_script_progression --message="Backing up nginx web server configuration..." --weight=1
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#================================================= #=================================================
# BACKUP THE PHP-FPM CONFIGURATION # BACKUP THE PHP-FPM CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Backing up php-fpm configuration..." --time --weight=1 ynh_script_progression --message="Backing up php-fpm configuration..." --weight=1
ynh_backup --src_path="/etc/php/7.2/fpm/pool.d/$app.conf" ynh_backup --src_path="/etc/php/7.3/fpm/pool.d/$app.conf"
#================================================= #=================================================
# BACKUP THE MYSQL DATABASE # BACKUP THE MYSQL DATABASE
#================================================= #=================================================
ynh_script_progression --message="Backing up the PostgreSQL database..." --time --weight=1 ynh_script_progression --message="Backing up the PostgreSQL database..." --weight=1
ynh_psql_dump_db --database="$db_name" > db.sql ynh_psql_dump_db --database="$db_name" > db.sql
@ -69,4 +69,4 @@ ynh_psql_dump_db --database="$db_name" > db.sql
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." --time --last ynh_script_progression --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." --last

View file

@ -24,13 +24,30 @@ app=$YNH_APP_INSTANCE_NAME
#================================================= #=================================================
# LOAD SETTINGS # LOAD SETTINGS
#================================================= #=================================================
ynh_script_progression --message="Loading installation settings..." --time --weight=1 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)
# Add settings here as needed by your application # Add settings here as needed by your application
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
ynh_print_info --message="Backing up the app before changing its url (may take a while)..."
# 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
#================================================= #=================================================
@ -52,7 +69,7 @@ fi
#================================================= #=================================================
# MODIFY URL IN NGINX CONF # MODIFY URL IN NGINX CONF
#================================================= #=================================================
ynh_script_progression --message="Updating nginx web server configuration..." --time --weight=1 ynh_script_progression --message="Updating nginx web server configuration..." --weight=1
nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf
@ -83,24 +100,22 @@ fi
#================================================= #=================================================
# UPDATE DRUSH ALIAS # UPDATE DRUSH ALIAS
#================================================= #=================================================
ynh_print_info --message="Updating Drush alias..." ynh_script_progression --message="Updating Drush alias..." --weight=1
cp -f "../conf/yoursite.aliases.drushrc.php" "$final_path/.drush/$app.aliases.drushrc.php" drush_aliasconfig="$final_path/.drush/$app.aliases.drushrc.php"
cp -f "../conf/yoursite.aliases.drushrc.php" "$drush_aliasconfig"
ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="$final_path/.drush/$app.aliases.drushrc.php" ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="$drush_aliasconfig"
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/.drush/$app.aliases.drushrc.php" ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$drush_aliasconfig"
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$new_domain" --target_file="$final_path/.drush/$app.aliases.drushrc.php" ynh_replace_string --match_string="__DOMAIN__" --replace_string="$new_domain" --target_file="$drush_aliasconfig"
ynh_replace_string --match_string="__PATH_URL__" --replace_string="$new_path" --target_file="$final_path/.drush/$app.aliases.drushrc.php" ynh_replace_string --match_string="__PATH_URL__" --replace_string="$new_path" --target_file="$drush_aliasconfig"
#=================================================
#================================================= #=================================================
# GENERIC FINALISATION # GENERIC FINALISATION
#=================================================
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================
ynh_script_progression --message="Reloading nginx web server..." --time --weight=1 ynh_script_progression --message="Reloading nginx web server..." --weight=1
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload
@ -108,4 +123,4 @@ ynh_systemd_action --service_name=nginx --action=reload
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Change of URL completed for $app" --time --last ynh_script_progression --message="Change of URL completed for $app" --last

View file

@ -7,11 +7,11 @@
#================================================= #=================================================
source _common.sh source _common.sh
source /usr/share/yunohost/helpers
source ynh_add_extra_apt_repos__3 source ynh_add_extra_apt_repos__3
source ynh_install_php__3 source ynh_install_php__3
source ynh_composer__2 source ynh_composer__2
source ynh_exec_as source ynh_exec_as
source /usr/share/yunohost/helpers
#================================================= #=================================================
# MANAGE SCRIPT FAILURE # MANAGE SCRIPT FAILURE
@ -49,15 +49,25 @@ ynh_save_args domain path_url password is_public final_path
#================================================= #=================================================
# STANDARD MODIFICATIONS # STANDARD MODIFICATIONS
#================================================= #=================================================
# INSTALL DEPENDENCIES # INSTALL PHP7.3
#================================================= #=================================================
if [ "$(lsb_release --codename --short)" = "buster" ]; then
pkg_dependencies="$pkg_dependencies $extra_pkg_dependencies"
else
ynh_script_progression --message="Installing PHP7.3..." --weight=1
ynh_install_php --phpversion="7.3" --package="$extra_pkg_dependencies"
fi
#=================================================
# INSTALL DEPENDENCIES
#=================================================
ynh_script_progression --message="Installing dependencies..." --weight=7 ynh_script_progression --message="Installing dependencies..." --weight=7
ynh_install_app_dependencies $pkg_dependencies ynh_install_app_dependencies $pkg_dependencies
#================================================= #=================================================
# CREATE A PostgreSQL DATABASE # CREATE A POSTGRESQL DATABASE
#================================================= #=================================================
ynh_script_progression --message="Creating a PostgreSQL database..." --weight=2 ynh_script_progression --message="Creating a PostgreSQL database..." --weight=2
@ -92,22 +102,6 @@ ynh_script_progression --message="Configuring system user..." --weight=3
# Create a system user # Create a system user
ynh_system_user_create --username=$app --home_dir="$final_path" ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
# INSTALL PHP 7.2
#=================================================
ynh_script_progression --message="Installing PHP 7.2..." --weight=35
ynh_install_php --phpversion="7.2" --package="$extra_pkg_dependencies"
#=================================================
# PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression --message="Configuring php-fpm..." --weight=1
# Create a dedicated php-fpm config
ynh_add_fpm_config --phpversion="7.2"
#================================================= #=================================================
# SPECIFIC SETUP # SPECIFIC SETUP
#================================================= #=================================================
@ -116,13 +110,13 @@ ynh_add_fpm_config --phpversion="7.2"
ynh_script_progression --message="Creating Drush alias..." --weight=2 ynh_script_progression --message="Creating Drush alias..." --weight=2
mkdir -p "$final_path/.drush" mkdir -p "$final_path/.drush"
drush_aliasconfig="$final_path/.drush/$app.aliases.drushrc.php"
cp -f "../conf/yoursite.aliases.drushrc.php" "$drush_aliasconfig"
cp -f "../conf/yoursite.aliases.drushrc.php" "$final_path/.drush/$app.aliases.drushrc.php" ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="$drush_aliasconfig"
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$drush_aliasconfig"
ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="$final_path/.drush/$app.aliases.drushrc.php" ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$drush_aliasconfig"
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/.drush/$app.aliases.drushrc.php" ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" --target_file="$drush_aliasconfig"
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/.drush/$app.aliases.drushrc.php"
ynh_replace_string --match_string="__PATH_URL__" --replace_string="$path_url" --target_file="$final_path/.drush/$app.aliases.drushrc.php"
#================================================= #=================================================
# INSTALL COMPOSER # INSTALL COMPOSER
@ -133,12 +127,12 @@ mkdir -p "$final_path/.composer"
cp -f "../conf/composer.json" "$final_path/.composer/composer.json" cp -f "../conf/composer.json" "$final_path/.composer/composer.json"
ynh_install_composer --phpversion="7.2" --workdir="$final_path/.composer" ynh_install_composer --phpversion="7.3" --workdir="$final_path/.composer"
export PATH="$final_path/.composer/vendor/bin:$PATH" export PATH="$final_path/.composer/vendor/bin:$PATH"
#================================================= #=================================================
# Database initialization # INITIALIZE POSTGRESQL DATABASE
#================================================= #=================================================
ynh_script_progression --message="Initializing PostgreSQL database..." --weight=8 ynh_script_progression --message="Initializing PostgreSQL database..." --weight=8
@ -146,7 +140,7 @@ ynh_replace_string "betaforms" "$db_user" "$final_path/framaforms.sql"
ynh_psql_execute_file_as_root "$final_path/framaforms.sql" "$db_name" ynh_psql_execute_file_as_root "$final_path/framaforms.sql" "$db_name"
#================================================= #=================================================
# Initialize tmp and private directory # INITIALIZE TMP AND PRIVATE DIRECTORY
#================================================= #=================================================
ynh_script_progression --message="Initializing tmp and private directory..." --weight=1 ynh_script_progression --message="Initializing tmp and private directory..." --weight=1
@ -159,7 +153,7 @@ chown -R $app: "/home/yunohost.app/$app/data"
chmod 775 "/home/yunohost.app/$app/data" chmod 775 "/home/yunohost.app/$app/data"
#================================================= #=================================================
# Missing images # ADD MISSING IMAGES
#================================================= #=================================================
ynh_script_progression --message="Adding missing images..." --weight=2 ynh_script_progression --message="Adding missing images..." --weight=2
@ -182,15 +176,15 @@ ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --targ
ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="$config_file" ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="$config_file"
#================================================= #=================================================
# Change admin password and apply custom conf # CHANGE ADMIN PASSWORD AND APPLY CUSTOM CONF
#================================================= #=================================================
ynh_script_progression --message="Changing admin password..." --weight=19 ynh_script_progression --message="Changing admin password..." --weight=19
chown -R $app: $final_path chown -R $app: $final_path
update-alternatives --set php /usr/bin/php7.2 update-alternatives --set php /usr/bin/php7.3
ynh_exec_as $app env PATH=$PATH drush @$app upwd --password="$password" "admin" 2>&1 ynh_exec_as $app env PATH=$PATH drush @$app user-password "admin" --password="$password" 2>&1
ynh_exec_as $app env PATH=$PATH drush @$app variable-set site_name "Framaforms" 2>&1 ynh_exec_as $app env PATH=$PATH drush @$app variable-set site_name "Framaforms" 2>&1
ynh_exec_as $app env PATH=$PATH drush @$app variable-set site_mail "no-reply@$domain" 2>&1 ynh_exec_as $app env PATH=$PATH drush @$app variable-set site_mail "no-reply@$domain" 2>&1
ynh_exec_as $app env PATH=$PATH drush @$app variable-set file_private_path "/home/yunohost.app/$app/data" 2>&1 ynh_exec_as $app env PATH=$PATH drush @$app variable-set file_private_path "/home/yunohost.app/$app/data" 2>&1
@ -218,6 +212,14 @@ ynh_store_file_checksum --file="$config_file"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
#=================================================
# PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression --message="Configuring php-fpm..." --weight=1
# Create a dedicated php-fpm config
ynh_add_fpm_config --phpversion="7.3"
#================================================= #=================================================
# SECURE FILES AND DIRECTORIES # SECURE FILES AND DIRECTORIES
#================================================= #=================================================

View file

@ -7,13 +7,14 @@
#================================================= #=================================================
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source ynh_add_extra_apt_repos__3
source ynh_install_php__3 source ynh_install_php__3
source /usr/share/yunohost/helpers
#================================================= #=================================================
# LOAD SETTINGS # LOAD SETTINGS
#================================================= #=================================================
ynh_script_progression --message="Loading installation settings..." --time --weight=1 ynh_script_progression --message="Loading installation settings..." --weight=1
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
@ -25,13 +26,21 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#================================================= #=================================================
# STANDARD REMOVE # STANDARD REMOVE
#================================================= #=================================================
# REMOVE THE PostgresSQL DATABASE # REMOVE THE POSTGRESQL DATABASE
#================================================= #=================================================
ynh_script_progression --message="Removing the database..." --weight=1 ynh_script_progression --message="Removing the database..." --weight=1
# Remove a database if it exists, along with the associated user # Remove a database if it exists, along with the associated user
ynh_psql_remove_db --db_user=$db_user --db_name=$db_name ynh_psql_remove_db --db_user=$db_user --db_name=$db_name
#=================================================
# REMOVE PHP
#=================================================
if [ "$(lsb_release --codename --short)" != "buster" ]; then
ynh_print_info --message="Removing php..."
ynh_remove_php
fi
#================================================= #=================================================
# REMOVE DEPENDENCIES # REMOVE DEPENDENCIES
#================================================= #=================================================
@ -67,12 +76,6 @@ ynh_remove_fpm_config
#================================================= #=================================================
# SPECIFIC REMOVE # SPECIFIC REMOVE
#================================================= #=================================================
# REMOVE PHP
#=================================================
ynh_script_progression --message="Removing php..." --weight=14
ynh_remove_php
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
#================================================= #=================================================

View file

@ -8,11 +8,11 @@
#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts #Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
source ../settings/scripts/ynh_add_extra_apt_repos__3 source ../settings/scripts/ynh_add_extra_apt_repos__3
source ../settings/scripts/ynh_install_php__3 source ../settings/scripts/ynh_install_php__3
source ../settings/scripts/ynh_composer__2 source ../settings/scripts/ynh_composer__2
source ../settings/scripts/ynh_exec_as source ../settings/scripts/ynh_exec_as
source /usr/share/yunohost/helpers
#================================================= #=================================================
# MANAGE SCRIPT FAILURE # MANAGE SCRIPT FAILURE
@ -24,7 +24,7 @@ ynh_abort_if_errors
#================================================= #=================================================
# LOAD SETTINGS # LOAD SETTINGS
#================================================= #=================================================
ynh_script_progression --message="Loading settings..." --time --weight=1 ynh_script_progression --message="Loading settings..." --weight=1
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
@ -37,7 +37,7 @@ db_user=$db_name
#================================================= #=================================================
# CHECK IF THE APP CAN BE RESTORED # CHECK IF THE APP CAN BE RESTORED
#================================================= #=================================================
ynh_script_progression --message="Validating restoration parameters..." --time --weight=1 ynh_script_progression --message="Validating restoration parameters..." --weight=1
ynh_webpath_available --domain=$domain --path_url=$path_url \ ynh_webpath_available --domain=$domain --path_url=$path_url \
|| ynh_die --message="Path not available: ${domain}${path_url}" || ynh_die --message="Path not available: ${domain}${path_url}"
@ -49,14 +49,14 @@ test ! -d $final_path \
#================================================= #=================================================
# RECREATE THE DEDICATED USER # RECREATE THE DEDICATED USER
#================================================= #=================================================
ynh_print_info --message="Recreating the dedicated system user..." ynh_script_progression --message="Recreating the dedicated system user..." --weight=1
ynh_system_user_create --username=$app --home_dir="$final_path" ynh_system_user_create --username=$app --home_dir="$final_path"
#================================================= #=================================================
# RESTORE ALL FILES # RESTORE ALL FILES
#================================================= #=================================================
ynh_script_progression --message="Restoring all files..." --time --weight=1 ynh_script_progression --message="Restoring all files..." --weight=1
ynh_restore ynh_restore
@ -74,26 +74,29 @@ chmod 775 "/home/yunohost.app/$app/data"
#================================================= #=================================================
# SPECIFIC RESTORATION # SPECIFIC RESTORATION
#=================================================
# REINSTALL PHP7.3
#=================================================
if [ "$(lsb_release --codename --short)" = "buster" ]; then
pkg_dependencies="$pkg_dependencies $extra_pkg_dependencies"
else
ynh_print_info --message="Reinstalling PHP7.3..."
ynh_install_php --phpversion="7.3" --package="$extra_pkg_dependencies"
fi
#================================================= #=================================================
# REINSTALL DEPENDENCIES # REINSTALL DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Reinstalling dependencies..." --time --weight=1 ynh_script_progression --message="Reinstalling dependencies..." --weight=1
# Define and install dependencies # Define and install dependencies
ynh_install_app_dependencies $pkg_dependencies ynh_install_app_dependencies $pkg_dependencies
#================================================= #=================================================
# REINSTALL PHP # RESTORE THE POSTGRESQL DATABASE
#================================================= #=================================================
ynh_print_info --message="Reinstalling php..." ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=1
ynh_install_php --phpversion="7.2" --package="$extra_pkg_dependencies"
#=================================================
# RESTORE THE DATABASE
#=================================================
ynh_script_progression --message="Restoring the database..." --time --weight=1
ynh_psql_test_if_first_run ynh_psql_test_if_first_run
@ -106,13 +109,13 @@ ynh_psql_execute_file_as_root ./db.sql "$db_name"
#================================================= #=================================================
# RELOAD NGINX AND PHP-FPM # RELOAD NGINX AND PHP-FPM
#================================================= #=================================================
ynh_script_progression --message="Reloading nginx web server and php-fpm..." --time --weight=1 ynh_script_progression --message="Reloading nginx web server and php-fpm..." --weight=1
ynh_systemd_action --service_name=php7.2-fpm --action=reload ynh_systemd_action --service_name=php7.3-fpm --action=reload
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Restoration completed for $app" --time --last ynh_script_progression --message="Restoration completed for $app" --last

View file

@ -7,11 +7,11 @@
#================================================= #=================================================
source _common.sh source _common.sh
source /usr/share/yunohost/helpers
source ynh_add_extra_apt_repos__3 source ynh_add_extra_apt_repos__3
source ynh_install_php__3 source ynh_install_php__3
source ynh_composer__2 source ynh_composer__2
source ynh_exec_as source ynh_exec_as
source /usr/share/yunohost/helpers
#================================================= #=================================================
# LOAD SETTINGS # LOAD SETTINGS
@ -74,6 +74,14 @@ ynh_abort_if_errors
#================================================= #=================================================
# STANDARD UPGRADE STEPS # STANDARD UPGRADE STEPS
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Upgrading nginx web server configuration..." --weight=1
# Create a dedicated nginx config
ynh_add_nginx_config
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
@ -87,12 +95,22 @@ then
fi fi
#================================================= #=================================================
# NGINX CONFIGURATION # UPGRADE PHP7.3
#================================================= #=================================================
ynh_script_progression --message="Upgrading nginx web server configuration..." --weight=1
# Create a dedicated nginx config if [ "$(lsb_release --codename --short)" = "buster" ]; then
ynh_add_nginx_config pkg_dependencies="$pkg_dependencies $extra_pkg_dependencies"
else
if [ "$(ynh_app_setting_get --app=$app --key=php_version)" != "7.3" ]; then
ynh_print_info --message="Upgrading PHP7.3..."
ynh_remove_fpm_config
ynh_remove_app_dependencies
ynh_remove_php
ynh_install_php --phpversion="7.3" --package="$extra_pkg_dependencies"
else
ynh_install_php --phpversion="7.3" --package="$extra_pkg_dependencies"
fi
fi
#================================================= #=================================================
# UPGRADE DEPENDENCIES # UPGRADE DEPENDENCIES
@ -109,20 +127,13 @@ ynh_script_progression --message="Making sure dedicated system user exists..." -
# Create a dedicated user (if not existing) # Create a dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir="$final_path" ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
# UPGRADE PHP
#=================================================
ynh_script_progression --message="Upgrading PHP..." --weight=12
ynh_install_php --phpversion="7.2" --package="$extra_pkg_dependencies"
#================================================= #=================================================
# PHP-FPM CONFIGURATION # PHP-FPM CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Upgrading php-fpm configuration..." --weight=1 ynh_script_progression --message="Upgrading php-fpm configuration..." --weight=1
# Create a dedicated php-fpm config # Create a dedicated php-fpm config
ynh_add_fpm_config --phpversion="7.2" ynh_add_fpm_config --phpversion="7.3"
#================================================= #=================================================
# SPECIFIC UPGRADE # SPECIFIC UPGRADE
@ -131,24 +142,24 @@ ynh_add_fpm_config --phpversion="7.2"
#================================================= #=================================================
ynh_script_progression --message="Upgrading Composer..." --weight=3 ynh_script_progression --message="Upgrading Composer..." --weight=3
ynh_install_composer --phpversion="7.2" --workdir="$final_path/.composer" ynh_install_composer --phpversion="7.3" --workdir="$final_path/.composer"
#================================================= #=================================================
# UPGRADE DRUPAL # UPGRADE DRUPAL
#================================================= #=================================================
ynh_script_progression --message="Upgrading Drupal..." --time --weight=30 ynh_script_progression --message="Upgrading Drupal..." --weight=30
ynh_backup_if_checksum_is_different --file="$final_path/$app/sites/default/settings.php" ynh_backup_if_checksum_is_different --file="$final_path/$app/sites/default/settings.php"
export PATH="$final_path/.composer/vendor/bin:$PATH" export PATH="$final_path/.composer/vendor/bin:$PATH"
update-alternatives --set php /usr/bin/php7.2 update-alternatives --set php /usr/bin/php7.3
ynh_exec_as $app env PATH=$PATH drush @$app variable-set --exact maintenance_mode 1 ynh_exec_as $app env PATH=$PATH drush @$app variable-set --exact maintenance_mode 1
ynh_exec_as $app env PATH=$PATH drush @$app cache-clear all ynh_exec_as $app env PATH=$PATH drush @$app cache-clear all
ynh_exec_as $app env PATH=$PATH drush @$app pm-update -y drupal ynh_exec_as $app env PATH=$PATH drush @$app pm-update -y drupal
ynh_exec_as $app env PATH=$PATH drush @$app vset --exact maintenance_mode 0
ynh_exec_as $app env PATH=$PATH drush @$app cache-clear all ynh_exec_as $app env PATH=$PATH drush @$app cache-clear all
ynh_exec_as $app env PATH=$PATH drush @$app variable-set --exact maintenance_mode 0
update-alternatives --set php /usr/bin/php7.0 update-alternatives --set php /usr/bin/php7.0
@ -162,16 +173,9 @@ ynh_store_file_checksum --file="$config_file"
#================================================= #=================================================
#=================================================
# STORE THE CONFIG FILE CHECKSUM
#=================================================
config_file=$final_path/sites/default/settings.php
# Recalculate and store the checksum of the file for the next upgrade.
ynh_store_file_checksum --file="$config_file"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
#=================================================
# SECURE FILES AND DIRECTORIES # SECURE FILES AND DIRECTORIES
#================================================= #=================================================
@ -185,7 +189,7 @@ chmod 775 "/home/yunohost.app/$app/data"
#================================================= #=================================================
# SETUP SSOWAT # SETUP SSOWAT
#================================================= #=================================================
ynh_script_progression --message="Upgrading SSOwat configuration..." --time --weight=1 ynh_script_progression --message="Upgrading SSOwat configuration..." --weight=1
# Make app public if necessary # Make app public if necessary
if [ $is_public -eq 1 ] if [ $is_public -eq 1 ]
@ -197,7 +201,7 @@ fi
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================
ynh_script_progression --message="Reloading nginx web server..." --time --weight=1 ynh_script_progression --message="Reloading nginx web server..." --weight=1
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload
@ -205,4 +209,4 @@ ynh_systemd_action --service_name=nginx --action=reload
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Upgrade of $app completed" --time --last ynh_script_progression --message="Upgrade of $app completed" --last

View file

@ -37,10 +37,11 @@ ynh_install_php () {
# Set php7.0 back as the default version for php-cli. # Set php7.0 back as the default version for php-cli.
update-alternatives --set php /usr/bin/php7.0 update-alternatives --set php /usr/bin/php7.0
# Remove this extra repository after packages are installed # Pin this extra repository after packages are installed to prevent sury of doing shit
ynh_remove_extra_repo --name=extra_php_version ynh_pin_repo --package="*" --pin="origin \"packages.sury.org\"" 200 --name=extra_php_version
ynh_pin_repo --package="php7.0*" --pin="origin \"packages.sury.org\"" 600 --name=extra_php_version --append
# Advertise service in admin panel # INTEGRATE SERVICE IN YUNOHOST
yunohost service add php${phpversion}-fpm --log "/var/log/php${phpversion}-fpm.log" yunohost service add php${phpversion}-fpm --log "/var/log/php${phpversion}-fpm.log"
} }

2
sources/patches/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
*~
*.sw[op]

View file

@ -0,0 +1,12 @@
diff --git a/sites/all/modules/rules/includes/faces.inc b/sites/all/modules/rules/includes/faces.inc
index a1fc93bd..812d96a1 100644
--- a/sites/all/modules/rules/includes/faces.inc
+++ b/sites/all/modules/rules/includes/faces.inc
@@ -224,6 +224,7 @@ if (!class_exists('FacesExtendable', FALSE)) {
* describe a single file.
*/
public function extend($interface, array $callbacks = array(), array $includes = array()) {
+ $interface = class_exists($interface) ? $interface : FALSE;
$face_methods = $interface ? get_class_methods($interface) : array_keys($callbacks);
if ($interface) {
if (array_diff($face_methods, array_keys($callbacks))) {