Giter VIP home page Giter VIP logo

redmine_bots's Introduction

Build Status Rate at redmine.org

redmine_bots

This plugin provides common stuff to build redmine plugins that involve Slack/Telegram API usage.

Requirements

Upgrade from 0.2.0 to 0.3+

From 0.3.0 proxy settings are unified for tdlib and bot and there is support for multiple proxies. If you have used proxies before, you should reassign it on plugin settings page.

Upgrade from 0.1.0 to 0.2+

Webhook URL is changed in 0.2.0 because of webhook secret. You need to reinitialize webhook from plugin settings page.

Telegram

Telegram support includes:

  • Common components to interact with Bot API
  • Common client commands that utilize tdlib-ruby
  • Telegram Login to connect Redmine and Telegram accounts

Proxy

You can set proxy pool on plugin settings page. Proxies are gonna be monitored for availability, and first working proxy will be taken for every request.

Proxy format is same to curl:

http://user:[email protected]:3128
socks5://user:[email protected]:9050

Only SOCKS5 and HTTP proxies are supported. Note that tdlib supports only SOCKS5 proxies, so you should add at least one SOCKS5 proxy if you want tdlib to be proxied.

Tdlib

In order to use tdlib client you need compiled TDLib.

It should be placed it in redmine_root/vendor or added to ldconfig.

For CentOS you can use our repositories:

http://rpms.southbridge.ru/rhel7/stable/x86_64/

http://rpms.southbridge.ru/rhel6/stable/x86_64/

And also SRPMS:

http://rpms.southbridge.ru/rhel7/stable/SRPMS/

http://rpms.southbridge.ru/rhel6/stable/SRPMS/

To make telegram client working you should follow steps:

  • Be sure you set correct host in Redmine settings
  • Go to the plugin settings page
  • Press "Authorize Telegram client" button and follow instructions

IMPORTANT: 2FA is not supported at the moment

Bot API

It is necessary to register a bot and get its token. There is a @BotFather bot used in Telegram for this purpose. Type /start to get a complete list of available commands.

Type /newbot command to register a new bot. @BotFather will ask you to name the new bot. The bot's name must end with the "bot" word. On success @BotFather will give you a token for your new bot and a link so you could quickly add the bot to the contact list. You'll have to come up with a new name if registration fails.

Set the Privacy mode to disabled with /setprivacy. This will let the bot listen to all group chats and write its logs to Redmine chat archive.

Set bot domain with /setdomain for account connection via Telegram Login. Otherwise, you will receive Bot domain invalid error on account connection page.

Enter the bot's token on the Plugin Settings page to add the bot to your chat.

To add hints for commands for the bot, use command /setcommands. You need to send list of commands with descriptions. You can get this list from command /help.

Bot should be added to contacts of account used to authorize telegram client in plugin.

Bot can work in two modes โ€” getUpdates or WebHooks.

getUpdates

To work via getUpdates, you should run bot process bundle exec rake redmine_bots:telegram. This will drop bot WebHook setting.

WebHooks

To work via WebHooks, you should go to plugin settings and press button "Initialize bot" (bot token should be saved earlier, and notice that redmine should work on https)

Slack

Slack support includes:

  • Bot components
  • Rake task to daemonize slack bot
  • Sign in with Slack to connect Redmine and Slack accounts

In order to use Slack integrations you need to follow these steps:

  • Create your own Slack app here.

  • Go to your app page (you can view the list of all your apps here) and copy data from App Credentials block to plugin settings.

  • Create bot user on Bot users page.

  • Obtain your oauth tokens on OAuth & Permissions page and copy it to plugin settings.

  • Add redirect url for Sign in with Slack: https://your.redmine.host/slack/sign_in/check

  • Configure app scopes on demand.

  • Run bot with bundle exec rake redmine_bots:slack

Migration from redmine_telegram_common

You can transparently migrate your old data (telegram accounts, settings and tdlib db/files) to new DB structure if you used redmine_telegram_common before with bundle exec rake redmine_bots:migrate_from_telegram_common.

Author of the Plugin

The plugin is designed by Southbridge

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.