diff --git a/src/freedombone-app-smilodon b/src/freedombone-app-smilodon index 3b5705b3..104874ac 100755 --- a/src/freedombone-app-smilodon +++ b/src/freedombone-app-smilodon @@ -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"