From fa8f5321ba3f066dc5f929827a1abb6bddc7da24 Mon Sep 17 00:00:00 2001 From: saravanan_477at17 Date: Wed, 29 May 2019 16:32:49 +0530 Subject: [PATCH 1/2] Fixes #2216: Dynamic password change for admin user issue fixed --- Jelastic/jelastic_password.txt | 22 ++++++++++++++++++++++ Jelastic/restyaboard.yaml | 4 +++- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 Jelastic/jelastic_password.txt diff --git a/Jelastic/jelastic_password.txt b/Jelastic/jelastic_password.txt new file mode 100644 index 000000000..54ea95cde --- /dev/null +++ b/Jelastic/jelastic_password.txt @@ -0,0 +1,22 @@ + + * @copyright 2014 Restya + * @license http://restya.com/ Restya Licence + * @link http://restya.com/ + */ +require_once '/var/www/webroot/ROOT/server/php/config.inc.php'; +require_once '/var/www/webroot/ROOT/server/php/libs/core.php'; +$password = $argv[1]; +error_log($password, 3, '/var/www/webroot/ROOT/server/php/shell/jelastic.log'); +$result = pg_query_params($db_lnk, 'UPDATE users SET password = $1 WHERE username = $2', array( + getCryptHash($password), + 'admin' +)); \ No newline at end of file diff --git a/Jelastic/restyaboard.yaml b/Jelastic/restyaboard.yaml index 420f2de0a..96df1ceef 100644 --- a/Jelastic/restyaboard.yaml +++ b/Jelastic/restyaboard.yaml @@ -49,4 +49,6 @@ onInstall: - cmd [postgres9]: curl -v -L -G -o /tmp/restyaboard_with_empty_data.sql https://raw.githubusercontent.com/RestyaPlatform/board/master/sql/restyaboard_with_empty_data.sql - cmd [postgres9]: printf "PGPASSWORD=${nodes.postgres9.password};\nexport PGPASSWORD;\npsql postgres webadmin -c \"CREATE DATABASE restyaboard;\"\npsql -h ${nodes.postgres9.address} -d restyaboard -U webadmin < /tmp/restyaboard_with_empty_data.sql;\n" > /tmp/createDb - cmd [postgres9]: chmod +x /tmp/createDb && /tmp/createDb -success: Installation completed. username admin and password restya \ No newline at end of file + - cmd [nginxphp]: curl -v -L -G -o /var/www/webroot/ROOT/server/php/shell/jelastic_password.php https://raw.githubusercontent.com/RestyaPlatform/board/dev/Jelastic/jelastic_password.txt + - cmd [nginxphp]: php /var/www/webroot/ROOT/server/php/shell/jelastic_password.php ${user.appPassword} +success: Installation completed. username admin and password ${user.appPassword} \ No newline at end of file From 9c46f318c1ef7eab59c1afa72ed08fca0e349ef6 Mon Sep 17 00:00:00 2001 From: saravanan_477at17 Date: Wed, 29 May 2019 16:33:54 +0530 Subject: [PATCH 2/2] Fixes #2216: error Log file removed --- Jelastic/jelastic_password.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/Jelastic/jelastic_password.txt b/Jelastic/jelastic_password.txt index 54ea95cde..ae0b78a21 100644 --- a/Jelastic/jelastic_password.txt +++ b/Jelastic/jelastic_password.txt @@ -15,7 +15,6 @@ require_once '/var/www/webroot/ROOT/server/php/config.inc.php'; require_once '/var/www/webroot/ROOT/server/php/libs/core.php'; $password = $argv[1]; -error_log($password, 3, '/var/www/webroot/ROOT/server/php/shell/jelastic.log'); $result = pg_query_params($db_lnk, 'UPDATE users SET password = $1 WHERE username = $2', array( getCryptHash($password), 'admin'