在CentOS8上安装Taiga项目管理工具

您可以通过以下链接以PDF格式下载本文来支持我们。以PDF格式下载指南关闭关闭关闭

Taiga是面向小型企业的开源敏捷项目管理平台。它的功能直接与Jira和Trello等商业项目管理解决方案一起使用。 Taiga平台基于Python,Django,AngularJS和CoffeeScript构建。您可以使用基于云的产品轻松地开始使用Taiga,或者很难在本地基础结构上安装它。今天的指南详细介绍了CentOS 8上Taiga项目管理工具的安装和配置。

借助Taiga,您可以大大改善工作流程,并节省大量时间在内部团队内部以及与客户进行管理和沟通。票务系统非常出色,是快速响应客户要求的主要方式。

Taiga平台具有三个主要模块:

  • 大雅回 –用Python和Django写
  • taiga-front-dist –用Angular JS和Coffee Script编写
  • 大雅活动 –用JavaScript编写。

此设置需要全新安装CentOS 8服务器。运行以下命令以验证服务器已更新。

sudo dnf -y update

考虑在更新完成后重新启动。

sudo systemctl reboot

步骤1:将SELinux设置为Permissive,然后设置服务器的主机名

如果服务器SELinux已设置为Enforcing,则将其置于许可模式。

sudo setenforce 0
sudo sed -i 's/^SELINUX=.*/SELINUX=permissive/g' /etc/selinux/config

在服务器上设置FQDN主机名。

fqdn_hostname="projects.hirebestengineers.com"
sudo hostnamectl set-hostname ${fqdn_hostname} --static
sudo hostnamectl set-hostname ${fqdn_hostname} --transient

检查主机名设置。

$ hostnamectl
   Static hostname: projects.hirebestengineers.com
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 5ba3065ca48e47fca70cdbaf22866fc7
           Boot ID: 15a036b5710f4bb4a6c6da83ac6c05eb
    Virtualization: kvm
  Operating System: CentOS Linux 8 (Core)
       CPE OS Name: cpe:/o:centos:centos:8
            Kernel: Linux 4.18.0-193.19.1.el8_2.x86_64
      Architecture: x86-64

将正确的IP地址和FQDN添加到/ etc / hosts目录。

95.217.216.7 projects.hirebestengineers.com

验证:

$ sudo dnf -y install bind-utils
$ host projects.hirebestengineers.com
projects.hirebestengineers.com has address 95.217.216.7

还将A记录添加到DNS服务器。

检查是否可以从本地计算机查询记录。

$ dig A  projects.hirebestengineers.com

; <<>> DiG 9.11.13-RedHat-9.11.13-6.el8_2.1 <<>> A projects.hirebestengineers.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 57153
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;projects.hirebestengineers.com.	IN	A

;; ANSWER SECTION:
projects.hirebestengineers.com.	273 IN	A	95.217.216.7

;; Query time: 0 msec
;; SERVER: 213.133.98.98#53(213.133.98.98)
;; WHEN: Fri Oct 02 21:10:27 CEST 2020
;; MSG SIZE  rcvd: 75

步骤2:安装依赖项程序包

让我们在CentOS8上安装基本的标准软件包。

sudo dnf -y install epel-release
sudo dnf config-manager --set-enabled PowerTools
sudo dnf -y install git wget curl bash-completion vim pwgen 

安装Python软件包。

sudo dnf -y install @python38 python38-devel virtualenv
sudo pip3 install virtualenvwrapper

安装Nginx Web服务器。

sudo dnf -y install nginx

步骤3:安装Redis,RabbitMQ,Node.js

安装Redis。

sudo dnf -y install @redis
sudo systemctl enable --now redis

安装Rabbit MQ。

curl -s https://packagecloud.io/install/repositories/rabbitmq/rabbitmq-server/script.rpm.sh | sudo bash
sudo dnf -y install rabbitmq-server
sudo systemctl enable --now rabbitmq-server.service

安装RabbitMQ服务器后,创建Taiga用户和虚拟主机。

$ sudo rabbitmqctl add_user taiga StrongPassword
Adding user "taiga" ...

$ sudo rabbitmqctl add_vhost taiga
Adding vhost "taiga" ...

$ sudo rabbitmqctl set_permissions -p taiga taiga ".*" ".*" ".*"
Setting permissions for user "taiga" in vhost "taiga" ...

