Sequence of installation

This commit is contained in:
Bob Mottram 2017-11-23 20:52:41 +00:00
parent 974ba8742e
commit 50d936e73b
1 changed files with 15 additions and 7 deletions

View File

@ -291,13 +291,25 @@ function install_smilodon {
groupadd smilodon
useradd -c "Smilodon system account" -d $SMILODON_PATH -m -r -g smilodon smilodon
SMILODON_ONION_HOSTNAME=$(add_onion_service smilodon 80 ${SMILODON_ONION_PORT})
if [ ! $SMILODON_SECRET_KEY ]; then
SMILODON_SECRET_KEY="$(create_password 30)$(create_password 30)$(create_password 30)$(create_password 30)"
fi
export smilodon_domain_name=$SMILODON_ONION_HOSTNAME
export secret_key='$SMILODON_SECRET_KEY'
export mongodb_username='smilodon'
export mongodb_password='$SMILODON_ADMIN_PASSWORD'
export smilodon_admin_address=$MY_EMAIL_ADDRESS
export MAIL_SERVER='localhost'
export MAIL_PORT=25
function_check install_mongodb
install_mongodb smilodon
smilodon_create_database
SMILODON_ONION_HOSTNAME=$(add_onion_service smilodon 80 ${SMILODON_ONION_PORT})
pip3 install -r requirements.txt
if [ ! "$?" = "0" ]; then
echo $'Unable to install smilodon dependencies'
@ -319,14 +331,9 @@ function install_smilodon {
nginx_ensite smilodon
systemctl enable mongodb
systemctl restart mongodb
systemctl restart nginx
chown -R smilodon:smilodon ${SMILODON_PATH}
if [ ! $SMILODON_SECRET_KEY ]; then
SMILODON_SECRET_KEY="$(create_password 30)$(create_password 30)$(create_password 30)$(create_password 30)"
fi
echo '#!/bin/bash' > ${SMILODON_PATH}/run_smilodon.sh
echo "cd ${SMILODON_PATH}" >> ${SMILODON_PATH}/run_smilodon.sh
echo "export smilodon_domain_name=$SMILODON_ONION_HOSTNAME" >> ${SMILODON_PATH}/run_smilodon.sh
@ -358,6 +365,7 @@ function install_smilodon {
systemctl enable smilodon
systemctl daemon-reload
systemctl start smilodon
systemctl restart nginx
${PROJECT_NAME}-pass -u $MY_USERNAME -a smilodon -p "$SMILODON_ADMIN_PASSWORD"