Giter Club home page Giter Club logo

go-mantis-webhook's Introduction

Mantis webhook

Webhook integration Gitlab -> Mantisbt

This webhook aims to integrate Gitlab with Mantisbt by closing issues listed on a commit message. It also provides some nice features like email aliasing and project mapping.

Getting started

All you need to run this webhook is Go (any version, but the newer the better) and a Postgresql database. You can download the prebuilt package with a docker configuration to quickly get it running.

This webhook use both soap and REST mantis apis, so make sure both of them are enabled before you continue.

Configuration

This is an example of config.json you need to create on the root directory on the webhook.

{
  "port": 8090,
  "secret": "secret_token",
  "database": {
    "host": "localhost",
    "database_name": "go-mantis",
    "user": "postgres",
    "password": "postgres"
  },
  "gitlab": {
    "token": "my_gitlab_token"
  },
  "mantis": {
    "host": "http://localhost:8989",
    "user": "administrator",
    "password": "root",
    "token": "QAei2Pozy2FHd_5fFx2Bw3SH8obe4e49"
  }
}

Endpoints

Webhook

All requests under /webhook are authorized by the token you set on your Gitlab repository. The webhook will check for it under the request's X-Gitlab-Token header and compare it with the token you set on the config.json under gitlab.token.

POST /webhook/push

The endpoint you need to register on your Gitlab repository.

Application

All requests under /app are authorized by the token you set on you config.json under secret. The app will check for the token under the request's Authorization header.

POST /app/projects

Associates a new Gitlab project with a Mantis one.

Params:

{
  "gitlab_project": "test/test",
  "mantis_project": "Test project"
}

POST /app/aliases

Registers an email alias for a Mantis user.

Params:

{
  "email": "[email protected]",
  "alias": "[email protected]"
}

go-mantis-webhook's People

Contributors

skiptirengu 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.