安装Node.js

sudo dnf -y install @nodejs

步骤4:安装和配置PostgreSQL

Taiga需要PostgreSQL数据库服务器来保留数据。运行以下命令以在CentOS8上安装PostgreSQL数据库服务器。

sudo dnf install -y @postgresql

初始化数据库服务器。

sudo /usr/bin/postgresql-setup initdb

启动并启用PostgreSQL数据库服务。

sudo systemctl enable --now postgresql

使用以下命令设置PostgreSQL管理员用户的密码:

$ sudo passwd postgres
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully

创建一个Taiga数据库和用户。

$ sudo su - postgres
[email protected]:~$ createuser taiga 
[email protected]:~$ psql 
psql (10.14)
Type "help" for help.

postgres=# ALTER USER taiga WITH ENCRYPTED password 'StrongPassword';
postgres=# CREATE DATABASE taiga OWNER taiga;
postgres=# q
[email protected]:~$ exit

交换:

  • 大河 使用Taiga.io数据库用户名
  • 强密码 为taiga用户使用强健的数据库密码。

步骤5:安装和配置Taiga后端

在CentOS Linux上创建专用的taiga用户。

$ sudo adduser taiga
$ sudo passwd taiga
Changing password for user taiga.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.

$ sudo usermod -aG wheel taiga

切换到Taiga用户帐户并创建日志文件夹

$ su - taiga
$ mkdir -p ~/logs
$ ls
logs

Github Clone Taiga后端项目

$ git clone https://github.com/taigaio/taiga-back.git
Cloning into 'taiga-back'...
remote: Enumerating objects: 40, done.
remote: Counting objects: 100% (40/40), done.
remote: Compressing objects: 100% (31/31), done.
remote: Total 37230 (delta 13), reused 26 (delta 8), pack-reused 37190
Receiving objects: 100% (37230/37230), 18.97 MiB | 5.50 MiB/s, done.
Resolving deltas: 100% (25889/25889), done.

$ cd taiga-back
$ git checkout stable

升级pip3。

sudo pip3 install --upgrade pip

使用pip安装Python依赖项。

pip3 install -r requirements.txt

在数据库中输入初始基本数据

python3 manage.py migrate --noinput
python3 manage.py loaddata initial_user
python3 manage.py loaddata initial_project_templates
python3 manage.py compilemessages
python3 manage.py collectstatic --noinput

运行以上命令会将数据导入PostgreSQL数据库。这还将创建一个具有以下登录凭据的管理员帐户: admin 带密码 123123

创建配置

将以下设置复制到 ~/taiga-back/settings/local.py

$ vim ~/taiga-back/settings/local.py

复制并更新以下内容。

from .common import *

MEDIA_URL = "http://projects.hirebestengineers.com/media/"
STATIC_URL = "http://projects.hirebestengineers.com/static/"
SITES["front"]["scheme"] = "http"
SITES["front"]["domain"] = "projects.hirebestengineers.com"

SECRET_KEY = "OQOEJNSJIQHDBQNSUQEJSNNANsqQPAASQLSMSOQND"

DEBUG = False
PUBLIC_REGISTER_ENABLED = True

DEFAULT_FROM_EMAIL = "[email protected]"
SERVER_EMAIL = DEFAULT_FROM_EMAIL

#CELERY_ENABLED = True

EVENTS_PUSH_BACKEND = "taiga.events.backends.rabbitmq.EventsPushBackend"
EVENTS_PUSH_BACKEND_OPTIONS = {"url": "amqp://taiga:[email protected]:5672/taiga"}

# Uncomment and populate with proper connection parameters
# for enable email sending. EMAIL_HOST_USER should end by @domain.tld
#EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
#EMAIL_USE_TLS = False
#EMAIL_HOST = "localhost"
#EMAIL_HOST_USER = ""
#EMAIL_HOST_PASSWORD = ""
#EMAIL_PORT = 25

# Uncomment and populate with proper connection parameters
# for enable github login/singin.
#GITHUB_API_CLIENT_ID = "yourgithubclientid"
#GITHUB_API_CLIENT_SECRET = "yourgithubclientsecret"

根据您的环境更改设置,并进行如下设置。

  • Rabbit MQ连接用户名和密码
  • Taiga域名
  • 带私钥
  • 可选的邮件设置。

