-
Notifications
You must be signed in to change notification settings - Fork 78
/
Copy pathquick_install
executable file
·73 lines (64 loc) · 2.69 KB
/
quick_install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
FAILURE=$(tput setaf 1)
SUCCESS=$(tput setaf 2)
INFO=$(tput setaf 3)
WARNING=$(tput setaf 4)
END=$(tput sgr0)
cd install/
printf "${SUCCESS} ========= STEP 1/6: Install Database ========= ${END}\n"
printf "${INFO}Installs the malspider database and creates a new database user.${END}\n"
printf "${INFO}Press enter to begin or type 's' to skip this step...${END}"
read input
if [ "$input" != "s" ]
then
printf "${INFO}A new mysql user must be created. Please enter the credentials you would like to use below:${END}\n"
printf "Username: "
read username
printf "Password: "
stty -echo
read password
stty echo
printf "\n"
./install_database $username $password
fi
printf "${SUCCESS} ========= STEP 2/6: Install dependencies ========= ${END}\n"
printf "${INFO}Installs required packages and dependencies. If any of the dependencies fail to install, please install them manually.${END}\n"
printf "${INFO}Press enter to begin or type "s" to skip this step...${END}"
read input
if [ "$input" != "s" ]
then
sudo ./install_dependencies
fi
printf "${SUCCESS} ========= STEP 3/6: Apply Web App DB Migrations ========= ${END}\n"
printf "${INFO}Applies django schema changes to the 'malspider' database. If this step fails, please run python manage.py migrate manually. You won't be able to complete step 4 without applying the migrations.${END}\n"
printf "${INFO}Press enter to begin or type 's' to skip this step...${END}"
read input
if [ "$input" != "s" ]
then
./apply_db_migrations
fi
printf "${SUCCESS} ========= STEP 4/6: Create Web App Admin User ========= ${END}\n"
printf "${INFO}This step will prompt you for a username/password combination - these credentials will be used to login to the admin section of the web interface.${END}\n"
printf "${INFO}Press enter to begin or type 's' to skip this step...${END}"
read input
if [ "$input" != "s" ]
then
./create_web_admin
fi
printf "${SUCCESS} ========= STEP 5/6: Apply Access Control ========= ${END}\n"
printf "${INFO}Creates port access rules using iptables. Port 6802 should only be accessible to localhost. Port 8080 needs to be open for the web interface.${END}\n"
printf "${INFO}Press enter to begin or type 's' to skip this step...${END}"
read input
if [ "$input" != "s" ]
then
./create_iptables_rules
fi
printf "${SUCCESS} ========= STEP 6/6: Add Scheduled Jobs to crontab ========= ${END}\n"
printf "${INFO}Schedules regular cron jobs for sending jobs to the crawler, analyzing crawl data, and purging the database. ${END}\n"
printf "${INFO}Press enter to begin or type 's' to skip this step...${END}"
read input
if [ "$input" != "s" ]
then
./add_cron_jobs
fi
printf "${SUCCESS}Installation finished! Please refer to the instructions for next steps!${END}\n"