All Projects → agrison → Harpoon

agrison / Harpoon

Licence: mit
GitHub WebHook server written in Go

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Harpoon

Webhook
webhook is a lightweight incoming webhook server to run shell commands
Stars: ✭ 7,201 (+2900.42%)
Mutual labels:  webhook, server
Yivnet
Yivnet is a microservice game server base on go-kit
Stars: ✭ 237 (-1.25%)
Mutual labels:  server
Yin
The efficient and elegant JSON:API 1.1 server library for PHP
Stars: ✭ 214 (-10.83%)
Mutual labels:  server
Beasthttp
Provides helper tools for creating RESTful services using Boost.Beast
Stars: ✭ 227 (-5.42%)
Mutual labels:  server
Construct
This is The Construct
Stars: ✭ 218 (-9.17%)
Mutual labels:  server
Voicebook
🗣️ A book and repo to get you started programming voice computing applications in Python (10 chapters and 200+ scripts).
Stars: ✭ 236 (-1.67%)
Mutual labels:  server
Meghanada Server
A Java IDE Server for your editor. Java IDE-like features to your favourite text editor.
Stars: ✭ 213 (-11.25%)
Mutual labels:  server
Mockoon
Mockoon is the easiest and quickest way to run mock APIs locally. No remote deployment, no account required, open source.
Stars: ✭ 3,448 (+1336.67%)
Mutual labels:  server
Hypertext
Any-way-you-want-it, type-safe HTML in Swift.
Stars: ✭ 236 (-1.67%)
Mutual labels:  server
Craftbook
🔧 Machines, ICs, PLCs, and more!
Stars: ✭ 226 (-5.83%)
Mutual labels:  server
Simplenetwork
simple TCP server / client C++ linux socket
Stars: ✭ 225 (-6.25%)
Mutual labels:  server
Jupyter server
The backend—i.e. core services, APIs, and REST endpoints—to Jupyter web applications.
Stars: ✭ 217 (-9.58%)
Mutual labels:  server
Playmaker
Fdroid repository manager fetching apps from Play Store
Stars: ✭ 236 (-1.67%)
Mutual labels:  server
Ocsinventory Server
Communication server of OCS Inventory
Stars: ✭ 214 (-10.83%)
Mutual labels:  server
Stubby4node
A configurable server for mocking/stubbing external systems during development.
Stars: ✭ 237 (-1.25%)
Mutual labels:  server
Raid Toolbox
Raid ToolBox (RTB) is a big toolkit of Spamming/Raiding/Token management tools for discord.
Stars: ✭ 211 (-12.08%)
Mutual labels:  server
Hls Vod
HTTP Live Streaming with on-the-fly encoding of any video file for Web/Apple TV/iPhone/iPad/iPod
Stars: ✭ 221 (-7.92%)
Mutual labels:  server
Twist
A light script for you to setup shadowsocks-libev server with high-speed connections and newest powerful features
Stars: ✭ 229 (-4.58%)
Mutual labels:  server
Iobroker.js Controller
ioBroker controller
Stars: ✭ 238 (-0.83%)
Mutual labels:  server
Heimdall
As the name suggests Heimdall Application Dashboard is a dashboard for all your web applications. It doesn't need to be limited to applications though, you can add links to anything you like.
Stars: ✭ 3,501 (+1358.75%)
Mutual labels:  server

Harpoon

Go Report Card Build Status

Harpoon is a simple Go program that listens for GitHub hooks like push on specific git repository refs and execute a defined command when it occurs.

It can be configured in a TOML configuration file.

That's nothing fancy, just didn't want to install the whole nodejs + npm or Apache + PHP just for this.

Install

go get github.com/agrison/harpoon
go build

Add it to your path if you want.

Runnning

Configuration

You must have a config.toml file located in your directory.

This is a sample TOML file:

port = 9001
addr = "0.0.0.0"
# tunneling stuff
tunnel = true
tunnelName = "foobarbazz"

[events."push:foo/bar:refs/heads/develop"]
cmd = "echo"
args = "Push!"

[events."watch:foo/bar:refs/heads/develop"]
cmd = "echo"
args = "Watch!"

As you can see events and refs can be configured in the events TOML table section.

These keys have the following format events.{event}:{repository}:{ref} where {event} refers to a GitHub WebHook event like push, watch, pull_request, ...; {repository} is the GitHub repository name and {ref} refers to a ref in your git repository like refs/heads/master or refs/tags/v0.0.1.

For the above example, it will echo Push! when something has been pushed to the develop branch of your GitHub repository. It will also echo Watch! if someone stars it.

Tunneling

Tunneling can be enabled using localtunnel.me, you just have to enable it in the config.toml and indicate a desired subdomain using the tunnelName field. If no tunnelName is provided then localtunnel.me will give you a random subdomain, this subdomain is printed in the console logs.

Really running

harpoon

or to have it verbose (use -vt also if you want logs about localtunnel.me):

harpoon -v

It will output something like this when running:

    __
   / /_  ____ __________  ____  ____  ____
  / __ \/ __ `/ ___/ __ \/ __ \/ __ \/ __ \
 / / / / /_/ / /  / /_/ / /_/ / /_/ / / / /
/_/ /_/\__,_/_/  / .___/\____/\____/_/ /_/
                /_/
	Listening on 0.0.0.0:9001
    
push detected on foo/bar with ref refs/heads/develop with the following commits:
	2016-03-08 13:59:38 +0100 CET - adding some awesomeness by Foo Bar
	2016-03-08 13:59:57 +0100 CET - forgot the unicorn png by Foo Bar
	2016-03-08 14:01:12 +0100 CET - so much joy in one commit by Foo Bar
> Push!

Obviously, the command should be something like /path/to/pull-build-n-deploy.sh where some awesome stuff is going on. Like something involving git, maven, rake, npm, bower, I don't know, this is your job :)

Security

POST requests made by GitHub are validated against the X-Hub-Signature if the environment variable GITHUB_HOOK_SECRET_TOKEN is set. It must be the same as the one defined on the GitHub's WebHook page.

Thanks

Licence

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].