diff --git a/.bzrignore b/.bzrignore new file mode 100644 index 0000000..0405296 --- /dev/null +++ b/.bzrignore @@ -0,0 +1,8 @@ +bin +build +include +lib +local +src +dev.sqlite +media diff --git a/README b/README new file mode 100644 index 0000000..b5902b5 --- /dev/null +++ b/README @@ -0,0 +1,26 @@ +pdfvideo - share pdfs with video overlays + +Get: + cd /srv + bzr branch http://code.0x2620.org/pdfvideo + cd pdfvideo + virtualenv --system-site-packages . + . bin/activate + pip install -r requirements.txt + +Develop: + + cd /srv/pdfvideo + create pdfvideo/local_settings.py + ./manage.py runserver + +Deploy: + + cd /srv/pdfvideo + create pdfvideo/local_settings.py + + create /etc/apache2/sites-availavle/sitename.conf + create /etc/init/pdfvideo.conf + + service pdfvideo start + diff --git a/etc/apache2/pdfview.conf b/etc/apache2/pdfview.conf new file mode 100644 index 0000000..fe7ae31 --- /dev/null +++ b/etc/apache2/pdfview.conf @@ -0,0 +1,38 @@ + + ServerHostname pdf.0x2620.org + + LogLevel warn + ErrorLog /var/log/apache2/pdfvideo.org_error.log + CustomLog /var/log/apache2/pdfvideo.org_access.log combined + + + Options -Indexes + + + Order deny,allow + Allow from all + + + + XSendFile on + XSendFileAllowAbove on + + + Alias /.bzr /srv/pdfvideo/.bzr + Alias /static /srv/pdfvideo/static + Alias /robots.txt /srv/pdfvideo/pdfvideo/static/robots.txt + Alias /favicon.ico /srv/pdfvideo/pdfvideo/static/favicon.ico + Alias /data /srv/pdfvideo/data + Alias /admin/media /srv/pdfvideo/src/django/django/contrib/admin/media + Alias /static/js/jquery.js /srv/pdfvideo/src/django/django/contrib/admin/media/js/jquery.min.js + + RewriteEngine on + RewriteCond %{REQUEST_URI} !^/favicon.ico + RewriteCond %{REQUEST_URI} !^/robots.txt + RewriteCond %{REQUEST_URI} !^/.bzr + RewriteCond %{REQUEST_URI} !^/static + RewriteCond %{REQUEST_URI} !^/data + RewriteCond %{REQUEST_URI} !^/admin/media + RewriteRule ^/(.*) http://127.0.0.1:2688/$1 [P] + ServerSignature Off + diff --git a/etc/init/pdfview.conf b/etc/init/pdfview.conf new file mode 100644 index 0000000..9115d71 --- /dev/null +++ b/etc/init/pdfview.conf @@ -0,0 +1,24 @@ +# pdfview gunicorn daemon +# + +description "pdfview daemon" + +start on runlevel [2345] +stop on runlevel [!2345] +kill timeout 5 +respawn + +env NAME=pdfview +env VENV=/srv/pdfview +env DAEMON_USER=pdfview +env HOME=/home/pdfview + +script +test -e /var/log/$NAME || (mkdir -p /var/log/pdfview && chown $DAEMON_USER:$DAEMON_USER /var/log/$NAME) +cd $VENV/pdfview +exec /usr/bin/sudo -u $DAEMON_USER $VENV/bin/gunicorn_django \ + --bind 127.0.0.1:2688 \ + --timeout 90 \ + --log-level info --log-file /var/log/$NAME/$NAME.log \ + --workers 5 +end script diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..b48e575 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +-e git+https://github.com/django/django.git@stable/1.4.x#egg=django +-e bzr+http://code.0x2620.org/python-ox/#egg=python-ox +gunicorn>=0.14.3