parent
b832e50b4b
commit
17fa3847ec
@ -0,0 +1 @@
|
||||
>=dev-db/postgresql-13
|
@ -0,0 +1,6 @@
|
||||
# Calculate format=samba path=/var/calculate grep(/var/calculate/ini.env,postgresql)== comment=# protected
|
||||
[postgresql]
|
||||
postgres_password = #-rnd(pas,12)-#
|
||||
taiga_user = taiga
|
||||
taiga_password = #-rnd(pas,12)-#
|
||||
taiga_database = taiga
|
@ -0,0 +1,2 @@
|
||||
# Calculate path=/root name=.pgpass chmod=600 comment=# protected
|
||||
localhost:*:*:postgres:#-ini(postgresql.postgres_password)-#
|
@ -0,0 +1,4 @@
|
||||
# Calculate format=samba path=/var/calculate grep(/var/calculate/ini.env,rabbitmq)== comment=# protected
|
||||
[rabbitmq]
|
||||
taiga_user = taiga
|
||||
taiga_password = #-rnd(pas,12)-#
|
@ -0,0 +1 @@
|
||||
# Calculate path=/usr/sbin name=#-cut(1,.)-# link=/var/db/repos/container/scripts/cl-setup-taiga.sh symbolic protected
|
@ -1 +0,0 @@
|
||||
# Calculate path=/etc/runlevels/default name=#-cut(1,.)-# link=/etc/init.d/#-cut(1,.)-# protected symbolic
|
@ -1,10 +0,0 @@
|
||||
# Calculate path=/var/calculate/bin name=#-cut(1,.)-# chmod=755 comment=#
|
||||
#!/bin/bash
|
||||
set -eo pipefail
|
||||
export PATH="/lib/rc/bin:$PATH"
|
||||
|
||||
su - taiga -c /var/calculate/bin/install-taiga
|
||||
|
||||
/var/calculate/bin/setup-taiga
|
||||
|
||||
/var/calculate/bin/setup-rabbit
|
@ -1,50 +0,0 @@
|
||||
# Calculate path=/var/calculate/bin name=#-cut(1,.)-# chmod=755 comment=#
|
||||
#!/bin/bash
|
||||
set -ueo pipefail
|
||||
export PATH="/lib/rc/bin:$PATH"
|
||||
|
||||
all=
|
||||
while IFS= read -r line
|
||||
do
|
||||
if [[ $line == *"["* ]]
|
||||
then
|
||||
line=${line#*[}
|
||||
line=${line%%]*}
|
||||
sec=$line
|
||||
continue
|
||||
fi
|
||||
if [[ ${line:0:1} == '#' || $line == '' ]]
|
||||
then
|
||||
continue
|
||||
fi
|
||||
com=${sec}_${line// =/=};
|
||||
com=${com//= /=};
|
||||
all="$com; $all"
|
||||
done < /var/calculate/ini.env
|
||||
eval $all
|
||||
|
||||
ebegin 'Проверка выполненной базовой настройки'
|
||||
if [[ ! -e /var/lib/postgresql/12 ]]
|
||||
then
|
||||
echo Выполните настройку 'emerge --config =dev-db/postgresql-12.12'.
|
||||
exit 1
|
||||
fi
|
||||
eend
|
||||
|
||||
ebegin 'Проверка запущенного PostgreSQL'
|
||||
if [[ $(ls /run/postgresql/.*lock 2>/dev/null | wc -l) == 0 ]]
|
||||
then
|
||||
echo Запустите PostgreSQL
|
||||
exit 1
|
||||
fi
|
||||
eend
|
||||
|
||||
ebegin 'Проверка наличия роли taiga'
|
||||
$(psql -U taiga -d taiga -c '\dt' 2&>/dev/null) || {
|
||||
echo Пароль: $taiga_pgsql_password
|
||||
createuser -U postgres -P taiga
|
||||
createdb -U postgres -O taiga taiga
|
||||
}
|
||||
eend
|
||||
|
||||
cl-core-setup -n postgresql
|
@ -1,37 +0,0 @@
|
||||
# Calculate path=/var/calculate/bin name=#-cut(1,.)-# chmod=755 comment=#
|
||||
#!/bin/bash
|
||||
set -ueo pipefail
|
||||
export PATH="/lib/rc/bin:$PATH"
|
||||
|
||||
all=
|
||||
while IFS= read -r line
|
||||
do
|
||||
if [[ $line == *"["* ]]
|
||||
then
|
||||
line=${line#*[}
|
||||
line=${line%%]*}
|
||||
sec=$line
|
||||
continue
|
||||
fi
|
||||
if [[ ${line:0:1} == '#' || $line == '' ]]
|
||||
then
|
||||
continue
|
||||
fi
|
||||
com=${sec}_${line// =/=};
|
||||
com=${com//= /=};
|
||||
all="$com; $all"
|
||||
done < /var/calculate/ini.env
|
||||
eval $all
|
||||
|
||||
rabbit_configure(){
|
||||
if [[ ! -e /var/lib/rabbitmq/mnesia ]]
|
||||
then
|
||||
/etc/init.d/rabbitmq start
|
||||
|
||||
rabbitmqctl add_user $taiga_rabbitmq_user $taiga_rabbitmq_password
|
||||
rabbitmqctl add_vhost taiga
|
||||
rabbitmqctl set_permissions -p taiga $taiga_rabbitmq_user ".*" ".*" ".*"
|
||||
fi
|
||||
}
|
||||
|
||||
rabbit_configure
|
@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ueo pipefail
|
||||
|
||||
/var/db/repos/container/scripts/taiga-postgresql.sh
|
||||
|
||||
/var/db/repos/container/scripts/taiga-rabbitmq.sh
|
||||
|
||||
su - taiga -c '/var/db/repos/container/scripts/taiga-www-install.sh'
|
||||
|
||||
/var/db/repos/container/scripts/taiga-www-setup.sh
|
||||
|
||||
su - taiga -c '/var/db/repos/container/scripts/taiga-www-migrate.sh'
|
||||
|
||||
rc-update add taiga
|
||||
rc-update -u
|
||||
openrc
|
@ -0,0 +1,23 @@
|
||||
# Read vars from /var/calculate/ini.env
|
||||
get_ini(){
|
||||
all=
|
||||
while IFS= read -r line
|
||||
do
|
||||
if [[ $line == *"["* ]]
|
||||
then
|
||||
line=${line#*[}
|
||||
line=${line%%]*}
|
||||
sec=$line
|
||||
continue
|
||||
fi
|
||||
if [[ ${line:0:1} == '#' || $line == '' ]]
|
||||
then
|
||||
continue
|
||||
fi
|
||||
com=${sec}_${line// =/=};
|
||||
com=${com//= /=};
|
||||
all="$com; $all"
|
||||
done < /var/calculate/ini.env
|
||||
eval $all
|
||||
}
|
||||
|
@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ueo pipefail
|
||||
if [[ -e /var/lib/postgresql/12 ]]
|
||||
then
|
||||
exit
|
||||
fi
|
||||
|
||||
export PATH="/lib/rc/bin:$PATH"
|
||||
source /var/db/repos/container/scripts/functions.sh
|
||||
get_ini
|
||||
|
||||
emerge --config =dev-db/postgresql-12.12
|
||||
|
||||
/etc/init.d/postgresql-12 start
|
||||
|
||||
psql -U postgres -c "ALTER USER postgres WITH PASSWORD '$postgresql_postgres_password'"
|
||||
|
||||
psql -U postgres -c "CREATE ROLE $postgresql_taiga_user WITH login"
|
||||
psql -U postgres -c "CREATE DATABASE taiga OWNER taiga"
|
||||
psql -U postgres -c "ALTER USER $postgresql_taiga_user WITH PASSWORD '$postgresql_taiga_password'"
|
||||
|
||||
cl-core-setup -n postgresql -f
|
||||
/etc/init.d/postgresql-12 restart
|
@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ueo pipefail
|
||||
|
||||
if [[ -e /var/lib/rabbitmq/mnesia ]]
|
||||
then
|
||||
exit
|
||||
fi
|
||||
|
||||
export PATH="/lib/rc/bin:$PATH"
|
||||
source /var/db/repos/container/scripts/functions.sh
|
||||
get_ini
|
||||
|
||||
/etc/init.d/rabbitmq start
|
||||
|
||||
rabbitmqctl add_user $rabbitmq_taiga_user $rabbitmq_taiga_password
|
||||
rabbitmqctl add_vhost taiga
|
||||
rabbitmqctl set_permissions -p taiga $rabbitmq_taiga_user ".*" ".*" ".*"
|
@ -0,0 +1,109 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -eo pipefail
|
||||
export PATH="/lib/rc/bin:$PATH"
|
||||
|
||||
if [[ $UID == 0 ]]
|
||||
then
|
||||
exit
|
||||
fi
|
||||
|
||||
source /var/db/repos/container/scripts/functions.sh
|
||||
get_ini
|
||||
|
||||
if [[ ! -e ~/.node-live ]]
|
||||
then
|
||||
einfo 'Install Node.js'
|
||||
cd ~
|
||||
nodeenv --node=$taiga_node .node-${taiga_node%%.*}
|
||||
ln -sfT .node-${taiga_node%%.*} .node-live
|
||||
fi
|
||||
source ~/.node-live/bin/activate
|
||||
|
||||
set -u
|
||||
|
||||
install_taiga_back(){
|
||||
cd ~
|
||||
einfo 'Backend Setup: Get the code'
|
||||
git clone https://github.com/kaleidos-ventures/taiga-back.git taiga-back
|
||||
cd taiga-back
|
||||
git checkout stable
|
||||
|
||||
einfo 'Create a virtualenv'
|
||||
python -m venv .venv --prompt taiga-back
|
||||
source .venv/bin/activate
|
||||
pip install --upgrade pip wheel
|
||||
|
||||
einfo 'Install all Python dependencies'
|
||||
pip install -r requirements.txt
|
||||
|
||||
einfo 'Install taiga-contrib-protected'
|
||||
pip install git+https://github.com/kaleidos-ventures/taiga-contrib-protected.git@stable#egg=taiga-contrib-protected
|
||||
|
||||
ebegin 'Copy the example config file'
|
||||
cp settings/config.py.prod.example settings/config.py
|
||||
eend
|
||||
}
|
||||
|
||||
install_taiga_front_dist(){
|
||||
cd ~
|
||||
einfo 'Frontend Setup: Get the code'
|
||||
git clone https://github.com/kaleidos-ventures/taiga-front-dist.git taiga-front-dist
|
||||
cd taiga-front-dist
|
||||
git checkout stable
|
||||
|
||||
ebegin 'Copy the example config file'
|
||||
cp ~/taiga-front-dist/dist/conf.example.json ~/taiga-front-dist/dist/conf.json
|
||||
eend
|
||||
}
|
||||
|
||||
install_taiga_events(){
|
||||
cd ~
|
||||
einfo 'Events Setup: Get the code'
|
||||
git clone https://github.com/kaleidos-ventures/taiga-events.git taiga-events
|
||||
cd taiga-events
|
||||
git checkout stable
|
||||
|
||||
einfo 'Install the required JavaScript dependencies'
|
||||
#source ~/.node-live/bin/activate
|
||||
npm install
|
||||
npm audit fix
|
||||
|
||||
ebegin 'Create .env file based on the provided example'
|
||||
cp .env.example .env
|
||||
eend
|
||||
}
|
||||
|
||||
install_taiga_protected(){
|
||||
cd ~
|
||||
einfo 'Taiga protected Setup: Get the code'
|
||||
git clone https://github.com/kaleidos-ventures/taiga-protected.git taiga-protected
|
||||
cd taiga-protected
|
||||
git checkout stable
|
||||
|
||||
einfo 'Create a virtualenv'
|
||||
python -m venv .venv --prompt taiga-protected
|
||||
source .venv/bin/activate
|
||||
pip install --upgrade pip wheel
|
||||
|
||||
einfo 'Install all Python dependencies'
|
||||
pip install -r requirements.txt
|
||||
|
||||
ebegin 'Copy the example config file'
|
||||
cp ~/taiga-protected/env.sample ~/taiga-protected/.env
|
||||
eend
|
||||
}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Запуск
|
||||
#-----------------------------------------------------------------------------
|
||||
[[ ! -e ~/taiga-back ]] && install_taiga_back
|
||||
|
||||
[[ ! -e ~/taiga-front-dist ]] && install_taiga_front_dist
|
||||
|
||||
[[ ! -e ~/taiga-events ]] && install_taiga_events
|
||||
|
||||
[[ ! -e ~/taiga-protected ]] && install_taiga_protected
|
||||
|
||||
exit 0
|
||||
|
@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ueo pipefail
|
||||
export PATH="/lib/rc/bin:$PATH"
|
||||
|
||||
source /var/db/repos/container/scripts/functions.sh
|
||||
get_ini
|
||||
|
||||
if [[ $UID == 0 ]]
|
||||
then
|
||||
exit
|
||||
fi
|
||||
|
||||
data=$(PGPASSWORD=$postgresql_taiga_password psql -U $postgresql_taiga_user -d $postgresql_taiga_database -c '\dt' 2>/dev/null)
|
||||
|
||||
if [[ -n $data ]]
|
||||
then
|
||||
exit
|
||||
fi
|
||||
|
||||
migrate_pgsql(){
|
||||
cd ~
|
||||
cd taiga-back
|
||||
source .venv/bin/activate
|
||||
DJANGO_SETTINGS_MODULE=settings.config python manage.py migrate --noinput
|
||||
einfo create an administrator with strong password
|
||||
CELERY_ENABLED=False DJANGO_SETTINGS_MODULE=settings.config python manage.py createsuperuser
|
||||
DJANGO_SETTINGS_MODULE=settings.config python manage.py loaddata initial_project_templates
|
||||
DJANGO_SETTINGS_MODULE=settings.config python manage.py compilemessages
|
||||
DJANGO_SETTINGS_MODULE=settings.config python manage.py collectstatic --noinput
|
||||
}
|
||||
|
||||
migrate_pgsql
|
Loading…
Reference in new issue