Randomize the admin password

This commit is contained in:
Girish Ramakrishnan 2015-06-24 11:36:12 -07:00
parent bf63f41072
commit 802f014d9f

View file

@ -22,6 +22,9 @@ if [[ ! -f /home/cloudron/gogs/custom/conf/app.ini ]]; then
touch /home/cloudron/gogs/custom/conf/app.ini touch /home/cloudron/gogs/custom/conf/app.ini
chown cloudron:cloudron /home/cloudron/gogs/custom/conf/app.ini chown cloudron:cloudron /home/cloudron/gogs/custom/conf/app.ini
admin_password=$(pwgen -1)
echo "Admin password set to ${admin_password}"
# this creates the custom/conf/app.ini # this creates the custom/conf/app.ini
curl -X POST http://localhost:3000/install \ curl -X POST http://localhost:3000/install \
--data db_type=MySQL \ --data db_type=MySQL \
@ -38,7 +41,7 @@ if [[ ! -f /home/cloudron/gogs/custom/conf/app.ini ]]; then
--data smtp_user= \ --data smtp_user= \
--data smtp_pwd= \ --data smtp_pwd= \
--data admin_name=administrator \ --data admin_name=administrator \
--data admin_passwd=admin123 \ --data admin_passwd=${admin_password} \
--data admin_confirm_passwd=admin123 \ --data admin_confirm_passwd=admin123 \
--data-urlencode admin_email=girish@forwardbias.in --data-urlencode admin_email=girish@forwardbias.in
fi fi