Skip to content
This repository has been archived by the owner on Dec 4, 2020. It is now read-only.

Ubuntu 18.04 #67

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions scripts/setup-apt.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function apt-install {
for pkg in $@; do
echo -e "[APT-GET] Installing package $pkg..."
sudo apt-get install -yq $pkg
sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq -o DPkg::options::="--force-confdef" -o DPkg::options::="--force-confold" $pkg
done
}

Expand All @@ -20,5 +20,5 @@ function package-not-installed {
}

sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt-get -y dist-upgrade
sudo DEBIAN_FRONTEND=noninteractive apt-get -y -o DPkg::options::="--force-confdef" -o DPkg::options::="--force-confold" upgrade
sudo DEBIAN_FRONTEND=noninteractive apt-get -y -o DPkg::options::="--force-confdef" -o DPkg::options::="--force-confold" dist-upgrade
16 changes: 10 additions & 6 deletions scripts/setup-backend.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ pushd ~
cat > /tmp/settings.py <<EOF
from .common import *

MEDIA_URL = "/media/"
STATIC_URL = "/static/"
MEDIA_URL = "$TAIGA_SCHEME://$TAIGA_DOMAIN/media/"
STATIC_URL = "$TAIGA_SCHEME://$TAIGA_DOMAIN/static/"

# This should change if you want generate urls in emails
# for external dns.
SITES["front"]["domain"] = "localhost:8000"
SITES["front"]["domain"] = "$TAIGA_DOMAIN"

DEBUG = True
PUBLIC_REGISTER_ENABLED = True
PUBLIC_REGISTER_ENABLED = $TAIGA_PUBLIC_REGISTER_ENABLED

DEFAULT_FROM_EMAIL = "[email protected]"
SERVER_EMAIL = DEFAULT_FROM_EMAIL
Expand Down Expand Up @@ -51,8 +51,12 @@ if [ ! -e ~/taiga-back ]; then
python manage.py collectstatic --noinput
python manage.py loaddata initial_user
python manage.py loaddata initial_project_templates
python manage.py sample_data
python manage.py rebuild_timeline --purge

# Import sample projects unless explicitly set to "False" in setup-vars
if [ "$TAIGA_SAMPLE_DATA" != "False" ] ; then
python manage.py sample_data
python manage.py rebuild_timeline --purge
fi

deactivate
popd
Expand Down
17 changes: 16 additions & 1 deletion scripts/setup-buildessential.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
if [ ! -e ~/.setup/buildessential ]; then
touch ~/.setup/buildessential

apt-install-if-needed build-essential binutils-doc autoconf flex bison libjpeg-dev libfreetype6-dev zlib1g-dev libzmq3-dev libgdbm-dev libncurses5-dev automake libtool libffi-dev curl gettext cairo
if [ "$VERSION_ID" = "18.04" ]; then
apt-install-if-needed automake wget curl gettext circus \
build-essential libgdbm-dev binutils-doc autoconf flex gunicorn \
bison libjpeg-dev libzmq3-dev libfreetype6-dev zlib1g-dev \
libncurses5-dev libtool libxslt1-dev libxml2-dev libffi-dev \
libssl-dev circus

# Utils
apt-install-if-needed git pwgen tmux

elif [ "$VERSION_ID" = "16.04" ]; then
apt-install-if-needed build-essential binutils-doc autoconf \
flex bison libjpeg-dev libfreetype6-dev zlib1g-dev libzmq3-dev \
libgdbm-dev libncurses5-dev automake libtool libffi-dev curl \
gettext cairo

# Utils
apt-install-if-needed git tmux
fi
fi
17 changes: 17 additions & 0 deletions scripts/setup-certbot.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# setup-certbot.sh
# install certbot and configure nginx

if [ ! -e ~/.setup/certbot ]; then

touch ~/.setup/certbot

