From c7db4f0bd3299d7a78828acb3c5c87d2299e2ab4 Mon Sep 17 00:00:00 2001 From: Joel Falknau Date: Thu, 6 Mar 2025 09:59:08 +1000 Subject: [PATCH 01/72] tox pre-commit formatter --- .pre-commit-config.yaml | 10 +++++----- tox.ini | 25 ++++++++++++++----------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b147476a..0404b9a2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -85,18 +85,18 @@ repos: - --disable=MD013 # Infrastructure - repo: https://github.com/tox-dev/pyproject-fmt - rev: v2.5.0 + rev: v2.5.1 hooks: - id: pyproject-fmt - name: pyproject.toml formatter - description: "Format the pyproject.toml file." args: - --indent=4 additional_dependencies: - tox==4.24.1 # https://github.com/tox-dev/tox/releases/latest + - repo: https://github.com/tox-dev/tox-ini-fmt + rev: 1.5.0 + hooks: + - id: tox-ini-fmt - repo: https://github.com/abravalheri/validate-pyproject rev: v0.23 hooks: - id: validate-pyproject - name: Validate pyproject.toml - description: "Validate the pyproject.toml file." diff --git a/tox.ini b/tox.ini index d9c30ac2..ffb5638d 100644 --- a/tox.ini +++ b/tox.ini @@ -1,30 +1,33 @@ [tox] -isolated_build = true -skipsdist = true +requires = + tox>=4.2 +env_list = + docs + py{313, 312, 311, 310}-{all, core} +no_package = true usedevelop = true -envlist = py{310,311,312,313}-{all,core}, docs [testenv] -setenv = - all: DJANGO_SETTINGS_MODULE = tests.settings_all - core: DJANGO_SETTINGS_MODULE = tests.settings_core -basepython = +base_python = py310: python3.10 py311: python3.11 py312: python3.12 py313: python3.13 -deps= +deps = coverage -install_command = pip install -e ".[test]" -U {opts} {packages} +set_env = + all: DJANGO_SETTINGS_MODULE = tests.settings_all + core: DJANGO_SETTINGS_MODULE = tests.settings_core commands = all: coverage run runtests.py -v 2 --debug-mode core: coverage run runtests.py allianceauth.authentication.tests.test_app_settings -v 2 --debug-mode all: coverage report -m all: coverage xml +install_command = pip install -e ".[test]" -U {opts} {packages} [testenv:docs] description = invoke sphinx-build to build the HTML docs -basepython = python3.12 -install_command = pip install -e ".[docs]" -U {opts} {packages} +base_python = python3.12 commands = sphinx-build -T -E -b html -d "{toxworkdir}/docs_doctree" -D language=en docs "{toxworkdir}/docs_out" {posargs} +install_command = pip install -e ".[docs]" -U {opts} {packages} From 876f1e48e74ae113c53c595bf690dcbdedf3b709 Mon Sep 17 00:00:00 2001 From: Joel Falknau Date: Thu, 6 Mar 2025 11:28:19 +1000 Subject: [PATCH 02/72] Update docs to python312, drop old OS --- .../dev_setup/aa-dev-setup-wsl-vsc-v2.md | 6 +- docs/features/services/mumble.md | 8 +- docs/features/services/openfire.md | 30 +-- docs/installation/allianceauth.md | 206 ++++-------------- docs/installation/apache.md | 48 +--- docs/installation/nginx.md | 18 +- docs/installation/upgrade_python.md | 55 +---- 7 files changed, 67 insertions(+), 304 deletions(-) diff --git a/docs/development/dev_setup/aa-dev-setup-wsl-vsc-v2.md b/docs/development/dev_setup/aa-dev-setup-wsl-vsc-v2.md index 64a68a5d..c9538664 100644 --- a/docs/development/dev_setup/aa-dev-setup-wsl-vsc-v2.md +++ b/docs/development/dev_setup/aa-dev-setup-wsl-vsc-v2.md @@ -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 `_ 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 ``` ::: diff --git a/docs/features/services/mumble.md b/docs/features/services/mumble.md index 1c08a468..81cc49a7 100644 --- a/docs/features/services/mumble.md +++ b/docs/features/services/mumble.md @@ -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 diff --git a/docs/features/services/openfire.md b/docs/features/services/openfire.md index 3897efa0..8ec86923 100644 --- a/docs/features/services/openfire.md +++ b/docs/features/services/openfire.md @@ -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 -dpkg -i openfire_4.7.2_all.deb -::: -:::{group-tab} CentOS Stream 8 -wget -yum install -y openfire-4.7.2-1.noarch.rpm -::: -:::{group-tab} CentOS Stream 9 +:::{group-tab} CentOS Stream 9, 10 wget yum install -y openfire-4.7.2-1.noarch.rpm ::: diff --git a/docs/installation/allianceauth.md b/docs/installation/allianceauth.md index 2b7c3924..feeefa4d 100644 --- a/docs/installation/allianceauth.md +++ b/docs/installation/allianceauth.md @@ -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 to add the MariaDB repository to your host. +:::{group-tab} Ubuntu 2204 +Follow the instructions at 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 to add the MariaDB repository to your host. +:::{group-tab} Ubuntu 2404 +Follow the instructions at 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 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 to add the MariaDB repository to your host. +:::{group-tab} CentOS Stream 9, 10 +Follow the instructions at 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 diff --git a/docs/installation/apache.md b/docs/installation/apache.md index 7613ff7b..9f7387b1 100644 --- a/docs/installation/apache.md +++ b/docs/installation/apache.md @@ -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`. ::: :::: diff --git a/docs/installation/nginx.md b/docs/installation/nginx.md index ba6ea3c7..0299c4f1 100644 --- a/docs/installation/nginx.md +++ b/docs/installation/nginx.md @@ -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 diff --git a/docs/installation/upgrade_python.md b/docs/installation/upgrade_python.md index 4449c574..3bdcd16b 100644 --- a/docs/installation/upgrade_python.md +++ b/docs/installation/upgrade_python.md @@ -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 From 2ce9ba997f85f541b51d3d5fc3eafbb92a7eeae1 Mon Sep 17 00:00:00 2001 From: Peter Pfeufer Date: Sun, 16 Mar 2025 10:11:27 +0100 Subject: [PATCH 03/72] [CHANGE] Update supervisor.conf template Use `%(program_name)s` variable for logfile names, which makes it easier to avoid possible copy/paste issues and mistakes. --- allianceauth/project_template/supervisor.conf | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/allianceauth/project_template/supervisor.conf b/allianceauth/project_template/supervisor.conf index 5dcc54d6..ed9bb2a1 100644 --- a/allianceauth/project_template/supervisor.conf +++ b/allianceauth/project_template/supervisor.conf @@ -2,8 +2,8 @@ command={{ celery }} -A {{ project_name }} beat directory={{ project_directory }} user=allianceserver -stdout_logfile={{ project_directory }}/log/beat.log -stderr_logfile={{ project_directory }}/log/beat.log +stdout_logfile={{ project_directory }}/log/%(program_name)s.log +stderr_logfile={{ project_directory }}/log/%(program_name)s.log autostart=true autorestart=true startsecs=10 @@ -15,12 +15,12 @@ directory={{ project_directory }} user=allianceserver numprocs=1 process_name=%(program_name)s_%(process_num)02d -stdout_logfile={{ project_directory }}/log/worker.log -stderr_logfile={{ project_directory }}/log/worker.log +stdout_logfile={{ project_directory }}/log/%(program_name)s.log +stderr_logfile={{ project_directory }}/log/%(program_name)s.log autostart=true autorestart=true startsecs=10 -stopwaitsecs = 600 +stopwaitsecs=600 killasgroup=true priority=998 @@ -29,12 +29,11 @@ priority=998 user = allianceserver directory={{ project_directory }} command={{ gunicorn }} {{ project_name }}.wsgi --workers=3 --timeout 120 -stdout_logfile={{ project_directory }}/log/gunicorn.log -stderr_logfile={{ project_directory }}/log/gunicorn.log +stdout_logfile={{ project_directory }}/log/%(program_name)s.log +stderr_logfile={{ project_directory }}/log/%(program_name)s.log autostart=true autorestart=true stopsignal=INT - {% endif %} [eventlistener:memmon] From 4edb7cb678054ffaca8a13199cc0d821c13c7f02 Mon Sep 17 00:00:00 2001 From: Peter Pfeufer Date: Sun, 16 Mar 2025 10:15:36 +0100 Subject: [PATCH 04/72] [CHANGE] Assignment format to INI style The supervisor.conf file uses INI style, so the format should reflect this. --- allianceauth/project_template/supervisor.conf | 72 +++++++++---------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/allianceauth/project_template/supervisor.conf b/allianceauth/project_template/supervisor.conf index ed9bb2a1..3c74a372 100644 --- a/allianceauth/project_template/supervisor.conf +++ b/allianceauth/project_template/supervisor.conf @@ -1,48 +1,48 @@ [program:beat] -command={{ celery }} -A {{ project_name }} beat -directory={{ project_directory }} -user=allianceserver -stdout_logfile={{ project_directory }}/log/%(program_name)s.log -stderr_logfile={{ project_directory }}/log/%(program_name)s.log -autostart=true -autorestart=true -startsecs=10 -priority=998 +command = {{ celery }} -A {{ project_name }} beat +directory = {{ project_directory }} +user = allianceserver +stdout_logfile = {{ project_directory }}/log/%(program_name)s.log +stderr_logfile = {{ project_directory }}/log/%(program_name)s.log +autostart = true +autorestart = true +startsecs = 10 +priority = 998 [program:worker] -command={{ celery }} -A {{ project_name }} worker --pool=threads --concurrency=5 -n %(program_name)s_%(process_num)02d -directory={{ project_directory }} -user=allianceserver -numprocs=1 -process_name=%(program_name)s_%(process_num)02d -stdout_logfile={{ project_directory }}/log/%(program_name)s.log -stderr_logfile={{ project_directory }}/log/%(program_name)s.log -autostart=true -autorestart=true -startsecs=10 -stopwaitsecs=600 -killasgroup=true -priority=998 +command = {{ celery }} -A {{ project_name }} worker --pool=threads --concurrency=5 -n %(program_name)s_%(process_num)02d +directory = {{ project_directory }} +user = allianceserver +numprocs = 1 +process_name = %(program_name)s_%(process_num)02d +stdout_logfile = {{ project_directory }}/log/%(program_name)s.log +stderr_logfile = {{ project_directory }}/log/%(program_name)s.log +autostart = true +autorestart = true +startsecs = 10 +stopwaitsecs = 600 +killasgroup = true +priority = 998 {% if gunicorn %} [program:gunicorn] user = allianceserver -directory={{ project_directory }} -command={{ gunicorn }} {{ project_name }}.wsgi --workers=3 --timeout 120 -stdout_logfile={{ project_directory }}/log/%(program_name)s.log -stderr_logfile={{ project_directory }}/log/%(program_name)s.log -autostart=true -autorestart=true -stopsignal=INT +directory = {{ project_directory }} +command = {{ gunicorn }} {{ project_name }}.wsgi --workers=3 --timeout 120 +stdout_logfile = {{ project_directory }}/log/%(program_name)s.log +stderr_logfile = {{ project_directory }}/log/%(program_name)s.log +autostart = true +autorestart = true +stopsignal = INT {% endif %} [eventlistener:memmon] -command={{ memmon }} -p worker_00=256MB -p gunicorn=256MB -directory={{ project_directory }} -events=TICK_60 -stdout_logfile={{ project_directory }}/log/memmon.log -stderr_logfile={{ project_directory }}/log/memmon.log +command = {{ memmon }} -p worker_00=256MB -p gunicorn=256MB +directory = {{ project_directory }} +events = TICK_60 +stdout_logfile = {{ project_directory }}/log/memmon.log +stderr_logfile = {{ project_directory }}/log/memmon.log [group:{{ project_name }}] -programs=beat,worker{% if gunicorn %},gunicorn{% endif %} -priority=999 +programs = beat,worker{% if gunicorn %},gunicorn{% endif %} +priority = 999 From f26835fae0af5c27452ad364cda00fb56324d889 Mon Sep 17 00:00:00 2001 From: Peter Pfeufer Date: Tue, 18 Mar 2025 18:25:58 +0100 Subject: [PATCH 05/72] [ADD] Opengraph Template for easier override --- allianceauth/authentication/templates/public/base.html | 7 +------ allianceauth/templates/allianceauth/base-bs5.html | 5 ++--- allianceauth/templates/allianceauth/opengraph.html | 5 +++++ 3 files changed, 8 insertions(+), 9 deletions(-) create mode 100644 allianceauth/templates/allianceauth/opengraph.html diff --git a/allianceauth/authentication/templates/public/base.html b/allianceauth/authentication/templates/public/base.html index b73cfd4d..ada256e0 100644 --- a/allianceauth/authentication/templates/public/base.html +++ b/allianceauth/authentication/templates/public/base.html @@ -6,13 +6,8 @@ - - - - - - + {% include 'allianceauth/opengraph.html' %} {% include 'allianceauth/icons.html' %} {% block title %}{% block page_title %}{% endblock page_title %} - {{ SITE_NAME }}{% endblock title %} diff --git a/allianceauth/templates/allianceauth/base-bs5.html b/allianceauth/templates/allianceauth/base-bs5.html index a26531e7..1eba9aea 100644 --- a/allianceauth/templates/allianceauth/base-bs5.html +++ b/allianceauth/templates/allianceauth/base-bs5.html @@ -12,11 +12,10 @@ - - - + {% include 'allianceauth/opengraph.html' %} {% include 'allianceauth/icons.html' %} + {% block title %}{% block page_title %}{% endblock page_title %} - {{ SITE_NAME }}{% endblock title %} {% theme_css %} diff --git a/allianceauth/templates/allianceauth/opengraph.html b/allianceauth/templates/allianceauth/opengraph.html new file mode 100644 index 00000000..b7b0d682 --- /dev/null +++ b/allianceauth/templates/allianceauth/opengraph.html @@ -0,0 +1,5 @@ +{% load static %} + + + + From b7bacd11af02ed25a78dcf2bac3220fb433bcf83 Mon Sep 17 00:00:00 2001 From: Peter Pfeufer Date: Tue, 18 Mar 2025 18:30:00 +0100 Subject: [PATCH 06/72] [CHANGE] Bring public base templkate in line with the non-public version --- allianceauth/authentication/templates/public/base.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/allianceauth/authentication/templates/public/base.html b/allianceauth/authentication/templates/public/base.html index ada256e0..39d9f520 100644 --- a/allianceauth/authentication/templates/public/base.html +++ b/allianceauth/authentication/templates/public/base.html @@ -1,19 +1,24 @@ {% load theme_tags %} {% load static %} - + + - + + {% include 'allianceauth/opengraph.html' %} {% include 'allianceauth/icons.html' %} + {% block title %}{% block page_title %}{% endblock page_title %} - {{ SITE_NAME }}{% endblock title %} {% theme_css %} + {% include 'bundles/fontawesome.html' %} + {% include 'bundles/auth-framework-css.html' %} {% block extra_include %} {% endblock %} From c93afd2d68c2e86f0b892823ff6a31d2226774af Mon Sep 17 00:00:00 2001 From: Peter Pfeufer Date: Tue, 18 Mar 2025 21:40:47 +0100 Subject: [PATCH 07/72] [ADD] Site name and URL --- allianceauth/templates/allianceauth/opengraph.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/allianceauth/templates/allianceauth/opengraph.html b/allianceauth/templates/allianceauth/opengraph.html index b7b0d682..bc960918 100644 --- a/allianceauth/templates/allianceauth/opengraph.html +++ b/allianceauth/templates/allianceauth/opengraph.html @@ -3,3 +3,6 @@ + + + From 83d2dfc7d92cedf61ba2139526fbafa901b5a6af Mon Sep 17 00:00:00 2001 From: Aaron Kable Date: Thu, 20 Mar 2025 19:11:08 +0800 Subject: [PATCH 08/72] use the view_connection_history perm not superuser --- .../templates/services/mumble/mumble_service_ctrl.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/allianceauth/services/modules/mumble/templates/services/mumble/mumble_service_ctrl.html b/allianceauth/services/modules/mumble/templates/services/mumble/mumble_service_ctrl.html index cf122157..962571e4 100644 --- a/allianceauth/services/modules/mumble/templates/services/mumble/mumble_service_ctrl.html +++ b/allianceauth/services/modules/mumble/templates/services/mumble/mumble_service_ctrl.html @@ -48,9 +48,9 @@ {% endif %} {% endif %} - {% if request.user.is_superuser %} - - History - -{% endif %} + {% if perms.mumble.view_connection_history %} + + History + + {% endif %} {% endblock %} From 4de0774f15f9e5c4b98d1b3c0609ebb2fa0a0518 Mon Sep 17 00:00:00 2001 From: r0kym Date: Thu, 20 Mar 2025 18:47:19 +0100 Subject: [PATCH 09/72] Switch the doc example to use group instead of chain for long running tasks --- docs/development/tech_docu/celery.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/development/tech_docu/celery.md b/docs/development/tech_docu/celery.md index b9571170..a9b6c566 100644 --- a/docs/development/tech_docu/celery.md +++ b/docs/development/tech_docu/celery.md @@ -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 `_. - 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. ::: From a34baf4154f0f75ab15ceaefdeda12bde34edfe5 Mon Sep 17 00:00:00 2001 From: Peter Pfeufer Date: Sat, 22 Mar 2025 17:37:10 +0100 Subject: [PATCH 10/72] [FIX] `logo_height` variable name --- allianceauth/templates/bundles/image-auth-logo.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/allianceauth/templates/bundles/image-auth-logo.html b/allianceauth/templates/bundles/image-auth-logo.html index b797e12d..47281028 100644 --- a/allianceauth/templates/bundles/image-auth-logo.html +++ b/allianceauth/templates/bundles/image-auth-logo.html @@ -1,3 +1,3 @@ {% load static %} -{{ SITE_NAME }} +{{ SITE_NAME }} From 702def2a4da63a186e1cd80730008bacf58a2f8d Mon Sep 17 00:00:00 2001 From: Peter Pfeufer Date: Mon, 24 Mar 2025 13:32:53 +0100 Subject: [PATCH 11/72] [CHANGE] Wrap page header in `header` element --- .../templates/framework/header/page-header.html | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/allianceauth/framework/templates/framework/header/page-header.html b/allianceauth/framework/templates/framework/header/page-header.html index d84868c2..a88c8924 100644 --- a/allianceauth/framework/templates/framework/header/page-header.html +++ b/allianceauth/framework/templates/framework/header/page-header.html @@ -2,12 +2,14 @@ {# {% include "framework/header/page-header.html" with title="Foobar" subtitle="Barfoo" %}#} {% if title %} -

