1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/piwigo_ynh.git synced 2024-09-03 20:06:03 +02:00

More phpversion

This commit is contained in:
yalh76 2021-08-26 23:39:52 +02:00
parent d15a3a80c1
commit fdfff470b2
4 changed files with 15 additions and 7 deletions

View file

@ -7,7 +7,9 @@
YNH_PHP_VERSION="7.3" YNH_PHP_VERSION="7.3"
# dependencies used by the app # dependencies used by the app
pkg_dependencies="php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-imagick imagemagick" pkg_dependencies="imagemagick"
extra_php_dependencies="php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-imagick php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-mysqli"
#================================================= #=================================================
# PERSONAL HELPERS # PERSONAL HELPERS

View file

@ -139,7 +139,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 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)
#================================================= #=================================================
@ -197,14 +197,14 @@ ynh_script_progression --message="Configuring LDAP plugin..."
# Login with admin account # Login with admin account
ynh_local_curl "/ws.php?format=json" "method=pwg.session.login" "username=$admin" "password=$adm_pwd" ynh_local_curl "/ws.php?format=json" "method=pwg.session.login" "username=$admin" "password=$adm_pwd"
# Get session token # Get session token
status=$(ynh_local_curl "/ws.php?format=json" "method=pwg.session.getStatus") status=$(ynh_local_curl "/ws.php?format=json" "method=pwg.session.getStatus")
pwg_token=$(jq --raw-output .result.pwg_token <<< $status) pwg_token=$(jq --raw-output .result.pwg_token <<< $status)
# Install the Ldap_Login plugin # Install the Ldap_Login plugin
ynh_local_curl "/ws.php?format=json" "method=pwg.plugins.performAction" "action=install" "plugin=Ldap_Login" "pwg_token=$pwg_token" ynh_local_curl "/ws.php?format=json" "method=pwg.plugins.performAction" "action=install" "plugin=Ldap_Login" "pwg_token=$pwg_token"
# Activate the Ldap_Login plugin # Activate the Ldap_Login plugin
ynh_local_curl "/ws.php?format=json" "method=pwg.plugins.performAction" "action=activate" "plugin=Ldap_Login" "pwg_token=$pwg_token" ynh_local_curl "/ws.php?format=json" "method=pwg.plugins.performAction" "action=activate" "plugin=Ldap_Login" "pwg_token=$pwg_token"
# Log out # Log out
ynh_local_curl "/ws.php?format=json" "method=pwg.session.logout" ynh_local_curl "/ws.php?format=json" "method=pwg.session.logout"
# Edit Ldap_Login plugin configuration # Edit Ldap_Login plugin configuration

View file

@ -75,8 +75,13 @@ chown -R $app:www-data "$final_path"
#================================================= #=================================================
ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weight=10 ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weight=10
# Restore the file first, so it can have a backup if different
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"
# Recreate a dedicated php-fpm config
ynh_add_fpm_config --package="$extra_php_dependencies"
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#================================================= #=================================================
# RESTORE FAIL2BAN CONFIGURATION # RESTORE FAIL2BAN CONFIGURATION
#================================================= #=================================================

View file

@ -188,7 +188,8 @@ ynh_install_app_dependencies $pkg_dependencies
ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=3 ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=3
# Create a dedicated PHP-FPM config # Create a dedicated PHP-FPM config
ynh_add_fpm_config ynh_add_fpm_config --package="$extra_php_dependencies"
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#================================================= #=================================================
# SPECIFIC UPGRADE # SPECIFIC UPGRADE
@ -242,12 +243,12 @@ ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name <<<
# Login with admin account # Login with admin account
ynh_local_curl "/ws.php?format=json" "method=pwg.session.login" "username=$admin" "password=$admin_pwd" ynh_local_curl "/ws.php?format=json" "method=pwg.session.login" "username=$admin" "password=$admin_pwd"
# Get session token # Get session token
status=$(ynh_local_curl "/ws.php?format=json" "method=pwg.session.getStatus") status=$(ynh_local_curl "/ws.php?format=json" "method=pwg.session.getStatus")
pwg_token=$(jq --raw-output .result.pwg_token <<< $status) pwg_token=$(jq --raw-output .result.pwg_token <<< $status)
# Activate the Ldap_Login plugin # Activate the Ldap_Login plugin
ynh_local_curl "/ws.php?format=json" "method=pwg.plugins.performAction" "action=activate" "plugin=Ldap_Login" "pwg_token=$pwg_token" ynh_local_curl "/ws.php?format=json" "method=pwg.plugins.performAction" "action=activate" "plugin=Ldap_Login" "pwg_token=$pwg_token"
# Log out # Log out
ynh_local_curl "/ws.php?format=json" "method=pwg.session.logout" ynh_local_curl "/ws.php?format=json" "method=pwg.session.logout"
# Edit Ldap_Login plugin configuration # Edit Ldap_Login plugin configuration