Обновлены шаблоны и скрипты настройки 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
[postgresql]
postgres_password = #-rnd(pas,12)-#
taiga_user = taiga
taiga_password = #-rnd(pas,12)-#
taiga_database = taiga

@ -1,2 +1,3 @@
# Calculate path=/root name=.pgpass chmod=600 comment=# protected
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
[rabbitmq]
taiga_user = taiga
taiga_password = #-rnd(pas,12)-#

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

@ -6,7 +6,7 @@ set -ueo pipefail
. /var/db/repos/container/scripts/functions.sh
. /var/db/repos/calculate/scripts/ini.sh
regular(){
regular() {
if [[ ${ini[taiga.public_register]} == 'True' ]]
then
local public_register='true'
@ -55,7 +55,7 @@ regular(){
)
}
check_conf(){
check_conf() {
conf=
for (( i=0; i < ${#replace[@]}; i += 2 ))
do
@ -77,7 +77,7 @@ check_conf(){
done
}
check_show(){
check_show() {
conf=
for (( i=0; i < ${#replace[@]}; i += 2 ))
do
@ -104,7 +104,7 @@ check_show(){
done
}
configure_conf(){
configure_conf() {
conf=
for (( i=0; i < ${#replace[@]}; i += 2 ))
do
@ -127,7 +127,7 @@ configure_conf(){
eend
}
show_conf(){
show_conf() {
conf=
for (( i=0; i < ${#replace[@]}; i += 2 ))
do
@ -147,7 +147,7 @@ show_conf(){
done
}
check_homedir(){
check_homedir() {
homedir=/var/calculate/www/taiga
if [[ -d $homedir ]]
then

@ -1,28 +1,25 @@
#!/bin/bash
set -eo pipefail
set -ueo pipefail
export PATH="/lib/rc/bin:$PATH"
if [[ $UID == 0 ]]
then
exit
fi
[[ $UID == 0 ]] && exit
. /var/db/repos/container/scripts/functions.sh
. /var/db/repos/calculate/scripts/ini.sh
if [[ ! -e ~/.node-live ]]
then
if [[ ! -e ~/.node-live ]]; then
einfo 'Install Node.js'
cd ~
nodeenv --node=$taiga_node .node-${taiga_node%%.*}
ln -sfT .node-${taiga_node%%.*} .node-live
nodeenv --node=${ini[taiga.node]} .node-${ini[taiga.node]%%.*}
ln -sfT .node-${ini[taiga.node]%%.*} .node-live
fi
source ~/.node-live/bin/activate
set +u
. ~/.node-live/bin/activate
set -u
install_taiga_back(){
if [[ ! -e ~/taiga-back ]]; then
cd ~
einfo 'Backend Setup: Get the code'
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'
cp settings/config.py.prod.example settings/config.py
eend
}
fi
install_taiga_front_dist(){
if [[ ! -e ~/taiga-front-dist ]]; then
cd ~
einfo 'Frontend Setup: Get the code'
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'
cp ~/taiga-front-dist/dist/conf.example.json ~/taiga-front-dist/dist/conf.json
eend
}
fi
install_taiga_events(){
if [[ ! -e ~/taiga-events ]]; then
cd ~
einfo 'Events Setup: Get the code'
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'
cp .env.example .env
eend
}
fi
install_taiga_protected(){
if [[ ! -e ~/taiga-protected ]]; then
cd ~
einfo 'Taiga protected Setup: Get the code'
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'
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
fi

@ -6,19 +6,11 @@ export PATH="/lib/rc/bin:$PATH"
. /var/db/repos/container/scripts/functions.sh
. /var/db/repos/calculate/scripts/ini.sh
if [[ $UID == 0 ]]
then
exit
fi
[[ $UID == 0 ]] && exit
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 ]]
then
exit
fi
migrate_pgsql(){
if [[ -e $data ]]; then
cd ~
cd taiga-back
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 compilemessages
DJANGO_SETTINGS_MODULE=settings.config python manage.py collectstatic --noinput
}
fi
migrate_pgsql

@ -1,24 +1,34 @@
#!/bin/bash
set -ueo pipefail
if [[ -e /var/lib/postgresql/12 ]]
then
exit
fi
[[ -n "$(ls -A /var/lib/postgresql)" ]] && exit
export PATH="/lib/rc/bin:$PATH"
. /var/db/repos/container/scripts/functions.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
}
/etc/init.d/postgresql-12 start
emerge --config =dev-db/postgresql-$(pgver)
psql -U postgres -c "ALTER USER postgres WITH PASSWORD '${ini[postgresql.postgres_password]}'"
/etc/init.d/postgresql-$(pgver slot) start
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 DATABASE taiga OWNER taiga"
psql -U postgres -c "ALTER USER ${ini[postgresql.taiga_user]} WITH PASSWORD '${ini[postgresql.taiga_password]}'"
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
if [[ -e /var/lib/rabbitmq/mnesia ]]
then
exit
fi
test -e /var/lib/rabbitmq/mnesia && exit
export PATH="/lib/rc/bin:$PATH"
. /var/db/repos/container/scripts/functions.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_vhost taiga
rabbitmqctl set_permissions -p taiga ${ini[rabbitmq.taiga_user]} ".*" ".*" ".*"

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

Loading…
Cancel
Save