From 8cdf1a890a01c1dbf569347c21dab7047f1dafc1 Mon Sep 17 00:00:00 2001 From: Josh Cox Date: Wed, 24 Aug 2016 19:00:03 -0400 Subject: [PATCH] Updated the docs so chatbots can use the Conduit API Summary: Previously, the chatbot docs instructed users to get certificates for the conduit API and put the cert in a `conduit.cert` config key. In order to get the chatbot to work, I needed to instead get an API key and put it in the `conduit.token` config entry. Test Plan: Doc fix. Tried the new documented way and it worked. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: Korvin, epriestley Differential Revision: https://secure.phabricator.com/D16443 --- resources/chatbot/example_config.json | 3 +-- src/docs/tech/chatbot.diviner | 8 +++----- src/infrastructure/daemon/bot/PhabricatorBot.php | 7 +++---- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/resources/chatbot/example_config.json b/resources/chatbot/example_config.json index b688d88c82..7d150e65ae 100644 --- a/resources/chatbot/example_config.json +++ b/resources/chatbot/example_config.json @@ -15,8 +15,7 @@ ], "conduit.uri" : null, - "conduit.user" : null, - "conduit.cert" : null, + "conduit.token" : null, "macro.size" : 48, "macro.aspect" : 0.66, diff --git a/src/docs/tech/chatbot.diviner b/src/docs/tech/chatbot.diviner index 9bc1ce4796..6f79e2e465 100644 --- a/src/docs/tech/chatbot.diviner +++ b/src/docs/tech/chatbot.diviner @@ -32,7 +32,7 @@ These are the configuration values it reads: - `join` Array, list of channels to join. - `handlers` Array, list of handlers to run. These are like plugins for the bot. - - `conduit.uri`, `conduit.user`, `conduit.cert` Conduit configuration, + - `conduit.uri`, `conduit.token` Conduit configuration, see below. - `notification.channels` Notification configuration, see below. @@ -72,10 +72,8 @@ with. To do this, login to Phabricator as an administrator and go to - `conduit.uri` The URI for your Phabricator install, like `http://phabricator.example.com/` - - `conduit.user` The username your bot should login to Phabricator with -- - whatever you selected above, like `phabot`. - - `conduit.cert` The user's certificate, from the "Conduit Certificate" tab - in the user's administrative view. + - `conduit.token` The user's conduit API token, from the "Conduit API Tokens" + tab in the user's administrative view. Now the bot should be able to connect to Phabricator via Conduit. diff --git a/src/infrastructure/daemon/bot/PhabricatorBot.php b/src/infrastructure/daemon/bot/PhabricatorBot.php index 6c4bfafc8a..b6efdb8b6d 100644 --- a/src/infrastructure/daemon/bot/PhabricatorBot.php +++ b/src/infrastructure/daemon/bot/PhabricatorBot.php @@ -159,11 +159,10 @@ final class PhabricatorBot extends PhabricatorDaemon { if (empty($this->conduit)) { throw new Exception( pht( - "This bot is not configured with a Conduit uplink. Set '%s', ". - "'%s' and '%s' in the configuration to connect.", + "This bot is not configured with a Conduit uplink. Set '%s' and ". + "'%s' in the configuration to connect.", 'conduit.uri', - 'conduit.user', - 'conduit.cert')); + 'conduit.token')); } return $this->conduit; }