2010-12-02 03:32:06 +00:00
|
|
|
#!/bin/sh
|
2010-12-22 15:15:49 +00:00
|
|
|
#fails in bootstrap
|
|
|
|
apt-get -y install ipython
|
|
|
|
|
2010-12-02 03:32:06 +00:00
|
|
|
#ffmpeg
|
|
|
|
wget http://firefogg.org/nightly/ffmpeg.linux -O /usr/local/bin/ffmpeg
|
|
|
|
chmod 755 /usr/local/bin/ffmpeg
|
|
|
|
|
|
|
|
wget http://firefogg.org/nightly/ffmpeg2theora.linux -O /usr/local/bin/ffmpeg2theora
|
|
|
|
chmod 755 /usr/local/bin/ffmpeg2theora
|
|
|
|
|
|
|
|
#postgresql
|
|
|
|
apt-get -y install postgresql
|
|
|
|
sudo -u postgres createuser -S -D -R pandora
|
2011-11-08 17:05:26 +00:00
|
|
|
sudo -u postgres createdb -T template0 --locale=C --encoding=UTF8 -O pandora pandora
|
2010-12-02 03:32:06 +00:00
|
|
|
|
|
|
|
#rabbitmq
|
|
|
|
RABBITPWD=$(pwgen -n 16 -1)
|
|
|
|
rabbitmqctl add_user pandora $RABBITPWD
|
|
|
|
rabbitmqctl add_vhost /pandora
|
|
|
|
rabbitmqctl set_permissions -p /pandora pandora ".*" ".*" ".*"
|
|
|
|
|
|
|
|
#pandora
|
|
|
|
cat > /srv/pandora/pandora/local_settings.py << EOF
|
2011-11-08 17:05:26 +00:00
|
|
|
DATABASES = {
|
|
|
|
'default': {
|
|
|
|
'NAME': 'pandora',
|
|
|
|
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
|
|
|
'USER': 'pandora',
|
|
|
|
'PASSWORD': '',
|
|
|
|
}
|
|
|
|
}
|
2010-12-02 03:32:06 +00:00
|
|
|
|
2012-03-21 14:11:12 +00:00
|
|
|
DEBUG = False
|
|
|
|
|
|
|
|
DATA_SERVICE = ""
|
|
|
|
SITE_CONFIG = '/srv/pandora/pandora/pandora.jsonc'
|
2010-12-02 03:32:06 +00:00
|
|
|
|
|
|
|
BROKER_PASSWORD = "$RABBITPWD"
|
|
|
|
|
|
|
|
XACCELREDIRECT = True
|
|
|
|
EOF
|
|
|
|
|
|
|
|
cd /srv/pandora/pandora
|
2012-03-21 14:11:12 +00:00
|
|
|
sudo -u pandora python manage.py syncdb --noinput
|
|
|
|
HOST=$(hostname -s)
|
|
|
|
echo "UPDATE django_site SET domain = '$HOST.local', name = '$HOST.local' WHERE 1=1;" | sudo -u pandora python manage.py dbshell
|
2010-12-02 03:32:06 +00:00
|
|
|
|
2011-11-08 17:05:26 +00:00
|
|
|
|
2010-12-02 03:32:06 +00:00
|
|
|
mkdir /srv/pandora/data
|
|
|
|
chown -R pandora:pandora /srv/pandora
|
2011-12-16 14:13:37 +00:00
|
|
|
sudo -u pandora python manage.py update_static
|
2010-12-02 03:32:06 +00:00
|
|
|
|
|
|
|
cp /srv/pandora/etc/init/* /etc/init/
|
|
|
|
|
|
|
|
service pandora-encoding start
|
|
|
|
service pandora-tasks start
|
|
|
|
service pandora start
|
|
|
|
|
|
|
|
#nginx
|
2011-11-08 17:05:26 +00:00
|
|
|
sed "s/__PREFIX__/\/srv\/pandora/g" "/srv/pandora/etc/nginx/vhost.in" > "/etc/nginx/sites-available/default"
|
2010-12-02 03:32:06 +00:00
|
|
|
service nginx restart
|
|
|
|
|