dw

docker-webhook

A simple webhook endpoint for the docker registry

Showing:

Popularity

Downloads/wk

5

GitHub Stars

8

Maintenance

Last Commit

6yrs ago

Contributors

1

Package

Dependencies

1

Size (min+gzip)

1.2KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

docker-webhook

NPM

A simple node.js library for responding to pushes to the docker registry.

Usage

Simply:

var webhook = require('docker-webhook')
webhook(function cb(json) {
  cosole.log(JSON.stringify(json,null," "))
})

Parse the url to check against an AUTH_TOKEN:

var webhook = require('docker-webhook')
var URL = require('url')

webhook(function cb(json, url) {
  var url_auth_token = URL.parse(url).path.substr(1)
  if( url_auth_token === process.env.AUTH_TOKEN ){
    // authorized to run hook commands
    cosole.log(JSON.stringify(json,null," "))
  }else{
    // unauthorized, do nothing
  }
})

Default port is 8411, and can be changed by setting the DOCKER_WEBHOOK_PORT environment variable.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100