forked from DefectDojo/django-DefectDojo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
legacy-setup.bash
executable file
·73 lines (61 loc) · 2.18 KB
/
legacy-setup.bash
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
# setup.bash helps you installing DefectDojo in your current environment
#
# setup.bash covers the following cases (and types of environments):
# - Fresh installs on non-transient environments (physical or virtual OS)
# - Fresh installs on transient environment blueprints (containerized environments)
# - Updates on non-transient environments
#
# Not (yet) addressed:
# - Updates for transient environments
#
echo
echo "Welcome to DefectDojo! This is a quick script to get you up and running."
echo
# Initialize variables and functions
source entrypoint_scripts/common/dojo-shared-resources.sh
# This function invocation ensures we're running the script at the right place
verify_cwd
if [ "$BATCH_MODE" == "yes" ]; then
setup_batch_mode
else
prompt_db_type
fi
echo
echo "NEED SUDO PRIVILEGES FOR NEXT STEPS!"
echo
echo "Installing required packages..."
echo
# Install OS dependencies like DB client, further package managers, etc.
install_os_dependencies
# Install database-related packages
install_db
# Create the application DB or recreate it, if it's already present
ensure_application_db
if [ -z "$BATCH_MODE" ]; then
# Adjust the settings.py file
prepare_settings_file
fi
# Ensure, we're running on a supported python version
verify_python_version
# Install the actual application
install_app
echo "=============================================================================="
echo
echo "SUCCESS! Now edit your settings.py file in the 'dojo/settings/' directory to complete the installation."
echo
echo "We suggest you consider changing the following defaults:"
echo
echo " DEBUG = True # you should set this to False when you are ready for production."
echo " Uncomment the following lines if you enabled SSL/TLS on your server:"
echo " SESSION_COOKIE_SECURE = True"
echo " CSRF_COOKIE_SECURE = True"
echo " SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')"
echo " SECURE_SSL_REDIRECT = True"
echo " SECURE_BROWSER_XSS_FILTER = True"
echo " django.middleware.security.SecurityMiddleware"
echo
echo "When you're ready to start the DefectDojo server, type in this directory:"
echo
echo " python manage.py runserver"
echo