Coder Social home page Coder Social logo

requilence / integram Goto Github PK

View Code? Open in Web Editor NEW
1.5K 52.0 151.0 6.38 MB

Integrate Telegram into your workflow – Trello, Gitlab, Bitbucket and other bots

Home Page: https://integram.org

License: GNU General Public License v3.0

Go 99.83% Dockerfile 0.17%
telegram trello bitbucket gitlab golang golang-application telegram-bot telegram-bot-api

integram's People

Contributors

kswgit avatar manuel-tiedtke avatar olebedev avatar requilence avatar tru2dagame avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

integram's Issues

Does it support newer gitlab api?

screen shot 2017-08-30 at 1 01 05 am

when i use older verison of gitlab (GitLab Community Edition 8.8.2), the word issue can be link to correspond issue URL.
it now worked for the new version of gitlab (GitLab Community Edition 9.2.2)

Unable to start Integram

Hello!
First of all, thanks for development and open sourcing Integram. It's extremely useful.
But,
today I've noticed that Trello messages not handled. So the messages were marked as read, but
without any actions from @trello_bot.
I was trying to restart the @trello_bot and Integram itself but after Integram restart it didn't even suggest me the integration list.

Trying to open Integram via web version of Telegram got the message "One of the params is missing or invalid." with such technical details

Method: messages.sendMessage Url: N/A Result: {"_":"rpc_error","error_code":400,"error_message":"YOU_BLOCKED_USER"}

Didn't found message YOU_BLOCKED_USER in Telegram API docs.

Please, advise how can I debug such case on my side.
Thanks you in advance.

Issues don't work

Since we use the the new gitlab bot issues are only displayed with updated by username. There is no reference to this issue. Is that right?

.

Self-hosted Bitbucket

The locally hosted version of bitbucket does not have a 'Webhooks' section in the repository settings. It only has a 'Hooks' section which is very limited, allowing only specify plugins to offer outgoing webhooks here. The plugin

POST service webhook for Bitbucket Server

by Atlassian and documented here seems the only one offering to send webhooks. However nothing happens when pushing to the branch.

Please integrate the self-hosted bitbucket server into integram.

Cant build

When I try to execute go get -v -u github.com/requilence/integram -- I am getting error:

src/github.com/requilence/integram/bots.go:84: undefined: tgbotapi.MessageEntity
src/github.com/requilence/integram/bots.go:94: undefined: tgbotapi.Venue

In bots.go import looks like:

import (
  ...
  tg "gopkg.in/telegram-bot-api.v3"
)

I believe that this types was added in v4.0.0 of tgbotapi (commit: go-telegram-bot-api/telegram-bot-api@18510df)

Did you stop maintenance?

Hi.
Did you stop maintenance of this really nice project?
Can't use any of your bots as well as your site. Can't reach it.
it was very useful in our telegram channel.

How to prevent to notify my activity

Thanks for your awesome project.

I added git project to telegram.

I want to select notification type, I choose issue and comment.

But Integram notify to me include my activity (If I made issue, send to message to me. but I already knew my activity)

How to prevent to notify my activity?

keyboardButton

Been stuck for 2 days, couldnt figure out a way to create a keyboardmarkup after user input /start, pls help thanks!

GitLab should not notify an unsuccessful build if allow_failure is enabled

Hi. We use your tool and that's cool, but for one of the projects we have this config:

test_jre7:
  <<: *test_definition
  image: openjdk:7-jdk-alpine

test_jre8:
  <<: *test_definition
  image: openjdk:8-jdk-alpine

# Allow failure, until https://github.com/docker-library/openjdk/issues/101#issuecomment-312510546
test_jre9:
  <<: *test_definition
  image: openjdk:9-jdk
  allow_failure: true

As you can see, task for jre9 have allow_failure: true, because some Java 9 bug (not ours, honestly). But the bot continues to send a notification that this task has been failed:

If this is possible, please, add an option or enable it by default to do not receive such notifications for suppressed tasks.

#22 coming back

@requilence it has been working perfectly for last 7 days, but today issue #22 turned back.
I've noticed that @trello_bot didn't reply to me. Repeat of the command or perform other command doesn't get a result.
If I try to restart Integram, it doesn't react to any commands after Start pressed.
Please, advise me and feel free to request my help to investigate the issue.
Thanks in advance.

