From 2cf3d3e7cbfa906adbf0ae35e4e7bc0f22ad1832 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sat, 2 Feb 2013 19:53:44 +0530 Subject: [PATCH] fix vm build script/nginx example config --- etc/nginx/pandora | 2 +- vm/firstboot.sh | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/etc/nginx/pandora b/etc/nginx/pandora index 485f3707..efc99a3a 100644 --- a/etc/nginx/pandora +++ b/etc/nginx/pandora @@ -41,7 +41,7 @@ server { proxy_read_timeout 90; #should be in sync with gunicorn timeout proxy_connect_timeout 90; #should be in sync with gunicorn timeout if (!-f $request_filename) { - proxy_pass http:/127.0.0.1:2620; + proxy_pass http://127.0.0.1:2620; break; } client_max_body_size 32m; diff --git a/vm/firstboot.sh b/vm/firstboot.sh index 5a347be9..ca4aa963 100755 --- a/vm/firstboot.sh +++ b/vm/firstboot.sh @@ -40,16 +40,19 @@ TEMPLATE_DEBUG = DEBUG JSON_DEBUG = False EOF +MANAGE="sudo -H -u pandora python manage.py" + cd /srv/pandora/pandora -sudo -u pandora python manage.py syncdb --noinput -sudo -u pandora python manage.py sqlfindindex | sudo -u pandora python manage.py dbshell -echo "UPDATE django_site SET domain = '$HOST.local', name = '$HOST.local' WHERE 1=1;" | sudo -u pandora python manage.py dbshell +$MANAGE syncdb --noinput +$MANAGE migrate echo "DB_GIN_TRGM = True" >> /srv/pandora/pandora/local_settings.py +$MANAGE sqlfindindex +echo "UPDATE django_site SET domain = '$HOST.local', name = '$HOST.local' WHERE 1=1;" | $MANAGE dbshell mkdir /srv/pandora/data chown -R pandora:pandora /srv/pandora -sudo -u pandora python manage.py update_static -sudo -u pandora python manage.py collectstatic -l --noinput +$MANAGE update_static +$MANAGE collectstatic -l --noinput cp /srv/pandora/etc/init/* /etc/init/