- {{ title }} +
+

+ {{ title }} - {% if subtitle %} -
- {{ subtitle }} - {% endif %} -

+ {% if subtitle %} +
+ {{ subtitle }} + {% endif %} +

+ {% endif %} From 43e1be4032d14696b425076221aa0134881b86a7 Mon Sep 17 00:00:00 2001 From: Peter Pfeufer Date: Mon, 24 Mar 2025 14:49:51 +0100 Subject: [PATCH 12/72] [CHANGE] Move margin class to `header` element --- .../framework/templates/framework/header/page-header.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/allianceauth/framework/templates/framework/header/page-header.html b/allianceauth/framework/templates/framework/header/page-header.html index a88c8924..dd8330b4 100644 --- a/allianceauth/framework/templates/framework/header/page-header.html +++ b/allianceauth/framework/templates/framework/header/page-header.html @@ -2,8 +2,8 @@ {# {% include "framework/header/page-header.html" with title="Foobar" subtitle="Barfoo" %}#} {% if title %} -
-

+
+

{{ title }} {% if subtitle %} From f4c5c7f6db27c5c96272983fbcb7865ac10fed2e Mon Sep 17 00:00:00 2001 From: Peter Pfeufer Date: Mon, 24 Mar 2025 15:14:30 +0100 Subject: [PATCH 13/72] [FIX] Spelling (It's EVE time, not Eve time) --- .../templates/fleetactivitytracking/fatlinkmodify.html | 2 +- .../fatlinkpersonalmonthlystatisticsview.html | 2 +- .../templates/fleetactivitytracking/fatlinkview.html | 4 ++-- allianceauth/optimer/templates/optimer/dashboard.ops.html | 2 +- allianceauth/optimer/templates/optimer/management.html | 6 +++--- allianceauth/static/allianceauth/css/auth-base.css | 2 +- allianceauth/static/allianceauth/js/eve-time.js | 2 +- allianceauth/static/allianceauth/js/timers.js | 2 +- allianceauth/templates/allianceauth/top-menu.html | 2 +- allianceauth/timerboard/form.py | 2 +- .../timerboard/templates/timerboard/dashboard.timers.html | 2 +- .../timerboard/templates/timerboard/timertable.html | 2 +- allianceauth/timerboard/templates/timerboard/view.html | 2 +- 13 files changed, 16 insertions(+), 16 deletions(-) diff --git a/allianceauth/fleetactivitytracking/templates/fleetactivitytracking/fatlinkmodify.html b/allianceauth/fleetactivitytracking/templates/fleetactivitytracking/fatlinkmodify.html index 24943440..7ecca1a1 100644 --- a/allianceauth/fleetactivitytracking/templates/fleetactivitytracking/fatlinkmodify.html +++ b/allianceauth/fleetactivitytracking/templates/fleetactivitytracking/fatlinkmodify.html @@ -36,7 +36,7 @@ {% translate "Character" %} {% translate "System" %} {% translate "Ship" %} - {% translate "Eve Time" %} + {% translate "EVE time" %} diff --git a/allianceauth/fleetactivitytracking/templates/fleetactivitytracking/fatlinkpersonalmonthlystatisticsview.html b/allianceauth/fleetactivitytracking/templates/fleetactivitytracking/fatlinkpersonalmonthlystatisticsview.html index 24256381..486851d2 100644 --- a/allianceauth/fleetactivitytracking/templates/fleetactivitytracking/fatlinkpersonalmonthlystatisticsview.html +++ b/allianceauth/fleetactivitytracking/templates/fleetactivitytracking/fatlinkpersonalmonthlystatisticsview.html @@ -72,7 +72,7 @@ {% translate "Fleet" %} {% translate "Creator" %} - {% translate "Eve Time" %} + {% translate "EVE time" %} {% translate "Duration" %} {% translate "Edit" %} diff --git a/allianceauth/fleetactivitytracking/templates/fleetactivitytracking/fatlinkview.html b/allianceauth/fleetactivitytracking/templates/fleetactivitytracking/fatlinkview.html index 72470ab0..519374ce 100644 --- a/allianceauth/fleetactivitytracking/templates/fleetactivitytracking/fatlinkview.html +++ b/allianceauth/fleetactivitytracking/templates/fleetactivitytracking/fatlinkview.html @@ -41,7 +41,7 @@ {% translate "Character" %} {% translate "System" %} {% translate "Ship" %} - {% translate "Eve Time" %} + {% translate "EVE time" %} {% for fat in fats %} @@ -89,7 +89,7 @@ {% translate "Name" %} {% translate "Creator" %} {% translate "Fleet" %} - {% translate "Eve Time" %} + {% translate "EVE time" %} {% translate "Duration" %} {% translate "Edit" %} diff --git a/allianceauth/optimer/templates/optimer/dashboard.ops.html b/allianceauth/optimer/templates/optimer/dashboard.ops.html index b9e1d418..126dd93a 100644 --- a/allianceauth/optimer/templates/optimer/dashboard.ops.html +++ b/allianceauth/optimer/templates/optimer/dashboard.ops.html @@ -14,7 +14,7 @@ {% translate "Operation" %} {% translate "Type" %} {% translate "Form Up System" %} - {% translate "EVE Time" %} + {% translate "EVE time" %} diff --git a/allianceauth/optimer/templates/optimer/management.html b/allianceauth/optimer/templates/optimer/management.html index 437458ca..ac96c711 100644 --- a/allianceauth/optimer/templates/optimer/management.html +++ b/allianceauth/optimer/templates/optimer/management.html @@ -25,7 +25,7 @@
- {% translate "Current Eve Time:" %} + {% translate "Current EVE time:" %}
@@ -127,8 +127,8 @@ }; /** - * Get the current Eve time as a string - * @returns {string} Eve time string + * Get the current EVE time as a string + * @returns {string} EVE time string */ const updateClock = () => { document.getElementById("current-time").innerHTML = getCurrentEveTimeString(); diff --git a/allianceauth/static/allianceauth/css/auth-base.css b/allianceauth/static/allianceauth/css/auth-base.css index b2b18aa5..6656db27 100644 --- a/allianceauth/static/allianceauth/css/auth-base.css +++ b/allianceauth/static/allianceauth/css/auth-base.css @@ -172,7 +172,7 @@ ul.list-group.list-group-horizontal > li.list-group-item { } } -/* eve time in navbar +/* EVE time in navbar ------------------------------------------------------------------------------------- */ @media all { .nav-item-eve-time .eve-time-wrapper { diff --git a/allianceauth/static/allianceauth/js/eve-time.js b/allianceauth/static/allianceauth/js/eve-time.js index 280fabb0..87a6f9f2 100644 --- a/allianceauth/static/allianceauth/js/eve-time.js +++ b/allianceauth/static/allianceauth/js/eve-time.js @@ -14,7 +14,7 @@ $(document).ready(() => { }; /** - * Start the Eve time clock in the top menu bar + * Start the EVE time clock in the top menu bar */ setInterval(() => { renderClock($('.eve-time-wrapper .eve-time-clock')); diff --git a/allianceauth/static/allianceauth/js/timers.js b/allianceauth/static/allianceauth/js/timers.js index 908abf19..7703f8f3 100644 --- a/allianceauth/static/allianceauth/js/timers.js +++ b/allianceauth/static/allianceauth/js/timers.js @@ -28,7 +28,7 @@ const getDurationString = (duration) => { // eslint-disable-line no-unused-vars }; /** - * returns the current eve time as a formatted string + * returns the current EVE time as a formatted string * * condition: * only if moment.js is loaded before, diff --git a/allianceauth/templates/allianceauth/top-menu.html b/allianceauth/templates/allianceauth/top-menu.html index 60914386..463095db 100644 --- a/allianceauth/templates/allianceauth/top-menu.html +++ b/allianceauth/templates/allianceauth/top-menu.html @@ -20,7 +20,7 @@
-
+
{% translate "Applicant" %}
@@ -50,7 +50,7 @@
-
+
{% translate "Characters" %}
diff --git a/allianceauth/menu/templates/menu/menu-item-bs5.html b/allianceauth/menu/templates/menu/menu-item-bs5.html index 82edd7d3..e0e7dbda 100644 --- a/allianceauth/menu/templates/menu/menu-item-bs5.html +++ b/allianceauth/menu/templates/menu/menu-item-bs5.html @@ -27,7 +27,7 @@ {% if item.count >= 1 %} - + {{ item.count }} {% elif item.url %} diff --git a/allianceauth/menu/templates/menu/sortable-side-menu.html b/allianceauth/menu/templates/menu/sortable-side-menu.html index c010a3ce..dd6d4b02 100644 --- a/allianceauth/menu/templates/menu/sortable-side-menu.html +++ b/allianceauth/menu/templates/menu/sortable-side-menu.html @@ -5,7 +5,7 @@