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

Save the password during install to be able to call curl during upgrade >_>

This commit is contained in:
Alexandre Aubin 2024-01-06 19:45:31 +01:00
parent fb61948453
commit 0a3b8c5680
2 changed files with 7 additions and 4 deletions

View file

@ -3,6 +3,9 @@
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
# Gotta save the stupid password because we need it during upgrade because there's no way to trigger the upgrade.php script from command line ...
ynh_app_setting_set --app=$app --key=password --value="$password"
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================

View file

@ -74,8 +74,8 @@ ynh_add_nginx_config
ynh_script_progression --message="Upgrading Piwigo with cURL..." --weight=6 ynh_script_progression --message="Upgrading Piwigo with cURL..." --weight=6
# Upgrade Piwigo via cURL # Upgrade Piwigo via cURL
# FIXME : Why Curl ... Why can't we trigger the migration from the command line somehow ... # Why can't we trigger the migration from the command line somehow ...
#ynh_local_curl "/upgrade.php?language=$language&now=true" "language=$language" "username=$admin" "password=$admin_pwd" ynh_local_curl "/upgrade.php?language=$language&now=true" "language=$language" "username=$admin" "password=$admin_pwd"
#================================================= #=================================================
# CONFIGURE PIWIGO # CONFIGURE PIWIGO
@ -104,8 +104,8 @@ ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name <<<
# Login with admin account # Login with admin account
# FIXME: Is this stuff really needed ... isn't there a way to enable the damn LDAP login plugin from the command line or something ... # ... isn't there a way to enable the damn LDAP login plugin from the command line or something ...
#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)