Giter VIP home page Giter VIP logo

beehive's Introduction

Beehive

Build Status Go ReportCard GoDoc

Beehive is an event and agent system, which allows you to create your own agents that perform automated tasks triggered by events and filters. It is modular, flexible and really easy to extend for anyone. It has modules (we call them Hives), so it can interface with, talk to, or retrieve information from Twitter, Tumblr, Email, IRC, Jabber, RSS, Jenkins, Hue - to name just a few. Check out the full list of available Hives in our Wiki.

Connecting those modules with each other lets you create immensly useful agents.

Here are just a few examples of things Beehive could do for you:

  • Re-post tweets on your Tumblr blog
  • Forward incoming chat messages to your email account
  • Turn on the heating system if the temperature drops below a certain value
  • Run your own IRC bot that lets you trigger builds on a Jenkins CI
  • Control your Hue lighting system
  • Notify you when a stock's price drops below a certain value

beehive's Logo

Installation

Packages & Binaries

You can find even more official releases here.

Deployment Tools

  • Docker: docker run --name beehive -d -p 8181:8181 fribbledom/beehive
  • Ansible

From source

Beehive requires Go 1.13 or higher. Make sure you have a working Go environment. See the install instructions.

The recommended way is to fetch the sources and run make.

git clone --recursive https://github.com/muesli/beehive.git
cd beehive
make

You can build and install the beehive binary like other Go binaries out there (go get) but you'll need to make sure Beehive can find the assets (images, javascript, css, etc). See the Troubleshooting/Notes section for additional details.

Run beehive --help to see a full list of options.

Configuration

Think of Hives as little plugins, extending Beehive's abilities with events you can react on and actions you can execute.

Just as examples, there's a Twitter plugin that can

  • react to someone you follow posting a tweet (an event)
  • post a new tweet for you (an action)
  • ...

or an RSS plugin that lets you

  • monitor RSS feeds and react on new feed items (another event)

or an email plugin that gives you the ability to

  • send emails (another action)

Each Hive lets you spawn one or multiple Bees in it, all working independently from another. That allows you to create separate plugin instances, e.g. one email-Bee for your private mail account, and another one for your work email.

Creating Bees

Sounds complicated? It's not! Just for fun, let's setup Beehive to send us an email whenever an RSS feed gets updated. Start beehive and open http://localhost:8181/ in your browser. Note that Beehive will create a config file beehive.conf in its current working directory, unless you specify a different file with the -config option.

Note: If you built Beehive with go build instead of make you will have to start beehive from within its source directory in order for it to find all the resources for the admin interface. Also see the Troubleshooting & Notes section of this README.

The admin interface will present you with a list of available Hives. We will need to create two Bees here, one for the RSS feed and one for your email account.

New Bees

Setting up a Chain

Now we will have to create a new Chain, which will wire up the two Bees we just created. First we pick the Bee & Event we want to react on, then we pick the Bee we want to execute an Action with. The RSS-Bee's event gives us a whole set of parameters we can work with: the feed item's title, its links and description among others. You can manipulate and combine these parameters with a full templating language at your disposal. For example we can set the email's content to something like:

Title: {{.title}} - Link: {{index .links 0}}

Whenever this action gets executed, Beehive will replace {{.title}} with the RSS event's title parameter, which is the title of the feed item it retrieved. In the same manner {{index .links 0}} becomes the first URL of this event's links array.

New Chain

That's it. Whenever the RSS-feed gets updated, Beehive will now send you an email! It's really easy to make various Bees work together seamlessly and do clever things for you. Try it yourself!

You can find more information on how to configure Beehive and examples in our Wiki.

Troubleshooting & Notes

The web interface and other resources are embedded in the binary by default. When using make noembed, Beehive tries to find those files in its current working directory, so it's currently recommended to start Beehive from within its git repository, if you plan to use the web interface.

Should you still not be able to reach the web interface, check if the config directory in the git repository is empty. If that's the case, make sure the git submodules get initialized by running git submodule update --init.

The web interface does not require authentication yet. Beehive by default accepts all connections from the loopback device only.

If you want to bind Beehive to a different interface/address, run Beehive with the -bind and -canonicalurl parameters. For example:

beehive -bind "192.168.0.1:8181" -canonicalurl "http://192.168.0.1:8181"

or

docker run --name beehive -d -e CANONICAL_URL="http://192.168.0.1:8181" -p 8181:8181 fribbledom/beehive

Development