have problem with bitbucket integrations

yo

i cant integrate integram with bitbucket
pushing to /start in integram he is redirect me to bitbucket and after that
he is giving me link for adding in the webhooks to setting
i'm added, saving, and nothing change
whats next i musted make, help please??

Bot commands don't work

Hi.
Thanks for useful bots.
But I have a problem. I want to use Gitlab bot, so I add him and he say Hi to me and provide a link for web hooks. Then I try /settings command, everything work's fine for a while.
But after some time all of two commands stop working. I can spam bot with my /start or /settings commands, but bot stays silent.
Instead of it's silent behavior, notifications from Gitlab works well.

[Enhancement] Improve message format on commit

You should look at the bot @githubbot and see how it displays commit and issue messages.
image
I am using Integram with Bitbucket. The main problem is that if you provide a direct url, telegram renders it along with a giant profile picture on mobile devices. This quickly floods development groups.

I think implementing an output format like the one above shouldn't be difficult at all. If you point me in the right direction I could even make a pull request for you. Thanks!

Edit: Took a look at the code, the changes should be made around here: https://github.com/Requilence/integram/blob/master/services/bitbucket/webhook.go#L340

integram.org and bots down

Hello,

I don't know if you were planning on discontinuing the integram.org service now that it's opensource (I could self host, I'm just lazy :) )
Is it expected to be down?

Support for a docker image

Is it possible to create and publish this as a docker image on dockerhub so other projects can use it?

[GitLab CE] Redirect URI issue

I have a few questions about using integram.

  1. What Redirect URI should I use for Gitlab CE, if I'm running integram in the same kubernetes cluster, as the Giltab CE, and integram is accessible to GitLab via FQDN like integram.default.svc.cluster.local on port 80.

  2. What Scopes should I set for Redirect URI? (Gitlab 9.3.5)

Could you please help me to get this working? Thanks in advance.

Support for Gitea

Just recently started using Gitea, would love to have Integram support for it. I intend to work on this myself, but I wanted to create an issue here for reference, as per the wiki.

Intergration for Github Orgs

Hey guys,

Been looking into this and I couldn't find anything. It seems like I can approve the github bot to see the ORG, but I can't seem to integrated it with the BOT.

Any thoughts about a feature request?

[Question] Got Bot up and running but having oauth issue

Hi there

I have managed to get the bot up and running on an EC2 instance.

[GIN-debug] Listening and serving HTTP on :7000
INFO[0002] Start listening for updates bot ahleeTestbot 
trello msg: start 

When I trigger the bot with /start
I got redirected to this link

http://ec2-52-221-237-194.ap-southeast-1.compute.amazonaws.com/oauth1/skenwwcrlhd4w8k-

Where ec2-52-221-237-194.ap-southeast-1.compute.amazonaws.com is my based url
However, the page can't be open.

2017-01-21 at 2 57 pm

found AuthTempToken:skenwwcrlhd4w8k-
DEBU[0013] beforeJob 865EKu0unycvVGOGba5q0dr9hqzk, poolID:02:95:d3:2d:b4:89_telegram, finished:0
 
DEBU[0014] Successfully sent, id=19
                    
DEBU[0014] afterJob 865EKu0unycvVGOGba5q0dr9hqzk, poolID:02:95:d3:2d:b4:89_telegram, finished:1484981506
 
DEBU[0014] destroying the job 865EKu0unycvVGOGba5q0dr9hqzk finished(2017-01-21 06:51:46.732318468 +0000 UTC), status=executing, retriesLeft=23, nextTime=0 

Am I missing something here?

Thank you @requilence :)

Bot unable to push data to Trello

Hi integram team, we noticed that the bot have suddenly unable to push the data to Trello, any idea what had happen? I create a new card with the bot, but it stopped after i enter the name of the card with Trello bot, the integram doesn't Trigger it back for me to enter the rest of the information.

[Question] Bot setup

Hi there

thanks for making this open source.
I'm trying to learn and set up
I managed to get this up and running
2017-01-20 at 7 08 pm

