GithubHelp home page GithubHelp logo

gitlab-telegram-bot's Introduction

Telegramm BOT for GitLab v0.1-alpha

WARNING

This is first Alpha version, all in one

Capabilities

Push events
This events will be triggered by a push to the repository

Tag push events
This events will be triggered when a new tag is pushed to the repository

Issues events
This events will be triggered when an issue is created/updated/close/reopen

Build

git clone https://gitlab.com/POStroi/gitlab-telegram-bot.git
cd gitlab-telegram-bot
go get github.com/Syfaro/telegram-bot-api github.com/julienschmidt/httprouter github.com/mattn/go-sqlite3
go build -ldflags "-s -w" .

Run

./gitlab-telegram-bot &

Settings

Default config path ./bot.cfg, JSON format

{
"bot_api": "BOT_API_KEY",
"hook_key": "RANDOM_KEY",
"bot_admin": "Privileged_USER_for_BOT",
"listen": "0.0.0.0:3000",
"database": "./chat.db"
}

bot_api - Api key obtained from @BotFather
hook_key - Auth. key - random letter diget combination
bot_admin - telegram user, admin for bot. Nikname without "@"
listen - IP and port
database - SQLite3 database path

Settings GitLab WEB hook

URL = http://IP:PORT/hook/hook_key

Enabling event publishing to a telegram channel

  1. Add your bot to common channel or open a private channel
  2. Use the /start_hook ARGS command to start a publicate events to channel,
    ARGS should be equivalent to the repository name.
  3. Eat a cookie and enjoy spam in channel :D

Docker

docker pull sysalex/gitlab-telegram-bot

docker run -t -i -p 3000:8081 -d \
--env BOT_API_KEY="BOT_API_KEY" \
--env BOT_HOOK_KEY="BOT_HOOK_KEY" \
--env BOT_ADMIN="ADMIN_USER_NAME" sysalex/gitlab-telegram-bot

hook url URL = http://IP:8081/hook/BOT_HOOK_KEY

Contributing

:-*

License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

gitlab-telegram-bot's People

Contributors

yousysadmin avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.