Обновлены шаблоны и скрипты настройки Taiga

master 71
parent e5c8cd4c50
commit ebf4a9645a

@ -0,0 +1,9 @@
[taiga]
node = 12.22.12
[postgresql]
taiga_user = taiga
taiga_database = taiga
[rabbitmq]
taiga_user = taiga

@ -1,6 +1,4 @@
# Calculate format=samba path=/var/calculate grep(/var/calculate/ini.env,postgresql)== comment=# protected # Calculate format=samba path=/var/calculate grep(/var/calculate/ini.env,postgresql)== comment=# protected
[postgresql] [postgresql]
postgres_password = #-rnd(pas,12)-# postgres_password = #-rnd(pas,12)-#
taiga_user = taiga
taiga_password = #-rnd(pas,12)-# taiga_password = #-rnd(pas,12)-#
taiga_database = taiga

@ -1,2 +1,3 @@
# Calculate path=/root name=.pgpass chmod=600 comment=# protected # Calculate path=/root name=.pgpass chmod=600 comment=# protected
localhost:*:*:postgres:#-ini(postgresql.postgres_password)-# localhost:*:*:postgres:#-ini(postgresql.postgres_password)-#
localhost:*:*:taiga:#-ini(postgresql.taiga_password)-#

@ -1,4 +1,3 @@
# Calculate format=samba path=/var/calculate grep(/var/calculate/ini.env,rabbitmq)== comment=# protected # Calculate format=samba path=/var/calculate grep(/var/calculate/ini.env,rabbitmq)== comment=# protected
[rabbitmq] [rabbitmq]
taiga_user = taiga
taiga_password = #-rnd(pas,12)-# taiga_password = #-rnd(pas,12)-#

@ -15,5 +15,4 @@ public_register = True
user_email_allowed_domains = user_email_allowed_domains =
max_private_projects_per_user = None max_private_projects_per_user = None
max_public_projects_per_user = None max_public_projects_per_user = None
node = 12.22.12
secret_key = #-rnd(pas,16)-# secret_key = #-rnd(pas,16)-#

