resin-io/hubot-as-webot

Name: hubot-as-webot

Owner: Resin.io

Description: null

Created: 2017-01-10 12:03:11.0

Updated: 2017-02-22 08:48:10.0

Pushed: 2017-02-22 15:55:27.0

Homepage: null

Size: 1518

Language: Shell

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Mebot

About

Webot is a chat bot built on the Hubot framework. It was initially generated by generator-hubot.

This project is a tying together of a yo generated hubot and several published packages for the purpose of taking an individual's presence in one room and replicating this onto a different service.

It was written by Andrew Lucas for resin.io's internal communication streamlining.

License
Installation
Resin.io
  1. Get an app & device
    1. Create a new application in https://resin.io targeted for your hardware
    2. Download ResinOS, flash and boot to make your IoT device cloud manageable
  2. Set up environment
    1. Read the Environment Variables section of this document
    2. Use the Environment Variables page of your application or device
  3. Deploy the repo
    1. git clone https://github.com/resin-io/hubot-as-mebot then cd into it
    2. Add the remote using the provided command in the top right of resin.io
    3. git push resin & see the unicorn
Heroku
  1. Get an app
    1. Visit heroku.com, get an account
    2. Create a new app using the top right button
  2. Set up environment
    1. Read the Environment Variables section of this document
    2. Visit the settings tab of Heroku
    3. Use the Config Variables section on Heroku to configure how you wish
  3. Fork the repo
    1. This is optional if you have access to and trust an organisation that has already forked this repo (eg resin.io)
    2. Fork hubot-as-mebot
  4. Link the repo
    1. Visit the deploy Tab on Heroku
    2. Enable Automatic deploys from the master branch
  5. Activate the worker
    1. Visit the resources tab on Heroku
    2. Edit the web Dyno so it is not running
    3. Edit the worker Dyno so it is running
  6. Restart, just in case
    1. My experience is that once this is all set up it's best to restart
    2. Using the More dropdown (top right) restart all Dynos
Deployment without Trust

So, you don't trust the repo maintainers and want to follow the principle of least privilege. Good for you. You've got two easy options, either way you're going to have to take over the review and deploy yourself:

Windows
  1. Get node.js
    1. I use whatever the latest ^6.x is.
    2. Plenty of guides exist for this, I'm not going to replicate or recommend.
  2. Clone the repo
    1. git clone https://github.com/resin-io/hubot-as-mebot
  3. Set up environment
    1. Read the Environment Variables section of this document
    2. I quite like using SET commands in a .bat file for this
  4. Run the code
    1. cd into the code directory
    2. npm run windows
    3. I quite like using a CALL in the .bat file for this
Environment Variables
Program Flow
  1. Connect
    1. because of HUBOT_ADAPTOR the flowdock-listen-to-self adaptor connects to flowdock using the HUBOT_FLOWDOCK_API_TOKEN and lists the channels it is joined to. This pays attention to the account's output because of HUBOT_LISTEN_TO_SELF.
  2. Receive
    1. flowdock-ignore-by-prefix intercepts all comments and stops the processing of any beginning with HUBOT_IGNORE_PREFIX.
    2. hubot-room-select intercepts all comments and stops any that are not from HUBOT_MONITOR_ROOM and HUBOT_NAME (this module seems to have two purposes because it was coded to have monitor off|me|all, but our use case configures it into one monitor me).
  3. Listen
    1. hubot-gitter-echo hears all comments and echos them to HUBOT_GITTER_ROOM using HUBOT_GITTER_API_TOKEN.
    2. hubot-rules listens for “what are the three rules” and echoes Asimov's three rules. In the project because it is a good debug script.

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.