Coder Social home page Coder Social logo

gohub's Introduction

gohub

What is gohub?

gohub is a little webserver written in go. He waits for webhook calls by github to run little shell commands.

Read the github post-receive-hooks guide

What is it good for?

Imagine you have your repo spread over several instances. You can use gohub to automate updating all your cloned repos.

How to use

Just edit the config.json to your needs. A short example: You want to track the status of your Repository "repo" and the branch master. If there is an update to this branch you want to execute your shell script "niftyscript.sh".

{
    "Hooks":[
        "Repo":"repo",
        "Branch":"master",
        "Shell":"niftyscript.sh"
    ]
}

Now start the server with

go run main.go --port 6578

and add a git-webhook for your.domain.com:6578/repo_master. Everytime you push to master, your script gets executed.

Testing with curl

curl -v -d 'payload={"repository": {"name": "repo" }, "ref": "refs/heads/branch" }' \
     http://localhost:6578/repo_branch

What about safety?

Git webhooks use only 4 different ips for their webhooks. (207.97.227.253, 50.57.128.197, 108.171.174.178, 50.57.231.61) You can easily restrict access to your gohup server by using either a firewall or an equivalent nginx configuration.

gohub's People

Contributors

nagyman avatar roa avatar

Watchers

Bartek Ciszkowski avatar  avatar Ivan Djokic avatar Andrew Gardner avatar James Cloos avatar Subodh M Bahl avatar  avatar Ken Lalonde avatar Neeraj Singh avatar Les Liddell avatar  avatar  avatar  avatar  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.