diff --git a/api_docs/configuring-python-bindings.md b/api_docs/configuring-python-bindings.md index d5b51b43c1..9336596bb5 100644 --- a/api_docs/configuring-python-bindings.md +++ b/api_docs/configuring-python-bindings.md @@ -8,12 +8,62 @@ using Zulip's [bot framework](/api/writing-bots). In order to use them, you need to configure them with your API key and other settings. There are two ways to achieve that: - - With a file called `.zuliprc`, located in your home directory. + - With a file called `zuliprc` passed as an argument via the `--config-file` + option. - With [environment variables](https://en.wikipedia.org/wiki/Environment_variable) set up in your host machine. -A `.zuliprc` file is a plain text document that looks like this: +## Download a `zuliprc` file + +{start_tabs} + +{tab|for-a-bot} + +{settings_tab|your-bots} + +1. Click the **download** () icon on the profile + card of the desired bot to download the bot's `zuliprc` file. + +!!! tip "" + + If you save or move a `zuliprc` file to your home directory as `~/.zuliprc`, + the Python API bindings will automatically read it in (you won't have to + pass the `--config-file` option). + +!!! warn "" + + Anyone with a bot's API key can impersonate the bot, so be careful with it! + +{tab|for-yourself} + +{settings_tab|account-and-privacy} + +1. Under **API key**, click **Manage your API key**. + +1. Enter your password, and click **Get API key**. If you don't know your + password, click **reset it** and follow the + instructions from there. + +1. Click **Download zuliprc** to download your `zuliprc` file. + +!!! tip "" + + If you save or move a `zuliprc` file to your home directory as `~/.zuliprc`, + the Python API bindings will automatically read it in (you won't have to + pass the `--config-file` option). + +!!! warn "" + + Anyone with your API key can impersonate you, so be doubly careful with it. + +{end_tabs} + +## Configuration keys and environment variables + +`zuliprc` is a configuration file written in the +[INI file format](https://en.wikipedia.org/wiki/INI_file), +which contains key-value pairs as shown in the following example: ``` [api] @@ -29,7 +79,7 @@ can be found in the following table: - + @@ -102,3 +152,10 @@ can be found in the following table:
.zuliprc keyzuliprc key Environment variable Required Description
+ +## Related articles + +* [Installation instructions](/api/installation-instructions) +* [API keys](/api/api-keys) +* [Running bots](/api/running-bots) +* [Deploying bots](/api/deploying-bots) diff --git a/help/add-a-bot-or-integration.md b/help/add-a-bot-or-integration.md index f1ac70b915..f65ac9427e 100644 --- a/help/add-a-bot-or-integration.md +++ b/help/add-a-bot-or-integration.md @@ -38,7 +38,7 @@ is visible and available for anyone to use. as the **bot type**. Depending on the type of bot you're creating, you may need to download its -`.zuliprc` configuration file. For that, click the **download** +`zuliprc` configuration file. For that, click the **download** () icon under the bot's name. ## Related articles diff --git a/web/templates/settings/api_key_modal.hbs b/web/templates/settings/api_key_modal.hbs index c4c94d75e6..90821f9d75 100644 --- a/web/templates/settings/api_key_modal.hbs +++ b/web/templates/settings/api_key_modal.hbs @@ -36,7 +36,7 @@
- {{t "Download .zuliprc" }} + {{t "Download zuliprc" }}
diff --git a/zerver/lib/markdown/tabbed_sections.py b/zerver/lib/markdown/tabbed_sections.py index 52d0945fd0..c707eeb2be 100644 --- a/zerver/lib/markdown/tabbed_sections.py +++ b/zerver/lib/markdown/tabbed_sections.py @@ -112,6 +112,8 @@ TAB_SECTION_LABELS = { "v6": "Zulip Server 6.0+", "v4": "Zulip Server 4.0+", "all-versions": "All versions", + "for-a-bot": "For a bot", + "for-yourself": "For yourself", }