*** WARNING ***
This script will DELETE FILES. It is intended to be used on new servers only.
*******************
MediaGoblin is a free software media publishing platform that anyone can run. You can think of it as a decentralized alternative to Flickr, YouTube, SoundCloud, etc.
This is a Binary Lane Deployment Script to get a MediaGoblin instance up and running super quickly.
Once the script has finished executing, your MediaGoblin server should start and be up and running at http://[yourIP]:6543
NOTE: It is intended for developers looking to test it out. Do not use in production. YMMV.
Deploy this script (requires existing VPS)
#!/bin/bash # Warning echo "WARNING: this is destructive. If it continues it can blow away your files & data (including an entire Postgres database." echo "To confirm continuing, type 'yes' and hit enter: " read ack if [ "$ack" == "yes" ]; then echo "OK, here we go..." else echo "Exiting." exit 1 fi # Install git, Python core sudo apt-get -y install git-core python python-dev python-lxml python-imaging python-virtualenv # Install postgres sudo apt-get -y install postgresql postgresql-client python-psycopg2 # Install video sudo apt-get -y install python-gst0.10 gstreamer0.10-plugins-base gstreamer0.10-plugins-bad gstreamer0.10-plugins-good gstreamer0.10-plugins-ugly gstreamer0.10-ffmpeg # Postgres sets up with ASCII encoding, change it to UTF 8 # Thanks http://jacobian.org/writing/pg-encoding-ubuntu/ # FIXME: automatically get the Postgres version sudo -u postgres pg_dropcluster --stop 9.1 main sudo -u postgres pg_createcluster --start -e UTF-8 9.1 main # Create MG user sudo -u postgres createuser --no-superuser --no-createdb --no-createrole mediagoblin # Create the MG DB sudo -u postgres createdb -E UNICODE -O mediagoblin mediagoblin # Create system user adduser --system mediagoblin # Create the MG directory # FIXME: is the 'users' group safe? sudo mkdir -p /srv/mediagoblin && sudo chown -hR mediagoblin:users /srv/mediagoblin # Install MG cd /srv/mediagoblin git clone git://gitorious.org/mediagoblin/mediagoblin.git cd mediagoblin git submodule init && git submodule update (virtualenv --system-site-packages . || virtualenv .) && ./bin/python setup.py develop ./bin/easy_install flup # Set up the INI file (FIXME, is this the right directory?) cp mediagoblin.ini mediagoblin_local.ini # Uncomment out the SQL engine line to set Postgres sed -i 's/# sql_engine/sql_engine/' mediagoblin_local.ini # Allow video echo "[[mediagoblin.media_types.video]]" >> mediagoblin_local.ini # Update MG DB sudo -u mediagoblin ./bin/gmg dbupdate # Set the permissions so MG user owns the directory # FIXME: As above, check group is safe sudo chown -R mediagoblin.users /srv/mediagoblin/mediagoblin/ # Start the MG server sudo -u mediagoblin ./lazyserver.sh --server-name=broadcast start