Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 95 additions & 0 deletions docs/setup.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
Setting Up Corobo
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Setting Up Corobo
Setting Up corobo

=================

The following documentation illustrates the process to
install corobo and interface it with the Gitter
(or any other backend) API.

Installation
------------
- To install corobo, first you need to install
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since these are all steps and not points, let's number them instead.

python (version 3.6 or more) and set up a virtual environment.
This can be done as follows:
::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
source bin/activate ----> For Linux
source bin/activate

\Scripts\activate ----> For Windows
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be a bit confusing, let's not specify instructions for windows or other OS.


- Next, you can clone the corobo package via git and
install the requirements (dependent packages).
::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above.

git clone https://github.com/coala/corobo.git
cd corobo
pip install -r requirements.txt

Configuring the backend
-----------------------

- Clone the err-backend-gitter repository in your "corobo" folder.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think quotes are needed here.

Suggested change
- 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
Comment on lines +31 to +32
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant new line?

- To make the bot interact with the Gitter API, you need to login to
Gitter using your GitHub, GitLab, Twitter, or any other available
account. Remember, it is recommended to use a separate account
(other than the admin account) for the bot. The bot will now use
this account as its Gitter identity.

- Also, you need to get your Gitter personal access token. It can be
found by logging in `here <https://developer.gitter.im/apps>`_ with
the above-created account.

- To configure the bot with access to your
`GitHub <https://docs.github.com/en/github \
/authenticating-to-github/creating-a-personal-access-token>`_
and `GitLab <https://docs.gitlab.com/ \
ee/user/profile/personal_access_tokens.html>`_
repositories, you will again need access tokens.
The given hyperlinks would guide you with the process.

- You can also create GitHub organizations and GitLab groups to
manage your repositories.
Under any organization, you can make teams to organize the workforce.

- To configure the bot to join rooms, it must first
manually enter those rooms via the bot Gitter account. Once this
is done, the bot would automatically find these rooms (if mentioned
in the ROOMS env variable) and establish a connection with them.

- After completing the above steps, it is finally time to set up the
environment variables with the above-gathered information. You
can create a .env file with the following variables and source it
before running the bot.
::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above.

BOT_PREFIX="any_name" ----> This will be used to address the bot
along with any command
BACKEND="Gitter" ----> Set the backend (other options are
"Text","Zulip",etc.)
Comment on lines +66 to +69
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not look good, also it's not required to specify the variables as they are self-explanatory.

Suggested change
BOT_PREFIX="any_name" ----> This will be used to address the bot
along with any command
BACKEND="Gitter" ----> Set the backend (other options are
"Text","Zulip",etc.)
BOT_PREFIX="any_name"
BACKEND="Gitter"

BOT_TOKEN="your_gitter_token"
GH_TOKEN="your_github_token"
GL_TOKEN="your_gitlab_token"
GH_ORG_NAME="your_github_organisation_name"
GL_ORG_NAME="your_gitlab_organisation_name"
ROOMS="rooms_to_join"
BOT_ADMINS="your_gitter_username"
(**Note:** The admin user account should be different than the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a line above this.

bot account.)

- Hurrah!!! The bot is now ready to rock. To run the corobo instance, use:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- 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:

::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above.

errbot
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
errbot
$ errbot

(**Note:** You can use the --DEBUG flag to run the bot in debug mode.)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a new line above this.


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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

the conversations tab.
You can send it commands via chat.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
You can send it commands via chat.
You can then send commands via messages.

::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above.

bot_prefix help ----> Lists the set of commands available with the bot
bot_prefix history ----> Lists the command history
Comment on lines +90 to +91
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also not required.

Suggested change
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


To know more about the list of available commands and other features
of corobo, check out the other
`docs <https://github.com/coala/corobo/tree/master/docs>`_.