if [ "$TAIGA_ENCRYPT" == "True" ]; then
sudo apt-get install software-properties-common -y
sudo add-apt-repository universe
sudo add-apt-repository ppa:certbot/certbot -y
sudo apt-get update
sudo apt-get install certbot python-certbot-nginx -y
sudo certbot --non-interactive --nginx -d $TAIGA_DOMAIN --agree-tos --email $TAIGA_SSL_EMAIL
fi

fi
17 changes: 17 additions & 0 deletions scripts/setup-hostname.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# setup-hostname.sh
# set up hostname and domain name in hosts file

if [ ! -e ~/.setup/hostname ]; then

touch ~/.setup/hostname

if [ "$TAIGA_HOSTNAME" != "localhost" ] && [ "$TAIGA_HOSTNAME" != $(hostname) ]; then
sudo hostnamectl set-hostname $TAIGA_HOSTNAME
echo "127.0.0.1 $TAIGA_HOSTNAME" | sudo tee -a /etc/hosts
fi

if [ "$TAIGA_DOMAIN" != "$IP_ADDRESS" ] ; then
echo "$IP_ADDRESS $TAIGA_DOMAIN" | sudo tee -a /etc/hosts
fi

fi
11 changes: 11 additions & 0 deletions scripts/setup-os-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

source /etc/os-release
if [ "$VERSION_ID" != "18.04" ] && [ "$VERSION_ID" != "16.04" ]; then
echo "This script is not compatible with your current OS: $PRETTY_NAME"
echo "Please try to install on Ubuntu-18.04 LTS or Ubuntu-16.04 LTS"
exit 1
else
echo "Installing taigaio on $PRETTY_NAME"
fi
sleep 3
18 changes: 18 additions & 0 deletions scripts/setup-post-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
if [ ! -e ~/.setup/data.sh ]; then

echo "---------------------------------------------------"
echo "Installed taiga.io:"
echo ""
echo "Hostname: $TAIGA_HOSTNAME"
echo "Import Sample Projects: $TAIGA_SAMPLE_DATA"
echo "Public Registation Enabled: $TAIGA_PUBLIC_REGISTER_ENABLED"
echo ""
echo "URL: $TAIGA_SCHEME://$TAIGA_DOMAIN"
echo "Username: admin"
echo "Password: 123123"
echo "(Please log in and change password)"
echo ""
echo "For more information please visit: http://taigaio.github.io/taiga-doc/dist/ "
echo "---------------------------------------------------"

fi
6 changes: 5 additions & 1 deletion scripts/setup-postgresql.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@ function dropdb-if-needed {
}

if [ ! -e ~/.setup/postgresql ]; then
if [ "$VERSION_ID" = "18.04" ]; then
apt-install-if-needed postgresql-10 postgresql-contrib \
postgresql-doc-10 postgresql-server-dev-10
elif [ "$VERSION_ID" = "16.04" ]; then
apt-install-if-needed postgresql-9.5 postgresql-contrib-9.5 \
postgresql-doc-9.5 postgresql-server-dev-9.5
fi

sudo -u postgres createuser --superuser $USER &> /dev/null
sudo -u postgres createdb $USER &> /dev/null

touch ~/.setup/postgresql
fi

11 changes: 9 additions & 2 deletions scripts/setup-python.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
#!/bin/bash

apt-install-if-needed python3 python3-pip python-dev python3-dev python-pip virtualenvwrapper libxml2-dev libxslt1-dev
if [ "$VERSION_ID" = "18.04" ]; then
# Define python version for virtualenv
PYTHON_VERSION="python3.6"
apt-install-if-needed python3 python3-pip python3-dev python3-pip virtualenvwrapper
elif [ "$VERSION_ID" = "16.04" ]; then
PYTHON_VERSION="python3.5"
apt-install-if-needed python3 python3-pip python-dev python3-dev python-pip virtualenvwrapper libxml2-dev libxslt1-dev
fi
source /usr/share/virtualenvwrapper/virtualenvwrapper_lazy.sh