@ -1,28 +1,25 @@
#!/bin/bash #!/bin/bash
set -eo pipefail set -ueo pipefail
export PATH="/lib/rc/bin:$PATH" export PATH="/lib/rc/bin:$PATH"
if [[ $UID == 0 ]] [[ $UID == 0 ]] && exit
then
exit
fi
. /var/db/repos/container/scripts/functions.sh . /var/db/repos/container/scripts/functions.sh
. /var/db/repos/calculate/scripts/ini.sh . /var/db/repos/calculate/scripts/ini.sh
if [[ ! -e ~/.node-live ]] if [[ ! -e ~/.node-live ]]; then
then
einfo 'Install Node.js' einfo 'Install Node.js'
cd ~ cd ~
nodeenv --node=$taiga_node .node-${taiga_node%%.*} nodeenv --node=${ini[taiga.node]} .node-${ini[taiga.node]%%.*}
ln -sfT .node-${taiga_node%%.*} .node-live ln -sfT .node-${ini[taiga.node]%%.*} .node-live
fi fi
source ~/.node-live/bin/activate
set +u
. ~/.node-live/bin/activate
set -u set -u
install_taiga_back(){ if [[ ! -e ~/taiga-back ]]; then
cd ~ cd ~
einfo 'Backend Setup: Get the code' einfo 'Backend Setup: Get the code'
git clone https://github.com/kaleidos-ventures/taiga-back.git taiga-back git clone https://github.com/kaleidos-ventures/taiga-back.git taiga-back
@ -43,9 +40,9 @@ install_taiga_back(){
ebegin 'Copy the example config file' ebegin 'Copy the example config file'
cp settings/config.py.prod.example settings/config.py cp settings/config.py.prod.example settings/config.py
eend eend
} fi
install_taiga_front_dist(){ if [[ ! -e ~/taiga-front-dist ]]; then
cd ~ cd ~
einfo 'Frontend Setup: Get the code' einfo 'Frontend Setup: Get the code'
git clone https://github.com/kaleidos-ventures/taiga-front-dist.git taiga-front-dist git clone https://github.com/kaleidos-ventures/taiga-front-dist.git taiga-front-dist
@ -55,9 +52,9 @@ install_taiga_front_dist(){
ebegin 'Copy the example config file' ebegin 'Copy the example config file'
cp ~/taiga-front-dist/dist/conf.example.json ~/taiga-front-dist/dist/conf.json cp ~/taiga-front-dist/dist/conf.example.json ~/taiga-front-dist/dist/conf.json
eend eend
} fi
install_taiga_events(){ if [[ ! -e ~/taiga-events ]]; then
cd ~ cd ~
einfo 'Events Setup: Get the code' einfo 'Events Setup: Get the code'
git clone https://github.com/kaleidos-ventures/taiga-events.git taiga-events git clone https://github.com/kaleidos-ventures/taiga-events.git taiga-events
@ -72,9 +69,9 @@ install_taiga_events(){
ebegin 'Create .env file based on the provided example' ebegin 'Create .env file based on the provided example'
cp .env.example .env cp .env.example .env
eend eend
} fi
install_taiga_protected(){ if [[ ! -e ~/taiga-protected ]]; then
cd ~ cd ~
einfo 'Taiga protected Setup: Get the code' einfo 'Taiga protected Setup: Get the code'
git clone https://github.com/kaleidos-ventures/taiga-protected.git taiga-protected git clone https://github.com/kaleidos-ventures/taiga-protected.git taiga-protected
@ -92,18 +89,4 @@ install_taiga_protected(){
ebegin 'Copy the example config file' ebegin 'Copy the example config file'
cp ~/taiga-protected/env.sample ~/taiga-protected/.env cp ~/taiga-protected/env.sample ~/taiga-protected/.env
eend eend
} fi
#-----------------------------------------------------------------------------
# Запуск
#-----------------------------------------------------------------------------
[[ ! -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

@ -6,19 +6,11 @@ export PATH="/lib/rc/bin:$PATH"
. /var/db/repos/container/scripts/functions.sh . /var/db/repos/container/scripts/functions.sh
. /var/db/repos/calculate/scripts/ini.sh . /var/db/repos/calculate/scripts/ini.sh
if [[ $UID == 0 ]] [[ $UID == 0 ]] && exit
then
exit
fi
data=$(PGPASSWORD=${ini[postgresql.taiga_password]} psql -U ${ini[postgresql.taiga_user]} -d ${ini[postgresql.taiga_database]} -c '\dt' 2>/dev/null) data=$(PGPASSWORD=${ini[postgresql.taiga_password]} psql -U ${ini[postgresql.taiga_user]} -d ${ini[postgresql.taiga_database]} -c '\dt' 2>/dev/null)
if [[ -n $data ]] if [[ -e $data ]]; then
then
exit
fi
migrate_pgsql(){
cd ~ cd ~
cd taiga-back cd taiga-back
source .venv/bin/activate source .venv/bin/activate
@ -30,6 +22,5 @@ migrate_pgsql(){
DJANGO_SETTINGS_MODULE=settings.config python manage.py loaddata initial_project_templates 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 compilemessages
DJANGO_SETTINGS_MODULE=settings.config python manage.py collectstatic --noinput DJANGO_SETTINGS_MODULE=settings.config python manage.py collectstatic --noinput
} fi
migrate_pgsql

@ -1,24 +1,34 @@
#!/bin/bash #!/bin/bash
set -ueo pipefail set -ueo pipefail
if [[ -e /var/lib/postgresql/12 ]]
then [[ -n "$(ls -A /var/lib/postgresql)" ]] && exit
exit
fi
export PATH="/lib/rc/bin:$PATH" export PATH="/lib/rc/bin:$PATH"
. /var/db/repos/container/scripts/functions.sh . /var/db/repos/container/scripts/functions.sh
. /var/db/repos/calculate/scripts/ini.sh . /var/db/repos/calculate/scripts/ini.sh
emerge --config =dev-db/postgresql-12.12 pgver() {
local ver=$(ls -d /var/db/pkg/dev-db/postgresql-*)
ver=${ver#*postgresql-}
if [[ ${1:-} == 'slot' ]]; then
echo ${ver%%.*}
else
echo ${ver%%-*}
fi
}
emerge --config =dev-db/postgresql-$(pgver)
/etc/init.d/postgresql-12 start /etc/init.d/postgresql-$(pgver slot) start
psql -U postgres -c "ALTER USER postgres WITH PASSWORD '${ini[postgresql.postgres_password]}'" psql -U postgres -c "ALTER USER postgres WITH PASSWORD '${ini[postgresql.postgres_password]}'"
psql -U postgres -c "CREATE ROLE ${ini[postgresql.taiga_user]} WITH login" psql -U postgres -c "CREATE ROLE ${ini[postgresql.taiga_user]} WITH login"
psql -U postgres -c "CREATE DATABASE taiga OWNER taiga" psql -U postgres -c "CREATE DATABASE taiga OWNER taiga"
psql -U postgres -c "ALTER USER ${ini[postgresql.taiga_user]} WITH PASSWORD '${ini[postgresql.taiga_password]}'" psql -U postgres -c "ALTER USER ${ini[postgresql.taiga_user]} WITH PASSWORD '${ini[postgresql.taiga_password]}'"
cl-core-setup -n postgresql -f cl-core-setup -n postgresql -f
/etc/init.d/postgresql-12 restart
/etc/init.d/postgresql-$(pgver slot) restart

@ -2,12 +2,10 @@
set -ueo pipefail set -ueo pipefail
if [[ -e /var/lib/rabbitmq/mnesia ]] test -e /var/lib/rabbitmq/mnesia && exit
then
exit
fi
export PATH="/lib/rc/bin:$PATH" export PATH="/lib/rc/bin:$PATH"
. /var/db/repos/container/scripts/functions.sh . /var/db/repos/container/scripts/functions.sh
. /var/db/repos/calculate/scripts/ini.sh . /var/db/repos/calculate/scripts/ini.sh
@ -16,3 +14,4 @@ export PATH="/lib/rc/bin:$PATH"
rabbitmqctl add_user ${ini[rabbitmq.taiga_user]} ${ini[rabbitmq.taiga_password]} rabbitmqctl add_user ${ini[rabbitmq.taiga_user]} ${ini[rabbitmq.taiga_password]}
rabbitmqctl add_vhost taiga rabbitmqctl add_vhost taiga
rabbitmqctl set_permissions -p taiga ${ini[rabbitmq.taiga_user]} ".*" ".*" ".*" rabbitmqctl set_permissions -p taiga ${ini[rabbitmq.taiga_user]} ".*" ".*" ".*"

@ -1,35 +1,32 @@
#!/bin/bash #!/bin/bash
# Install Taiga in Production
# https://docs.taiga.io/setup-production.html#_introduction
export PATH="/lib/rc/bin:$PATH"
set -ueo pipefail set -ueo pipefail
export PATH="/lib/rc/bin:$PATH"
show= echo "Taiga setup"
if [[ $# == 1 && $1 == 'show' ]]
then . /var/db/repos/calculate/scripts/ini.sh
show='show'
fi chown taiga: /var/calculate/ini.env
chown taiga:taiga /var/calculate/ini.env
su - taiga -c '/var/db/repos/container/scripts/taiga/install.sh' su - taiga -c '/var/db/repos/container/scripts/taiga/install.sh'
/var/db/repos/container/scripts/taiga/postgresql.sh /var/db/repos/container/scripts/taiga/postgresql.sh
/var/db/repos/container/scripts/taiga/rabbitmq.sh /var/db/repos/container/scripts/taiga/rabbitmq.sh
/var/db/repos/container/scripts/taiga/config.sh $show /var/db/repos/container/scripts/taiga/config.sh
su - taiga -c '/var/db/repos/container/scripts/taiga/migrate.sh' su - taiga -c '/var/db/repos/container/scripts/taiga/migrate.sh'
if [[ ! -e /etc/runlevels/default/taiga ]]; then
if [[ ! -e /etc/runlevels/default/taiga ]]
then
cl-setup-system cl-setup-system
rc-update -u rc-update -u
fi fi
openrc openrc
if [[ -z $show ]] echo "All is done! Open the link ${ini[taiga.protocol]}://${ini[taiga.taiga_sites_domain]} on your browser."
then
einfo "To display configured options, run 'cl-setup show'."
fi

Loading…
Cancel
Save