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
     groupadd smilodon
291
     groupadd smilodon
292
     useradd -c "Smilodon system account" -d $SMILODON_PATH -m -r -g smilodon smilodon
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
     function_check install_mongodb
308
     function_check install_mongodb
295
     install_mongodb smilodon
309
     install_mongodb smilodon
296
 
310
 
297
     smilodon_create_database
311
     smilodon_create_database
298
 
312
 
299
-    SMILODON_ONION_HOSTNAME=$(add_onion_service smilodon 80 ${SMILODON_ONION_PORT})
300
-
301
     pip3 install -r requirements.txt
313
     pip3 install -r requirements.txt
302
     if [ ! "$?" = "0" ]; then
314
     if [ ! "$?" = "0" ]; then
303
         echo $'Unable to install smilodon dependencies'
315
         echo $'Unable to install smilodon dependencies'
319
     nginx_ensite smilodon
331
     nginx_ensite smilodon
320
     systemctl enable mongodb
332
     systemctl enable mongodb
321
     systemctl restart mongodb
333
     systemctl restart mongodb
322
-    systemctl restart nginx
323
 
334
 
324
     chown -R smilodon:smilodon ${SMILODON_PATH}
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
     echo '#!/bin/bash' > ${SMILODON_PATH}/run_smilodon.sh
337
     echo '#!/bin/bash' > ${SMILODON_PATH}/run_smilodon.sh
331
     echo "cd ${SMILODON_PATH}" >> ${SMILODON_PATH}/run_smilodon.sh
338
     echo "cd ${SMILODON_PATH}" >> ${SMILODON_PATH}/run_smilodon.sh
332
     echo "export smilodon_domain_name=$SMILODON_ONION_HOSTNAME" >> ${SMILODON_PATH}/run_smilodon.sh
339
     echo "export smilodon_domain_name=$SMILODON_ONION_HOSTNAME" >> ${SMILODON_PATH}/run_smilodon.sh
358
     systemctl enable smilodon
365
     systemctl enable smilodon
359
     systemctl daemon-reload
366
     systemctl daemon-reload
360
     systemctl start smilodon
367
     systemctl start smilodon
368
+    systemctl restart nginx
361
 
369
 
362
     ${PROJECT_NAME}-pass -u $MY_USERNAME -a smilodon -p "$SMILODON_ADMIN_PASSWORD"
370
     ${PROJECT_NAME}-pass -u $MY_USERNAME -a smilodon -p "$SMILODON_ADMIN_PASSWORD"
363
 
371