mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2026-02-04 22:26:19 +01:00
Merge branch 'v5.x' of gitlab.com:allianceauth/allianceauth into djangomumble
This commit is contained in:
BIN
docs/_static/images/promotion/SampleInstallation-Darkly.png
vendored
Normal file
BIN
docs/_static/images/promotion/SampleInstallation-Darkly.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 206 KiB |
BIN
docs/_static/images/promotion/SampleInstallation-Flatly.png
vendored
Normal file
BIN
docs/_static/images/promotion/SampleInstallation-Flatly.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 206 KiB |
@@ -12,9 +12,11 @@
|
||||
#
|
||||
import os
|
||||
import sys
|
||||
import django
|
||||
|
||||
import sphinx_rtd_theme # noqa
|
||||
|
||||
import django
|
||||
|
||||
sys.path.insert(0, os.path.abspath('..'))
|
||||
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings_all'
|
||||
django.setup()
|
||||
|
||||
@@ -22,7 +22,7 @@ Within your auth project exists two folders named `static` and `templates`. Thes
|
||||
|
||||
You can add extra static or templates by putting files in these folders. Note that changes to static require running the `python manage.py collectstatic` command to copy to the web server directory.
|
||||
|
||||
It is possible to overload static and templates shipped with Django or Alliance Auth by including a file with the exact path of the one you wish to overload. For instance if you wish to add extra links to the menu bar by editing the template, you would make a copy of the `allianceauth/templates/allianceauth/base-bs5.html` (Bootstrap 5) `allianceauth/templates/allianceauth/base.html` (Legacy BS3) file to `myauth/templates/allianceauth/*.html` and edit it there. Notice the paths are identical after the `templates/` directory - this is critical for it to be recognized. Your custom template would be used instead of the one included with Alliance Auth when Django renders the web page. Similar idea for static: put CSS or images at an identical path after the `static/` directory and they will be copied to the web server directory instead of the ones included.
|
||||
It is possible to overload static and templates shipped with Django or Alliance Auth by including a file with the exact path of the one you wish to overload. For instance if you wish to add extra links to the menu bar by editing the template, you would make a copy of the `allianceauth/templates/allianceauth/base-bs5.html` file to `myauth/templates/allianceauth/*.html` and edit it there. Notice the paths are identical after the `templates/` directory - this is critical for it to be recognized. Your custom template would be used instead of the one included with Alliance Auth when Django renders the web page. Similar idea for static: put CSS or images at an identical path after the `static/` directory and they will be copied to the web server directory instead of the ones included.
|
||||
|
||||
## Custom URLs and Views
|
||||
|
||||
|
||||
53
docs/development/custom/app-announcement-hooks.md
Normal file
53
docs/development/custom/app-announcement-hooks.md
Normal file
@@ -0,0 +1,53 @@
|
||||
# Announcement Hooks
|
||||
|
||||
This hook allows the issues opened on your application repository to be displayed on the alliance auth front page to
|
||||
administrators.
|
||||
|
||||

