mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-12-18 06:45:04 +01:00
Merge branch 'master' of gitlab.com:allianceauth/allianceauth into v4.x
This commit is contained in:
@@ -24,7 +24,7 @@ To install on your favorite flavour of Linux, identify and install equivalent pa
|
||||
|
||||
### OS Maintenance
|
||||
|
||||
It is recommended to ensure your OS is fully up to date before proceeding. We may also add Package Repositories here, used later in the documentation.
|
||||
It is recommended to ensure your OS is fully up-to-date before proceeding. We may also add Package Repositories here, used later in the documentation.
|
||||
|
||||
::::{tabs}
|
||||
:::{group-tab} Ubuntu 2004, 2204
|
||||
@@ -281,7 +281,7 @@ For security and permissions, it’s highly recommended you create a separate us
|
||||
:::{group-tab} Ubuntu 2004, 2204
|
||||
|
||||
```shell
|
||||
sudo useradd -s /bin/bash allianceserver
|
||||
sudo adduser --disabled-login allianceserver
|
||||
```
|
||||
|
||||
:::
|
||||
@@ -319,7 +319,7 @@ sudo chown -R allianceserver:allianceserver /var/www/myauth/static/
|
||||
```
|
||||
|
||||
:::{warning}
|
||||
When installing and performing maintenance on Alliance Auth, virtual environments and python packages, _sudo_ means _superuser_ _do_, this will not use your venv or your allianceserver user and will routinely break your permission structure.
|
||||
When installing and performing maintenance on Alliance Auth, virtual environments and python packages, _sudo_ means _superuser_ _do_, this will not use your venv or your allianceserver user and will routinely break your permission structure.
|
||||
|
||||
Only use sudo for _system_ management or if you are unsure, when explicitly instructed to do so.
|
||||
|
||||
@@ -337,7 +337,7 @@ Switch to the allianceserver user.
|
||||
sudo su allianceserver
|
||||
```
|
||||
|
||||
And switch to it's home directory:
|
||||
And switch to its home directory:
|
||||
|
||||
```shell
|
||||
cd ~
|
||||
@@ -371,14 +371,14 @@ Each time you come to do maintenance on your Alliance Auth installation, you sho
|
||||
|
||||
You need to have a dedicated Eve SSO app for Alliance auth. Please go to [EVE Developer](https://developers.eveonline.com/applications) to create one.
|
||||
|
||||
For **scopes** your SSO app needs to have at least `publicData`. Additional scopes depends on which Alliance Auth apps you will be using. For convenience, we recommend adding all available ESO scopes to your SSO app. Note that Alliance Auth will always ask the users to approve specific scopes before they are used.
|
||||
For **scopes** your SSO app needs to have at least `publicData`. Additional scopes depend on which Alliance Auth apps you will be using. For convenience, we recommend adding all available ESO scopes to your SSO app. Note that Alliance Auth will always ask the users to approve specific scopes before they are used.
|
||||
|
||||
As **callback URL** you want to define the URL of your Alliance Auth site plus the route: `/sso/callback`. Example for a valid callback URL: `https://auth.example.com/sso/callback`
|
||||
|
||||
### Alliance Auth Project
|
||||
|
||||
:::{warning}
|
||||
Before installing any Python packages please double-check that you have activated in the virtual environment. This is usually indicated by your command line in the terminal starting with: `(auth)`.
|
||||
Before installing any Python packages, please double-check that you have activated in the virtual environment. This is usually indicated by your command line in the terminal starting with: `(auth)`.
|
||||
:::
|
||||
|
||||
#### Install Python packages
|
||||
@@ -395,7 +395,7 @@ You can install **Alliance Auth** with the following command. This will install
|
||||
pip install allianceauth superlance gunicorn
|
||||
```
|
||||
|
||||
#### Create Alliance Auth project
|
||||
#### Create the Alliance Auth project
|
||||
|
||||
Now you need to create the Django project that will run **Alliance Auth**. Ensure you are in the allianceserver home directory by issuing:
|
||||
|
||||
@@ -427,7 +427,7 @@ nano myauth/myauth/settings/local.py
|
||||
|
||||
#### Install database & static files
|
||||
|
||||
Django needs to setup the database before it can start.
|
||||
Django needs to set up the database before it can start.
|
||||
|
||||
```shell
|
||||
python /home/allianceserver/myauth/manage.py migrate
|
||||
@@ -462,9 +462,9 @@ Before using your auth site, it is essential to create a superuser account. This
|
||||
python /home/allianceserver/myauth/manage.py createsuperuser
|
||||
```
|
||||
|
||||
Once your install is complete, the superuser account is accessed by logging in via the admin site at `https://example.com/admin`.
|
||||
Once your installation is complete, the superuser account is accessed by logging in via the admin site at `https://example.com/admin`.
|
||||
|
||||
If you intend to use this account as your personal auth account you need to add a main character. Navigate to the normal user dashboard (at `https://example.com`) after logging in via the admin site and select `Change Main`. Once a main character has been added, it is possible to use SSO to login to this account.
|
||||
If you intend to use this account as your personal auth account, you need to add a main character. Navigate to the normal user dashboard (at `https://example.com`) after logging in via the admin site and select `Change Main`. Once a main character has been added, it is possible to use SSO to log in to this account.
|
||||
|
||||
## Services
|
||||
|
||||
@@ -472,7 +472,9 @@ Alliance Auth needs some additional services to run, which we will set up and co
|
||||
|
||||
### Gunicorn
|
||||
|
||||
To run the **Alliance Auth** website a [WSGI Server](https://www.fullstackpython.com/wsgi-servers.html) is required. For this [Gunicorn](http://gunicorn.org/) is highly recommended for its ease of configuring. It can be manually run from within your `myauth` base directory with `gunicorn --bind 0.0.0.0 myauth.wsgi` or automatically run using Supervisor.
|
||||
To run the **Alliance Auth** website, a [WSGI Server](https://www.fullstackpython.com/wsgi-servers.html) is required. For this [Gunicorn](http://gunicorn.org/) is highly recommended for its ease of configuring. It can be manually run from within your `myauth` base directory with `gunicorn --bind 0.0.0.0 myauth.wsgi` or automatically run using Supervisor.
|
||||
|
||||
If you don't see any errors, this means that Gunicorn is running fine. You can stop it with `Ctrl+C` now.
|
||||
|
||||
The default configuration is good enough for most installations. Additional information is available in the [gunicorn](gunicorn.md) doc.
|
||||
|
||||
@@ -583,7 +585,7 @@ Activate it with `sudo supervisorctl reload`.
|
||||
You can check the status of the processes with `sudo supervisorctl status`. Logs from these processes are available in `/home/allianceserver/myauth/log` named by process.
|
||||
|
||||
:::{note}
|
||||
Any time the code or your settings change you'll need to restart Gunicorn and Celery. ::
|
||||
Any time the code or your settings change, you'll need to restart Gunicorn and Celery. ::
|
||||
|
||||
```shell
|
||||
sudo supervisorctl restart myauth:
|
||||
@@ -595,13 +597,13 @@ sudo supervisorctl restart myauth:
|
||||
|
||||
Once installed, decide on whether you're going to use [NGINX](nginx.md) or [Apache](apache.md) and follow the respective guide.
|
||||
|
||||
Note that Alliance Auth is designed to run with web servers on HTTPS. While running on HTTP is technically possible, it is not recommended for production use, and some functions (e.g. Email confirmation links) will not work properly.
|
||||
Note that Alliance Auth is designed to run with web servers on HTTPS. While running on HTTP is technically possible, it is not recommended for production use, and some functions (e.g., Email confirmation links) will not work properly.
|
||||
|
||||
## Updating
|
||||
|
||||
Periodically [new releases](https://gitlab.com/allianceauth/allianceauth/tags) are issued with bug fixes and new features. Be sure to read the [release notes](https://gitlab.com/allianceauth/allianceauth/-/releases) which will highlight changes.
|
||||
|
||||
To update your install, swap to your allianceserver user
|
||||
To update your installation, swap to your allianceserver user
|
||||
|
||||
```shell
|
||||
sudo su allianceserver
|
||||
@@ -631,7 +633,7 @@ Some releases come with new or changed models. Update your database to reflect t
|
||||
python /home/allianceserver/myauth/manage.py migrate
|
||||
```
|
||||
|
||||
Finally, some releases come with new or changed static files. Run the following command to update your static files folder:
|
||||
Finally, some releases come with new or changed static files. Run the following command to update your static files' folder:
|
||||
|
||||
```shell
|
||||
python /home/allianceserver/myauth/manage.py collectstatic --noinput
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
## Overview
|
||||
|
||||
Alliance Auth gets served using a Web Server Gateway Interface (WSGI) script. This script passes web requests to Alliance Auth which generates the content to be displayed and returns it. This means very little has to be configured in Apache to host Alliance Auth.
|
||||
Alliance Auth gets served using a Web Server Gateway Interface (WSGI) script. This script passes web requests to Alliance Auth, which generates the content to be displayed and returns it. This means very little has to be configured in Apache to host Alliance Auth.
|
||||
|
||||
If you're using a small VPS to host services with very limited memory, consider using [NGINX](nginx.md).
|
||||
|
||||
@@ -78,7 +78,7 @@ chown -R apache:apache /var/www/myauth/static
|
||||
|
||||
Apache serves sites through defined virtual hosts. These are located in `/etc/apache2/sites-available/` on Ubuntu and `/etc/httpd/conf.d/httpd.conf` on CentOS.
|
||||
|
||||
A virtual host for auth need only proxy requests to your WSGI server (Gunicorn if you followed the install guide) and serve static files. Examples can be found below. Create your config in its own file e.g. `myauth.conf`
|
||||
A virtual host for auth needs only proxy requests to your WSGI server (Gunicorn if you followed the installation guide) and serve static files. Examples can be found below. Create your config in its own file e.g. `myauth.conf`
|
||||
|
||||
::::{tabs}
|
||||
:::{group-tab} Ubuntu 2004, 2204
|
||||
@@ -152,7 +152,7 @@ a2dissite 000-default.conf
|
||||
|
||||
It's 2018 - there's no reason to run a site without SSL. The EFF provides free, renewable SSL certificates with an automated installer. Visit their [website](https://certbot.eff.org/) for information.
|
||||
|
||||
After acquiring SSL the config file needs to be adjusted. Add the following lines inside the `<VirtualHost>` block:
|
||||
After acquiring SSL, the config file needs to be adjusted. Add the following lines inside the `<VirtualHost>` block:
|
||||
|
||||
```ini
|
||||
RequestHeader set X-FORWARDED-PROTOCOL https
|
||||
@@ -163,7 +163,7 @@ After acquiring SSL the config file needs to be adjusted. Add the following line
|
||||
|
||||
#### Apache2 vs. Django
|
||||
|
||||
For some versions of Apache2 you might have to tell the Django framework explicitly
|
||||
For some versions of Apache2, you might have to tell the Django framework explicitly
|
||||
to use SSL, since the automatic detection doesn't work. SSL in general will work,
|
||||
but internally created URLs by Django might still be prefixed with just `http://`
|
||||
instead of `https://`, so it can't hurt to add these lines to
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
|
||||
[Gunicorn](http://gunicorn.org) is a Python WSGI HTTP Server for UNIX. The Gunicorn server is light on server resources, and fairly speedy.
|
||||
|
||||
If you find Apache's `mod_wsgi` to be a headache or want to use NGINX (or some other webserver), then Gunicorn could be for you. There are a number of other WSGI server options out there and this documentation should be enough for you to piece together how to get them working with your environment.
|
||||
If you find Apache's `mod_wsgi` to be a headache or want to use NGINX (or some other webserver), then Gunicorn could be for you. There are a number of other WSGI server options out there, and this documentation should be enough for you to piece together how to get them working with your environment.
|
||||
|
||||
Check out the full [Gunicorn docs](http://docs.gunicorn.org/en/latest/index.html).
|
||||
|
||||
:::{note}
|
||||
The page contains additional steps on how to setup and configure Gunicorn that are not required for users who decide to stick with the default Gunicorn configuration as described in the main installation guide for AA.
|
||||
The page contains additional steps on how to set up and configure Gunicorn that are not required for users who decide to stick with the default Gunicorn configuration as described in the main installation guide for AA.
|
||||
:::
|
||||
|
||||
## Setting up Gunicorn
|
||||
@@ -30,7 +30,7 @@ Once you validate its running, you can kill the process with Ctrl+C and continue
|
||||
|
||||
## Running Gunicorn with Supervisor
|
||||
|
||||
If you are following this guide, we already use [Supervisor](allianceauth.md#supervisor) to keep all of Alliance Auth components running. You don't _have to_ but we will be using it to start and run Gunicorn for consistency.
|
||||
If you are following this guide, we already use [Supervisor](allianceauth.md#supervisor) to keep all of Alliance Auth's components running. You don't _have to_, but we will be using it to start and run Gunicorn for consistency.
|
||||
|
||||
### Sample Supervisor config
|
||||
|
||||
@@ -51,7 +51,7 @@ stopsignal=INT
|
||||
- `[program:gunicorn]` - Change `gunicorn` to whatever you wish to call your process in Supervisor.
|
||||
- `user = allianceserver` - Change to whatever user you wish Gunicorn to run as. You could even set this as allianceserver if you wished. I'll leave the question security of that up to you.
|
||||
- `directory=/home/allianceserver/myauth/` - Needs to be the path to your Alliance Auth project.
|
||||
- `command=/home/allianceserver/venv/auth/bin/gunicorn myauth.wsgi --workers=3 --timeout 120` - Running Gunicorn and the options to launch with. This is where you have some decisions to make, we'll continue below.
|
||||
- `command=/home/allianceserver/venv/auth/bin/gunicorn myauth.wsgi --workers=3 --timeout 120` - Running Gunicorn and the options to launch with. This is where you have some decisions to make. We'll continue below.
|
||||
|
||||
#### Gunicorn Arguments
|
||||
|
||||
@@ -59,7 +59,7 @@ See the [Commonly Used Arguments](http://docs.gunicorn.org/en/latest/run.html#co
|
||||
|
||||
##### Where to bind Gunicorn to
|
||||
|
||||
What address are you going to use to reference it? By default, without a bind parameter, Gunicorn will bind to `127.0.0.1:8000`. This might be fine for your application. If it clashes with another application running on that port you will need to change it. I would suggest using UNIX sockets too, if you can.
|
||||
What address are you going to use to reference it? By default, without a bind parameter, Gunicorn will bind to `127.0.0.1:8000`. This might be fine for your application. If it clashes with another application running on that port, you will need to change it. I would suggest using UNIX sockets too if you can.
|
||||
|
||||
For UNIX sockets add `--bind=unix:/run/allianceauth.sock` (or to a path you wish to use). Remember that your web server will need to be able to access this socket file.
|
||||
|
||||
@@ -69,13 +69,13 @@ Whatever you decide to use, remember it because we'll need it when configuring y
|
||||
|
||||
##### Number of workers
|
||||
|
||||
By default Gunicorn will spawn only one worker. The number you set this to will depend on your own server environment, how many visitors you have etc. Gunicorn suggests `(2 x $num_cores) + 1` for the number of workers. So for example if you have 2 cores you want 2 x 2 + 1 = 5 workers. See [here](https://docs.gunicorn.org/en/stable/design.html#how-many-workers) for the official discussion on this topic.
|
||||
By default, Gunicorn will spawn only one worker. The number you set this to will depend on your own server environment, how many visitors you have etc. Gunicorn suggests `(2 x $num_cores) + 1` for the number of workers. So, for example, if you have 2 cores, you want 2 x 2 + 1 = 5 workers. See [here](https://docs.gunicorn.org/en/stable/design.html#how-many-workers) for the official discussion on this topic.
|
||||
|
||||
Change it by adding `--workers=5` to the command.
|
||||
|
||||
##### Running with a virtual environment
|
||||
|
||||
Following this guide, you are running with a virtual environment. Therefore you'll need to add the path to the `command=` config line.
|
||||
Following this guide, you are running with a virtual environment. Therefore, you'll need to add the path to the `command=` config line.
|
||||
|
||||
e.g. `command=/path/to/venv/bin/gunicorn myauth.wsgi`
|
||||
|
||||
@@ -91,11 +91,11 @@ Once you have your configuration all sorted, you will need to reload your superv
|
||||
|
||||
## Configuring your webserver
|
||||
|
||||
Any web server capable of proxy passing should be able to sit in front of Gunicorn. Consult their documentation armed with your `--bind=` address and you should be able to find how to do it relatively easy.
|
||||
Any web server capable of proxy passing should be able to sit in front of Gunicorn. Consult their documentation armed with your `--bind=` address, and you should be able to find how to do it relatively easily.
|
||||
|
||||
## Restarting Gunicorn
|
||||
|
||||
In the past when you made changes you restarted the entire Apache server. This is no longer required. When you update or make configuration changes that ask you to restart Apache, instead you can just restart Gunicorn:
|
||||
In the past, when you made changes, you restarted the entire Apache server. This is no longer required. When you update or make configuration changes that ask you to restart Apache, instead you can just restart Gunicorn:
|
||||
|
||||
```shell
|
||||
supervisorctl restart myauth:gunicorn
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
This chapter contains the main installation guides for **Alliance Auth**.
|
||||
|
||||
In addition to main guide for installation Alliance Auth you also find guides for configuring web servers (Apache, NGINX) and the recommended WSGI server (Gunicorn).
|
||||
In addition to the main guide for installation Alliance Auth, you also find guides for configuring web servers (Apache, NGINX) and the recommended WSGI server (Gunicorn).
|
||||
|
||||
:::{toctree}
|
||||
:maxdepth: 1
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
## Overview
|
||||
|
||||
Nginx (engine x) is a HTTP server known for its high performance, stability, simple configuration, and low resource consumption. Unlike traditional servers (i.e. Apache), Nginx doesn't rely on threads to serve requests, rather using an asynchronous event driven approach which permits predictable resource usage and performance under load.
|
||||
Nginx (engine x) is an HTTP server known for its high performance, stability, simple configuration, and low-resource consumption. Unlike traditional servers (i.e., Apache), Nginx doesn't rely on threads to serve requests, rather using an asynchronous event-driven approach which permits predictable resource usage and performance under load.
|
||||
|
||||
If you're trying to cram Alliance Auth into a very small VPS of say, 1-2GB or less, then Nginx will be considerably friendlier to your resources compared to Apache.
|
||||
If you're trying to cram Alliance Auth into a very small VPS of say, 1 to 2GB or less, then Nginx will be considerably friendlier to your resources compared to Apache.
|
||||
|
||||
You can read more about NGINX on the [NGINX wiki](https://www.nginx.com/resources/wiki/).
|
||||
|
||||
@@ -12,7 +12,7 @@ You can read more about NGINX on the [NGINX wiki](https://www.nginx.com/resource
|
||||
|
||||
If you're converting from Apache, here are some things to consider.
|
||||
|
||||
Nginx is lightweight for a reason. It doesn't try to do everything internally and instead concentrates on just being a good HTTP server. This means that, unlike Apache, it won't automatically run PHP scripts via mod_php and doesn't have an internal WSGI server like mod_wsgi. That doesn't mean that it can't, just that it relies on external processes to run these instead. This might be good or bad depending on your outlook. It's good because it allows you to segment your applications, restarting Alliance Auth wont impact your PHP applications. On the other hand it means more config and more management of services. For some people it will be worth it, for others losing the centralised nature of Apache may not be worth it.
|
||||
Nginx is lightweight for a reason. It doesn't try to do everything internally and instead concentrates on just being a good HTTP server. This means that, unlike Apache, it won't automatically run PHP scripts via mod_php and doesn't have an internal WSGI server like mod_wsgi. That doesn't mean that it can't, just that it relies on external processes to run these instead. This might be good or bad depending on your outlook. It's good because it allows you to segment your applications, restarting Alliance Auth won't impact your PHP applications. On the other hand, it means more config and more management of services. For some people it will be worth it, for others losing the centralised nature of Apache may not be worth it.
|
||||
|
||||
```{eval-rst}
|
||||
+-----------+----------------------------------------+
|
||||
@@ -28,12 +28,12 @@ Your .htaccess files won't work. Nginx has a separate way of managing access to
|
||||
|
||||
## Setting up Nginx
|
||||
|
||||
Install Nginx via your preferred package manager or other method. If you need help just search, there are plenty of guides on installing Nginx out there.
|
||||
Install Nginx via your preferred package manager or other method. If you need help, search, there are plenty of guides on installing Nginx out there.
|
||||
|
||||
Nginx needs to be able to read the folder containing your auth project's static files. `chown -R nginx:nginx /var/www/myauth/static`.
|
||||
|
||||
:::{tip}
|
||||
Some specific distros may use ``www-data:www-data`` instead of ``nginx:nginx``, causing static files (images, stylesheets etc) not to appear. You can confirm what user Nginx will run under by checking either its base config file ``/etc/nginx/nginx.conf`` for the "user" setting, or once Nginx has started ``ps aux | grep nginx``.
|
||||
Some specific distros may use ``www-data:www-data`` instead of ``nginx:nginx``, causing static files (images, stylesheets etc.) not to appear. You can confirm what user Nginx will run under by checking either its base config file ``/etc/nginx/nginx.conf`` for the "user" setting, or once Nginx has started ``ps aux | grep nginx``.
|
||||
Adjust your chown commands to the correct user if needed.
|
||||
:::
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
# Switch to non-root
|
||||
|
||||
If you followed the official installation guide for Alliance Auth (AA) pre AA 3.x you usually ended up with a "root installation". A root installation means that you have installed AA with the root user and now need to log in as root every time to perform maintenance for AA, e.g. updating existing apps.
|
||||
If you followed the official installation guide for Alliance Auth (AA) pre AA 3.x you usually ended up with a "root installation". A root installation means that you have installed AA with the root user and now need to log in as root every time to perform maintenance for AA, e.g., updating existing apps.
|
||||
|
||||
Since working as root is [generally not recommended](https://askubuntu.com/questions/16178/why-is-it-bad-to-log-in-as-root), this guide explains how you can easily migrate your existing "root installation" to a "non-root installation".
|
||||
|
||||
## How to switch to non-root
|
||||
|
||||
We will change the setup so that you can use your `allianceserver` user to perform most maintenance operations. In addition, you also need a sudo user for invoking root privileges, e.g. when restarting the AA services.
|
||||
We will change the setup so that you can use your `allianceserver` user to perform most maintenance operations. In addition, you also need a sudo user for invoking root privileges, e.g., when restarting the AA services.
|
||||
|
||||
The migration itself is rather straightforward. The main idea is to change ownership for all relevant directories and files to `allianceserver`.
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
This guide describes how to upgrade an existing Alliance Auth (AA) installation to a newer Python 3 version.
|
||||
|
||||
This guide shares many similarities with the Alliance Auth install guide, but it is targeted towards existing installs needing to update.
|
||||
This guide shares many similarities with the Alliance Auth install guide, but it is targeted towards existing installations needing to update.
|
||||
|
||||
:::{note}
|
||||
This guide will upgrade the software components only but not change any data or configuration.
|
||||
@@ -10,7 +10,7 @@ This guide will upgrade the software components only but not change any data or
|
||||
|
||||
## Install a new Python version
|
||||
|
||||
To run AA with a newer Python 3 version than your system's default you need to install it first. Technically it would be possible to upgrade your system's default Python 3, but since many of your system's tools have been tested to work with that specific version we would not recommend it. Instead we recommend to install an additional Python 3 version alongside your default version and use that for AA.
|
||||
To run AA with a newer Python 3 version than your system's default, you need to install it first. Technically, it would be possible to upgrade your system's default Python 3, but since many of your system's tools have been tested to work with that specific version, we would not recommend it. Instead, we recommend installing an additional Python 3 version alongside your default version and using that for AA.
|
||||
|
||||
To install other Python versions than those included with your distribution, you need to add a new installation repository. Then you can install the specific Python 3 to your system.
|
||||
|
||||
@@ -20,7 +20,7 @@ To install other Python versions than those included with your distribution, you
|
||||
|
||||
Centos Stream 8/9:
|
||||
:::{note}
|
||||
A Python 3.9 Package is available for Stream 8 and 9. You _may_ use this instead of building your own package. But our documentation will assume Python3.11 and you may need to substitute as neccessary
|
||||
A Python 3.9 Package is available for Stream 8 and 9. You _may_ use this instead of building your own package. But our documentation will assume Python3.11, and you may need to substitute as necessary
|
||||
sudo dnf install python39 python39-devel
|
||||
:::
|
||||
|
||||
@@ -77,12 +77,12 @@ sudo make altinstall
|
||||
|
||||
## Preparing your venv
|
||||
|
||||
Before updating your venv it is important to make sure that your current installation is stable. Otherwise your new venv might not be consistent with your data, which might create problems.
|
||||
Before updating your venv, it is important to make sure that your current installation is stable. Otherwise, your new venv might not be consistent with your data, which might create problems.
|
||||
|
||||
Start by navigating to your main project folder (the one that has `manage.py` in it). If you followed the default installation the path is: `/home/allianceserver/myauth`
|
||||
Start by navigating to your main project folder (the one that has `manage.py` in it). If you followed the default installation, the path is: `/home/allianceserver/myauth`
|
||||
|
||||
:::{note}
|
||||
If you installed Alliance Auth under the allianceserver user, as reccommended. Remember to switch users for easier permission management::
|
||||
If you installed Alliance Auth under the allianceserver user, as recommended. Remember to switch users for easier permission management::
|
||||
:::
|
||||
|
||||
```bash
|
||||
@@ -121,9 +121,9 @@ supervisorctl restart myauth:
|
||||
|
||||
### Upgrade your apps
|
||||
|
||||
You also need to upgrade all additional apps to their newest version that you have installed. And you need to make sure that you can reinstall all your apps later, e.g. you know from which repo they came. We recommend to make a list of all your apps, so you can just go through them later when you rebuild your venv.
|
||||
You also need to upgrade all additional apps to their newest version that you have installed. And you need to make sure that you can reinstall all your apps later, e.g., you know from which repo they came. We recommend making a list of all your apps, so you can go through them later when you rebuild your venv.
|
||||
|
||||
If you unsure which apps you have installed from repos check `INSTALLED_APPS` in your settings. Alternatively run this command to get a list all apps in your venv.
|
||||
If you unsure which apps you have installed from repos check `INSTALLED_APPS` in your settings. Alternatively, run this command to get a list of all apps in your venv.
|
||||
|
||||
```shell
|
||||
pip list
|
||||
@@ -149,13 +149,13 @@ python manage.py collectstatic
|
||||
|
||||
Do a final restart of your AA supervisors and make sure your installation is still running normally.
|
||||
|
||||
For a final check that they are no issues - e.g. any outstanding migrations - run this command:
|
||||
For a final check that there are no issues - e.g., any outstanding migrations - run this command:
|
||||
|
||||
```shell
|
||||
python manage.py check
|
||||
```
|
||||
|
||||
If you get the following result you are good to go. Otherwise make sure to fix any issues first before proceeding.
|
||||
If you get the following result, you are good to go. Otherwise, make sure to fix any issues first before proceeding.
|
||||
|
||||
```shell
|
||||
System check identified no issues (0 silenced).
|
||||
@@ -165,22 +165,22 @@ System check identified no issues (0 silenced).
|
||||
|
||||
Make sure you are in your venv!
|
||||
|
||||
First we create a list of all installed packages in your venv. You can use this list later as reference to see what packages should be installed.
|
||||
First, we create a list of all installed packages in your venv. You can use this list later as a reference to see what packages should be installed.
|
||||
|
||||
```shell
|
||||
pip freeze > requirements.txt
|
||||
```
|
||||
|
||||
At this point we recommend creating a list of the additional packages that you need to manually reinstall later on top of AA:
|
||||
At this point, we recommend creating a list of the additional packages that you need to manually reinstall later on top of AA:
|
||||
|
||||
- Community AA apps (e.g. aa-structures)
|
||||
- Additional tools you are using (e.g. flower, django-extensions)
|
||||
- Additional tools you are using (e.g., flower, django-extensions)
|
||||
|
||||
:::{hint}
|
||||
While `requirements.txt` will contain a complete list of your packages, it will also contain many packages that are automatically installed as dependencies and don't need be manually reinstalled.
|
||||
While `requirements.txt` will contain a complete list of your packages, it will also contain many packages that are automatically installed as dependencies and don't need to be manually reinstalled.
|
||||
:::
|
||||
:::{note}
|
||||
Some guide on the Internet will suggest to use use the requirements.txt file to recreate a venv. This is indeed possible, but only works if all packages can be installed from PyPI. Since most community apps are installed directly from repos this guide will not follow that approach.
|
||||
Some guides on the Internet will suggest using the `requirements.txt` file to recreate a venv. This is indeed possible, but only works if all packages can be installed from PyPI. Since most community apps are installed directly from repos, this guide will not follow that approach.
|
||||
:::
|
||||
|
||||
Leave the venv and shutdown all AA services:
|
||||
@@ -193,7 +193,7 @@ deactivate
|
||||
supervisorctl stop myauth:
|
||||
```
|
||||
|
||||
Rename and keep your old venv so we have a fallback in case of some unforeseeable issues:
|
||||
Rename and keep your old venv, so we have a fallback in case of some unforeseeable issues:
|
||||
|
||||
```shell
|
||||
mv /home/allianceserver/venv/auth /home/allianceserver/venv/auth_old
|
||||
@@ -233,37 +233,37 @@ pip install gunicorn
|
||||
|
||||
### Install all other packages
|
||||
|
||||
Last, but not least you need to reinstall all other packages, e.g. for AA community apps or additional tools.
|
||||
Last, but not least, you need to reinstall all other packages, e.g., for AA community apps or additional tools.
|
||||
|
||||
Use the list of packages you created earlier as a checklist. Alternatively you use the `requirements.txt` file we created earlier to see what you need. During the installation process you can run `pip list` to see what you already got installed.
|
||||
|
||||
To check whether you are missing any apps you can also run the check command:
|
||||
To check whether you are missing any apps, you can also run the check command:
|
||||
|
||||
```shell
|
||||
python manage.py check
|
||||
```
|
||||
|
||||
Note: In case you forget to install an app you will get this error
|
||||
Note: In case you forget to install an app, you will get this error
|
||||
|
||||
```shell
|
||||
ModuleNotFoundError: No module named 'xyz'
|
||||
```
|
||||
|
||||
Note that you should not need to run any migrations unless you forgot to upgrade one of your existing apps or you got the newer version of an app through a dependency. In that case you just migrations normally.
|
||||
Note that you should not need to run any migrations unless you forgot to upgrade one of your existing apps, or you got the newer version of an app through a dependency. In that case, you run migrations normally.
|
||||
|
||||
## Restart
|
||||
|
||||
After you have completed installing all packages just start your AA supervisor again.
|
||||
After you have completed installing all packages, start your AA supervisor again.
|
||||
|
||||
```shell
|
||||
supervisorctl start myauth:
|
||||
```
|
||||
|
||||
We recommend to keep your old venv copy for a couple of days so you have a fallback just in case. After that you should be fine to remove it.
|
||||
We recommend keeping your old venv copy for a couple of days, so you have a fallback just in case. After that, you should be fine to remove it.
|
||||
|
||||
## Fallback
|
||||
|
||||
In case you run into any major issue you can always switch back to your initial venv.
|
||||
In case you run into any major issue, you can always switch back to your initial venv.
|
||||
|
||||
Before you start double-check that you still have your old venv for auth:
|
||||
|
||||
@@ -271,7 +271,7 @@ Before you start double-check that you still have your old venv for auth:
|
||||
ls /home/allianceserver/venv/auth /home/allianceserver/venv
|
||||
```
|
||||
|
||||
If the output shows these two folders you should be safe to proceed:
|
||||
If the output shows these two folders, you should be safe to proceed:
|
||||
|
||||
- `auth`
|
||||
- `auth_old`
|
||||
|
||||
Reference in New Issue
Block a user