/Kremlin

YunoHost VPS deployer for comrades

Primary LanguagePython

Kremlin

Kremlin is the homemade YunoHost VPS deployer based on Docker and Django.

How to install

Tested on Ubuntu 12.04.4 64bit (kernel 3.11, docker 0.9.0)

  1. Install Docker
  2. Clone the Kremlin repository
 git clone https://github.com/YunoHost/Kremlin /root/Kremlin
  1. Build the YunoHost container
 cd /root/Kremlin/docker
 docker build -t yunohost .
  1. Install and run virtualenv
 apt-get install python-pip
 pip install virtualenv
 cd /root/docker
 virtualenv ve
 source ve/bin/activate
  1. Install Kremlin's dependencies and synchronize database (SQLite by default)
 pip install -r requirements.txt
 python manage.py syncdb
  1. Edit public IP range to allow to containers
 vim kremlin/settings.py   # Parameter called "AVAILABLE_PUBLIC_IPS"

Development workflow

  1. Clean database, stop docker containers and flush iptables
 gulag() {
   rm db.sqlite3
   python manage.py syncdb --noinput
   docker ps | grep yunohost | awk '{print $1}' | xargs -l docker stop &> /dev/null &
   iptables -t nat -F
 }
 gulag
  1. Start Django development server
 python manage.py runserver 0.0.0.0:8000
  1. Debug & go to 1 :)