From 385fb51f01ae7c7aab8ce02151f0bba1b85ada47 Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Thu, 7 Jan 2021 00:17:03 -0800 Subject: [PATCH] zulip-botserver: Document use of environment var in README.md --- zulip_botserver/README.md | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/zulip_botserver/README.md b/zulip_botserver/README.md index 5efbbea..c16e0b1 100644 --- a/zulip_botserver/README.md +++ b/zulip_botserver/README.md @@ -1,16 +1,29 @@ ``` zulip-botserver --config-file --hostname
--port - ``` Example: `zulip-botserver --config-file ~/botserverrc` This program loads the bot configurations from the -config file (botserverrc here) and loads the bot modules. +config file (`botserverrc`, here) and loads the bot modules. It then starts the server and fetches the requests to the above loaded modules and returns the success/failure result. -Please make sure you have a current botserverrc file with the -configurations of the required bots. -Hostname and Port are optional arguments. Default hostname is -127.0.0.1 and default port is 5002. +The `--hostname` and `--port` arguments are optional, and default to +127.0.0.1 and 5002 respectively. + +The format for a configuration file is: + + [helloworld] + key=value + email=helloworld-bot@zulip.com + site=http://localhost + token=abcd1234 + +Is passed `--use-env-vars` instead of `--config-file`, the +configuration can instead be provided via the `ZULIP_BOTSERVER_CONFIG` +environment variable. This should be a JSON-formatted dictionary of +bot names to dictionary of their configuration; for example: + + ZULIP_BOTSERVER_CONFIG='{"helloworld":{"email":"helloworld-bot@zulip.com","key":"value","site":"http://localhost","token":"abcd1234"}}' \ + zulip-botserver --use-env-vars