Git Product home page Git Product logo

tevents's Introduction

tevents

tevents is a small tool to be deployed in your tailnet to collect events/hooks from other services. By using tsnet, it can be deployed as a virtual private service. This allows to centrally collect events in your network and display them on a web interface.

Usage

All required resources are embedded in the executable.

git clone github.com/rverton/tevents
cd tevents && make
export TS_AUTHKEY=tskey-auth-xyu # can be retrieved via admin panel
go build -o tevents ./cmd/tevents
./tevents # all assets are embedded in this binary

Events

An event holds the following fields:

origin: (unique) identifier of the sender
type: type of the event (event or monitor-event)
body: content
owner: tailnet owner who send the event

There are two different types of events:

  • Log events are simple one-time HTTP requests to to notify of a specific event.
  • Monitor events are events that are sent periodically and allow you to graph execution. This allows for example to watch cron jobs for execution.

Submission

Events can be submitted via HTTP POST.

# example for log event
curl http://tevents/.log?origin=networkwatcher -d "new device found connected to network"

# example for monitoring a cron job executed every morning
0 1 * * * /usr/local/bin/backup.sh && curl -X POST http://tevents/.monitor?origin=cron:backup

Development

All relevant tasks can be done via make:

make watch              # restart web server on code changes
make tailwind-watch     # watch tailwind css changes
make tailwind           # only build tailwind resources
make run                # run web server
make test               # run all tests
make                    # build executable with all assets embedded

ToDo

  • Add tests for event/monitor hook handler
  • Make hour interval configurable
  • Filter, search and pagination
  • Allow to remove monitors (and all corresponding events)
  • Clear functionality

tevents's People

Contributors

rverton avatar nickoneill 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.