nixys / nxs-chat-srv

Nixys chat bot that integrates Telegram and Redmine
GNU General Public License v3.0
35 stars 10 forks source link

DEPRECATED

This repository is considered deprecated and will be archived. For the new version of this tool please go to nxs-support-bot project.

Introduction

Nxs-chat-srv is a Telegram Bot that allows linking Redmine and Telegram.

At the moment nxs-chat-bot supports only English and Russian languages. You may create files in json format for your languages.

Compatible with Redmine 4.2+

Installation

Docker

docker pull nixyslab/nxs-chat-srv:latest

Settings

Default configuration file locacation is /nxs-chat-srv.conf. Config file is in JSON format.

proc

Nxs-chat-srv process settings block description.

logging

Loging settings block description.

bind

Bind settings block description.

telegram

Telegram settings block description.

mysql

MySQL settings block description.

redis

Redis settings block description.

redmine

Redmine settings block description.

ra_queue

Rest API queue process settings block description.

cache

Cache settings block description.

dev_accounts

Development accounts settings block description.

Strings array contains the Telegram usernames allowed to work with nxs-chat. Useful for development purposes.

attachments

Attachments settings block description.

statistic

Statistic settings block description.

labels

Labels settings block description.

This block is used to translate user Telegram bot interface to their language specified in Redmine.

greetings

Description of the settings block for the greeting message.

Bot replies with a greeting message in accordance with language specified in Redmine account settings after receiving '/start' command from user.

This block is an objects array:

If there are no greetings for user language the greeting for default language will be used.

Configuration

To set up nxs-chat-srv you need:

Redmine setting up

After Redmine is installed, you need to create some basic elements, such as: roles, users, statuses, trackers, etc.

This section describes setup for an empty Redmine installation. So if you already have installed and configured Redmine - look the subsections below and make sure you have all needed settings in place.

Let's begin...

Firstly change the default Redmine admin password :)

Check that nxs-chat-redmine plugin has been installed in Redmine plugins directory.

Basic settings

Enable REST web service

Go to https://demo.nxs-chat.nixys.ru/settings?tab=api and enable Enable REST web service:

Enable REST web service

Nxs-chat Redmine plugin

Setting up Nxs-chat Redmine plugin

Go to https://demo.nxs-chat.nixys.ru/settings/plugin/nxs_chat and paste prepared URL into URL for notifications field:

Setting up Nxs-chat Redmine plugin

Optionally you can disable nxs-chat-srv SSL verification.

Edit the following option in /nxs-chat-srv.conf config file:

Statuses

Go to https://demo.nxs-chat.nixys.ru/issue_statuses/new and create a few statuses:

Now you need to get the IDs of created statuses:

Get the IDs of created statuses

and insert them in the following options in /nxs-chat-srv.conf config file:

Trackers

You need one or more trackers to make possible issue processing in Redmine.

Go to https://demo.nxs-chat.nixys.ru/trackers/new and create a new tracker:

Create the new tracker

Roles

You need to one or more roles to make possible issue processing in Redmine.

Go to https://demo.nxs-chat.nixys.ru/roles/new and create a new role with the following permissions:

Create the role

Create the role

For demo version allow creating new projects for all registered users

Go to https://demo.nxs-chat.nixys.ru/roles/1/edit and enable Create project option on Project block:

Enable `Create project` option

For demo version set the role given to a non-admin user who creates a project

Go to https://demo.nxs-chat.nixys.ru/settings?tab=projects and select option Role given to a non-admin user who creates a project to created role:

Set default role

Workflow

Now go to https://demo.nxs-chat.nixys.ru/workflows/edit and make a workflow for created role and tracker:

Create workflow

Priorities

You need one or more priorities to make possible issue processing in Redmine.

Go to https://demo.nxs-chat.nixys.ru/enumerations/new?type=IssuePriority and create the following priorities:

Priorities

Custom fields

Now create a custom field for Telegram username. This field is required to link Telegram and Redmine accounts.

Go to https://demo.nxs-chat.nixys.ru/custom_fields/new and select the type of object to which the custom field shall be attached:

Custom field create step 1

Custom field create step 2

Get the created custom field ID:

Get custom field ID

and insert it in the following option in /nxs-chat-srv.conf config file:

Projects

Create the Pre-sale project to communicate with all no registered users.

Go to https://demo.nxs-chat.nixys.ru/projects/new and create a new project named Pre-sale. Make sure that project options match the following:

Create presale project

and insert its name in the following option in /nxs-chat-srv.conf config file:

Issues list query

Go to https://demo.nxs-chat.nixys.ru/projects/pre-sale/queries/new and create a query with the following required options:

Create issues list query

Get created query id:

Get a created query id

and insert it the following option in /nxs-chat-srv.conf config file:

Accounts

Create an account with administrative permissions

Go to https://demo.nxs-chat.nixys.ru/users/new and fill out the fields for the new account:

Create admin account

Now log in as the new user and get the Rest API key:

Get Rest API key for admin account

Insert it in the following option in /nxs-chat-srv.conf config file:

Create presale account

Go to https://demo.nxs-chat.nixys.ru/users/new and fill out the fields for the new account:

Create presale account

Now log in as the new user and get the Rest API key:

Get Rest API key for presale account

Insert it in the following option in /nxs-chat-srv.conf config file:

Nxs-chat-srv setting up

In addition to already specified settings you need to set the following blocks.

Block bind

In this block set bind address, port and path to SSL certificate and private key.

Block redmine

Block mysql

Create MySQL DB and specify the connection options in corresponding block in /nxs-chat-srv.conf config file.

Block redis

Specify connection options in corresponding block in /nxs-chat-srv.conf config file.

Block telegram

Block statistic

Telegram bot initializaton

Before the nxs-chat-srv has been starts you need to set Webhook in Telegram and populate the created MySQL DB.