But when I type /start with the bot.
an error occured at tgupdates.go

I followed your steps. Is there anything I'm doing wrong?

Thank you

Horn in telegram

You should write somewhere how to use this Horn in telegram. This bot allows you to pass user messages exactly to telegram. Because it's not definitely clear how to pass objects to text param.
Should it be array, or string, or json, or whatever.
But after searching for one hour, I found that it should only string and nothing else.

  $data = array("text" => "Hello telegram from github");
  $data_string = json_encode($data);

  $ch = curl_init('$YOUR_HORN_URL');
  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
  curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_HTTPHEADER, array(
      'Content-Type: application/json',
      'Content-Length: ' . strlen($data_string))
  );

  $result = curl_exec($ch);
  curl_close($ch);

However if you will use

  $data = array("text" => ["name" => "george", "surname" => "my"]);
  ...

It will never get to your horn in telegram. But the response for request will be 200, and you will be stopped with this unnecessary debugging.

Self-hosted Gitlab bot stopped doing anything

Hi. Thanks for the awesome project. We've been using it for a couple of weeks as a self-hosted solution until the bot suddenly stopped doing anything. I've tried setting it up from scratch but with no luck. I will describe step by step what I've done:

  1. Created a bot with @BotFather and got a token
999999999:zzzz9zzzzzzzz_zzz9zzz999zzzzzzzzz9z
  1. Created new gitlab OAuth application in Gitlab's admin area:
ID=z9zz9zzz99z9999zzz99zz99z9z9z9999z9zz9zzzzzz99zz99z99zzzz9zz9z99
SECRET=99999999zz9zzzz9999999zz9999z9zzz99z99zzzzzzzz9z99z9zzz9z999zz99
  1. Created a docker-compose.yml file:
version: '3'

services:
  mongo:
    image: mongo:3.4.10
    expose:
      - "27017"
    command: --smallfiles --port 27017
    volumes:
      - /data/db:/data/db

  redis:
    restart: always
    command: redis-server --appendonly yes
    image: redis:3.2
    expose:
        - "6379"
    volumes:
        - /data/redis:/data

  integram:
    image: integram/integram:latest
    restart: always
    volumes:
      - /data/integram:/app/.conf
    links:
      - mongo
      - redis
    depends_on:
      - mongo
      - redis
    expose:
      - "7000"
    environment:
      - TZ=UTC
      - INTEGRAM_MONGO_URL=mongodb://mongo:27017/integram
      - INTEGRAM_REDIS_URL=redis:6379
      - INTEGRAM_INSTANCE_MODE=multi-main
      - INTEGRAM_CONFIG_DIR=/app/.conf
      - INTEGRAM_PORT=7000
      - INTEGRAM_BASE_URL=https://bot.example.org

  gitlab:
    image: integram/gitlab
    restart: always
    links:
      - mongo
      - redis
    depends_on:
      - integram
    environment:
      - TZ=UTC
      - INTEGRAM_MONGO_URL=mongodb://mongo:27017/integram
      - INTEGRAM_REDIS_URL=redis:6379
      - INTEGRAM_INSTANCE_MODE=multi-service
      - INTEGRAM_BASE_URL=https://bot.example.org
      - GITLAB_BOT_TOKEN=999999999:zzzz9zzzzzzzz_zzz9zzz999zzzzzzzzz9z
      - GITLAB_OAUTH_ID=z9zz9zzz99z9999zzz99zz99z9z9z9999z9zz9zzzzzz99zz99z99zzzz9zz9z99
      - GITLAB_OAUTH_SECRET=99999999zz9zzzz9999999zz9999z9zzz99z99zzzzzzzz9z99z9zzz9z999zz99

  caddy:
    image: abiosoft/caddy
    depends_on:
      - integram
    links:
      - integram
    environment:
      - CADDYPATH=/etc/caddycerts
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - /var/www/Caddyfile:/etc/Caddyfile
      - /var/www/.caddy:/etc/caddycerts
      - /var/www/logs:/srv/logs

When I start the application, I see a bunch of successful logs:

$ docker-compose logs integram

