Skip to content

Installation

Cynthia Lin edited this page Aug 26, 2017 · 22 revisions
Installation

In the instructions below, your copy of the zulipbot software will be referred to as @zulipbot.

Prerequisites

Before you get started, make sure you have:

  • installed and configured Git on your local machine
  • installed Node.js (version >= v7.6.0) and npm (version >= 4.2.0)
  • created a GitHub user account for @zulipbot to use
  • invited @zulipbot's user account to collaborate on your repository, changing its permission level in the repository to Admin.

Server

In order to receive events from GitHub, @zulipbot must be running on a server. We recommend using Heroku or Amazon Web Services (AWS) for hosting your copy of @zulipbot, since both services offer free plans to their consumers. You can choose to host your copy of @zulipbot locally, but it is highly discouraged.

Once you have secured a server for @zulipbot to operate on, add a repository webhook to @zulipbot's server:

  • Enter your server's URL in the Payload URL field.
  • Set the Content type field to application/json.
  • Set the Secret field to a secure token that will be used to validate webhook payloads from GitHub. Read the GitHub webhook documentation for more information.
  • Select the "Send me everything." option in the Which events would you like to trigger this webhook? field.

Installation

  1. Open your command line interface (CLI).

  2. Download the latest release or clone this repository to your local machine.

$ git clone https://github.com/zulip/zulipbot.git
  1. Switch to the local copy of this repository.
$ cd ~/path-to-repo/zulipbot
  1. Install the necessary node packages and dependencies. Any npm WARN warnings can be safely ignored.
$ npm install

Configuration

  1. Create two files in the src folder: one file named config.js, the other named secrets.js.
$ touch src/config.js
$ touch src/secrets.js
  1. Open /src/config.js in your preferred text editor.

  2. Edit the contents of src/config.js, using src/zulip_project.config.js as a guide; visit the Configuration page for more details.

  3. Once you are finished modifying /src/config.js, run tools/configLint to check if your configuration file was set up properly.

$ tools/configLint
  1. Open /src/secrets.json in your preferred text editor.

  2. Edit the contents of src/secrets.js as follows:

{
  "username": "Username123",
  "password": "Password456",
  "webhookSecret": "abc123def456"
}

where username is the username of @zulipbot's GitHub user account, password is the password of @zulipbot's GitHub user account, and webhookSecret is the value of the secret token that you previously used to configure your GitHub webhook.

  1. Run the bot to ensure that your environment was configured correctly.
$ npm start

Congratulations, you have finished the installation of @zulipbot! You can now begin using @zulipbot to manage your repository.

Clone this wiki locally