mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-06 01:12:33 -05:00
Split documents per OS, fix few things, drop and add few OSes (#5328)
* Exclude include files from being built * Split install guides into multiple documents (one per OS/version combo) * Update references * Unify anchor names * Update pyenv requirements in CentOS 7 guide * Update install guides for RHEL derivatives to not use pyenv * Add guide for Rocky Linux 8 * 8.4+ -> 8.4-8.x * Add 'the'
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
------------------------------
|
||||
Creating a Virtual Environment
|
||||
------------------------------
|
||||
|
||||
.. tip::
|
||||
|
||||
If you want to learn more about virtual environments, see page: `about-venvs`
|
||||
|
||||
We require installing Red into a virtual environment. Don't be scared, it's very
|
||||
straightforward.
|
||||
|
||||
**************************
|
||||
Using ``pyenv virtualenv``
|
||||
**************************
|
||||
|
||||
Using ``pyenv virtualenv`` saves you the headache of remembering where you installed your virtual
|
||||
environments. This option is only available if you installed Python with pyenv.
|
||||
|
||||
First, ensure your pyenv interpreter is set to python 3.8.1 or greater with the following command:
|
||||
|
||||
.. prompt:: bash
|
||||
|
||||
pyenv version
|
||||
|
||||
Now, create a virtual environment with the following command:
|
||||
|
||||
.. prompt:: bash
|
||||
|
||||
pyenv virtualenv <name>
|
||||
|
||||
Replace ``<name>`` with whatever you like. If you ever forget what you named it,
|
||||
you can always use the command ``pyenv versions`` to list all virtual environments.
|
||||
|
||||
Now activate your virtualenv with the following command:
|
||||
|
||||
.. prompt:: bash
|
||||
|
||||
pyenv shell <name>
|
||||
|
||||
.. important::
|
||||
|
||||
You must activate the virtual environment with the above command every time you open a new
|
||||
shell to run, install or update Red. You can check out other commands like ``pyenv local`` and
|
||||
``pyenv global`` if you wish to keep the virtualenv activated all the time.
|
||||
38
docs/install_guides/_includes/create-env-with-venv.rst
Normal file
38
docs/install_guides/_includes/create-env-with-venv.rst
Normal file
@@ -0,0 +1,38 @@
|
||||
------------------------------
|
||||
Creating a Virtual Environment
|
||||
------------------------------
|
||||
|
||||
.. tip::
|
||||
|
||||
If you want to learn more about virtual environments, see page: `about-venvs`
|
||||
|
||||
We require installing Red into a virtual environment. Don't be scared, it's very
|
||||
straightforward.
|
||||
|
||||
**************
|
||||
Using ``venv``
|
||||
**************
|
||||
|
||||
This is the quickest way to get your virtual environment up and running, as `venv` is shipped with
|
||||
python.
|
||||
|
||||
First, choose a directory where you would like to create your virtual environment. It's a good idea
|
||||
to keep it in a location which is easy to type out the path to. From now, we'll call it
|
||||
``redenv`` and it will be located in your home directory.
|
||||
|
||||
Create your virtual environment with the following command:
|
||||
|
||||
.. prompt:: bash
|
||||
|
||||
python3.9 -m venv ~/redenv
|
||||
|
||||
And activate it with the following command:
|
||||
|
||||
.. prompt:: bash
|
||||
|
||||
source ~/redenv/bin/activate
|
||||
|
||||
.. important::
|
||||
|
||||
You must activate the virtual environment with the above command every time you open a new
|
||||
shell to run, install or update Red.
|
||||
56
docs/install_guides/_includes/install-and-setup-red-unix.rst
Normal file
56
docs/install_guides/_includes/install-and-setup-red-unix.rst
Normal file
@@ -0,0 +1,56 @@
|
||||
--------------
|
||||
Installing Red
|
||||
--------------
|
||||
|
||||
Choose one of the following commands to install Red.
|
||||
|
||||
To install without additional config backend support:
|
||||
|
||||
.. prompt:: bash
|
||||
:prompts: (redenv) $
|
||||
|
||||
python -m pip install -U pip setuptools wheel
|
||||
python -m pip install -U Red-DiscordBot
|
||||
|
||||
Or, to install with PostgreSQL support:
|
||||
|
||||
.. prompt:: bash
|
||||
:prompts: (redenv) $
|
||||
|
||||
python -m pip install -U pip setuptools wheel
|
||||
python -m pip install -U "Red-DiscordBot[postgres]"
|
||||
|
||||
|
||||
.. note::
|
||||
|
||||
These commands are also used for updating Red
|
||||
|
||||
--------------------------
|
||||
Setting Up and Running Red
|
||||
--------------------------
|
||||
|
||||
After installation, set up your instance with the following command:
|
||||
|
||||
.. prompt:: bash
|
||||
:prompts: (redenv) $
|
||||
|
||||
redbot-setup
|
||||
|
||||
This will set the location where data will be stored, as well as your
|
||||
storage backend and the name of the instance (which will be used for
|
||||
running the bot).
|
||||
|
||||
Once done setting up the instance, run the following command to run Red:
|
||||
|
||||
.. prompt:: bash
|
||||
:prompts: (redenv) $
|
||||
|
||||
redbot <your instance name>
|
||||
|
||||
It will walk through the initial setup, asking for your token and a prefix.
|
||||
You can find out how to obtain a token with
|
||||
`this guide <../bot_application_guide>`.
|
||||
|
||||
.. tip::
|
||||
If it's the first time you're using Red, you should check our `getting-started` guide
|
||||
that will walk you through all essential information on how to interact with Red.
|
||||
@@ -0,0 +1,26 @@
|
||||
.. include:: _includes/linux-preamble.rst
|
||||
|
||||
-------------------------------
|
||||
Installing the pre-requirements
|
||||
-------------------------------
|
||||
|
||||
Red Hat Enterprise Linux (RHEL) 8.4-8.x and its derivatives have all required packages available in official repositories.
|
||||
Install them with dnf:
|
||||
|
||||
.. prompt:: bash
|
||||
|
||||
sudo dnf -y update
|
||||
sudo dnf -y group install development
|
||||
sudo dnf -y install python39 python39-pip python39-devel java-11-openjdk-headless nano git
|
||||
|
||||
Set ``java`` executable to point to Java 11:
|
||||
|
||||
.. prompt:: bash
|
||||
|
||||
sudo alternatives --set java "java-11-openjdk.$(uname -i)"
|
||||
|
||||
.. Include common instructions:
|
||||
|
||||
.. include:: _includes/create-env-with-venv.rst
|
||||
|
||||
.. include:: _includes/install-and-setup-red-unix.rst
|
||||
34
docs/install_guides/_includes/install-python-pyenv.rst
Normal file
34
docs/install_guides/_includes/install-python-pyenv.rst
Normal file
@@ -0,0 +1,34 @@
|
||||
----------------------------
|
||||
Installing Python with pyenv
|
||||
----------------------------
|
||||
|
||||
On distributions where Python 3.9 needs to be compiled from source, we recommend the use of pyenv.
|
||||
This simplifies the compilation process and has the added bonus of simplifying setting up Red in a
|
||||
virtual environment.
|
||||
|
||||
.. prompt:: bash
|
||||
|
||||
command -v pyenv && pyenv update || curl https://pyenv.run | bash
|
||||
|
||||
**After this command, you may see a warning about 'pyenv' not being in the load path. Follow the
|
||||
instructions given to fix that, then close and reopen your shell.**
|
||||
|
||||
Then run the following command:
|
||||
|
||||
.. prompt:: bash
|
||||
|
||||
CONFIGURE_OPTS=--enable-optimizations pyenv install 3.9.7 -v
|
||||
|
||||
This may take a long time to complete, depending on your hardware. For some machines (such as
|
||||
Raspberry Pis and micro-tier VPSes), it may take over an hour; in this case, you may wish to remove
|
||||
the ``CONFIGURE_OPTS=--enable-optimizations`` part from the front of the command, which will
|
||||
drastically reduce the install time. However, be aware that this will make Python run about 10%
|
||||
slower.
|
||||
|
||||
After that is finished, run:
|
||||
|
||||
.. prompt:: bash
|
||||
|
||||
pyenv global 3.9.7
|
||||
|
||||
Pyenv is now installed and your system should be configured to run Python 3.9.
|
||||
34
docs/install_guides/_includes/install-python38-pyenv.rst
Normal file
34
docs/install_guides/_includes/install-python38-pyenv.rst
Normal file
@@ -0,0 +1,34 @@
|
||||
----------------------------
|
||||
Installing Python with pyenv
|
||||
----------------------------
|
||||
|
||||
On distributions where Python 3.8 needs to be compiled from source, we recommend the use of pyenv.
|
||||
This simplifies the compilation process and has the added bonus of simplifying setting up Red in a
|
||||
virtual environment.
|
||||
|
||||
.. prompt:: bash
|
||||
|
||||
command -v pyenv && pyenv update || curl https://pyenv.run | bash
|
||||
|
||||
**After this command, you may see a warning about 'pyenv' not being in the load path. Follow the
|
||||
instructions given to fix that, then close and reopen your shell.**
|
||||
|
||||
Then run the following command:
|
||||
|
||||
.. prompt:: bash
|
||||
|
||||
CONFIGURE_OPTS=--enable-optimizations pyenv install 3.8.12 -v
|
||||
|
||||
This may take a long time to complete, depending on your hardware. For some machines (such as
|
||||
Raspberry Pis and micro-tier VPSes), it may take over an hour; in this case, you may wish to remove
|
||||
the ``CONFIGURE_OPTS=--enable-optimizations`` part from the front of the command, which will
|
||||
drastically reduce the install time. However, be aware that this will make Python run about 10%
|
||||
slower.
|
||||
|
||||
After that is finished, run:
|
||||
|
||||
.. prompt:: bash
|
||||
|
||||
pyenv global 3.8.12
|
||||
|
||||
Pyenv is now installed and your system should be configured to run Python 3.8.
|
||||
5
docs/install_guides/_includes/linux-preamble.rst
Normal file
5
docs/install_guides/_includes/linux-preamble.rst
Normal file
@@ -0,0 +1,5 @@
|
||||
.. warning::
|
||||
|
||||
For safety reasons, DO NOT install Red with a root user. If you are unsure how to create
|
||||
a new user on Linux, see `this guide by DigitalOcean
|
||||
<https://www.digitalocean.com/community/tutorials/how-to-create-a-new-sudo-enabled-user-on-ubuntu-20-04-quickstart>`_.
|
||||
Reference in New Issue
Block a user