Need help? Want to hack on your own Hives? Join us on IRC (irc://freenode.net/#beehive) or Gitter. Follow the bees on Twitter!

beehive's People

Contributors

akashshinde avatar asymmetric avatar calmbit avatar corrantho avatar cyian-1756 avatar dschmidt avatar dustinmiller avatar gabrielalacchi avatar glaxx avatar grindhold avatar henson avatar horrendus avatar jamesbvaughan avatar leopku avatar michiwend avatar mkrauser avatar momo-aux avatar morbidick avatar muesli avatar mutschler avatar orsinium avatar pbek avatar penguwin avatar profpatsch avatar prologic avatar rubiojr avatar seblw avatar sks avatar syakesaba avatar tymm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

beehive's Issues

notifyd Bee

A bee which accepts events and publishes them as notifydaemon-messages

Cannot build beehive on Debian Jessie, Go version 1.2

Hi,

I find this project really interesting and was hoping to submit some patches; however I am unable to build when following the instructions

[hunter@apollo: beehive]$ go get -v 
github.com/muesli/beehive/app
github.com/muesli/beehive/filters
github.com/muesli/beehive/bees/cronbee/cron
code.google.com/p/go-charset/charset
golang.org/x/net/html/atom
github.com/muesli/beehive/bees
github.com/advancedlogic/gojs-config
github.com/bjarneh/latinx
golang.org/x/net/html
code.google.com/p/go-charset/data
github.com/muesli/beehive/bees/anelpowerctrlbee
github.com/muesli/beehive/bees/cronbee
github.com/michiwend/goefa
github.com/muesli/beehive/bees/emailbee
gopkg.in/fatih/set.v0
github.com/muesli/beehive/bees/efabee
github.com/muesli/go.hue
github.com/fluffle/goirc/logging
code.google.com/p/gomock/gomock
github.com/muesli/beehive/bees/huebee
github.com/mattn/go-xmpp
github.com/fluffle/goirc/state
github.com/fluffle/goirc/client
github.com/muesli/beehive/bees/jabberbee
github.com/muesli/beehive/bees/jenkinsbee
code.google.com/p/cascadia
github.com/muesli/beehive/bees/ircbee
github.com/muesli/beehive/bees/nagiosbee
# github.com/muesli/beehive/bees/ircbee
../Dropbox/git/godir/src/github.com/muesli/beehive/bees/ircbee/ircbee.go:140: mod.client.SSL undefined (type *client.Conn has no field or method SSL)
../Dropbox/git/godir/src/github.com/muesli/beehive/bees/ircbee/ircbee.go:142: mod.client.AddHandler undefined (type *client.Conn has no field or method AddHandler)
../Dropbox/git/godir/src/github.com/muesli/beehive/bees/ircbee/ircbee.go:145: mod.client.AddHandler undefined (type *client.Conn has no field or method AddHandler)
../Dropbox/git/godir/src/github.com/muesli/beehive/bees/ircbee/ircbee.go:148: mod.client.AddHandler undefined (type *client.Conn has no field or method AddHandler)
../Dropbox/git/godir/src/github.com/muesli/beehive/bees/ircbee/ircbee.go:150: mod.client.Me.Nick undefined (type func() *state.Nick has no field or method Nick)
../Dropbox/git/godir/src/github.com/muesli/beehive/bees/ircbee/ircbee.go:192: too many arguments in call to mod.client.Connect
github.com/guelfey/go.dbus
github.com/jteeuwen/go-pkg-xmlx
github.com/huin/goserial
github.com/PuerkitoBio/goquery
github.com/jteeuwen/go-pkg-rss
github.com/advancedlogic/GoOse
github.com/muesli/beehive/bees/serialbee
github.com/muesli/beehive/bees/rssbee
github.com/muesli/beehive/bees/spaceapibee
github.com/muesli/beehive/bees/timebee
github.com/kurrik/oauth1a
github.com/ChimeraCoder/tokenbucket
github.com/garyburd/go-oauth/oauth
github.com/muesli/beehive/bees/notificationbee
github.com/MariaTerzieva/gotumblr
code.google.com/p/go.net/websocket
github.com/muesli/beehive/bees/htmlextractbee
github.com/ChimeraCoder/anaconda
github.com/muesli/beehive/filters/contains
github.com/muesli/beehive/filters/endswith
github.com/muesli/beehive/filters/equals
github.com/muesli/beehive/bees/tumblrbee
github.com/muesli/beehive/filters/startswith
github.com/hoisie/web
github.com/muesli/beehive/bees/twitterbee
github.com/muesli/beehive/bees/webbee
[hunter@apollo: beehive]$ go build
# github.com/muesli/beehive/bees/ircbee
../Dropbox/git/godir/src/github.com/muesli/beehive/bees/ircbee/ircbee.go:140: mod.client.SSL undefined (type *client.Conn has no field or method SSL)
../Dropbox/git/godir/src/github.com/muesli/beehive/bees/ircbee/ircbee.go:142: mod.client.AddHandler undefined (type *client.Conn has no field or method AddHandler)
../Dropbox/git/godir/src/github.com/muesli/beehive/bees/ircbee/ircbee.go:145: mod.client.AddHandler undefined (type *client.Conn has no field or method AddHandler)
../Dropbox/git/godir/src/github.com/muesli/beehive/bees/ircbee/ircbee.go:148: mod.client.AddHandler undefined (type *client.Conn has no field or method AddHandler)
../Dropbox/git/godir/src/github.com/muesli/beehive/bees/ircbee/ircbee.go:150: mod.client.Me.Nick undefined (type func() *state.Nick has no field or method Nick)
../Dropbox/git/godir/src/github.com/muesli/beehive/bees/ircbee/ircbee.go:192: too many arguments in call to mod.client.Connect

Here is what I am running systemwise:

[hunter@apollo: bin]$ go version
go version go1.3.2 linux/amd64
[hunter@apollo: bin]$ uname -ar
Linux apollo 3.16.0-4-amd64 #1 SMP Debian 3.16.7-2 (2014-11-06) x86_64 GNU/Linux

Thoughts?

IRCBee doesn’t build

../../../.go/src/github.com/muesli/beehive/bees/ircbee/ircbee.go:139: undefined: client.NewConfig
../../../.go/src/github.com/muesli/beehive/bees/ircbee/ircbee.go:144: not enough arguments in call to client.Client
../../../.go/src/github.com/muesli/beehive/bees/ircbee/ircbee.go:146: mod.client.HandleFunc undefined (type *client.Conn has no field or method HandleFunc)
../../../.go/src/github.com/muesli/beehive/bees/ircbee/ircbee.go:149: mod.client.HandleFunc undefined (type *client.Conn has no field or method HandleFunc)
../../../.go/src/github.com/muesli/beehive/bees/ircbee/ircbee.go:152: mod.client.HandleFunc undefined (type *client.Conn has no field or method HandleFunc)
../../../.go/src/github.com/muesli/beehive/bees/ircbee/ircbee.go:154: mod.client.Config undefined (type *client.Conn has no field or method Config)
../../../.go/src/github.com/muesli/beehive/bees/ircbee/ircbee.go:196: not enough arguments in call to mod.client.Connect

MPRIS2 Bee

A bee that triggers events and controls your media player of choice.

DBus bee

implement a Bee that is able to receive events via dbus and trigger rpc method calls via dbus

Create a piped filter

A piped filter is an arbitrary command that gets executed and communicates via stdin/out with beehive.

Email Bee

A bee that triggers events from incoming emails and provides an action to send a new mail.

YouTube Bee

A bee triggering events on new YouTube videos (or even posting new videos to YouTube).

NetAtmo Bee

A bee that triggers weather events via the NetAtmo API.

System Bee

A bee that watches your hardware and triggers events accordingly. Diskspace, memory, bandwidth, (wireless) network status are just a few examples of event categories.

Jira Bee

A bee that triggers events on Jira changes.

100% cpu in either webbee or ircbee

Config:

{
   "Bees":[
      {
         "Name":"ircbee_freenode",
         "Class":"ircbee",
         "Description":"ircbee connected to freenode, channel #beehive",
         "Options":[
            {
               "Name":"server",
               "Value":"irc.freenode.net"
            },
            {
               "Name":"nick",
               "Value":"arpbee"
            },
            {
               "Name":"channels",
               "Value":["#beehive"]
            }
         ]
      },
      {
         "Name":"arp_http_listener",
         "Class":"webbee",
         "Description":"Listens to output from the arpspoofing detection script",
         "Options":[
            {
               "Name":"addr",
               "Value":"127.0.0.1:8080"
            },
            {
               "Name":"path",
               "Value":"/"
            }
         ]
      }
   ],
   "Chains":[
      {
         "Name": "ARP_to_IRC",
         "Description": "Posts incoming messages to IRC",
         "Event":{
            "Bee":"arp_http_listener",
            "Name":"get"
         },
         "Elements":[
            {
               "Action":{
                  "Bee":"ircbee_freenode",
                  "Name":"send",
                  "Options":[
                     {
                        "Name":"channel",
                        "Value":"#beehive"
                     },
                     {
                        "Name":"text",
                        "Value":"ARP WARNUNG: {{.message}}"
                     }
                  ]
               }
            }
         ]
      }
   ]
}

HtmlExtractBee misses everything before a β€œ-”

Example:

https://www.youtube.com/watch?v=RXPg0yINxWU

evaluates to

[ It's Time (Matoma Tropical Remix) | www.youtube.com | https://i.ytimg.com/vi/RXPg0yINxWU/maxresdefault.jpg ]

but its full title is

Imagine Dragons - It's Time (Matoma Tropical Remix)

Nagios Bee

A bee that triggers events on Nagios state changes.

Timing Bee

A bee that triggers events based on Time.

FitBit Bee

A bee that triggers events via the FitBit API.

GitHub Bee

Bee triggering events on GitHub commits / changes.

Storage containers for Bees

Bees should be able to keep state with the help of local & global containers offering temporary & persistent storage.

RSS Bee

A bee triggering events from RSS feed updates.

SIP Bee

Bee that watches over incoming calls or texts to a SIP-based phonenumber. Bee should also have the ablilty to send SMS.

Bonuspoints for text-to-speech-call-capability!

MongoDB Bee

MongoDBee should provide an action to dump events into a MongoDB

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.