GithubHelp home page GithubHelp logo

hubot-circuit's Introduction

hubot-circuit

License CircleCI Coverage Status Dependency Status

Description

This is the Circuit adapter for hubot. Now, you can create your own bots in Circuit and have them easily configured through hubot.

Configuration

  • Start by creating a bot application
  • Create a Circuit client credentials application
  • Get the client_id and client_secret
  • Export necessary environment variables. The Circuit adapter requires 3 environment variables:
export HUBOT_CIRCUIT_CLIENT_ID="YOUR_CIRCUIT_CLIENT_ID"
export HUBOT_CIRCUIT_CLIENT_SECRET="YOUR_CIRCUIT_CLIENT_SECRET"
export HUBOT_CIRCUIT_WEBHOOKS_URL="YOUR_APP_URL"

The following are optional:

export HUBOT_CIRCUIT_REST_API_URL="CIRCUIT_REST_API_URL"
export HUBOT_CIRCUIT_ADDRESS="YOUR_APP_ADDRESS"
export HUBOT_CIRCUIT_PORT="YOUR_APP_PORT"
export HUBOT_CIRCUIT_SCOPE="YOUR_APP_SCOPE"

If you do not specify the optional parameters above the default ones will be loaded.

HUBOT_CIRCUIT_ADDRESS="0.0.0.0"
HUBOT_CIRCUIT_PORT="8181"
HUBOT_CIRCUIT_REST_API_URL="https://eu.yourcircuit.com/rest"
HUBOT_CIRCUIT_SCOPE="ALL"

Run hubot

./bin/hubot -a circuit

hubot-circuit uses Rest API and webhooks in order to communicate with Circuit. The default events that are registered through webhooks are the CONVERSATION.ADD_ITEM and CONVERSATION.UPDATE_ITEM. In order to receive events the callback url (HUBOT_CIRCUIT_WEBHOOKS_URL) that you will use must be a secure url.

Certificates

When you load hubot-circuit adapter, an express https server will start up on 443 port. In order for the https server to start up place the certificate files, named 'key.pem' and 'cert.pem', in the root folder of your application.

If you have not provided any certificates an http server will start up on 8181 port.

Note: Hubot starts a server on the address and port you have specified with the corresponding env variables (EXPRESS_BIND_ADDRESS and EXPRESS_PORT) or 0.0.0.0 and 8080, otherwise. If you do not plan to use robot.router in your scripts, you can disable the embedded hubot express server, simply by running

./bin/hubot -d -a circuit

Otherwise, you will have two servers running on 8080 and on 8181.

How do I get set up?

  • Install dependencies with
npm install
  • Run tests
npm test

Contribution guidelines

  • Fork the project
  • Clone your fork
  • Create a feature branch
  • Develop your feature
  • Write tests
  • Make sure everything still passes by running tests
  • Make sure you have followed coffeescript's syntax coffeelint
  • Make sure coverage is not decreased
  • Push your changes
  • Send a pull request for your branch

hubot-circuit's People

Contributors

bettinatop22 avatar

Watchers

 avatar James Cloos avatar  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.