为确保一切正常,请发出以下命令以开发模式运行后端进行测试。

python3 manage.py runserver

成功的输出样本:

Trying import local.py settings...
Trying import local.py settings...
Performing system checks...

System check identified no issues (0 silenced).
October 02, 2020 - 20:53:40
Django version 2.2.16, using settings 'settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

打开另一个外壳,然后尝试卷曲。

curl http://127.0.0.1:8000/api/v1/

步骤6:安装和配置Taiga前端

备份Taiga并确认其正常运行后,您可以继续安装Taiga前端模块。

切换到 taiga 用户帐号

su - taiga

从Github克隆项目源代码

$ git clone https://github.com/taigaio/taiga-front-dist.git
Cloning into 'taiga-front-dist'...
remote: Enumerating objects: 807, done.
remote: Counting objects: 100% (807/807), done.
remote: Compressing objects: 100% (686/686), done.
remote: Total 8580 (delta 374), reused 526 (delta 101), pack-reused 7773
Receiving objects: 100% (8580/8580), 62.04 MiB | 7.13 MiB/s, done.
Resolving deltas: 100% (3616/3616), done.

$ cd taiga-front-dist
$ git checkout stable

复制样本配置文件。

cp ~/taiga-front-dist/dist/conf.example.json ~/taiga-front-dist/dist/conf.json
vim ~/taiga-front-dist/dist/conf.json

根据以下模式编辑样本配置(替换为您自己的详细信息)。

{
    "api": "http://projects.hirebestengineers.com/api/v1/",
    "eventsUrl": "ws://projects.hirebestengineers.com/events",
    "eventsMaxMissedHeartbeats": 5,
    "eventsHeartbeatIntervalTime": 60000,
    "eventsReconnectTryInterval": 10000,
    "debug": true,
    "debugInfo": false,
    "defaultLanguage": "en",
    "themes": ["taiga"],
    "defaultTheme": "taiga",
    "publicRegisterEnabled": true,
    "feedbackEnabled": true,
    "supportUrl": "https://tree.taiga.io/support",
    "privacyPolicyUrl": null,
    "termsOfServiceUrl": null,
    "GDPRUrl": null,
    "maxUploadFileSize": null,
    "contribPlugins": [],
    "tribeHost": null,
    "importers": [],
    "gravatar": true,
    "rtlLanguages": ["fa"]
}

必须替换 projects.hirebestengineers.com 使用DNS名称。

步骤7:安装Taiga活动

Taiga-events是Taiga WebSocket服务器,它允许taiga-front在积压,任务板,宴会和问题列表中显示实时更改。 Taiga-events使用Rabbitmq作为其消息代理。

$ cd ~
$ git clone https://github.com/taigaio/taiga-events.git taiga-events
Cloning into 'taiga-events'...
remote: Enumerating objects: 107, done.
remote: Counting objects: 100% (107/107), done.
remote: Compressing objects: 100% (72/72), done.
remote: Total 245 (delta 38), reused 90 (delta 28), pack-reused 138
Receiving objects: 100% (245/245), 44.87 KiB | 553.00 KiB/s, done.
Resolving deltas: 100% (113/113), done.

$ cd taiga-events

安装所需的JavaScript依赖项。

npm install

为Taiga事件创建配置文件。

cp config.example.json config.json

编辑配置文件,并设置rabbitmq URL和私钥。

$ vim config.json

{
    "url": "amqp://taiga:[email protected]:5672/taiga",
    "secret": "OQOEJNSJIQHDBQNSUQEJSNNANsqQPAASQLSMSOQND",
    "webSocketServer": {
        "port": 8888
    }
}

的秘密价值 config.json 必须与中的SECRET_KEY相同 〜/后退/设置/ local.py!!

将taiga事件添加到systemd配置。

sudo tee /etc/systemd/system/taiga_events.service<<EOF
[Unit]
Description=taiga_events
After=network.target

[Service]
User=taiga
WorkingDirectory=/home/taiga/taiga-events
ExecStart=/bin/bash -c "node_modules/coffeescript/bin/coffee index.coffee"
Restart=always
RestartSec=3

[Install]
WantedBy=default.target
EOF

重新加载Systemd并启动服务。

