Поиск по сайту:

Как установить Focalboard на Ubuntu 22.04


Это руководство существует для этих версий ОС

  • Ubuntu 22.04 (Jammy Jellyfish)
  • Ubuntu 20.04 (Focal Fossa)

На этой странице

  1. Предпосылки
  2. Установка и настройка PostgreSQL
  3. Установка и настройка Focalboard
  4. Создание служебного файла Systemd для Focalboard
  5. Настройка Nginx в качестве обратного прокси-сервера
  6. Доступ к веб-интерфейсу Focalboard
  7. Включить SSL на Focalboard
  8. Заключение

Focalboard — это инструмент управления проектами с открытым исходным кодом и собственным хостингом. Это многоязычная альтернатива Asana, Trello и Notion, которую разработчики могут использовать для отслеживания и управления работой между командами. Он основан на канбане и доступен для настольных компьютеров и серверов. Его можно использовать как автономный персональный сервер для тестирования и разработки. Focalboard помогает разработчикам оставаться на связи, чтобы выполнять задачи, достигать вех и достигать своих целей.

В этом посте мы покажем вам, как установить Focalboard с Nginx в качестве обратного прокси-сервера на Ubuntu 22.04.

Предпосылки

  • Сервер под управлением Ubuntu 22.04.
  • Действительное доменное имя, указанное с IP-адресом вашего сервера.
  • На сервере настроен пароль root.

Установите и настройте PostgreSQL.

Focalboard использует PostgreSQL для хранения своих данных. Поэтому в вашей системе должен быть установлен сервер базы данных PostgreSQL.

Если он не установлен, вы можете установить его с другими пакетами, используя следующую команду:

apt-get install curl wget gnupg2 -y
apt-get install postgresql postgresql-contrib -y

После установки PostgreSQL подключитесь к PostgreSQL с помощью следующей команды:

su - postgres
psql

Затем создайте базу данных и пользователя для PostgreSQL с помощью следующей команды:

CREATE DATABASE focaldb;
CREATE USER focaluser WITH PASSWORD 'password';

Затем выйдите из оболочки PostgreSQL с помощью следующей команды:

\q
exit

Как только вы закончите, вы можете перейти к следующему шагу.

Установите и настройте Focalboard

Сначала посетите страницу загрузки Focalboard Git Hub и загрузите последнюю версию Focalboard с помощью следующей команды:

