Installing Taiga on CentOS (x64)

 

Dependencies

yum update -y
yum groupinstall "Development Tools" -y
yum install libxslt-devel libxml2-devel libXt-devel curl git tmux -y

Installing PostgreSQL

TAIGA_POSTGRES_BD = taiga
TAIGA_POSTGRES_USER = taiga
TAIGA_POSTGRES_PASSWORD=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-20};echo;`

rpm -ivh http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-centos94-9.4-1.noarch.rpm
sed -i 's/^gpgkey.*/&nexclude=postgresql*/' /etc/yum.repos.d/CentOS-Base.repo

yum -y install postgresql94 postgresql94-contrib postgresql94-server postgresql94-devel postgresql94-libs
service postgresql-9.4 initdb

sed -i "/^host/s/ident/md5/g" /var/lib/pgsql/9.4/data/pg_hba.conf

/sbin/chkconfig --level 35 postgresql-9.4 on
service postgresql-9.4 start

echo -e "$TAIGA_POSTGRES_PASSWORDn$TAIGA_POSTGRES_PASSWORDn" | su - postgres -c "createuser --pwprompt $TAIGA_POSTGRES_USER"
su - postgres -c "createdb $TAIGA_POSTGRES_BD -O $TAIGA_POSTGRES_USER"

Installing Python

wget --directory-prefix=/tmp http://repo.continuum.io/miniconda/Miniconda3-3.7.0-Linux-x86_64.sh
bash /tmp/Miniconda3-3.7.0-Linux-x86_64.sh -b -p /usr/local/miniconda3

cat > /etc/profile.d/miniconda.sh << EOF
if [[ $PATH != */usr/local/miniconda3/bin* ]]
then
    export PATH=/usr/local/miniconda3/bin:$PATH
fi
EOF

source /etc/profile.d/miniconda.sh

Installing Taiga Backend

TAIGA_SECRET_KEY=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-20};echo;`

adduser taiga

DIR="/var/log/taiga /opt/taiga-back /opt/taiga-events"
for NAME in $DIR
do
if [ ! -d $NAME ]; then
   mkdir $NAME
   chown taiga.taiga $NAME
fi
done

su - taiga
git clone https://github.com/taigaio/taiga-back.git /opt/taiga-back
cd /opt/taiga-back
git checkout stable

Create environment…

conda create --yes -n taiga python
source activate taiga
conda install --yes pip

Installing taiga.io requirements…

export PATH=$PATH:/usr/pgsql-9.4/bin/
pip install -r requirements.txt
exit

Configure backend…

cat > /opt/taiga-back/settings/local.py << EOF
from .development import *

DATABASES = {
    'default': {
        'ENGINE': 'transaction_hooks.backends.postgresql_psycopg2',
        'NAME': '$TAIGA_POSTGRES_BD',
        'USER': '$TAIGA_POSTGRES_USER',
        'PASSWORD': '$TAIGA_POSTGRES_PASSWORD'
    }
}

MEDIA_URL = "http://example.com/media/"
STATIC_URL = "http://example.com/static/"
ADMIN_MEDIA_PREFIX = "http://example.com/static/admin/"
SITES["front"]["scheme"] = "http"
SITES["front"]["domain"] = "example.com"

SECRET_KEY = "$TAIGA_SECRET_KEY"

DEBUG = False
TEMPLATE_DEBUG = False

PUBLIC_REGISTER_ENABLED = True

DEFAULT_FROM_EMAIL = "no-reply@example.com"
SERVER_EMAIL = DEFAULT_FROM_EMAIL
EOF

chown taiga.taiga /opt/taiga-back/settings/local.py

Populate the database with initial data…

su - taiga
source activate taiga
cd /opt/taiga-back
python manage.py migrate --noinput
python manage.py loaddata initial_user
python manage.py loaddata initial_project_templates
python manage.py loaddata initial_role
python manage.py collectstatic --noinput
exit

This creates a new user “admin” with password “123123”.

Circus and gunicorn

conda install --yes pip
pip install circus

You can check environment path with this command:

su - taiga -c "conda info -e"

Output will be something like this:

# conda environments:
#
taiga                    /home/taiga/envs/taiga
root                  *  /usr/local/miniconda3

cat > /etc/circus.ini << EOF
[circus]
check_delay = 5
endpoint = tcp://127.0.0.1:5555
pubsub_endpoint = tcp://127.0.0.1:5556
statsd = true

[watcher:taiga]
working_dir = /opt/taiga-back
cmd = gunicorn
args = -w 3 -t 60 --pythonpath=. -b 127.0.0.1:8001 taiga.wsgi
uid = taiga
numprocesses = 1
autostart = true
send_hup = true
stdout_stream.class = FileStream
stdout_stream.filename = /var/log/taiga/gunicorn.stdout.log
stdout_stream.max_bytes = 10485760
stdout_stream.backup_count = 4
stderr_stream.class = FileStream
stderr_stream.filename = /var/log/taiga/gunicorn.stderr.log
stderr_stream.max_bytes = 10485760
stderr_stream.backup_count = 4

[env:taiga]
PATH = $PATH:/home/taiga/envs/taiga/bin
TERM=rxvt-256color
SHELL=/bin/bash
USER=taiga
LANG=en_US.UTF-8
HOME=/home/taiga
PYTHONPATH=/home/taiga/envs/taiga/lib/python3.4/site-packages
EOF

cat > /etc/init/circus.conf << EOF
start on runlevel [2345]
stop on runlevel [016]

respawn
exec /usr/local/miniconda3/bin/circusd /etc/circus.ini
EOF

Start the circus service.

initctl start circus

Backend installation complete.

Installing Taiga Events // Review: doesn’t work

su - taiga
git clone https://github.com/taigaio/taiga-events.git /opt/taiga-events
cd /opt/taiga-events
git checkout stable

Install requirements… …

source activate taiga
pip install -r requirements.txt
exit

Configure taiga-events…

cat > /opt/taiga-events/conf.py << EOF
secret_key = "$TAIGA_SECRET_KEY"

repo_conf = {
    "kwargs": {"dsn": "dbname=$TAIGA_POSTGRES_BD"}
}

queue_conf = {
    "path": "taiga_events.queues.pg.EventsQueue",
    "kwargs": {
        "dsn": "dbname=$TAIGA_POSTGRES_BD"
    }
}
EOF

chown taiga.taiga /opt/taiga-events/conf.py

Configure circus…

cat >> /etc/circus.ini << EOF

[watcher:taiga-events]
working_dir = /opt/taiga-events
cmd = python run.py -f conf.py
uid = taiga
numprocesses = 1
autostart = true
stdout_stream.class = FileStream
stdout_stream.filename = /var/log/taiga/events.stdout.log
stdout_stream.max_bytes = 10485760
stdout_stream.backup_count = 4
stderr_stream.class = FileStream
stderr_stream.filename = /var/log/taiga/events.stderr.log
stderr_stream.max_bytes = 10485760
stderr_stream.backup_count = 4
copy_env = true
virtualenv = /home/taiga/envs/taiga/
EOF

Restart circus after updating the configuration

initctl restart circus

Installing Taiga Frontend