--- /dev/null
+from fabric.api import *
+
+env.user = 'portal'
+env.hosts = ['agave5.man.poznan.pl']
+
+
+#################################################
+# server management (remote)
+#################################################
+
+PID_FILE = '/var/run/uwsgi.pid'
+
+
+@task
+def start():
+ with cd('qcg-portal'):
+ run("uwsgi --ini uwsgi.ini")
+
+
+@task
+def stop():
+ run("uwsgi --stop " + PID_FILE)
+
+
+@task
+def restart():
+ run("uwsgi --reload " + PID_FILE)
+
+
+def is_running():
+ with settings(hide('everything'), warn_only=True):
+ return not run("ps -p `cat {}`".format(PID_FILE), shell_escape=False).failed
+
+
+@task
+def status():
+ print "Server is",
+ print "running." if is_running() else "not running."
+
+
+#################################################
+# deployment (remote)
+#################################################
+
+@task
+def git_status():
+ with cd('qcg-portal'):
+ run("git status")
+
+
+@task
+def deploy(load_ex_data=False):
+ with cd('qcg-portal'):
+ run("git pull")
+
+ run("pip install -r requirements.txt")
+ run("python manage.py migrate qcg")
+ run("python manage.py collectstatic --noinput")
+
+ if is_running:
+ run("uwsgi --reload " + PID_FILE)
+ else:
+ run("uwsgi --ini uwsgi.ini")
\ No newline at end of file
--- /dev/null
+[uwsgi]
+base-dir = /home/portal/qcg-portal
+
+uid = portal
+gid = portal
+
+cache2 = name=ssl,items=1000,keysize=128,blocksize=4096
+ssl-sessions-use-cache = ssl
+ssl-sessions-timeout = 300
+
+shared-socket = :80
+shared-socket = :443
+
+http-to-https = =0
+https = =1,%(base-dir)/certs/cert.crt,%(base-dir)/certs/cert.key,EECDH+aRSA+AES:EDH+aRSA+AES:kRSA+AES:@STRENGTH
+
+add-header = Strict-Transport-Security: max-age=31536000
+
+workers = 6
+enable-threads = True
+; this do not play well with ssl cache...
+; thunder-lock = True
+
+master = True
+vacuum = True
+umask = 022
+pidfile = /var/run/uwsgi.pid
+logfile-chmod = 644
+daemonize = %(base-dir)/uwsgi.master.log
+stats = %(base-dir)/uwsgi.stats.socket
+
+chdir = %(base-dir)
+virtualenv = /home/portal/venv
+module = plgng.wsgi:application
+env = DJANGO_SETTINGS_MODULE=plgng.settings_prod
+
+static-map = /static=%(base-dir)/server-static