setup.rst: Add docs to setup corobo#665
Conversation
This illustrates the steps involved in setting up corobo in text mode and with gitter-backend. Closes coala#668
bf322a3 to
fae8cf5
Compare
abhishalya
left a comment
There was a problem hiding this comment.
This is not complete in any way as there are a lot more steps involved. Although, this is a small step in the right direction.
docs/setup.rst
Outdated
| 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.
This is incomplete. And what is BOT_USERNAME?
There was a problem hiding this comment.
This was mentioned in the docs. Seems like it is not used now. Will get it removed.
Also, can u pls suggest the points that you mean to get added??
docs/setup.rst
Outdated
| #. Clone the err-backend-gitter repository in your "corobo" folder. | ||
| :: | ||
| git clone https://github.com/errbotio/err-backend-gitter.git |
There was a problem hiding this comment.
Nope. We use a submodule pinned to a specific commit, so you should be using that.
There was a problem hiding this comment.
Yes.. will get this done.
docs/setup.rst
Outdated
| #. 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.
Not required since the path is fixed.
There was a problem hiding this comment.
Will get this fixed.
docs/setup.rst
Outdated
| ./oauth.py | ||
| This will guide you with the gitter token generation process. |
There was a problem hiding this comment.
On running this file it guides us with the process generating the gitter bit token.
There was a problem hiding this comment.
This is the file.. https://github.com/errbotio/err-backend-gitter/blob/14a428bdd0597b473605264c822855da979bd916/oauth.py
This point is also mentioned in the gitter backend documentation.
There was a problem hiding this comment.
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.
docs/setup.rst
Outdated
| export ROOMS="rooms_to_join" | ||
| export BOT_ADMINS="your_gitter_username" | ||
| (**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.
deployed seems to be the wrong word here.
There was a problem hiding this comment.
Yes, will get this changed.
docs/setup.rst
Outdated
| 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.
These exports statements are coming too many times, instead have them bunched up in a single step.
There was a problem hiding this comment.
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.
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.
Ok.. will get this fixed..
There was a problem hiding this comment.
Please suggest using .env file, which don't need the export.
There was a problem hiding this comment.
Ok. Can I insert link to some external blog regarding working with .env files??
docs/setup.rst
Outdated
| (**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: | ||
| :: | ||
| errbot |
There was a problem hiding this comment.
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.
Yes, forgot this step.. will get it added..
docs/setup.rst
Outdated
| 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.
Not really required, on a single session the env vars are preserved.
There was a problem hiding this comment.
I meant running a new shell instance. Will get this explicitly mentioned..
There was a problem hiding this comment.
It would be better to advise them to use .env instead.
abhishalya
left a comment
There was a problem hiding this comment.
Please run this text over a spell or grammar checker. Also take care of max line length, we have this checks over coala repository. Maybe grab a bear from there?
Docs usually take some time, but it's fine as they are supposed to be very easy to understand.
docs/setup.rst
Outdated
| 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.
| * To install corobo, first you need to setup a virtual environment(it is not mandatory but highly recommended). This can be done as follows: | |
| * To install corobo, first you need to setup a virtual environment. This can be done as follows: |
Let's not involve non-venv setups, which most probably won't even work.
docs/setup.rst
Outdated
|
|
||
| * To install corobo, first you need to setup a virtual environment(it is not mandatory but highly recommended). This can be done as follows: | ||
| :: | ||
| pip3 install virtualenv |
There was a problem hiding this comment.
Use venv since it ships with python. Let's also add a point of recommending them python 3.6.
docs/setup.rst
Outdated
|
|
||
|
|
||
| Configuring the backend | ||
| ------------------------ |
There was a problem hiding this comment.
| ------------------------ | |
| ----------------------- |
Can you check this, it should be exact the same length as the title above.
docs/setup.rst
Outdated
| #. Clone the err-backend-gitter repository in your "corobo" folder. | ||
| :: | ||
| git clone https://github.com/errbotio/errbot@a0f35732484c8c0692e123c48653517cffa21a42 |
There was a problem hiding this comment.
Again, this is incorrect. We should be using submodule.
docs/setup.rst
Outdated
| ./oauth.py | ||
| This will guide you with the gitter token generation process. |
There was a problem hiding this comment.
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.
docs/setup.rst
Outdated
| 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.
Please suggest using .env file, which don't need the export.
docs/setup.rst
Outdated
| export BOT_ADMINS="your_gitter_username" | ||
| (**Note:** The admin user account should be different than the bot account.) | ||
|
|
||
| #. Hurrah!!! the bot is now ready to rock. To run the corobo instance use: |
There was a problem hiding this comment.
| #. Hurrah!!! the bot is now ready to rock. To run the corobo instance use: | |
| #. Hurrah!!! The bot is now ready to rock. To run the corobo instance use: |
docs/setup.rst
Outdated
| (**Note:** You can use the --DEBUG flag to run the bot in debug mode.) | ||
|
|
||
| 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.
| searching its username in the contacts section. You can send it commands via chat. | |
| searching it's username in the contacts section. You can send it commands via chat. |
There was a problem hiding this comment.
Also contact section? This could use a better word
docs/setup.rst
Outdated
| bot_prefix history ----> Lists the command history | ||
|
|
||
|
|
||
| **Note:** To avoid setting the env variables on every new run of shell instance, you can use a .env file to store the vars and run it before running the bot. |
There was a problem hiding this comment.
| **Note:** To avoid setting the env variables on every new run of shell instance, you can use a .env file to store the vars and run it before running the bot. | |
| **Note:** To avoid setting the env variables on every new run of shell instance, you can use a .env file to store the vars and source it before running the bot. |
docs/setup.rst
Outdated
|
|
||
|
|
||
| **Note:** To avoid setting the env variables on every new run of shell instance, you can use a .env file to store the vars and run it before running the bot. | ||
| Refer this `link <https://pybit.es/persistent-environment-variables.html>`_ for more info. |
There was a problem hiding this comment.
No, unless it's an official resource it's better to just avoid it.
There was a problem hiding this comment.
Ok. Will get all the changes done and also have the grammar check..
| Configuring the backend | ||
| ----------------------- | ||
|
|
||
| - Clone the err-backend-gitter repository in your "corobo" folder. |
There was a problem hiding this comment.
I don't think quotes are needed here.
| - Clone the err-backend-gitter repository in your "corobo" folder. | |
| - Clone the err-backend-gitter repository in your 'corobo' folder. |
| pip3 install git+https://github.com/errbotio/\ | ||
| err-backend-gitter@14a428bdd0597b473605264c822855da979bd916 |
There was a problem hiding this comment.
This is not the way we install gitter backend. It is a part of the git submodules so the user just needs to update the git submodule.
| @@ -0,0 +1,95 @@ | |||
| Setting Up Corobo | |||
There was a problem hiding this comment.
| Setting Up Corobo | |
| Setting Up corobo |
| - To install corobo, first you need to install | ||
| python (version 3.6 or more) and set up a virtual environment. | ||
| This can be done as follows: | ||
| :: |
There was a problem hiding this comment.
This is incorrect, you should keep this at the end of the paragraph above. Github somehow renders this but I wasn't able to get this rendered properly locally.
| python3 -m venv env | ||
| cd env | ||
| source bin/activate ----> For Linux | ||
| \Scripts\activate ----> For Windows |
There was a problem hiding this comment.
This could be a bit confusing, let's not specify instructions for windows or other OS.
| - Hurrah!!! The bot is now ready to rock. To run the corobo instance, use: | ||
| :: | ||
| errbot | ||
| (**Note:** You can use the --DEBUG flag to run the bot in debug mode.) |
| (**Note:** You can use the --DEBUG flag to run the bot in debug mode.) | ||
|
|
||
| Your corobo instance should now be running. You can chat with the bot by | ||
| logging in through the admin Gitter account and searching it's username in |
There was a problem hiding this comment.
| logging in through the admin Gitter account and searching it's username in | |
| logging in through the Gitter admin account and searching its username in |
| Your corobo instance should now be running. You can chat with the bot by | ||
| logging in through the admin Gitter account and searching it's username in | ||
| the conversations tab. | ||
| You can send it commands via chat. |
There was a problem hiding this comment.
| You can send it commands via chat. | |
| You can then send commands via messages. |
| logging in through the admin Gitter account and searching it's username in | ||
| the conversations tab. | ||
| You can send it commands via chat. | ||
| :: |
| bot_prefix help ----> Lists the set of commands available with the bot | ||
| bot_prefix history ----> Lists the command history |
There was a problem hiding this comment.
Also not required.
| bot_prefix help ----> Lists the set of commands available with the bot | |
| bot_prefix history ----> Lists the command history | |
| bot_prefix help | |
| bot_prefix history |
This illustrates the steps involved in setting up corobo in text mode and with gitter-backend.
Reviewers Checklist
botcmdandre_botcmddecorators.