Giter Club home page Giter Club logo

webhookhandler's Introduction

Webhook Handler

GitHub license Docker Docker Image Size (tag)

A Webhook Handler for Github, Gitlab, .... It's just a simple parser and you should extend this project if you need a visualization.

Configure

You need to set env variables for using webhooks. Create a .env like this :

SECRET=changeme

DB_CONNECTION="mongodb://localhost:27017/webhook"

PROVIDER=github

# Github:  X-Hub-Signature
# Gitlab:  X-Gitlab-Token
# Gogs:    X-Gogs-Signature
# Gitea:   HTTP_X_GITEA_SIGNATURE
SIGNATURE="X-Hub-Signature"

LOG_LEVEL=info

TRUST_KEY=changeme

Use SECRET value in github settings :

secret

Important : You should select application/json for content type.

Trusted platforms

For use with trusted platforms or offline/local usage, you can pass a trusted query to webhook URL. For example :

http://<domain>/gitlab?trusted=1234

Now, the program will ignore verification and catch anything received.

โ• This query value should equal to TRUST_KEY variable from your env. file.

Run

npm install
node hook.js

Or use docker

docker pull hatamiarash7/webhook
docker run -d
    -p 3000:3000
    -e SECRET='changeme'
    -e DB_CONNECTION='mongodb://localhost:27017/webhook'
    -e PROVIDER='github'
    -e SIGNATURE='X-Hub-Signature'
    -e LOG_LEVEL='debug'
    -e TRUST_KEY='changeme'
    hatamiarash7/webhook

screenshot

Log

We have 6 level for logging

  • trace
  • debug
  • info
  • warn
  • error
  • fatal

Set any level in .env file :

LOG_LEVEL=info

To-Do

  • Connect to DB
  • Test with git platforms
    • Github
    • Gitlab
    • Gitea
    • Gogs
  • Configure a logger
  • Add another crypto methods
  • Add a simple dashboard

Support

Donate with Bitcoin Donate with Ethereum

ko-fi

Contributing

Don't be shy to be a contributor ๐Ÿ˜‰

  1. Fork it !
  2. Create your feature branch : git checkout -b my-new-feature
  3. Commit your changes : git commit -am 'Add some feature'
  4. Push to the branch : git push origin my-new-feature
  5. Submit a pull request

Issues

Each project may have many problems. Contributing to the better development of this project by reporting them.

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.