Skip to content

retrohacker/docker-webhook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published