mirror of
https://github.com/YunoHost-Apps/piwigo_ynh.git
synced 2024-09-03 20:06:03 +02:00
commit
bb70605b5e
5 changed files with 16 additions and 8 deletions
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
// Use HTTP authentication
|
||||
$conf['apache_authentication'] = true;
|
||||
$conf['apache_authentication'] = false;
|
||||
|
||||
// Use external authentication
|
||||
$conf['external_authentification'] = true;
|
||||
|
|
|
@ -7,7 +7,9 @@
|
|||
YNH_PHP_VERSION="7.3"
|
||||
|
||||
# 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
|
||||
|
|
|
@ -139,7 +139,7 @@ ynh_add_nginx_config
|
|||
ynh_script_progression --message="Configuring PHP-FPM..." --weight=2
|
||||
|
||||
# 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)
|
||||
|
||||
#=================================================
|
||||
|
@ -197,14 +197,14 @@ ynh_script_progression --message="Configuring LDAP plugin..."
|
|||
|
||||
# Login with admin account
|
||||
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")
|
||||
pwg_token=$(jq --raw-output .result.pwg_token <<< $status)
|
||||
# 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"
|
||||
# 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"
|
||||
# Log out
|
||||
# Log out
|
||||
ynh_local_curl "/ws.php?format=json" "method=pwg.session.logout"
|
||||
|
||||
# Edit Ldap_Login plugin configuration
|
||||
|
|
|
@ -75,8 +75,13 @@ chown -R $app:www-data "$final_path"
|
|||
#=================================================
|
||||
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"
|
||||
|
||||
# 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
|
||||
#=================================================
|
||||
|
|
|
@ -188,7 +188,8 @@ ynh_install_app_dependencies $pkg_dependencies
|
|||
ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=3
|
||||
|
||||
# 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
|
||||
|
@ -242,12 +243,12 @@ ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name <<<
|
|||
|
||||
# Login with admin account
|
||||
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")
|
||||
pwg_token=$(jq --raw-output .result.pwg_token <<< $status)
|
||||
# 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"
|
||||
# Log out
|
||||
# Log out
|
||||
ynh_local_curl "/ws.php?format=json" "method=pwg.session.logout"
|
||||
|
||||
# Edit Ldap_Login plugin configuration
|
||||
|
|
Loading…
Reference in a new issue