unknwon / orbiter

Orbiter is a tool for collecting and redistributing webhooks over the network.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Orbiter is a tool for collecting and redistributing webhooks over the network.

NOTICES

  • This project comes with absolutely NO warranty for break changes,
  • ... but you can file bugs, feature requests and usage questions if you have to.

Features

  • Receive and save webhook by time, type (GitHub, etc) and tags (repository, owner, etc).
  • Redistribute webhook by APIs whenever and whatever it gets requested.
  • Nice admin dashboard to config and do statistics.

WTF?

Oh well, it is just a tool to collect webhook history when you don't have time to process them at the moment.

Or, maybe you want to study the history later to understand a basic user action flow.

And nothing else, sorry!

Installation

First of all, you need to install MySQL (WHAT?!).

Then, install Orbiter:

$ go get unknwon.dev/orbiter

Configuration

The default configuration is located at conf/app.ini, please create another file called custom/app.ini to adjust your own values.

Finally, execute ./orbiter.

The server should start listening on 0.0.0.0:8085 by default, visit http://localhost:8085.

Quick start

Config new collector

Collector defines what the type (currently only support GitHub) and secret token should be.

Secret token is auto-generated by Orbiter, you can ask to regenerate as many times as you prefer.

Normally, one collector is for an individual repository, but that's up to you.

After creation, setup the webhook with secret token in corresponding hosting site.

For example, in GitHub:

  • Payload URL: https://orbiter.unknwon.io/hook?secret=mysecretweapon
  • Content type: application/json
  • Secret: REMAIN EMPTY
  • Events: ORBITER DOES NOT CARE

View recent history

You can go to /webhooks to view recent receive history of webhooks, and their payloads.

Important tags such as repository owner, repository name, event type and sender are extracted for payload automatically and can be used as query conditions for applications.

Add new application

Application is basically nothing but contains a access token which is needed for calling APIs.

APIs

All parameters and access token is passed by URL query parameters.

List webhooks

GET /api/v1/webhooks
Parameters

Following parameters are all optional, and combine with condition AND.

Name Description
collector_id List webhooks that were received by certain collector
owner List webhooks that belongs to certain repository owner
repo_name List webhooks that belongs to certain repository
event_type List webhooks that have certain event type
sender List webhooks that were triggered by someone
after List webhooks that received after certain time point, this value is Unix nanoseconds
limit Maximum number of webhooks to response
Example
GET /api/v1/webhooks?token=mysecretdefense&event_type=issue_comment&after=1454740438165946316&limit=10

Acknowledgments

Open-source, not open-contribution

Quote from benbjohnson/litestream:

I am grateful for community involvement, bug reports, & feature requests. I do not wish to come off as anything but welcoming, however, I've made the decision to keep this project closed to contributions for my own mental health and long term viability of the project.

License

This project is under the Apache License, Version 2.0. See the LICENSE file for the full license text.

About

Orbiter is a tool for collecting and redistributing webhooks over the network.

License:Apache License 2.0


Languages

Language:Go 97.3%Language:CSS 2.7%