Skip to content
Permalink
Browse files Browse the repository at this point in the history
[IMP] Generating random strong keys
  • Loading branch information
devangnathwani committed Jul 12, 2019
1 parent d976b28 commit 9877ec6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion config/astpp-config.conf
Expand Up @@ -3,7 +3,8 @@ dbhost = 127.0.0.1
dbname = astpp
dbuser = astppuser
dbpass = <PASSSWORD>

PRIVATE_KEY = <PR_KEY>
ENCRYPTION_KEY = <EN_KEY>

; Database type: ASTPP was designed for a MySQL database initially. Valid options are:
; MySQL. Pgsql is coming but is not ready yet.
Expand Down
4 changes: 4 additions & 0 deletions install.sh
Expand Up @@ -70,6 +70,8 @@ genpasswd()

MYSQL_ROOT_PASSWORD=`echo "$(genpasswd 20)" | sed s/./*/5`
ASTPPUSER_MYSQL_PASSWORD=`echo "$(genpasswd 20)" | sed s/./*/5`
PR_KEY=`echo "$(genpasswd 32)"`
EN_KEY=`echo "$(genpasswd 12)"`
#Fetch OS Distribution
get_linux_distribution ()
{
Expand Down Expand Up @@ -332,6 +334,8 @@ normalize_astpp ()
sed -i "s#DB_PASSWD=\"<PASSSWORD>\"#DB_PASSWD = \"${ASTPPUSER_MYSQL_PASSWORD}\"#g" ${ASTPPDIR}astpp.lua
sed -i "s#base_url=http://localhost:8089/#base_url=https://${ASTPP_HOST_DOMAIN_NAME}/#g" ${ASTPPDIR}/astpp-config.conf
sed -i "s#PASSWORD = <PASSWORD>#PASSWORD = ${ASTPPUSER_MYSQL_PASSWORD}#g" /etc/odbc.ini
sed -i "s#<PR_KEY>#${PR_KEY}#g" ${ASTPPDIR}astpp-config.conf
sed -i "s#<EN_KEY>#${EN_KEY}#g" ${ASTPPDIR}astpp-config.conf
systemctl restart nginx
}

Expand Down
5 changes: 2 additions & 3 deletions web_interface/astpp/application/config/config.php
Expand Up @@ -228,7 +228,7 @@
* | MUST set private key with 32 characters.
* |
*/
$config ['private_key'] = '8YSDaBtDHAB3EQkxPAyTz2I5DttzA9uR';
$config ['private_key'] = $astpp_config ['PRIVATE_KEY'];
/*
* |--------------------------------------------------------------------------
* | Encryption Key
Expand All @@ -238,8 +238,7 @@
* | MUST set an encryption key. See the user guide for info.
* |
*/
$config ['encryption_key'] = 'r)fddEw232f';

$config ['encryption_key'] = $astpp_config ['ENCRYPTION_KEY'];
/*
* |--------------------------------------------------------------------------
* | Session Variables
Expand Down

0 comments on commit 9877ec6

Please sign in to comment.