|
||||
|
||||
To register an AppAnnouncementHook class, you would do the following:
|
||||
|
||||
```python
|
||||
from allianceauth import hooks
|
||||
from allianceauth.services.hooks import AppAnnouncementHook
|
||||
|
||||
|
||||
@hooks.register('app_announcement_hook')
|
||||
def announcement_hook():
|
||||
return AppAnnouncementHook("Your app name", "USERNAME/REPOSITORY_NAME", AppAnnouncementHook.Service.GITLAB)
|
||||
```
|
||||
|
||||
```{eval-rst}
|
||||
.. autoclass:: allianceauth.services.hooks.AppAnnouncementHook
|
||||
:members: __init__
|
||||
:undoc-members:
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
### app_name
|
||||
|
||||
The name of your application.
|
||||
|
||||
### repository_namespace
|
||||
|
||||
Here you should enter the namespace of your repository.
|
||||
The structure stays the same for both GitHub and GitLab repositories. \
|
||||
A repository with the url `https://gitlab.com/username/appname` will have a namespace of `username/appname`.
|
||||
|
||||
### Service
|
||||
|
||||
This variable is an enumeration of the class `AppAnnouncemementHook.Service`
|
||||
|
||||
It is mandatory to specify this variable so alliance auth contacts the correct API when fetching your repository issues.
|
||||
|
||||
```{eval-rst}
|
||||
.. autoclass:: allianceauth.services.hooks.AppAnnouncementHook.Service
|
||||
:members: GITLAB, GITHUB
|
||||
:undoc-members:
|
||||
```
|
||||
|
||||
### label
|
||||
|
||||
The label that will determine if issues should be seen as an announcement.
|
||||
This value is case-sensitive and the default value is `"announcement"`.
|
||||
@@ -43,7 +43,7 @@ if the `EveCharacter` has no user.
|
||||
|
||||
### get_all_characters_from_user
|
||||
|
||||
This is to get all character objects (`EveCharacter`) of a user.
|
||||
This is to get all character objects (`EveCharacter`) of a user (alphabetically sorted).
|
||||
|
||||
Given we have a `User` object called `my_user` and we want to get all characters:
|
||||
|
||||
@@ -51,12 +51,16 @@ Given we have a `User` object called `my_user` and we want to get all characters
|
||||
# Alliance Auth
|
||||
from allianceauth.framework.api.user import get_all_characters_from_user
|
||||
|
||||
characters = get_all_characters_from_user(user=my_user)
|
||||
characters = get_all_characters_from_user(user=my_user, main_first=False)
|
||||
```
|
||||
|
||||
Now, `characters` is a `list` containing all `EveCharacter` objects of the user.
|
||||
If the user is `None`, an empty `list` will be returned.
|
||||
|
||||
The second parameter `main_first` is optional and defaults to `False`.
|
||||
If set to `True`, the function will return the main character as the first
|
||||
item in the list of characters.
|
||||
|
||||
### get_main_character_from_user
|
||||
|
||||
This is to get the main character object (`EveCharacter`) of a user.
|
||||
|
||||
BIN
docs/development/custom/img/app_announcement_hook_example.png
Executable file
BIN
docs/development/custom/img/app_announcement_hook_example.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
@@ -8,6 +8,7 @@ This section describes how to extend **Alliance Auth** with custom apps, service
|
||||
integrating-services
|
||||
menu-hooks
|
||||
url-hooks
|
||||
app-announcement-hooks
|
||||
logging
|
||||
custom-themes
|
||||
aa-framework
|
||||
|
||||
@@ -67,13 +67,13 @@ sudo apt-get install gettext
|
||||
Next, we need to install Python and related development tools.
|
||||
|
||||
:::{note}
|
||||
Should your Ubuntu come with a newer version of Python we recommend to still set up your dev environment with the oldest Python 3 version currently supported by AA (e.g., Python 3.8 at this time of writing) to ensure your apps are compatible with all current AA installations
|
||||
Should your Ubuntu come with a newer version of Python we recommend to still set up your dev environment with the oldest Python 3 version currently supported by AA (e.g., Python 3.10 at this time of writing) to ensure your apps are compatible with all current AA installations
|
||||
You can check out this `page <https://askubuntu.com/questions/682869/how-do-i-install-a-different-python-version-using-apt-get/1195153>`_ on how to install additional Python versions on Ubuntu.
|
||||
|
||||
If you install a different python version from the default, you need to adjust some commands below to install appopriate versions of those packages, for example, using Python 3.8 you might need to run the following after using the setup steps for the repository mentioned in the AskUbuntu post above:
|
||||
If you install a different python version from the default, you need to adjust some commands below to install appopriate versions of those packages, for example, using Python 3.10 you might need to run the following after using the setup steps for the repository mentioned in the AskUbuntu post above:
|
||||
|
||||
```shell
|
||||
sudo apt-get install python3.8 python3.8-dev python3.8-venv python3-setuptools python3-pip python-pip
|
||||
sudo apt-get install python3.10 python3.10-dev python3.10-venv python3-setuptools python3-pip python-pip
|
||||
```
|
||||
|
||||
:::
|
||||
|
||||
@@ -81,7 +81,7 @@ Example implementation for a celery chain:
|
||||
|
||||
```python
|
||||
from allianceauth.services.hooks import get_extension_logger
|
||||
from celery import shared_task, chain
|
||||
from celery import shared_task, group
|
||||
|
||||
logger = get_extension_logger(__name__)
|
||||
|
||||
@@ -98,18 +98,23 @@ def long_runner():
|
||||
task_signature = example.si()
|
||||
my_tasks.append(task_signature)
|
||||
|
||||
chain(my_tasks).delay()
|
||||
group(my_tasks).delay()
|
||||
```
|
||||
|
||||
In this example, we first add 10 example tasks that need to run one after the other to a list. This can be done by creating a so-called signature for a task. Those signatures are a kind of wrapper for tasks and can be used in various ways to compose work flow for tasks.
|
||||
|
||||
The list of task signatures is then converted to a chain and started asynchronously.
|
||||
|
||||
:::{note}
|
||||
In this example we import group to execute all tasks independently.
|
||||
If you wish to run them in order (and stop if a tasks fail) you can use `celery.chain` instead of `celery.group`
|
||||
|
||||
For more information on signature and work flows see the official documentation on [Canvas](https://docs.celeryproject.org/en/latest/userguide/canvas.html).
|
||||
:::
|
||||
|
||||
:::{hint}
|
||||
In our example we use ``si()``, which is a shortcut for "immutable signatures" and prevents us from having to deal with result sharing between tasks.
|
||||
|
||||
For more information on signature and work flows see the official documentation on `Canvas <https://docs.celeryproject.org/en/latest/userguide/canvas.html>`_.
|
||||
|
||||
In this context, please note that Alliance Auth currently only supports chaining because all other variants require a so-called results back, which Alliance Auth does not have.
|
||||
:::
|
||||
|
||||
@@ -123,6 +128,7 @@ Example setting:
|
||||
CELERYBEAT_SCHEDULE['structures_update_all_structures'] = {
|
||||
'task': 'structures.tasks.update_all_structures',
|
||||
'schedule': crontab(minute='*/30'),
|
||||
'apply_offset': True,
|
||||
}
|
||||
```
|
||||
|
||||
@@ -130,6 +136,7 @@ CELERYBEAT_SCHEDULE['structures_update_all_structures'] = {
|
||||
|
||||
- `'task'`: Name of your task (full path)
|
||||
- `'schedule'`: Schedule definition (see Celery documentation on [Periodic Tasks](https://docs.celeryproject.org/en/latest/userguide/periodic-tasks.html) for details)
|
||||
- `'apply_offset'`: Boolean, Apply a Delay unique to the install, in order to reduce impact on ESI. See [Apply Offset](#apply-offset)
|
||||
|
||||
## How can I use priorities for tasks?
|
||||
|
||||
@@ -168,6 +175,94 @@ example.apply_async(priority=3)
|
||||
For defining a priority to tasks, you cannot use the convenient shortcut ``delay()``, but instead need to start a task with ``apply_async()``, which also requires you to pass parameters to your task function differently. Please check out the `official docs <https://docs.celeryproject.org/en/stable/reference/celery.app.task.html#celery.app.task.Task.apply_async>`_ for details.
|
||||
:::
|
||||
|
||||
## Rate-Limiting and Smoothing of Task Execution
|
||||
|
||||
Large numbers of installs running the same crontab (ie. `0 * * * *`) can all slam an external service at the same time.
|
||||
|
||||
Consider Artificially smoothing out your tasks with a few methods
|
||||
|
||||
### Apply Offset
|
||||
|
||||
`allianceauth.crontab` contains a series of Offsets stored in the DB that are both static for an install, but random across all AA installs.
|
||||
|
||||
This enables us to spread our load on ESI (or other external resources) across a greater window, making it unlikely that two installs will hit ESI at the same time.
|
||||
|
||||
Tasks defined in local.py, can have `'apply_offset': True` added to their Task Definition
|
||||
|
||||
```python
|
||||
CELERYBEAT_SCHEDULE['taskname'] = {
|
||||
'task': 'module.tasks.task',
|
||||
'schedule': crontab(minute='*/30'),
|
||||
'apply_offset': True,
|
||||
}
|
||||
```
|
||||
|
||||
Tasks added to directly to Django Celery Beat Models (Using a Management Task etc) can pass their Cron Schedule through offset_cron(crontab)
|
||||
|
||||
```{eval-rst}
|
||||
.. automodule:: allianceauth.crontab.utils
|
||||
:members:
|
||||
:undoc-members:
|
||||
```
|
||||
|
||||
```python
|
||||
from django_celery_beat.models import CrontabSchedule, PeriodicTask
|
||||
from celery.schedules import crontab
|
||||
|
||||
schedule = CrontabSchedule.from_schedule(offset_cron(crontab(minute='0', hour='0')))
|
||||
|
||||
schedule, created = CrontabSchedule.objects.get_or_create(
|
||||
minute=schedule.minute,
|
||||
hour=schedule.hour,
|
||||
day_of_month=schedule.day_of_month,
|
||||
month_of_year=schedule.month_of_year,
|
||||
day_of_week=schedule.day_of_week,
|
||||
timezone=schedule.timezone,
|
||||
)
|
||||
|
||||
PeriodicTask.objects.update_or_create(
|
||||
task='module.tasks.task',
|
||||
defaults={
|
||||
'crontab': schedule,
|
||||
'name': 'task name',
|
||||
'enabled': True
|
||||
}
|
||||
)
|
||||
```
|
||||
|
||||
### Subset Tasks
|
||||
|
||||
Slice your tasks needed up into more manageable chunks and run them more often. 1/10th of your tasks run 10x more often will return the same end result with less peak loads on external services and your task queue.
|
||||
|
||||
### Celery ETA/Countdown
|
||||
|
||||
Scatter your tasks across a larger window using <https://docs.celeryq.dev/en/latest/userguide/calling.html#eta-and-countdown>
|
||||
|
||||
This example will queue up tasks across the next 10 minutes, trickling them into your workers (and the external service)
|
||||
|
||||
```python
|
||||
for corp in EveCorporationInfo.objects.all().values('corporation_id'):
|
||||
update_corp.apply_async(args=[corp['corporation_id']], priority=TASK_PRIORITY)
|
||||
update_corp.apply_async(
|
||||
args=[corp['corporation_id']],
|
||||
priority=TASK_PRIORITY,
|
||||
countdown=randint(1, 600))
|
||||
```
|
||||
|
||||
### Celery Rate Limits
|
||||
|
||||
Celery Rate Limits come with a small catch, its _per worker_, you may have to be either very conservative or have these configurable by the end user if they varied their worker count.
|
||||
|
||||
<https://docs.celeryq.dev/en/latest/userguide/tasks.html#Task.rate_limit>
|
||||
|
||||
This example of 10 Tasks per Minute will result in ~100 tasks per minute at 10 Workers
|
||||
|
||||
```python
|
||||
@shared_task(rate_limit="10/m")
|
||||
def update_charactercorporationhistory(character_id: int) -> None:
|
||||
"""Update CharacterCorporationHistory models from ESI"""
|
||||
```
|
||||
|
||||
## What special features should I be aware of?
|
||||
|
||||
Every Alliance Auth installation will come with a couple of special celery related features "out-of-the-box" that you can make use of in your apps.
|
||||
@@ -176,14 +271,14 @@ Every Alliance Auth installation will come with a couple of special celery relat
|
||||
|
||||
Celery-once is a celery extension "that allows you to prevent multiple execution and queuing of celery tasks". What that means is that you can ensure that only one instance of a celery task runs at any given time. This can be useful, for example, if you do not want multiple instances of your task to talk to the same external service at the same time.
|
||||
|
||||
We use a custom backend for celery_once in Alliance Auth defined [here](https://gitlab.com/allianceauth/allianceauth/-/blob/master/allianceauth/services/tasks.py#L14)
|
||||
We use a custom backend for celery_once in Alliance Auth defined [allianceauth.services.tasks.celery_once](https://gitlab.com/allianceauth/allianceauth/-/blob/master/allianceauth/services/tasks.py#L14)
|
||||
You can import it for use like so:
|
||||
|
||||
```python
|
||||
from allianceauth.services.tasks import QueueOnce
|
||||
```
|
||||
|
||||
An example of Alliance Auth's use within the `@sharedtask` decorator, can be seen [here](https://gitlab.com/allianceauth/allianceauth/-/blob/master/allianceauth/services/modules/discord/tasks.py#L62) in the discord module
|
||||
An example of Alliance Auth's use within the `@sharedtask` decorator, can be seen in [allianceauth.services.modules.discord.tasks](https://gitlab.com/allianceauth/allianceauth/-/blob/master/allianceauth/services/modules/discord/tasks.py#L62) in the discord module
|
||||
You can use it like so:
|
||||
|
||||
```python
|
||||
@@ -192,6 +287,6 @@ You can use it like so:
|
||||
|
||||
Please see the [official documentation](https://pypi.org/project/celery_once/) of celery-once for details.
|
||||
|
||||
### task priorities
|
||||
### Task Priorities
|
||||
|
||||
Alliance Auth is using task priorities to enable priority-based scheduling of task execution. Please see [How can I use priorities for tasks?](#how-can-i-use-priorities-for-tasks) for details.
|
||||
|
||||
@@ -40,10 +40,10 @@ To use and administer this feature, users will require some of the following.
|
||||
+----------------------+------------------+------------------------------------------------------------+
|
||||
| Permission | Admin Site | Auth Site |
|
||||
+======================+==================+============================================================+
|
||||
| auth.access_srp | None | Can create an SRP request from a fleet |
|
||||
| srp.access_srp | None | Can create an SRP request from a fleet |
|
||||
+----------------------+------------------+------------------------------------------------------------+
|
||||
| auth.srp_management | None | Can Approve and Deny SRP requests, Can create an SRP Fleet |
|
||||
+----------------------+------------------+------------------------------------------------------------+
|
||||
| srp.add_srpfleetmain | Can Add Model | Can Create an SRP Fleet |
|
||||
| srp.add_srpfleetmain | None | Can Create an SRP Fleet |
|
||||
+----------------------+------------------+------------------------------------------------------------+
|
||||
```
|
||||
|
||||
@@ -27,6 +27,7 @@ Analytics comes preloaded with our Google Analytics token, and the three types o
|
||||
Our Daily Stats contain the following:
|
||||
|
||||
- A phone-in task to identify a server's existence
|
||||
- A phone-in task to identify if a server is Bare-Metal or Dockerized
|
||||
- A task to send the Number of User models
|
||||
- A task to send the Number of Token Models
|
||||
- A task to send the Number of Installed Apps
|
||||
|
||||
@@ -25,6 +25,15 @@ INSTALLED_APPS += [
|
||||
MUMBLE_URL = "mumble.example.com"
|
||||
```
|
||||
|
||||
Add the following lines to your `.env` file
|
||||
|
||||
```bash
|
||||
# Mumble
|
||||
MUMBLE_SUPERUSER_PASSWORD = superuser_password
|
||||
MUMBLE_ICESECRETWRITE = icesecretwrite
|
||||
MUMBLE_SERVERPASSWORD = serverpassword
|
||||
```
|
||||
|
||||
Finally, restart your stack and run migrations
|
||||
|
||||
```shell
|
||||
|
||||
@@ -17,14 +17,14 @@ This guide is currently for Ubuntu only.
|
||||
The mumble server package can be retrieved from a repository, which we need to add:
|
||||
|
||||
::::{tabs}
|
||||
:::{group-tab} Ubuntu 2004, 2204, 2404
|
||||
:::{group-tab} Ubuntu 2204, 2404
|
||||
|
||||
```shell
|
||||
sudo apt-add-repository ppa:mumble/release
|
||||
```
|
||||
|
||||
:::
|
||||
:::{group-tab} CentOS 7, Stream 8, Stream 9
|
||||
:::{group-tab} CentOS Stream 9, 10
|
||||
|
||||
sudo yum install epel-release
|
||||
sudo yum update
|
||||
@@ -35,14 +35,14 @@ sudo yum update
|
||||
Now three packages need to be installed:
|
||||
|
||||
::::{tabs}
|
||||
:::{group-tab} Ubuntu 2004, 2204, 2404
|
||||
:::{group-tab} Ubuntu 2204, 2404
|
||||
|
||||
```shell
|
||||
sudo apt-get install software-properties-common mumble-server libqt5sql5-mysql
|
||||
```
|
||||
|
||||
:::
|
||||
:::{group-tab} CentOS 7, Stream 8, Stream 9
|
||||
:::{group-tab} CentOS Stream 9, 10
|
||||
|
||||
sudo yum install mumble-server
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ BROADCAST_SERVICE_NAME = "broadcast"
|
||||
|
||||
Add the following lines to your `.env` file
|
||||
|
||||
```env
|
||||
```bash
|
||||
# Openfire
|
||||
OPENFIRE_SECRET_KEY = superuser_password
|
||||
BROADCAST_USER_PASSWORD = icesecretwrite
|
||||
|
||||
@@ -24,28 +24,14 @@ BROADCAST_SERVICE_NAME = "broadcast"
|
||||
Openfire require a Java 8 runtime environment.
|
||||
|
||||
::::{tabs}
|
||||
:::{group-tab} Ubuntu 2004, 2204
|
||||
:::{group-tab} Ubuntu 2204, 2404
|
||||
|
||||
```shell
|
||||
sudo apt-get install openjdk-11-jre
|
||||
```
|
||||
|
||||
:::
|
||||
:::{group-tab} CentOS 7
|
||||
|
||||
```shell
|
||||
sudo yum install java-11-openjdk java-11-openjdk-devel
|
||||
```
|
||||
|
||||
:::
|
||||
:::{group-tab} CentOS Stream 8
|
||||
|
||||
```shell
|
||||
sudo dnf install java-11-openjdk java-11-openjdk-devel
|
||||
```
|
||||
|
||||
:::
|
||||
:::{group-tab} CentOS Stream 9
|
||||
:::{group-tab} CentOS Stream 9, 10
|
||||
|
||||
```shell
|
||||
sudo dnf install java-11-openjdk java-11-openjdk-devel
|
||||
@@ -73,18 +59,10 @@ cd ~
|
||||
Download and install the package, replacing the URL with the latest you got from the Openfire download page earlier
|
||||
|
||||
::::{tabs}
|
||||
:::{group-tab} Ubuntu 2004, 2204
|
||||
:::{group-tab} Ubuntu 2204, 2404
|
||||
|
||||
:::
|
||||
:::{group-tab} CentOS 7
|
||||
wget <https://www.igniterealtime.org/downloadServlet?filename=openfire/openfire_4.7.2_all.deb>
|
||||
dpkg -i openfire_4.7.2_all.deb
|
||||
:::
|
||||
:::{group-tab} CentOS Stream 8
|
||||
wget <https://www.igniterealtime.org/downloadServlet?filename=openfire/openfire-4.7.2-1.noarch.rpm>
|
||||
yum install -y openfire-4.7.2-1.noarch.rpm
|
||||
:::
|
||||
:::{group-tab} CentOS Stream 9
|
||||
:::{group-tab} CentOS Stream 9, 10
|
||||
wget <https://www.igniterealtime.org/downloadServlet?filename=openfire/openfire-4.7.2-1.noarch.rpm>
|
||||
yum install -y openfire-4.7.2-1.noarch.rpm
|
||||
:::
|
||||
|
||||
@@ -34,7 +34,7 @@ CELERYBEAT_SCHEDULE['run_ts3_group_update'] = {
|
||||
|
||||
- Add the following lines to your `.env` file
|
||||
|
||||
```env
|
||||
```bash
|
||||
# Temspeak
|
||||
TEAMSPEAK3_SERVERQUERY_USER = "serverquery"
|
||||
TEAMSPEAK3_SERVERQUERY_PASSWORD = ""
|
||||
|
||||
@@ -17,7 +17,7 @@ If at any point `docker compose` does not work, but `docker-compose` does, you h
|
||||
1. run `bash <(curl -s https://gitlab.com/allianceauth/allianceauth/-/raw/master/docker/scripts/download.sh)`. This will download all the files you need to install Alliance Auth and place them in a directory named `aa-docker`. Feel free to rename/move this folder.
|
||||
1. run `./scripts/prepare-env.sh` to set up your environment
|
||||
1. (optional) Change `PROTOCOL` to `http://` if not using SSL in `.env`
|
||||
1. run `docker compose --env-file=.env up -d` (NOTE: if this command hangs, follow the instructions [here](https://www.digitalocean.com/community/tutorials/how-to-setup-additional-entropy-for-cloud-servers-using-haveged))
|
||||
1. run `docker compose --env-file=.env up -d` (NOTE: if this command hangs, follow the instructions on [How to Setup Entropy](https://www.digitalocean.com/community/tutorials/how-to-setup-additional-entropy-for-cloud-servers-using-haveged))
|
||||
1. run `docker compose exec allianceauth_gunicorn bash` to open up a terminal inside an auth container
|
||||
1. run `auth migrate`
|
||||
1. run `auth collectstatic`
|
||||
|
||||
@@ -29,7 +29,7 @@ Replace your docker-compose.yml with the contents of <https://gitlab.com/allianc
|
||||
|
||||
V3.x installs likely used a dedicated database for Nginx Proxy Manager, you can either setup NPM again without a database, or uncomment the sections noted to maintain this configuration
|
||||
|
||||
```docker-compose
|
||||
```docker
|
||||
proxy:
|
||||
...
|
||||
# Uncomment this section to use a dedicated database for Nginx Proxy Manager
|
||||
@@ -64,7 +64,7 @@ V3.x installs likely used a dedicated database for Nginx Proxy Manager, you can
|
||||
|
||||
You will need to add some entries to your .env file
|
||||
|
||||
```env
|
||||
```bash
|
||||
AA_DB_CHARSET=utf8mb4
|
||||
GF_SECURITY_ADMIN_USERNAME=admin
|
||||
```
|
||||
|
||||
@@ -14,11 +14,10 @@ Alliance Auth can be installed on any in-support *nix operating system.
|
||||
|
||||
Our install documentation targets the following operating systems.
|
||||
|
||||
- Ubuntu 20.04 - Not Recommended for new installs
|
||||
- Ubuntu 22.04
|
||||
- Centos 7
|
||||
- CentOS Stream 8
|
||||
- Ubuntu 22.04 (New installs please use 2404)
|
||||
- Ubutnu 24.04
|
||||
- CentOS Stream 9
|
||||
- CentOS Stream 10
|
||||
|
||||
To install on your favorite flavour of Linux, identify and install equivalent packages to the ones listed here.
|
||||
|
||||
@@ -27,7 +26,7 @@ To install on your favorite flavour of Linux, identify and install equivalent pa
|
||||
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, 2404
|
||||
:::{group-tab} Ubuntu 2204, 2404
|
||||
|
||||
```shell
|
||||
sudo apt-get update
|
||||
@@ -36,24 +35,7 @@ sudo do-dist-upgrade
|
||||
```
|
||||
|
||||
:::
|
||||
:::{group-tab} CentOS 7
|
||||
|
||||
```shell
|
||||
yum install epel-release
|
||||
sudo yum upgrade
|
||||
```
|
||||
|
||||
:::
|
||||
:::{group-tab} CentOS Stream 8
|
||||
|
||||
```shell
|
||||
sudo dnf config-manager --set-enabled powertools
|
||||
sudo dnf install epel-release epel-next-release
|
||||
sudo yum upgrade
|
||||
```
|
||||
|
||||
:::
|
||||
:::{group-tab} CentOS Stream 9
|
||||
:::{group-tab} CentOS Stream 9, 10
|
||||
|
||||
```shell
|
||||
sudo dnf config-manager --set-enabled crb
|
||||
@@ -66,58 +48,33 @@ sudo yum upgrade
|
||||
|
||||
### Python
|
||||
|
||||
Install Python 3.11 and related tools on your system.
|
||||
Install Python 3.12 and related tools on your system.
|
||||
|
||||
::::{tabs}
|
||||
|
||||
:::{group-tab} Ubuntu 2004, 2204, 2404
|
||||
:::{group-tab} Ubuntu 2204
|
||||
|
||||
```shell
|
||||
sudo add-apt-repository ppa:deadsnakes/ppa
|
||||
sudo apt-get update
|
||||
sudo apt-get install python3.11 python3.11-dev python3.11-venv
|
||||
sudo apt-get install python3.12 python3.12-dev python3.12-venv
|
||||
```
|
||||
|
||||
:::
|
||||
:::{group-tab} CentOS 7
|
||||
We need to build Python from source
|
||||
:::{group-tab} Ubuntu 2404
|
||||
|
||||
```bash
|
||||
cd ~
|
||||
sudo yum install gcc openssl-devel bzip2-devel libffi-devel wget
|
||||
wget https://www.python.org/ftp/python/3.11.7/Python-3.11.7.tgz
|
||||
tar xvf Python-3.11.7.tgz
|
||||
cd Python-3.11.7/
|
||||
./configure --enable-optimizations --enable-shared
|
||||
sudo make altinstall
|
||||
```shell
|
||||
sudo add-apt-repository ppa:deadsnakes/ppa
|
||||
sudo apt-get update
|
||||
sudo apt-get install python3.12 python3.12-dev python3.12-venv
|
||||
```
|
||||
|
||||
:::
|
||||
:::{group-tab} CentOS Stream 8
|
||||
We need to build Python from source
|
||||
:::{group-tab} CentOS Stream 9, 10
|
||||
|
||||
```bash
|
||||
cd ~
|
||||
sudo yum install gcc openssl-devel bzip2-devel libffi-devel wget
|
||||
wget https://www.python.org/ftp/python/3.11.7/Python-3.11.7.tgz
|
||||
tar xvf Python-3.11.7.tgz
|
||||
cd Python-3.11.7/
|
||||
./configure --enable-optimizations --enable-shared
|
||||
sudo make altinstall
|
||||
```
|
||||
sudo dnf update
|
||||
sudo dnf install python3.12 python3.12-dev python3.12-venv
|
||||
|
||||
:::
|
||||
:::{group-tab} CentOS Stream 9
|
||||
We need to build Python from source
|
||||
|
||||
```bash
|
||||
cd ~
|
||||
sudo yum install gcc openssl-devel bzip2-devel libffi-devel wget
|
||||
wget https://www.python.org/ftp/python/3.11.7/Python-3.11.7.tgz
|
||||
tar xvf Python-3.11.7.tgz
|
||||
cd Python-3.11.7/
|
||||
./configure --enable-optimizations --enable-shared
|
||||
sudo make altinstall
|
||||
```
|
||||
|
||||
:::
|
||||
@@ -128,32 +85,24 @@ sudo make altinstall
|
||||
It's recommended to use a database service instead of SQLite. Many options are available, but this guide will use MariaDB 10.11
|
||||
|
||||
::::{tabs}
|
||||
:::{group-tab} Ubuntu 2004, 2204, 2404
|
||||
Follow the instructions at <https://mariadb.org/download/?t=repo-config&d=20.04+%22focal%22&v=10.11&r_m=osuosl> to add the MariaDB repository to your host.
|
||||
:::{group-tab} Ubuntu 2204
|
||||
Follow the instructions at <https://mariadb.org/download/?t=repo-config&d=22.04+%22noble%22&v=11.4> to add the MariaDB repository to your host.
|
||||
|
||||
```shell
|
||||
sudo apt-get install mariadb-server mariadb-client libmysqlclient-dev
|
||||
```
|
||||
|
||||
:::
|
||||
:::{group-tab} CentOS 7
|
||||
Follow the instructions at <https://mariadb.org/download/?t=repo-config&d=CentOS+7&v=10.11&r_m=osuosl> to add the MariaDB repository to your host.
|
||||
:::{group-tab} Ubuntu 2404
|
||||
Follow the instructions at <https://mariadb.org/download/?t=repo-config&d=24.04+%22noble%22&v=11.4> to add the MariaDB repository to your host.
|
||||
|
||||
```shell
|
||||
sudo yum install MariaDB-server MariaDB-client MariaDB-devel MariaDB-shared
|
||||
sudo apt-get install mariadb-server mariadb-client libmysqlclient-dev
|
||||
```
|
||||
|
||||
:::
|
||||
:::{group-tab} CentOS Stream 8
|
||||
Follow the instructions at <https://mariadb.org/download/?t=repo-config&d=CentOS+Stream&v=10.11&r_m=osuosl> to add the MariaDB repository to your host.
|
||||
|
||||
```shell
|
||||
sudo dnf install mariadb mariadb-server mariadb-devel
|
||||
```
|
||||
|
||||
:::
|
||||
:::{group-tab} CentOS Stream 9
|
||||
Follow the instructions at <https://mariadb.org/download/?t=repo-config&d=CentOS+Stream&v=10.11&r_m=osuosl> to add the MariaDB repository to your host.
|
||||
:::{group-tab} CentOS Stream 9, 10
|
||||
Follow the instructions at <https://mariadb.org/download/?t=repo-config&d=CentOS+Stream&v=11.4> to add the MariaDB repository to your host.
|
||||
|
||||
```shell
|
||||
sudo dnf install mariadb mariadb-server mariadb-devel
|
||||
@@ -164,16 +113,10 @@ sudo dnf install mariadb mariadb-server mariadb-devel
|
||||
|
||||
:::::{important}
|
||||
::::{tabs}
|
||||
:::{group-tab} Ubuntu 2004, 2204, 2404
|
||||
:::{group-tab} Ubuntu 2204, 2404
|
||||
If you don't plan on running the database on the same server as auth you still need to install the `libmysqlclient-dev` package
|
||||
:::
|
||||
:::{group-tab} CentOS 7
|
||||
If you don't plan on running the database on the same server as auth you still need to install the `mariadb-devel` package
|
||||
:::
|
||||
:::{group-tab} CentOS Stream 8
|
||||
If you don't plan on running the database on the same server as auth you still need to install the `mariadb-devel` package
|
||||
:::
|
||||
:::{group-tab} CentOS Stream 9
|
||||
:::{group-tab} CentOS Stream 9, 10
|
||||
If you don't plan on running the database on the same server as auth you still need to install the `mariadb-devel` package
|
||||
:::
|
||||
::::
|
||||
@@ -185,9 +128,10 @@ A few extra utilities are also required for the installation of packages.
|
||||
|
||||
::::{tabs}
|
||||
|
||||
:::{group-tab} Ubuntu 2004, 2204, 2404
|
||||
:::{group-tab} Ubuntu 2204, 2404
|
||||
|
||||
```shell
|
||||
sudo apt-get install lsb-release curl gpg
|
||||
curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
|
||||
sudo chmod 644 /usr/share/keyrings/redis-archive-keyring.gpg
|
||||
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list
|
||||
@@ -195,32 +139,13 @@ sudo apt-get update
|
||||
sudo apt-get install unzip git redis-server curl libssl-dev libbz2-dev libffi-dev build-essential pkg-config
|
||||
```
|
||||
|
||||
:::
|
||||
:::{group-tab} CentOS 7
|
||||
|
||||
```shell
|
||||
sudo yum install gcc gcc-c++ unzip git redis curl bzip2-devel openssl-devel libffi-devel wget pkg-config
|
||||
```
|
||||
|
||||
```shell
|
||||
sudo systemctl enable redis.service
|
||||
sudo systemctl start redis.service
|
||||
sudo systemctl enable redis-server
|
||||
sudo systemctl start redis-server
|
||||
```
|
||||
|
||||
:::
|
||||
:::{group-tab} CentOS Stream 8
|
||||
|
||||
```shell
|
||||
sudo dnf install gcc gcc-c++ unzip git redis curl bzip2-devel openssl-devel libffi-devel wget
|
||||
```
|
||||
|
||||
```shell
|
||||
sudo systemctl enable redis.service
|
||||
sudo systemctl start redis.service
|
||||
```
|
||||
|
||||
:::
|
||||
:::{group-tab} CentOS Stream 9
|
||||
:::{group-tab} CentOS Stream 9, 10
|
||||
|
||||
```shell
|
||||
sudo dnf install gcc gcc-c++ unzip git redis curl bzip2-devel openssl-devel libffi-devel wget
|
||||
@@ -282,28 +207,15 @@ mysql_secure_installation
|
||||
For security and permissions, it's highly recommended you create a separate user to install auth under. Do not log in as this account.
|
||||
::::{tabs}
|
||||
|
||||
:::{group-tab} Ubuntu 2004, 2204, 2404
|
||||
:::{group-tab} Ubuntu 2204, 2404
|
||||
|
||||
```shell
|
||||
sudo adduser --disabled-login allianceserver --shell /bin/bash
|
||||
```
|
||||
|
||||
:::
|
||||
:::{group-tab} CentOS 7
|
||||
|
||||
```shell
|
||||
sudo passwd -l allianceserver
|
||||
```
|
||||
|
||||
:::
|
||||
:::{group-tab} CentOS Stream 8
|
||||
|
||||
```shell
|
||||
sudo passwd -l allianceserver
|
||||
```
|
||||
|
||||
:::
|
||||
:::{group-tab} CentOS Stream 9
|
||||
:::{group-tab} CentOS Stream 9, 10
|
||||
|
||||
```shell
|
||||
sudo passwd -l allianceserver
|
||||
@@ -354,7 +266,7 @@ Your python3.x command/version may vary depending on your installed python versi
|
||||
:::
|
||||
|
||||
```shell
|
||||
python3.11 -m venv /home/allianceserver/venv/auth/
|
||||
python3.12 -m venv /home/allianceserver/venv/auth/
|
||||
```
|
||||
|
||||
:::{tip}
|
||||
@@ -497,44 +409,14 @@ exit
|
||||
|
||||
::::{tabs}
|
||||
|
||||
:::{group-tab} Ubuntu 2004, 2204, 2404
|
||||
:::{group-tab} Ubuntu 2204, 2404
|
||||
|
||||
```shell
|
||||
sudo apt-get install supervisor
|
||||
```
|
||||
|
||||
:::
|
||||
:::{group-tab} CentOS 7
|
||||
|
||||
```shell
|
||||
sudo dnf install supervisor
|
||||
```
|
||||
|
||||
```shell
|
||||
sudo systemctl enable supervisord.service
|
||||
```
|
||||
|
||||
```shell
|
||||
sudo systemctl start supervisord.service
|
||||
```
|
||||
|
||||
:::
|
||||
:::{group-tab} CentOS Stream 8
|
||||
|
||||
```shell
|
||||
sudo dnf install supervisor
|
||||
```
|
||||
|
||||
```shell
|
||||
sudo systemctl enable supervisord.service
|
||||
```
|
||||
|
||||
```shell
|
||||
sudo systemctl start supervisord.service
|
||||
```
|
||||
|
||||
:::
|
||||
:::{group-tab} CentOS Stream 9
|
||||
:::{group-tab} CentOS Stream 9, 10
|
||||
|
||||
```shell
|
||||
sudo dnf install supervisor
|
||||
@@ -554,28 +436,14 @@ sudo systemctl start supervisord.service
|
||||
Once installed, it needs a configuration file to know which processes to watch. Your Alliance Auth project comes with a ready-to-use template which will ensure the Celery workers, Celery task scheduler and Gunicorn are all running.
|
||||
::::{tabs}
|
||||
|
||||
:::{group-tab} Ubuntu 2004, 2204, 2404
|
||||
:::{group-tab} Ubuntu 2204, 2404
|
||||
|
||||
```shell
|
||||
ln -s /home/allianceserver/myauth/supervisor.conf /etc/supervisor/conf.d/myauth.conf
|
||||
```
|
||||
|
||||
:::
|
||||
:::{group-tab} CentOS 7
|
||||
|
||||
```shell
|
||||
sudo ln -s /home/allianceserver/myauth/supervisor.conf /etc/supervisord.d/myauth.ini
|
||||
```
|
||||
|
||||
:::
|
||||
:::{group-tab} CentOS Stream 8
|
||||
|
||||
```shell
|
||||
sudo ln -s /home/allianceserver/myauth/supervisor.conf /etc/supervisord.d/myauth.ini
|
||||
```
|
||||
|
||||
:::
|
||||
:::{group-tab} CentOS Stream 9
|
||||
:::{group-tab} CentOS Stream 9, 10
|
||||
|
||||
```shell
|
||||
sudo ln -s /home/allianceserver/myauth/supervisor.conf /etc/supervisord.d/myauth.ini
|
||||
|
||||
@@ -10,28 +10,14 @@ If you're using a small VPS to host services with very limited memory, consider
|
||||
|
||||
::::{tabs}
|
||||
|
||||
:::{group-tab} Ubuntu 2004, 2204, 2404
|
||||
:::{group-tab} Ubuntu 2204, 2404
|
||||
|
||||
```shell
|
||||
apt-get install apache2
|
||||
```
|
||||
|
||||
:::
|
||||
:::{group-tab} CentOS 7
|
||||
|
||||
```shell
|
||||
yum install httpd
|
||||
```
|
||||
|
||||
:::
|
||||
:::{group-tab} CentOS Stream 8
|
||||
|
||||
```shell
|
||||
dnf install httpd
|
||||
```
|
||||
|
||||
:::
|
||||
:::{group-tab} CentOS Stream 9
|
||||
:::{group-tab} CentOS Stream 9, 10
|
||||
|
||||
```shell
|
||||
systemctl enable httpd
|
||||
@@ -41,8 +27,6 @@ systemctl start httpd
|
||||
:::
|
||||
::::
|
||||
|
||||
CentOS 7, Stream 8, Stream 9
|
||||
|
||||
## Configuration
|
||||
|
||||
### Permissions
|
||||
@@ -50,28 +34,14 @@ CentOS 7, Stream 8, Stream 9
|
||||
Apache needs to be able to read the folder containing your auth project's static files.
|
||||
|
||||
::::{tabs}
|
||||
:::{group-tab} Ubuntu 2004, 2204, 2404
|
||||
:::{group-tab} Ubuntu 2204, 2404
|
||||
|
||||
```shell
|
||||
chown -R www-data:www-data /var/www/myauth/static
|
||||
```
|
||||
|
||||
:::
|
||||
:::{group-tab} CentOS 7
|
||||
|
||||
```shell
|
||||
chown -R apache:apache /var/www/myauth/static
|
||||
```
|
||||
|
||||
:::
|
||||
:::{group-tab} CentOS Stream 8
|
||||
|
||||
```shell
|
||||
chown -R apache:apache /var/www/myauth/static
|
||||
```
|
||||
|
||||
:::
|
||||
:::{group-tab} CentOS Stream 9
|
||||
:::{group-tab} CentOS Stream 9, 10
|
||||
|
||||
```shell
|
||||
chown -R apache:apache /var/www/myauth/static
|
||||
@@ -87,7 +57,7 @@ Apache serves sites through defined virtual hosts. These are located in `/etc/ap
|
||||
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, 2404
|
||||
:::{group-tab} Ubuntu 2204, 2404
|
||||
To proxy and modify headers a few mods need to be enabled.
|
||||
|
||||
```shell
|
||||
@@ -98,13 +68,7 @@ a2enmod headers
|
||||
|
||||
Create a new config file for auth e.g. `/etc/apache2/sites-available/myauth.conf` and fill out the virtual host configuration. To enable your config use `a2ensite myauth.conf` and then reload apache with `service apache2 reload`.
|
||||
:::
|
||||
:::{group-tab} CentOS 7
|
||||
Place your virtual host configuration in the appropriate section within `/etc/httpd/conf.d/httpd.conf` and restart the httpd service with `systemctl restart httpd`.
|
||||
:::
|
||||
:::{group-tab} CentOS Stream 8
|
||||
Place your virtual host configuration in the appropriate section within `/etc/httpd/conf.d/httpd.conf` and restart the httpd service with `systemctl restart httpd`.
|
||||
:::
|
||||
:::{group-tab} CentOS Stream 9
|
||||
:::{group-tab} CentOS Stream 9, 10
|
||||
Place your virtual host configuration in the appropriate section within `/etc/httpd/conf.d/httpd.conf` and restart the httpd service with `systemctl restart httpd`.
|
||||
:::
|
||||
::::
|
||||
@@ -122,7 +86,7 @@ a2dissite 000-default.conf
|
||||
|
||||
## Sample Config File
|
||||
|
||||
```ini
|
||||
```apacheconf
|
||||
<VirtualHost *:80>
|
||||
ServerName auth.example.com
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ 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 [How Many Workers](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.
|
||||
|
||||
|
||||
@@ -42,28 +42,14 @@ You will need to have [Gunicorn](gunicorn.md) or some other WSGI server setup fo
|
||||
## Install
|
||||
|
||||
::::{tabs}
|
||||
:::{group-tab} Ubuntu 2004, 2204, 2404
|
||||
:::{group-tab} Ubuntu 2204, 2404
|
||||
|
||||
```shell
|
||||
sudo apt-get install nginx
|
||||
```
|
||||
|
||||
:::
|
||||
:::{group-tab} CentOS 7
|
||||
|
||||
```shell
|
||||
sudo yum install nginx
|
||||
```
|
||||
|
||||
:::
|
||||
:::{group-tab} CentOS Stream 8
|
||||
|
||||
```shell
|
||||
sudo dnf install nginx
|
||||
```
|
||||
|
||||
:::
|
||||
:::{group-tab} CentOS Stream 9
|
||||
:::{group-tab} CentOS Stream 9, 10
|
||||
|
||||
```shell
|
||||
sudo dnf install nginx
|
||||
|
||||
@@ -14,62 +14,29 @@ To run AA with a newer Python 3 version than your system's default, you need to
|
||||
|
||||
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.
|
||||
|
||||
:::{note}
|
||||
Ubuntu 2204 ships with Python 3.10 already
|
||||
:::
|
||||
|
||||
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 necessary
|
||||
sudo dnf install python39 python39-devel
|
||||
:::
|
||||
|
||||
::::{tabs}
|
||||
:::{group-tab} Ubuntu 2004, 2204, 2404
|
||||
:::{group-tab} Ubuntu 2204, 2404
|
||||
|
||||
```shell
|
||||
sudo add-apt-repository ppa:deadsnakes/ppa
|
||||
sudo apt-get update
|
||||
sudo apt-get install python3.11 python3.11-dev python3.11-venv
|
||||
sudo apt-get install python3.12 python3.12-dev python3.12-venv
|
||||
```
|
||||
|
||||
:::
|
||||
:::{group-tab} CentOS 7
|
||||
:::{group-tab} Ubuntu 2404
|
||||
|
||||
```bash
|
||||
cd ~
|
||||
sudo yum install gcc openssl-devel bzip2-devel libffi-devel wget
|
||||
wget https://www.python.org/ftp/python/3.11.7/Python-3.11.7.tgz
|
||||
tar xvf Python-3.11.7.tgz
|
||||
cd Python-3.11.7/
|
||||
./configure --enable-optimizations --enable-shared
|
||||
sudo make altinstall
|
||||
```shell
|
||||
sudo apt-get update
|
||||
sudo apt-get install python3.12 python3.12-dev python3.12-venv
|
||||
```
|
||||
|
||||
:::
|
||||
:::{group-tab} CentOS Stream 8
|
||||
:::{group-tab} CentOS Stream 9, 10
|
||||
|
||||
```bash
|
||||
cd ~
|
||||
sudo yum install gcc openssl-devel bzip2-devel libffi-devel wget
|
||||
wget https://www.python.org/ftp/python/3.11.7/Python-3.11.7.tgz
|
||||
tar xvf Python-3.11.7.tgz
|
||||
cd Python-3.11.7/
|
||||
./configure --enable-optimizations --enable-shared
|
||||
sudo make altinstall
|
||||
```
|
||||
|
||||
:::
|
||||
:::{group-tab} CentOS Stream 9
|
||||
|
||||
```bash
|
||||
cd ~
|
||||
sudo yum install gcc openssl-devel bzip2-devel libffi-devel wget
|
||||
wget https://www.python.org/ftp/python/3.11.7/Python-3.11.7.tgz
|
||||
tar xvf Python-3.11.7.tgz
|
||||
cd Python-3.11.7/
|
||||
./configure --enable-optimizations --enable-shared
|
||||
sudo make altinstall
|
||||
sudo dnf update
|
||||
sudo dnf install python3.12 python3.12-dev python3.12-venv
|
||||
```
|
||||
|
||||
:::
|
||||
@@ -201,10 +168,10 @@ mv /home/allianceserver/venv/auth /home/allianceserver/venv/auth_old
|
||||
|
||||
## Create your new venv
|
||||
|
||||
Now let's create our new venv with Python 3.11 and activate it:
|
||||
Now let's create our new venv with Python 3.12 and activate it:
|
||||
|
||||
```shell
|
||||
python3.11 -m venv /home/allianceserver/venv/auth
|
||||
python3.12 -m venv /home/allianceserver/venv/auth
|
||||
```
|
||||
|
||||
```shell
|
||||
|
||||
@@ -9,7 +9,7 @@ Tuning usually has benefits and costs and should only be performed by experience
|
||||
:::{toctree}
|
||||
:maxdepth: 1
|
||||
|
||||
gunicorn
|
||||
web
|
||||
celery
|
||||
redis
|
||||
python
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
The default installation will have 3 workers configured for Gunicorn. This will be fine on most systems, but if your system as more than one core than you might want to increase the number of workers to get better response times. Note that more workers will also need more RAM though.
|
||||
|
||||
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.
|
||||
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 [How Many Workers](https://docs.gunicorn.org/en/stable/design.html#how-many-workers) for the official discussion on this topic.
|
||||
|
||||
::::{tabs}
|
||||
:::{group-tab} Ubuntu 2204, 2404
|
||||
@@ -99,7 +99,7 @@ Replace the nginx service in your docker-compose as follows
|
||||
|
||||
Modify your nginx.conf as follows
|
||||
|
||||
```conf
|
||||
```nginx
|
||||
load_module modules/ngx_http_brotli_static_module.so;
|
||||
load_module modules/ngx_http_brotli_filter_module.so;
|
||||
...
|
||||
|
||||
Reference in New Issue
Block a user