integram_1         | [GIN] 2018/02/16 - 10:00:47 | 200 |    1.076604ms |      172.18.0.1 |  GET     /gitlab/healthcheck
integram_1         | [GIN] 2018/02/16 - 10:01:17 | 200 |    1.266329ms |      172.18.0.1 |  GET     /gitlab/healthcheck
integram_1         | [GIN] 2018/02/16 - 10:01:47 | 200 |    1.126916ms |      172.18.0.1 |  GET     /gitlab/healthcheck
$ docker-compose logs gitlab

gitlab_1           | time="2018-02-16T07:04:54Z" level=info msg="Integram mode: multi-service"
gitlab_1           | time="2018-02-16T07:04:54Z" level=info msg="MongoDB connected: mongodb://mongo:27017/integram"
gitlab_1           | time="2018-02-16T07:04:57Z" level=info msg="gitlab is performing on behalf of @exampleOrgGitlabBot"
gitlab_1           | [GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
gitlab_1           |  - using env:	export GIN_MODE=release
gitlab_1           |  - using code:	gin.SetMode(gin.ReleaseMode)
gitlab_1           |
gitlab_1           | [GIN-debug] HEAD   /:param1/:param2/:param3  --> github.com/integram-org/gitlab/vendor/github.com/requilence/integram.serviceHookHandler (5 handlers)
gitlab_1           | [GIN-debug] GET    /:param1/:param2/:param3  --> github.com/integram-org/gitlab/vendor/github.com/requilence/integram.serviceHookHandler (5 handlers)
gitlab_1           | [GIN-debug] POST   /:param1/:param2/:param3  --> github.com/integram-org/gitlab/vendor/github.com/requilence/integram.serviceHookHandler (5 handlers)
gitlab_1           | [GIN-debug] HEAD   /:param1/:param2          --> github.com/integram-org/gitlab/vendor/github.com/requilence/integram.serviceHookHandler (5 handlers)
gitlab_1           | [GIN-debug] GET    /:param1/:param2          --> github.com/integram-org/gitlab/vendor/github.com/requilence/integram.serviceHookHandler (5 handlers)
gitlab_1           | [GIN-debug] POST   /:param1/:param2          --> github.com/integram-org/gitlab/vendor/github.com/requilence/integram.serviceHookHandler (5 handlers)
gitlab_1           | [GIN-debug] HEAD   /:param1                  --> github.com/integram-org/gitlab/vendor/github.com/requilence/integram.serviceHookHandler (5 handlers)
gitlab_1           | [GIN-debug] GET    /:param1                  --> github.com/integram-org/gitlab/vendor/github.com/requilence/integram.serviceHookHandler (5 handlers)
gitlab_1           | [GIN-debug] POST   /:param1                  --> github.com/integram-org/gitlab/vendor/github.com/requilence/integram.serviceHookHandler (5 handlers)
gitlab_1           | [GIN-debug] Listening and serving HTTP on :7000
gitlab_1           | time="2018-02-16T07:04:59Z" level=info msg="gitlab service: workers pool [1] started"
gitlab_1           | [GIN] 2018/02/16 - 07:05:13 | 500 |    1.167077ms |      172.18.0.1 |  GET     /gitlab/healthcheck
gitlab_1           | [GIN] 2018/02/16 - 07:05:43 | 200 |     616.633µs |      172.18.0.1 |  GET     /gitlab/healthcheck
gitlab_1           | [GIN] 2018/02/16 - 07:06:13 | 200 |     721.849µs |      172.18.0.1 |  GET     /gitlab/healthcheck
gitlab_1           | [GIN] 2018/02/16 - 07:06:43 | 200 |     557.026µs |      172.18.0.1 |  GET     /gitlab/healthcheck

Then I tried the following:

  1. Send a direct message to the bot: /start
  2. Invite the bot to a group and issue some commands: /start@exampleOrgGitlabBot

But nothing seems to happen.

If I inspect mongo, I can see that the bot is receiving the messages:

$ docker-compose exec mongo mongo integram

MongoDB shell version v3.4.10
connecting to: mongodb://127.0.0.1:27017/integram
MongoDB server version: 3.4.10
[...]

> db.messages.find().pretty()
{
	"_id" : ObjectId("5a86aecd18880afb2c85c7fb"),
	"msgid" : 4,
	"botid" : 414731650,
	"fromid" : 1431227,
	"chatid" : 1431227,
	"date" : ISODate("2018-02-16T10:13:33Z"),
	"text" : "/start"
}
{
	"_id" : ObjectId("5a86af0218880afb2c85c830"),
	"msgid" : 6,
	"botid" : 414731650,
	"fromid" : 1431227,
	"chatid" : -262650351,
	"date" : ISODate("2018-02-16T10:14:26Z")
}
{
	"_id" : ObjectId("5a86af0a18880afb2c85c83a"),
	"msgid" : 7,
	"botid" : 414731650,
	"fromid" : 1431227,
	"chatid" : -262650351,
	"date" : ISODate("2018-02-16T10:14:34Z"),
	"text" : "/start@exampleOrgGitlabBot"
}

> db.chats.find().pretty()
{
	"_id" : NumberLong(1431227),
	"type" : "private",
	"firstname" : "Anton",
	"lastname" : "Egorov",
	"username" : "xxx",
	"createdat" : ISODate("2018-02-16T10:13:33.386Z"),
	"hooks" : [
		{
			"token" : "cJ5GU2Ug2q6",
			"services" : [
				"gitlab"
			]
		}
	]
}
{
	"_id" : NumberLong(-262650351),
	"type" : "group",
	"firstname" : "",
	"title" : "zzz",
	"createdat" : ISODate("2018-02-16T10:14:26.304Z"),
	"hooks" : [
		{
			"token" : "c4PvppgFA5z",
			"services" : [
				"gitlab"
			]
		}
	],
	"membersids" : [
		NumberLong(1431227),
		NumberLong(3343033)
	]
}

Any hint is really much appreciated, thanks!

Store files as attachments

  1. The user searches for a card in chat, the bot posts a card with a fascinating inline keyboard.
  2. The user repleis to card with a message with a photo/voice/document attached.
  3. The bot should attach this file to the card.

Ignore invalid commands in groups

If we send some text with command without bot's name, and which is invalid for your bots (but may be valid for other bots), such as /status, it will respond with Command is invalid. Say what?. This kind of behavior is annoying in group chat.

Please ignore invalid command without bot's name in group chats, so that:

  • it won't respond to /status in group chats
  • it says invalid for /status@GitHubBot

Bug with issues reply on gitlab

After connecting integram with gitlab (by setting issue webhook) and trying to create issue and reply from chat, I got many same messages (see the screenshot). I think it's unwanted behavior.

default

Any chance to read fields attributes

Hi..

As you can see one of the important attributes on Slack message formatting is fields attributes. That would be nice if you could represent these parameters.

            "fields": [
                {
                    "title": "Priority",
                    "value": "High",
                    "short": false
                }
            ],

For more information see this link

Regards,

GitHub integration does not notify about subscribes.

I am receiving notification about my projects. But I have notifications from watching projects.
When I open the GitHub-site I see unread notifications from watching projects, but I have no one notifying in the Telegram.

Do not notify me, if I made the changes

Problem

Bot spams me on changing smthg in e.g. Trello by myself.

Solution

  1. Provide username and Trello/Bitbucket/etc mapping (probably the same like in the issue #18).
  2. Do not notify certain Telegram user, if this user made the change in Trello/Bitbucket/etc.

P.S. If it's already possible, please show me the proper way.

Thanks!

Support for self-hosted Gitlab

We host our own instance of Gitlab.

I guess this is just a matter of replacing all occurrences of gitlab.com in the code by the custom gitlab url.

But there is something that prevents me from trying this : given that gitlab requires a redirect_uri for oauth authentication, it means that gitlab has to be able to access the IP where Integram runs. Which is not the case in our infrastructure.
For Integram to work in our setup, we would need to use gitlab access tokens instead of oauth, which requires quite a lot of changes.

Gilab Integration - Bug when push hits pipeline

When I push to two branches in a row, integram gitlab integration was supposed to show two pipelines, but one for each branch. Instead, it shows the same pipeline twice.

image

Is this print, I pushed to a branch called dev, and a branch called staging. It is showing staging twice.

image

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.