在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