Skip to content
This repository was archived by the owner on Oct 29, 2025. It is now read-only.
Open

🆙 #75

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,5 @@ export HUBOT_TWITTER_CONSUMER_SECRET=""
export HUBOT_TWITTER_MENTION_QUERY=""
export HUBOT_TWITTER_MENTION_ROOM=""
export HUBOT_STANDUP_COPY_ROOM=""
export HUBOT_JANKY_URL=""
export HUBOT_GOOGLE_HANGOUTS_DOMAIN=""
export HUBOT_SEARCH_URL=""

101 changes: 71 additions & 30 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,67 +1,108 @@
## Installation (Mac OS X)
## Installation on macOS

### Install a modern version of Node.js

1. `curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.2/install.sh | bash`
1. `nvm install 4`
1. `nvm use 4`
1. `nvm alias default 4`
First, install and activate Node Version Manager, if you haven't already:
1. `curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash`
1. `export NVM_DIR="$HOME/.nvm"`
1. `[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"`

Then use NVM to install the latest long-term support release of Node:

```sh
nvm install lts/*
```

The new version should be activated for use automatically, but if not, run:

```sh
nvm use lts/*
```

### Install Redis

1. `brew install redis`
1. Start redis with `redis-server`

You can verify that it's working as expected by opening a new terminal window
and running `redis-cli ping`, which should return `PONG`.

### Install CFPBot

1. `git clone https://github.com/cfpb/CFPBot.git`
1. `cd CFPBot`
1. `cp .env.sample .env`
1. Edit `.env` appropriately.
1. Edit `.env` appropriately

## Installation (CentOS)

## Installation on CentOS/RHEL 7

CFPB EC2 instances currently run RHEL 7. These instructions assume a freshly spun-up instance.

### Install Node.js

1. `curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.1/install.sh | bash`
1. `source ~/.bashrc`
1. `nvm install 5`
First, install and activate Node Version Manager:
1. `curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash`
1. `export NVM_DIR="$HOME/.nvm"`
1. `[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"`

Then use NVM to install the latest long-term support release of Node:

```sh
nvm install lts/*
```

### Install Redis on your CentOS machine
The new version should be activated for use automatically, but if not, run:

1. `sudo rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm`
1. `sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm`
1. `sudo yum -y --enablerepo=remi,remi-test install redis git`
1. `sudo chkconfig --add redis`
1. `sudo chkconfig --level 345 redis on`
1. `sudo service redis start`
```sh
nvm use lts/*
```

### Install Redis

1. `sudo rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm`
1. `sudo rpm -ivh https://rpms.remirepo.net/enterprise/remi-release-7.rpm`
1. `sudo subscription-manager repos --enable=rhel-7-server-optional-rpms`
- The output from this step suggests that it may not be necessary.
1. `sudo yum install -y redis --enablerepo=remi`
1. `sudo systemctl start redis`
1. `sudo systemctl enable redis`

You can verify that it's working as expected by running `systemctl status redis`,
and `redis-cli ping` should return `PONG`.

### Install CFPBot

First, install Git:

```sh
sudo yum install -y git
```

1. `git clone https://github.com/cfpb/CFPBot.git`
1. `cd CFPBot`
1. `cp .env.sample .env`
1. Edit `.env` appropriately.
1. Edit `.env` appropriately

## Running CFPBot locally

## Running CFPBot

Run `npm start` to start the bot.
It will not attempt connect to our live chat server unless `HUBOT_PRODUCTION` is set to `true`.

Some plugins require environment variables to be set and may not behave as expected.
Try `curl -O https://[secret-internal-repo]/.env` to pull down CFPB's `.env` file with all our secrets in it.

You'll see some start up output and a prompt:
You'll see some start up output (possibly including several errors and warnings
if you didn't define everything in the `.env` file) and a prompt:

[Sat Feb 28 2015 12:38:27 GMT+0000 (GMT)] INFO Using default redis on localhost:6379
CFPBot>
```
[Fri May 21 2021 15:15:39 GMT-0400 (Eastern Daylight Time)] INFO hubot-redis-brain: Using default redis on localhost:6379
cfpbot>
```

Then you can interact with CFPBot by typing `cfpbot help`.
Then you can interact with CFPBot by typing commands such as `cfpbot ping`.

cfpbot> cfpbot help
cfpbot animate me <query> - The same thing as `image me`, except adds [snip]
cfpbot help - Displays all of the help commands that cfpbot knows about.
...
Other commands will likely fail without more environment variables being set.
CFPB employees can run `curl -O https://[secret-internal-repo]/.env`
to pull down our CFPB-specific `.env` file with all our secrets in it.

### Scripting

Expand Down
1 change: 0 additions & 1 deletion hubot-scripts.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
"uptime.coffee",
"applause.coffee",
"excuse.coffee",
"janky.coffee",
"update.coffee"
]