sudo systemctl daemon-reload
sudo systemctl start taiga_events
sudo systemctl enable taiga_events

检查服务是否正在运行。

$ systemctl status taiga_events.service
● taiga_events.service - taiga_events
   Loaded: loaded (/etc/systemd/system/taiga_events.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2020-10-02 23:01:00 CEST; 12s ago
 Main PID: 15170 (node)
    Tasks: 7 (limit: 24392)
   Memory: 38.6M
   CGroup: /system.slice/taiga_events.service
           └─15170 node node_modules/coffeescript/bin/coffee index.coffee

Oct 02 23:01:00 projects.hirebestengineers.com systemd[1]: Started taiga_events.

步骤8:启动taiga服务

创建一个新的taigasystemd文件。

sudo tee /etc/systemd/system/taiga.service<<EOF
[Unit]
Description=taiga_back
After=network.target

[Service]
User=taiga
Environment=PYTHONUNBUFFERED=true
WorkingDirectory=/home/taiga/taiga-back
ExecStart=/home/taiga/.local/bin/gunicorn --workers 4 --timeout 60 -b 127.0.0.1:8001 taiga.wsgi
Restart=always
RestartSec=3

[Install]
WantedBy=default.target
EOF

重新加载systemd守护程序并启动taiga服务。

sudo systemctl daemon-reload
sudo systemctl start taiga
sudo systemctl enable taiga

通过运行以下命令检查服务是否正在运行:

$ sudo systemctl status taiga
● taiga.service - taiga_back
   Loaded: loaded (/etc/systemd/system/taiga.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2020-10-02 23:03:48 CEST; 50s ago
 Main PID: 15494 (gunicorn)
    Tasks: 5 (limit: 24392)
   Memory: 298.5M
   CGroup: /system.slice/taiga.service
           ├─15494 /usr/bin/python3.6 /home/taiga/.local/bin/gunicorn --workers 4 --timeout 60 -b 127.0.0.1:8001 taiga.wsgi
           ├─15497 /usr/bin/python3.6 /home/taiga/.local/bin/gunicorn --workers 4 --timeout 60 -b 127.0.0.1:8001 taiga.wsgi
           ├─15498 /usr/bin/python3.6 /home/taiga/.local/bin/gunicorn --workers 4 --timeout 60 -b 127.0.0.1:8001 taiga.wsgi
           ├─15501 /usr/bin/python3.6 /home/taiga/.local/bin/gunicorn --workers 4 --timeout 60 -b 127.0.0.1:8001 taiga.wsgi
           └─15502 /usr/bin/python3.6 /home/taiga/.local/bin/gunicorn --workers 4 --timeout 60 -b 127.0.0.1:8001 taiga.wsgi

Oct 02 23:03:49 projects.hirebestengineers.com gunicorn[15494]: [2020-10-02 23:03:49 +0200] [15494] [INFO] Listening at: http://127.0.0.1:8001 (15494)
Oct 02 23:03:49 projects.hirebestengineers.com gunicorn[15494]: [2020-10-02 23:03:49 +0200] [15494] [INFO] Using worker: sync
Oct 02 23:03:49 projects.hirebestengineers.com gunicorn[15494]: [2020-10-02 23:03:49 +0200] [15497] [INFO] Booting worker with pid: 15497
Oct 02 23:03:49 projects.hirebestengineers.com gunicorn[15494]: [2020-10-02 23:03:49 +0200] [15498] [INFO] Booting worker with pid: 15498
Oct 02 23:03:49 projects.hirebestengineers.com gunicorn[15494]: [2020-10-02 23:03:49 +0200] [15501] [INFO] Booting worker with pid: 15501
Oct 02 23:03:49 projects.hirebestengineers.com gunicorn[15494]: [2020-10-02 23:03:49 +0200] [15502] [INFO] Booting worker with pid: 15502
Oct 02 23:03:49 projects.hirebestengineers.com gunicorn[15494]: Trying import local.py settings...
Oct 02 23:03:49 projects.hirebestengineers.com gunicorn[15494]: Trying import local.py settings...
Oct 02 23:03:49 projects.hirebestengineers.com gunicorn[15494]: Trying import local.py settings...
Oct 02 23:03:49 projects.hirebestengineers.com gunicorn[15494]: Trying import local.py settings...

步骤9:配置Nginx

NGINX用作静态文件Web服务器,用于服务taiga-front-dist并将代理请求发送到taiga-back。首先删除默认的Nginx配置文件。

为Taiga创建NGINX虚拟主机。

sudo vim /etc/nginx/conf.d/taiga.conf

相应地修改配置文件。

server {
    listen 80;
    server_name projects.hirebestengineers.com www.projects.hirebestengineers.com;  #  See http://nginx.org/en/docs/http/server_names.html

    large_client_header_buffers 4 32k;
    client_max_body_size 50M;
    charset utf-8;

    access_log /home/taiga/logs/nginx.access.log;
    error_log /home/taiga/logs/nginx.error.log;

    # Frontend
    location / {
        root /home/taiga/taiga-front-dist/dist/;
        try_files $uri $uri/ /index.html;
    }

    # Backend
    location /api {
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Scheme $scheme;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://127.0.0.1:8001/api;
        proxy_redirect off;
    }

    # Admin access (/admin/)
    location /admin {
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Scheme $scheme;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://127.0.0.1:8001$request_uri;
        proxy_redirect off;
    }

    # Static files
    location /static {
        alias /home/taiga/taiga-back/static;
    }

    # Media files
    location /media {
        alias /home/taiga/taiga-back/media;
    }

    # Events
    location /events {
        proxy_pass http://127.0.0.1:8888/events;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_connect_timeout 7d;
        proxy_send_timeout 7d;
        proxy_read_timeout 7d;
    }
}

检查Nginx配置。

$ sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

权限设置:

sudo chown -R taiga:taiga /home/taiga/
sudo chmod o+x /home/taiga/
sudo chmod o+rx ~taiga/taiga-back/media

如果一切正常,请启动nginx服务。

sudo systemctl daemon-reload
sudo systemctl restart nginx taiga
sudo systemctl enable nginx taiga

检查状态:

$ systemctl status nginx
● nginx.service - The nginx HTTP and reverse proxy server
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2020-10-02 23:14:06 CEST; 5s ago
  Process: 16260 ExecStart=/usr/sbin/nginx (code=exited, status=0/SUCCESS)
  Process: 16257 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS)
  Process: 16255 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)
 Main PID: 16261 (nginx)
    Tasks: 3 (limit: 24392)
   Memory: 5.4M
   CGroup: /system.slice/nginx.service
           ├─16261 nginx: master process /usr/sbin/nginx
           ├─16262 nginx: worker process
           └─16263 nginx: worker process

