Browse Source

Sequence of installation

Bob Mottram 7 years ago
parent
commit
50d936e73b
1 changed files with 15 additions and 7 deletions
  1. 15
    7
      src/freedombone-app-smilodon

+ 15
- 7
src/freedombone-app-smilodon View File

@@ -291,13 +291,25 @@ function install_smilodon {
291 291
     groupadd smilodon
292 292
     useradd -c "Smilodon system account" -d $SMILODON_PATH -m -r -g smilodon smilodon
293 293
 
294
+    SMILODON_ONION_HOSTNAME=$(add_onion_service smilodon 80 ${SMILODON_ONION_PORT})
295
+
296
+    if [ ! $SMILODON_SECRET_KEY ]; then
297
+        SMILODON_SECRET_KEY="$(create_password 30)$(create_password 30)$(create_password 30)$(create_password 30)"
298
+    fi
299
+
300
+    export smilodon_domain_name=$SMILODON_ONION_HOSTNAME
301
+    export secret_key='$SMILODON_SECRET_KEY'
302
+    export mongodb_username='smilodon'
303
+    export mongodb_password='$SMILODON_ADMIN_PASSWORD'
304
+    export smilodon_admin_address=$MY_EMAIL_ADDRESS
305
+    export MAIL_SERVER='localhost'
306
+    export MAIL_PORT=25
307
+
294 308
     function_check install_mongodb
295 309
     install_mongodb smilodon
296 310
 
297 311
     smilodon_create_database
298 312
 
299
-    SMILODON_ONION_HOSTNAME=$(add_onion_service smilodon 80 ${SMILODON_ONION_PORT})
300
-
301 313
     pip3 install -r requirements.txt
302 314
     if [ ! "$?" = "0" ]; then
303 315
         echo $'Unable to install smilodon dependencies'
@@ -319,14 +331,9 @@ function install_smilodon {
319 331
     nginx_ensite smilodon
320 332
     systemctl enable mongodb
321 333
     systemctl restart mongodb
322
-    systemctl restart nginx
323 334
 
324 335
     chown -R smilodon:smilodon ${SMILODON_PATH}
325 336
 
326
-    if [ ! $SMILODON_SECRET_KEY ]; then
327
-        SMILODON_SECRET_KEY="$(create_password 30)$(create_password 30)$(create_password 30)$(create_password 30)"
328
-    fi
329
-
330 337
     echo '#!/bin/bash' > ${SMILODON_PATH}/run_smilodon.sh
331 338
     echo "cd ${SMILODON_PATH}" >> ${SMILODON_PATH}/run_smilodon.sh
332 339
     echo "export smilodon_domain_name=$SMILODON_ONION_HOSTNAME" >> ${SMILODON_PATH}/run_smilodon.sh
@@ -358,6 +365,7 @@ function install_smilodon {
358 365
     systemctl enable smilodon
359 366
     systemctl daemon-reload
360 367
     systemctl start smilodon
368
+    systemctl restart nginx
361 369
 
362 370
     ${PROJECT_NAME}-pass -u $MY_USERNAME -a smilodon -p "$SMILODON_ADMIN_PASSWORD"
363 371