-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·87 lines (75 loc) · 1.88 KB
/
setup.sh
File metadata and controls
executable file
·87 lines (75 loc) · 1.88 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#! /bin/bash
# Source this.
# Setup virtualenv
#mkdir -p data
if [ -d venv ]
then
echo "Deactivating and removing old virtualenv"
deactivate 2>&1 /dev/null
rm -rf venv
fi
# Check for correct python version
# VERSION=`python2 -V | awk '{print $2}'`
# if [ "${VERSION:0:1}" -ne "2" ] || [ "${VERSION:2:1}" -ne "7" ]; then
# echo "You must use Python 2.7. You are using $VERSION"
# return 1
# else
# echo -e "You are using Python $VERSION"
# fi
virtualenv --python=python2.7 venv
. venv/bin/activate
pip install -r requirements.txt
# TODO create a db script that can use the docker init builder
# Check out tools/erase_mysql_db_and_use_real_data.sh
# Set up config files
FILE=${PWD}/api/secret_key
if [ ! -f "$FILE" ]; then
echo "Generating secret key"
head /dev/urandom | tr -dc A-Za-z0-9 | head -c 14 > $FILE
fi
# Make sure api/settings.py is present
FILE=${PWD}/api/settings.py
if test -f "$FILE"; then
echo "$FILE exists"
else
touch $FILE
echo "$FILE created"
fi
echo "Remember to edit your mail settings in $FILE"
pip install -U Werkzeug==0.16.0
pip install Flask
pip install peewee
pip install pyyaml
# For security, for LDAP
pip install pyopenssl ndg-httpsclient pyasn1
pip install ldap3
# For docs
pip install mkdocs
pip install gunicorn
pip install tornado
# additional python library
pip install XlsxWriter
#for login
pip install Flask-Login
pip install PyMySQL
# For QR Codes
pip install flask-wtf
pip install wtf-peewee
#flask-mail library
pip install Flask-Mail
#pip install sqlite-web
#pip install pyotp
#pip install qrcode
#pip install Pillow
#pip install git+git://github.com/ojii/pymaging.git#egg=pymaging
#pip install git+git://github.com/ojii/pymaging-png.git#egg=pymaging-png
# Database setup
# python recreate_dynamic.py
# To deactivate the venv, use
#
# $ deactivate
#
# as a command on the command line.
# To set up the venv again, then type
#
# $ source setup.sh