Oct 02 23:14:06 projects.hirebestengineers.com systemd[1]: Starting The nginx HTTP and reverse proxy server...
Oct 02 23:14:06 projects.hirebestengineers.com nginx[16257]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
Oct 02 23:14:06 projects.hirebestengineers.com nginx[16257]: nginx: configuration file /etc/nginx/nginx.conf test is successful
Oct 02 23:14:06 projects.hirebestengineers.com systemd[1]: Started The nginx HTTP and reverse proxy server.

步骤10:访问Taiga Web登录信息中心

打开您喜欢的Web浏览器,然后执行以下操作:

http://your_taiga_domain.com

将显示以下Taiga页面。

在CentOS8上安装Taiga项目管理工具

使用以下默认凭据登录。

Username: admin
Password: 123123

然后将管理员密码更改为on 管理员>更改密码

在CentOS8上安装Taiga项目管理工具

如何禁用自注册

要禁用自用户注册,请编辑文件〜/ taiga-back / settings / local.py并将PUBLIC_REGISTER_ENABLED的值设置为false。

$ su - taiga
$ vim ~/taiga-back/settings/local.py
PUBLIC_REGISTER_ENABLED = False

更改Taiga前端设置。

$ vim ~/taiga-front-dist/dist/conf.json
"publicRegisterEnabled": false

更新配置后,重新启动所有Taiga服务。

sudo systemctl restart 'taiga*'

重新加载nginx:

sudo systemctl reload nginx

之前:

在CentOS8上安装Taiga项目管理工具

后:

在CentOS8上安装Taiga项目管理工具

使用以下指南安装Ubuntu。

在Ubuntu上安装Taiga Project Management Platform

您可以通过以下链接以PDF格式下载本文来支持我们。以PDF格式下载指南关闭关闭关闭

Sidebar