Commit 02050bf9 by Bruno Bzeznik

Fixed CSRF cookie error and more idempotent init

parent 882dc348
......@@ -7,6 +7,9 @@ PHYLODB_DIR=$LIB_DIR/phyloalps/phylodb
echo 'GEOS_LIBRARY_PATH = "/run/current-system/sw/lib/libgeos_c.so"' >> $PHYLODB_DIR/phylodb/settings.py
echo 'GDAL_LIBRARY_PATH = "/run/current-system/sw/lib/libgdal.so"' >> $PHYLODB_DIR/phylodb/settings.py
# Disable CSRF cookie as we will use non-secure http
perl -pi -e "s/CSRF_COOKIE_SECURE.*=.*/CSRF_COOKIE_SECURE = False/" $PHYLODB_DIR/phylodb/settings.py
# Django install
cd $LIB_DIR/django
virtualenv -p python3 phylodbenv
......@@ -47,19 +50,29 @@ sudo -u phyloalps python3 install/load_sampling_data.py $latest_sample editor_db
#sudo -u phyloalps python3 install/load_genomic_data.py editor_db phyloeditor
# Download the project dependencies
cd phylodb/static/deps
source deps.sh
if [ \! -d phylodb/static/deps/bulma* ]
then
cd phylodb/static/deps
source deps.sh
fi
# Generate CSS files from SASS files
cd $PHYLODB_DIR
sass phylobrowser/static/sass/browser.sass phylobrowser/static/css/browser.css
sass phyloeditor/static/sass/editor.sass phyloeditor/static/css/editor.css
sass phylohome/static/sass/home.sass phylohome/static/css/home.css
if [ \! -f phylobrowser/static/css/browser.css ]
then
sass phylobrowser/static/sass/browser.sass phylobrowser/static/css/browser.css
sass phyloeditor/static/sass/editor.sass phyloeditor/static/css/editor.css
sass phylohome/static/sass/home.sass phylohome/static/css/home.css
fi
# Copy static files and grant permissions to httpd
python3 manage.py collectstatic
chown -R wwwrun:wwwrun $PHYLODB_DIR/static
chmod -R 775 $PHYLODB_DIR/static
if [ \! -f $PHYLODB_DIR/static/css/home.css ]
then
python3 manage.py collectstatic
chown -R wwwrun:wwwrun $PHYLODB_DIR/static
chmod -R 775 $PHYLODB_DIR/static
fi
# Start Gunicon WSGI server on port 8888
ps awux |grep gunicorn|grep -v grep|awk '{print "kill " $2}'|bash
nohup gunicorn -b :8888 phylodb.wsgi&
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment