An example webhook server for the Chef analytics pipeline
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2014-11-19 22:37:39 -08:00
config Added LICENCE headers 2014-11-19 22:28:18 -08:00
helpers Added LICENCE headers 2014-11-19 22:28:18 -08:00
routes Added LICENCE headers 2014-11-19 22:28:18 -08:00
spec Added LICENCE headers 2014-11-19 22:28:18 -08:00
test/routes Added LICENCE headers 2014-11-19 22:28:18 -08:00
.ruby-version Initial commit of analytics-webhook-server 2014-10-16 16:26:59 -07:00
app.rb Added LICENCE headers 2014-11-19 22:28:18 -08:00
config.ru Added LICENCE headers 2014-11-19 22:28:18 -08:00
Gemfile Added basic testing to the route handlers for the single '/messages' endpoint and config based route endpoint '/default/messages' 2014-10-23 15:31:52 -07:00
Gemfile.lock Added basic testing to the route handlers for the single '/messages' endpoint and config based route endpoint '/default/messages' 2014-10-23 15:31:52 -07:00
LICENSE add licence 2014-11-19 22:23:23 -08:00
Rakefile Added LICENCE headers 2014-11-19 22:28:18 -08:00
README.md add licence 2014-11-19 22:23:23 -08:00

#analytics-webhook-server Generic webhook server for accepting analytics notifications

##Prerequisites Install dependencies:

$ bundle

##Configuration

Currently supported output types: ###Log Writes data received to the log file

---
output:
    type: log

###File Writes data received to a file named message_id.json where message_id is from the id field from the analytics notification. This is then stored in the configured path dest_dir or /tmp if one is not specified

---
output:
    type: file
    settings:
        dest_dir: /path/to/dir

###Exec Executes a command specified using variables from the analytics notification. Available fields are documented in analytics-docs

---
output:
    type: exec
    settings:
        cmd: "echo %<id>s > /tmp/foo.txt"

##Usage

$  bundle exec rackup -p 8888 config.ru

This provides an endpoint at http://SERVER_NAME/8888/messages which will accept webhook payloads.

TODO

  • This currently does not support/verify Basic Authentication
  • Add HTTPS support

License

Copyright (c) 2014 Chef Software, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.