VER=$(curl -s https://api.github.com/repos/mattermost/focalboard/releases/latest|grep tag_name | cut -d '"' -f 4)
wget https://github.com/mattermost/focalboard/releases/download/${VER}/focalboard-server-linux-amd64.tar.gz

После завершения загрузки извлеките загруженный файл с помощью следующей команды:

tar -xvzf focalboard-server-linux-amd64.tar.gz

Затем переместите панель управления в каталог /opt с помощью следующей команды:

mv focalboard /opt

Затем отредактируйте файл конфигурации Focalboard:

nano /opt/focalboard/config.json

измените следующие строки, соответствующие вашей базе данных, как показано ниже:

"dbtype": "postgres",
"dbconfig": "postgres://focaluser:/focaldb?sslmode=disable&connect_timeout=10",

Сохраните и закройте файл, когда закончите.

Создайте служебный файл Systemd для Focalboard

Рекомендуется запускать Focalboard и управлять им с помощью systemd. Для этого вам нужно создать служебный файл systemd для Focalboard:

nano /lib/systemd/system/focalboard.service

Добавьте следующие строки:

[Unit]
Description=Focalboard server

[Service]
Type=simple
Restart=always
RestartSec=5s
ExecStart=/opt/focalboard/bin/focalboard-server
WorkingDirectory=/opt/focalboard

[Install]
WantedBy=multi-user.target

Сохраните и закройте файл, затем перезагрузите демон systemd, чтобы применить изменения:

systemctl daemon-reload

Затем запустите и включите службу Focalboard с помощью следующей команды:

systemctl start focalboard
systemctl enable focalboard

Теперь вы можете проверить состояние Focalboard с помощью следующей команды:

systemctl status focalboard

Вы получите следующий вывод:

? focalboard.service - Focalboard server
     Loaded: loaded (/lib/systemd/system/focalboard.service; disabled; vendor preset: enabled)
     Active: active (running) since Sun 2022-08-21 11:22:22 UTC; 8s ago
   Main PID: 4347 (focalboard-serv)
      Tasks: 4 (limit: 2242)
     Memory: 18.1M
        CPU: 1.977s
     CGroup: /system.slice/focalboard.service
             ??4347 /opt/focalboard/bin/focalboard-server

Aug 21 11:22:23 ubuntu2204 focalboard-server[4347]: debug [2022-08-21 11:22:23.507 Z] listener(s) for blockID                  caller="ws/ser>
Aug 21 11:22:23 ubuntu2204 focalboard-server[4347]: debug [2022-08-21 11:22:23.507 Z] listener(s) for blockID                  caller="ws/ser>
Aug 21 11:22:23 ubuntu2204 focalboard-server[4347]: debug [2022-08-21 11:22:23.510 Z] listener(s) for workspaceID              caller="ws/ser>
Aug 21 11:22:23 ubuntu2204 focalboard-server[4347]: debug [2022-08-21 11:22:23.510 Z] listener(s) for blockID                  caller="ws/ser>
Aug 21 11:22:23 ubuntu2204 focalboard-server[4347]: debug [2022-08-21 11:22:23.510 Z] listener(s) for blockID                  caller="ws/ser>
Aug 21 11:22:24 ubuntu2204 focalboard-server[4347]: debug [2022-08-21 11:22:24.928 Z] import archive - done                    caller="app/im>
Aug 21 11:22:24 ubuntu2204 focalboard-server[4347]: info  [2022-08-21 11:22:24.937 Z] initialized workspace                    caller="app/wo>
Aug 21 11:22:24 ubuntu2204 focalboard-server[4347]: info  [2022-08-21 11:22:24.941 Z] Server.Start                             caller="server>
Aug 21 11:22:24 ubuntu2204 focalboard-server[4347]: info  [2022-08-21 11:22:24.941 Z] http server started                      caller="web/we>
Aug 21 11:22:24 ubuntu2204 focalboard-server[4347]: info  [2022-08-21 11:22:24.947 Z] Starting unix socket server              caller="server>

На этом этапе Focalboard запущен и прослушивает порт 8000. Вы можете проверить порты прослушивания с помощью следующей команды:

ss -antpl | grep focalboard

Вы получите следующий вывод:

LISTEN 0      4096               *:8000            *:*    users:(("focalboard-serv",pid=4347,fd=9))
LISTEN 0      4096               *:9092            *:*    users:(("focalboard-serv",pid=4347,fd=8))

Как только вы закончите, вы можете перейти к следующему шагу.

Настройте Nginx в качестве обратного прокси

Затем рекомендуется установить и настроить Nginx в качестве обратного прокси-сервера для доступа к Focalboard через порт 80. Сначала установите сервер Nginx с помощью следующей команды:

apt-get install nginx -y

После установки сервера Nginx создайте файл конфигурации виртуального хоста Nginx:

nano /etc/nginx/conf.d/focalboard.conf

Добавьте следующие строки:

upstream focalboard {
   server localhost:8000;
   keepalive 32;
}

server {
   listen 80;

   server_name focalboard.example.com;

   location ~ /ws/* {
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "upgrade";
       client_max_body_size 50M;
       proxy_set_header Host $http_host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header X-Forwarded-Proto $scheme;
       proxy_set_header X-Frame-Options SAMEORIGIN;
       proxy_buffers 256 16k;
       proxy_buffer_size 16k;
       client_body_timeout 60;
       send_timeout 300;
       lingering_timeout 5;
       proxy_connect_timeout 1d;
       proxy_send_timeout 1d;
       proxy_read_timeout 1d;
       proxy_pass http://focalboard;
   }

   location / {
       client_max_body_size 50M;
       proxy_set_header Connection "";
       proxy_set_header Host $http_host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header X-Forwarded-Proto $scheme;
       proxy_set_header X-Frame-Options SAMEORIGIN;
       proxy_buffers 256 16k;
       proxy_buffer_size 16k;
       proxy_read_timeout 600s;
       proxy_cache_revalidate on;
       proxy_cache_min_uses 2;
       proxy_cache_use_stale timeout;
       proxy_cache_lock on;
       proxy_http_version 1.1;
       proxy_pass http://focalboard;
   }
}

Сохраните и закройте файл, когда закончите, затем проверьте Nginx на наличие ошибок конфигурации синтаксиса с помощью следующей команды:

nginx -t

Вы получите следующий вывод:

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

Затем перезапустите службу Nginx, чтобы применить изменения конфигурации:

systemctl restart nginx

Вы также можете проверить статус Nginx с помощью следующей команды:

systemctl status nginx

Вы должны увидеть следующий вывод:

? nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
     Active: active (running) since Sun 2022-08-21 11:24:08 UTC; 7s ago
       Docs: man:nginx(8)
    Process: 5017 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
    Process: 5018 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
   Main PID: 5019 (nginx)
      Tasks: 2 (limit: 2242)
     Memory: 2.6M
        CPU: 35ms
     CGroup: /system.slice/nginx.service
             ??5019 "nginx: master process /usr/sbin/nginx -g daemon on; master_process on;"
             ??5020 "nginx: worker process" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""

Aug 21 11:24:08 ubuntu2204 systemd[1]: Starting A high performance web server and a reverse proxy server...
Aug 21 11:24:08 ubuntu2204 systemd[1]: Started A high performance web server and a reverse proxy server.

Доступ к веб-интерфейсу Focalboard

Теперь откройте веб-браузер и введите URL-адрес http://focalboard.example.com/login, чтобы получить доступ к Focalboard. Вы будете перенаправлены на страницу входа в Focalboard:

Нажмите на кнопку создания учетной записи. Вы должны увидеть страницу создания учетной записи Focalboard:

Укажите свой адрес электронной почты, имя пользователя администратора, пароль и нажмите кнопку «Регистрация». Вы должны увидеть панель инструментов Focalboard на следующей странице:

Включить SSL на Focalboard

Из соображений безопасности рекомендуется защитить Focalboard с помощью Lets Encrypt SSL. Затем вам нужно будет установить клиентский пакет Certbot для установки и управления Lets Encrypt SSL.

Сначала установите Certbot с помощью следующей команды:

apt-get install python3-certbot-nginx -y

После завершения установки выполните следующую команду, чтобы установить Lets Encrypt SSL на свой веб-сайт:

certbot --nginx -d focalboard.example.com

Вам будет предложено указать действующий адрес электронной почты и принять условия обслуживания, как показано ниже:

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator nginx, Installer nginx
Enter email address (used for urgent renewal and security notices) (Enter 'c' to
cancel): 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server at
https://acme-v02.api.letsencrypt.org/directory
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(A)gree/(C)ancel: A

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing to share your email address with the Electronic Frontier
Foundation, a founding partner of the Let's Encrypt project and the non-profit
organization that develops Certbot? We'd like to send you email about our work
encrypting the web, EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for focalboard.example.com
Waiting for verification...
Cleaning up challenges
Deploying Certificate to VirtualHost /etc/nginx/conf.d/focalboard.conf

Затем выберите, следует ли перенаправлять HTTP-трафик на HTTPS, как показано ниже:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2

Введите 2 и нажмите Enter, чтобы завершить установку. Вы должны увидеть следующий вывод:

Redirecting all traffic on port 80 to ssl in /etc/nginx/conf.d/focalboard.conf

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled https://focalboard.example.com

You should test your configuration at:
https://www.ssllabs.com/ssltest/analyze.html?d=focalboard.example.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/focalboard.example.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/focalboard.example.com/privkey.pem
   Your cert will expire on 2022-11-21. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot again
   with the "certonly" option. To non-interactively renew *all* of
   your certificates, run "certbot renew"
 - Your account credentials have been saved in your Certbot
   configuration directory at /etc/letsencrypt. You should make a
   secure backup of this folder now. This configuration directory will
   also contain certificates and private keys obtained by Certbot so
   making regular backups of this folder is ideal.
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le

 - We were unable to subscribe you the EFF mailing list because your
   e-mail address appears to be invalid. You can try again later by
   visiting https://act.eff.org.

Заключение

Поздравляем! вы успешно установили Focalboard с Nginx в качестве обратного прокси-сервера на Ubuntu 22.04. Теперь вы можете развернуть Focalboard в своей организации и начать легко управлять своими проектами и отслеживать их из веб-браузера. Не стесняйтесь спрашивать меня, если у вас есть какие-либо вопросы.