pan.do/ra is a free, open source media archive platform.
Find a file
Will Thompson eebb0b5681 Combine {Item,Clip,edit.Clip}.get_layers()
This has several benefits:

    • Clip.get_layers() (used by smart edits) and Item.get_layers() pick up
    the select_related('user') optimization added for static edits in
    r5007.

    • Static edits and items pick up the optimization from r4941 to select
    annotations once, not once per layer.

Fetching an item with ~1000 annotations took ~1s without this patch,
~0.34s with this patch. Another item with ~6000 annotations took ~11.6s
before, ~8.6s after.

Because this block is moved out to the top:

if user and user.is_anonymous():
user = None

then, for anonymous users,

"editable": false,

is no longer included in the annotations. The old behaviour ended up
including this key in all layers listed before the first private layer
in the config, and leaving it out from later ones. So this new behaviour
is more consistent.
2015-09-14 14:06:43 +02:00
contrib/django_extensions include copy of django_extension, dont install django from git 2014-11-20 16:34:55 +00:00
etc tune nginx settings 2015-05-18 11:43:14 +02:00
pandora Combine {Item,Clip,edit.Clip}.get_layers() 2015-09-14 14:06:43 +02:00
scripts upper case pi, fixes #1677 2013-07-22 19:27:20 +00:00
static add canPlayClips flag to annotation layers and use those layers to limit playback to clips 2015-08-27 11:27:27 +02:00
vm dont install avahi-daemon in lxc 2015-09-03 19:57:58 +02:00
.bzrignore update .bzrignore 2014-09-30 15:43:06 +02:00
COPYING add gpl3 2012-11-26 17:46:14 +01:00
ctl add inital implementation for a websocket, disabled by default for now 2015-04-28 23:05:15 +05:30
README add inital implementation for a websocket, disabled by default for now 2015-04-28 23:05:15 +05:30
requirements.txt add inital implementation for a websocket, disabled by default for now 2015-04-28 23:05:15 +05:30
update.py use sys.argv[0] 2015-05-22 12:00:35 +02:00

pan.do/ra - open media archive

for more information on pan.do/ra visit our website at https://pan.do/ra

== SETUP ==
pan.do/ra is known to work with Ubuntu 14.04,
but other distributions should also work.
The instructions below are for Ubuntu 14.04.
All commans given expect that you are root.

To run pan.do/ra you need to install and setup:
    python
    postgres
    nginx (or apache2)
    additinal video packages


=== Installing required packages ===

1) add pandora ppa to get all packages in the required version

    apt-get install software-properties-common
    add-apt-repository ppa:j/pandora
    apt-get update

2) install all required packages
    apt-get install bzr git subversion mercurial \
            python-setuptools python-pip python-virtualenv ipython \
            python-dev python-imaging python-numpy python-psycopg2 \
            python-geoip python-html5lib python-lxml \
            postgresql postgresql-contrib rabbitmq-server \
            poppler-utils mkvtoolnix gpac imagemagick \
            python-ox oxframe ffmpeg

=== Prepare Environment ===

1) add pandora user and set permissions
   adduser pandora --disabled-login --disabled-password

2) Setup Database
   su postgres
   createuser pandora
   createdb  -T template0 --locale=C --encoding=UTF8 -O pandora pandora
   echo "CREATE EXTENSION pg_trgm;" | psql pandora
   exit

3) Setup RabbitMQ
You have to use the same password here and in BROKER_URL in local_settings.py

    rabbitmqctl add_user pandora PASSWORD
    rabbitmqctl add_vhost /pandora
    rabbitmqctl set_permissions -p /pandora pandora ".*" ".*" ".*"


=== Install Pan.do/ra ===

1) Get code from bazzar
    cd /srv/
    bzr branch http://code.0x2620.org/pandora pandora
    cd pandora
    virtualenv --system-site-packages .
    ./bin/pip install -r requirements.txt

    cd static
    bzr branch http://code.0x2620.org/oxjs

    cd /srv
    chown -R pandora.pandora pandora

2) create local_settings.py and config.jsonc

2.1) create file /srv/pandora/pandora/local_settings.py with the following content:
    DATABASES = {
        'default': {
            'NAME': 'pandora',
            'ENGINE': 'django.db.backends.postgresql_psycopg2',
            'USER': 'pandora',
            'PASSWORD': '',
        }
    }
    DB_GIN_TRGM = True
    BROKER_URL = 'amqp://pandora:PASSWORD@localhost:5672//pandora'

    #with apache x-sendfile or lighttpd set this to True
    XSENDFILE = False

    #with nginx X-Accel-Redirect set this to True
    XACCELREDIRECT = True

2.2) create config.jsonc
    config.jsonc holds the configuration for your site.
    To start you can copy /srv/pandora/pandora/config.pandora.jsonc
    to /srv/pandora/pandora/config.jsonc but have a look at 
    https://wiki.0x2620.org/wiki/pandora/configuration and
    config.0xdb.jsonc config.padma.jsonc for configuration options.

3) initialize database
    su pandora
    cd /srv/pandora/pandora
    ./manage.py init_db

4) install init scripts and start daemons

    /srv/pandora/ctl install
    /srv/pandora/ctl start

5) Setup Webserver
a) nginx (recommended)
    apt-get install nginx
    cp /srv/pandora/etc/nginx/pandora /etc/nginx/sites-available/pandora
    cd /etc/nginx/sites-enabled
    ln -s ../sites-available/pandora

    #read comments in /etc/nginx/sites-available/pandora for setting
    #your hostname and other required settings
    #make sure XACCELREDIRECT = True in /srv/pandora/pandora/local_settings.py
    
    service nginx reload

b) apache2 (if you need it for other sites on the same server)
    apt-get install apache2-mpm-prefork libapache2-mod-xsendfile
    a2enmod xsendfile
    a2enmod proxy_http
    a2enmod proxy_wstunnel
    cp /srv/pandora/etc/apache2/pandora.conf /etc/apache2/sites-available/pandora.conf
    a2ensite pandora

    #read comments in /etc/apache2/sites-available/pandora.conf for setting
    #your hostname and other required settings
    #make sure XSENDFILE = True in /srv/pandora/pandora/local_settings.py
    
    service apache2 reload

Now you can open pandora in your browser, the first user to sign up will become admin.

== Updating ==
To update pandora to the latest version run this:
  su pandora
  cd /srv/pandora
   ./update.py

this will update pandora/oxjs/python-ox and list possible upgrades to the db

to update your database run:
  su pandora
  cd /srv/pandora
   ./update.py db

== Development ==
  in one terminal:
    ./manage.py runserver 2620

  and background task in another:
    ./manage.py celeryd -B -Q celery,default,encoding -l INFO

  now you can access your local pandora instace at http://127.0.0.1:8000/

  we use virtual machines/lxc for development, you can get a vm from our site
  or use the script in vm/build.sh to create one.