Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

api-docs: Add instructions to download `zuliprc` files.

David Rosa948b427de719
diff --git a/api_docs/configuring-python-bindings.md b/api_docs/configuring-python-bindings.md
index d5b51b43c14..9336596bb54 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** (<i class="fa fa-download"></i>) 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:
<table class="table">
<thead>
<tr>
- <th><code>.zuliprc</code> key</th>
+ <th><code>zuliprc</code> key</th>
<th>Environment variable</th>
<th>Required</th>
<th>Description</th>
@@ -102,3 +152,10 @@ can be found in the following table:
</td>
</tr>
</table>
+
+## 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 f1ac70b9153..f65ac9427ee 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**
(<i class="fa fa-download"></i>) 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 c4c94d75e63..90821f9d755 100644
--- a/web/templates/settings/api_key_modal.hbs
+++ b/web/templates/settings/api_key_modal.hbs
@@ -36,7 +36,7 @@
</button>
<div id="api_key_buttons">
<button class="modal__btn dialog_submit_button" id="regenerate_api_key" aria-label="{{t 'Generate new API key' }}">{{t "Generate new API key" }}</button>
- <a class="modal__btn dialog_submit_button" id="download_zuliprc" download="zuliprc" tabindex="0">{{t "Download .zuliprc" }}</a>
+ <a class="modal__btn dialog_submit_button" id="download_zuliprc" download="zuliprc" tabindex="0">{{t "Download zuliprc" }}</a>
</div>
</footer>
</div>
diff --git a/zerver/lib/markdown/tabbed_sections.py b/zerver/lib/markdown/tabbed_sections.py
index 52d0945fd01..c707eeb2be6 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",
}