function mkvirtualenv-if-needed {
for envname in $@; do
$(lsvirtualenv | grep -q "$envname") || mkvirtualenv "$envname" -p /usr/bin/python3.5
$(lsvirtualenv | grep -q "$envname") || mkvirtualenv "$envname" -p /usr/bin/$PYTHON_VERSION
done
}
53 changes: 43 additions & 10 deletions scripts/setup-vars.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,54 @@
mkdir -p ~/.setup

if [ -e ~/.setup/data.sh ]; then
# For unattended install get variables from cloud installer
source ~/.setup/data.sh
else
echo -n "Scheme (default http): "
read scheme
echo -n "Hostname (default: localhost:8000): "
read hostname

if [ -z "$hostname" ]; then
hostname="localhost:8000"
fi
# Determine active network interface and active IP Address, if not connected, use hostname
NET_INTERFACE=$(ip addr show | awk '/inet.*brd/{print $NF; exit}')
if [[ $NET_INTERFACE = "" ]]; then
IP_ADDRESS=$(hostname)
else
IP_ADDRESS=${TAIGA_DOMAIN:-$(/sbin/ifconfig $NET_INTERFACE | awk '/inet / { print $2 }' | sed 's/addr://')}
fi

read -p "Host name (default: $(hostname)):" TAIGA_HOSTNAME
TAIGA_HOSTNAME=${TAIGA_HOSTNAME:-$(hostname)}

read -p "Fully qualified domain name or IP address (default: $IP_ADDRESS): " TAIGA_DOMAIN
TAIGA_DOMAIN=${TAIGA_DOMAIN:-$IP_ADDRESS}

if [ -z "$scheme" ]; then
scheme="http"
if [ "$TAIGA_DOMAIN" != "$IP_ADDRESS" ] ; then
read -p "Use encryption (from letsencrypt.org + certbot) for domain '$TAIGA_DOMAIN' - requires email next step (y/N):" TAIGA_ENCRYPT
case $TAIGA_ENCRYPT in
[Yy]* ) TAIGA_ENCRYPT="True";;
* ) TAIGA_ENCRYPT="False";;
esac

if [ "$TAIGA_ENCRYPT" == "True" ] ; then
TAIGA_SCHEME="https"
while [[ $TAIGA_SSL_EMAIL == "" ]]; do
read -p "Email to use for certificate notifications (required, cartificate will fail if invalid): " TAIGA_SSL_EMAIL
done
fi

fi

read -p "Import Sample Projects (Y/n):" TAIGA_SAMPLE_DATA
case $TAIGA_SAMPLE_DATA in
[Nn]* ) TAIGA_SAMPLE_DATA="False";;
* ) TAIGA_SAMPLE_DATA="True";;
esac

read -p "Public Registation Enabled: (Y/n):" TAIGA_PUBLIC_REGISTER_ENABLED
case $TAIGA_PUBLIC_REGISTER_ENABLED in
[Nn]* ) TAIGA_PUBLIC_REGISTER_ENABLED="False";;
* ) TAIGA_PUBLIC_REGISTER_ENABLED="True";;
esac

TAIGA_SCHEME=${TAIGA_SCHEME:-"http"}

fi

echo "Installing taigaio with user=$USER host=$hostname scheme=$scheme"
sleep 2
7 changes: 5 additions & 2 deletions setup-devel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ mkdir -p logs
mkdir -p conf
popd

# System information and verification
source ./scripts/setup-os-release.sh

# Bootstrap
# source ./scripts/setup-vars.sh
source ./scripts/setup-vars.sh
source ./scripts/setup-hostname.sh
source ./scripts/setup-config.sh
source ./scripts/setup-apt.sh

Expand All @@ -23,4 +27,3 @@ source ./scripts/setup-python.sh
# Setup Taiga
source ./scripts/setup-frontend.sh
source ./scripts/setup-backend.sh

4 changes: 4 additions & 0 deletions setup-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ source ./setup-devel.sh
# Post Setup Services
source ./scripts/setup-circus.sh
source ./scripts/setup-nginx.sh
source ./scripts/setup-certbot.sh

# Display install info
source ./scripts/setup-post-install.sh