Skip to content

LucienShui/Webhook

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Webhook

Webhook hosted by golang

Download

git clone https://github.com/LucienShui/Webhook.git -b build --depth=1

Usage

Usage of webhook:
  -c string
        -c <config file> (default "./config.json")
  -version
        Print version information

Config

For example, config.json looks like below:

{
  "address": "0.0.0.0",
  "port": 10086,
  "webhooks": [
    {
      "name": "beat",
      "script": "echo 'It works!'",
      "password": ""
    },
    {
      "name": "hello",
      "script": "set -x && echo 'Hello World!'",
      "password": "world"
    }
  ]
}

One can access the API /:name?password= to execute the script

API

Execute

POST /:name?password=[password]

Params

Name Type Description
name string record's name
password string record's password

Example

curl -X POST <host>:[port]/hello?password=word

Log

GET /log/:name?raw=true

Params

Name Type Description
name string record's name
raw bool show execute's output in raw or not, false for default

Example

curl <host>:[port]/log/hello?raw=true
curl <host>:[port]/log/hello

About

Simple webhook server, build for continuous integration & deployment

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published