-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setup.rst: Add docs to setup corobo #665
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,90 @@ | ||||||
Setting Up Corobo | ||||||
================= | ||||||
|
||||||
The following documentation illustrates the process to install Corobo and interface it with the gitter API. | ||||||
|
||||||
Installation | ||||||
------------ | ||||||
|
||||||
* To install corobo, first you need to setup a virtual environment(it is not mandatory but highly recommended). This can be done as follows: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Let's not involve non-venv setups, which most probably won't even work. |
||||||
:: | ||||||
pip3 install virtualenv | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use venv since it ships with python. Let's also add a point of recommending them python 3.6. |
||||||
virtualenv venv -p python | ||||||
cd venv | ||||||
source bin/activate ----> For Linux | ||||||
\Scripts\activate ----> For Windows | ||||||
* Next, you can clone the corobo package via git and install the requirements(dependent packages). | ||||||
:: | ||||||
git clone https://github.com/coala/corobo.git | ||||||
pip install -r requirements.txt | ||||||
|
||||||
Configuration of Environment variables(In text mode) | ||||||
-------------------------------------------------- | ||||||
|
||||||
* The following environment variables are required to setup corobo in text mode: | ||||||
:: | ||||||
export BOT_PREFIX="any_name" | ||||||
export BACKEND="Text" | ||||||
export BOT_USERNAME="@any_other_name" | ||||||
(**Note:** The BOT_USERNAME always starts with a @ for a person and # for a room) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is incomplete. And what is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was mentioned in the docs. Seems like it is not used now. Will get it removed. |
||||||
|
||||||
Testing Corobo | ||||||
--------------------------- | ||||||
|
||||||
* To run the bot use: | ||||||
:: | ||||||
errbot | ||||||
* You can test the bot using the following commands: | ||||||
:: | ||||||
bot_prefix help ----> Lists the set of commands available with the bot | ||||||
bot_prefix history ----> Lists the command history | ||||||
|
||||||
|
||||||
Setting up Corobo with gitter backend | ||||||
===================================== | ||||||
|
||||||
#. Clone the err-backend-gitter repository in your "corobo" folder. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's not use |
||||||
:: | ||||||
git clone https://github.com/errbotio/err-backend-gitter.git | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nope. We use a submodule pinned to a specific commit, so you should be using that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes.. will get this done. |
||||||
|
||||||
#. Configure the environment variables(for gitter-backend). | ||||||
:: | ||||||
export BACKEND="Gitter" | ||||||
export BOT_EXTRA_BACKEND_DIR="/path_to/err-backend-gitter" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not required since the path is fixed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will get this fixed. |
||||||
#. To make the bot interact with the gitter API you will need a github account(this account can be used to login to gitter) to generate the gitter access token. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Do this wherever required. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You actually don't need a github account to login to gitter. One can use gitlab, twitter, or whatever else there is available. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also take care of the line length. |
||||||
**Remember it is recommended to use a separate account(other than the admin account) for the bot.** | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Also bold not required here. |
||||||
Once the account is setup, run the following script. | ||||||
:: | ||||||
./oauth.py | ||||||
This will guide you with the gitter token generation process. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On running this file it guides us with the process generating the gitter bit token. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you link this file? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the file.. https://github.com/errbotio/err-backend-gitter/blob/14a428bdd0597b473605264c822855da979bd916/oauth.py There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks very redundant, and you didn't tell them that this file belongs to the gitter backend directory. I don't think we need this as it is not even a part of corobo. |
||||||
#. Now you can assign the above generated token to the BOT_TOKEN environment variable. | ||||||
:: | ||||||
export BOT_TOKEN="your_gitter_token" | ||||||
#. Also to configure the bot with access to your github and gitlab repositories, you will need personal access tokens. | ||||||
The following links may guide you through this: | ||||||
https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token | ||||||
https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not properly indented? Also, raw text links like these don't look good. |
||||||
#. You can also create github organisations and gitlab groups to manage your repositories. | ||||||
Under a organisation you can make teams to organize the workforce. | ||||||
#. After completing the above steps, it is time to setup the remaining environment variables with the above gathered information. | ||||||
:: | ||||||
export GH_TOKEN="your_github_token" | ||||||
export GL_TOKEN="your_gitlab_token" | ||||||
export GH_ORG_NAME="your_github_organisation_name" | ||||||
export GL_ORG_NAME="your_gitlab_organisation_name" | ||||||
export ROOMS="rooms_to_join" | ||||||
export BOT_ADMINS="your_gitter_username" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These exports statements are coming too many times, instead have them bunched up in a single step. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, since I have divided the configuration in steps, the export statements have also been divided accordingly. I will get this done into two parts. One is for simple corobo configuration (with text backend) and other would be with the gitter backend. Dividing in minimum two parts seemed to be essential because it future if we add support for more backends then we can have separate files for each backend. Is this fine?? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't use text backend, it's merely there for testing reasons. errbot doesn't need special handling for backends, and hence the instructions should be more or less same. For example, we use the same instance for connecting over zulip as well, but we still don't have any special instructions for that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok.. will get this fixed.. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please suggest using .env file, which don't need the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok. Can I insert link to some external blog regarding working with .env files?? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, not required. |
||||||
(**Note:** The admin user account should be different than the bot account.) | ||||||
#. Hurrah!!! the bot is now ready to be deployed. To run the corobo instance use: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. deployed seems to be the wrong word here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, will get this changed. |
||||||
:: | ||||||
errbot | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Before this is running, the bot account should join all rooms required manually to then listen to those iirc. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, forgot this step.. will get it added.. |
||||||
|
||||||
Your corobo instance should now be running. You can chat with the bot by logging in through the admin gitter account and | ||||||
searching its username in the contacts section. You can send it commands via chat. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also contact section? This could use a better word |
||||||
:: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment as above. |
||||||
bot_prefix help | ||||||
bot_prefix history | ||||||
|
||||||
**Note:** Every time you run a new instance of the bot, it is required to set the environment variables(steps 2 and 7). | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not really required, on a single session the env vars are preserved. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I meant running a new shell instance. Will get this explicitly mentioned.. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be better to advise them to use .env instead. |
||||||
|
||||||
To know more about the list of available commands and other features of corobo checkout the other `docs <https://github.com/coala/corobo/tree/master/docs>`_. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.