diff --git a/.env.sample b/.env.sample index 977effc..8e58219 100644 --- a/.env.sample +++ b/.env.sample @@ -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="" - diff --git a/INSTALL.md b/INSTALL.md index b383d5a..160816c 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -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 - 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 diff --git a/hubot-scripts.json b/hubot-scripts.json index 7f4ed87..b42782c 100644 --- a/hubot-scripts.json +++ b/hubot-scripts.json @@ -2,6 +2,5 @@ "uptime.coffee", "applause.coffee", "excuse.coffee", - "janky.coffee", "update.coffee" ]