mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2026-02-12 18:16:24 +01:00
Compare commits
87 Commits
v4.6.1
...
b02827cb3f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b02827cb3f | ||
|
|
2bcc0570ad | ||
|
|
a3ea0c65a1 | ||
|
|
5e526da11c | ||
|
|
5c79265f90 | ||
|
|
eb0134e716 | ||
|
|
afde1f4729 | ||
|
|
5c6dda0eac | ||
|
|
af453bc772 | ||
|
|
e13674e886 | ||
|
|
e3e856b826 | ||
|
|
9d1cd23a8f | ||
|
|
148f7c116f | ||
|
|
33e7134d6f | ||
|
|
fb799551aa | ||
|
|
7b95051fe1 | ||
|
|
efb6a6db4f | ||
|
|
478aa1aa12 | ||
|
|
751e55ed6c | ||
|
|
9dad53f763 | ||
|
|
2d57064a7a | ||
|
|
833d12cf66 | ||
|
|
7b56caa4cb | ||
|
|
5752644122 | ||
|
|
cadc0cb534 | ||
|
|
dcdab5ae1f | ||
|
|
d64e896288 | ||
|
|
500d8ede32 | ||
|
|
f4c5c7f6db | ||
|
|
43e1be4032 | ||
|
|
702def2a4d | ||
|
|
a34baf4154 | ||
|
|
4de0774f15 | ||
|
|
83d2dfc7d9 | ||
|
|
c93afd2d68 | ||
|
|
b7bacd11af | ||
|
|
f26835fae0 | ||
|
|
4edb7cb678 | ||
|
|
2ce9ba997f | ||
|
|
055077fa77 | ||
|
|
f342ccbc6a | ||
|
|
37ffd0a1ac | ||
|
|
a1f705381e | ||
|
|
c0970ad4fa | ||
|
|
3818d0c6d1 | ||
|
|
95411c79cb | ||
|
|
eeccbbacfc | ||
|
|
f6c4180502 | ||
|
|
f4d3d6c0b1 | ||
|
|
e9d2d11297 | ||
|
|
96204b29e8 | ||
|
|
47842c1243 | ||
|
|
9b494106bc | ||
|
|
d51e730a7f | ||
|
|
363909c0c4 | ||
|
|
82273f68fe | ||
|
|
12fa38b446 | ||
|
|
c26af593ff | ||
|
|
8e9a53c494 | ||
|
|
5559ce5fbb | ||
|
|
faa529a55b | ||
|
|
4ccfe20c14 | ||
|
|
960c9625fe | ||
|
|
7b92d103d6 | ||
|
|
c1e2449084 | ||
|
|
3acb651650 | ||
|
|
2de57b334b | ||
|
|
0498f5bb1b | ||
|
|
929485a8f9 | ||
|
|
28cb62f373 | ||
|
|
02214b74d0 | ||
|
|
f497c18e5b | ||
|
|
cb57d922e6 | ||
|
|
805d138b09 | ||
|
|
09a583fb1d | ||
|
|
146c4c8d94 | ||
|
|
c2ae680f72 | ||
|
|
b5ad1c8a1a | ||
|
|
8be2760fc4 | ||
|
|
f047943eb7 | ||
|
|
43906f41b3 | ||
|
|
a18ec98877 | ||
|
|
14163d2c0c | ||
|
|
81d9c41cf6 | ||
|
|
58f5a5b41d | ||
|
|
6363bb706a | ||
|
|
baf3be4cb2 |
@@ -3,22 +3,41 @@
|
|||||||
# Update this file:
|
# Update this file:
|
||||||
# pre-commit autoupdate
|
# pre-commit autoupdate
|
||||||
|
|
||||||
|
# Set the default language versions for the hooks
|
||||||
|
default_language_version:
|
||||||
|
python: python3 # Force all Python hooks to use Python 3
|
||||||
|
node: 22.12.0 # Force all Node hooks to use Node 22.12.0
|
||||||
|
|
||||||
|
# Globally exclude files
|
||||||
|
# https://pre-commit.com/#top_level-exclude
|
||||||
|
exclude: |
|
||||||
|
(?x)(
|
||||||
|
LICENSE|
|
||||||
|
allianceauth\/static\/allianceauth\/css\/themes\/bootstrap-locals.less|
|
||||||
|
\.min\.css|
|
||||||
|
\.min\.js|
|
||||||
|
\.po|
|
||||||
|
\.mo|
|
||||||
|
swagger\.json|
|
||||||
|
static/(.*)/libs/
|
||||||
|
)
|
||||||
|
|
||||||
repos:
|
repos:
|
||||||
# Code Upgrades
|
# Code Upgrades
|
||||||
- repo: https://github.com/asottile/pyupgrade
|
- repo: https://github.com/asottile/pyupgrade
|
||||||
rev: v3.15.2
|
rev: v3.19.1
|
||||||
hooks:
|
hooks:
|
||||||
- id: pyupgrade
|
- id: pyupgrade
|
||||||
args: [--py38-plus]
|
args: [--py38-plus]
|
||||||
- repo: https://github.com/adamchainz/django-upgrade
|
- repo: https://github.com/adamchainz/django-upgrade
|
||||||
rev: 1.17.0
|
rev: 1.22.2
|
||||||
hooks:
|
hooks:
|
||||||
- id: django-upgrade
|
- id: django-upgrade
|
||||||
args: [--target-version=4.2]
|
args: [--target-version=4.2]
|
||||||
|
|
||||||
# Formatting
|
# Formatting
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
rev: v4.6.0
|
rev: v5.0.0
|
||||||
hooks:
|
hooks:
|
||||||
# Identify invalid files
|
# Identify invalid files
|
||||||
- id: check-ast
|
- id: check-ast
|
||||||
@@ -44,48 +63,22 @@ repos:
|
|||||||
args: [--fix=lf]
|
args: [--fix=lf]
|
||||||
- id: trailing-whitespace
|
- id: trailing-whitespace
|
||||||
args: [--markdown-linebreak-ext=md]
|
args: [--markdown-linebreak-ext=md]
|
||||||
exclude: |
|
|
||||||
(?x)(
|
|
||||||
\.min\.css|
|
|
||||||
\.min\.js|
|
|
||||||
\.po|
|
|
||||||
\.mo|
|
|
||||||
swagger\.json|
|
|
||||||
static/(.*)/libs/
|
|
||||||
)
|
|
||||||
- id: check-executables-have-shebangs
|
- id: check-executables-have-shebangs
|
||||||
- id: end-of-file-fixer
|
- id: end-of-file-fixer
|
||||||
exclude: |
|
|
||||||
(?x)(
|
|
||||||
\.min\.css|
|
|
||||||
\.min\.js|
|
|
||||||
\.po|
|
|
||||||
\.mo|
|
|
||||||
swagger\.json|
|
|
||||||
static/(.*)/libs/
|
|
||||||
)
|
|
||||||
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
|
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
|
||||||
rev: 2.7.3
|
rev: 3.2.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: editorconfig-checker
|
- id: editorconfig-checker
|
||||||
exclude: |
|
|
||||||
(?x)(
|
|
||||||
LICENSE|
|
|
||||||
allianceauth\/static\/allianceauth\/css\/themes\/bootstrap-locals.less|
|
|
||||||
\.po|
|
|
||||||
\.mo|
|
|
||||||
swagger\.json|
|
|
||||||
static/(.*)/libs/
|
|
||||||
)
|
|
||||||
- repo: https://github.com/igorshubovych/markdownlint-cli
|
- repo: https://github.com/igorshubovych/markdownlint-cli
|
||||||
rev: v0.41.0
|
rev: v0.44.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: markdownlint
|
- id: markdownlint
|
||||||
|
language: node
|
||||||
args:
|
args:
|
||||||
- --disable=MD013
|
- --disable=MD013
|
||||||
# Infrastructure
|
# Infrastructure
|
||||||
- repo: https://github.com/tox-dev/pyproject-fmt
|
- repo: https://github.com/tox-dev/pyproject-fmt
|
||||||
rev: 2.1.3
|
rev: v2.5.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: pyproject-fmt
|
- id: pyproject-fmt
|
||||||
name: pyproject.toml formatter
|
name: pyproject.toml formatter
|
||||||
@@ -93,9 +86,9 @@ repos:
|
|||||||
args:
|
args:
|
||||||
- --indent=4
|
- --indent=4
|
||||||
additional_dependencies:
|
additional_dependencies:
|
||||||
- tox==4.15.0 # https://github.com/tox-dev/tox/releases/latest
|
- tox==4.24.1 # https://github.com/tox-dev/tox/releases/latest
|
||||||
- repo: https://github.com/abravalheri/validate-pyproject
|
- repo: https://github.com/abravalheri/validate-pyproject
|
||||||
rev: v0.18
|
rev: v0.23
|
||||||
hooks:
|
hooks:
|
||||||
- id: validate-pyproject
|
- id: validate-pyproject
|
||||||
name: Validate pyproject.toml
|
name: Validate pyproject.toml
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ manage online service access.
|
|||||||
# This will make sure the app is always imported when
|
# This will make sure the app is always imported when
|
||||||
# Django starts so that shared_task will use this app.
|
# Django starts so that shared_task will use this app.
|
||||||
|
|
||||||
__version__ = '4.6.1'
|
__version__ = '4.6.4'
|
||||||
__title__ = 'Alliance Auth'
|
__title__ = 'Alliance Auth'
|
||||||
__url__ = 'https://gitlab.com/allianceauth/allianceauth'
|
__url__ = 'https://gitlab.com/allianceauth/allianceauth'
|
||||||
NAME = f'{__title__} v{__version__}'
|
NAME = f'{__title__} v{__version__}'
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class AnalyticsConfig(AppConfig):
|
class AnalyticsConfig(AppConfig):
|
||||||
name = 'allianceauth.analytics'
|
name = 'allianceauth.analytics'
|
||||||
label = 'analytics'
|
label = 'analytics'
|
||||||
|
verbose_name = _('Analytics')
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
from django.core.checks import register, Tags
|
from django.core.checks import register, Tags
|
||||||
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class AuthenticationConfig(AppConfig):
|
class AuthenticationConfig(AppConfig):
|
||||||
name = "allianceauth.authentication"
|
name = "allianceauth.authentication"
|
||||||
label = "authentication"
|
label = "authentication"
|
||||||
|
verbose_name = _("Authentication")
|
||||||
|
|
||||||
def ready(self):
|
def ready(self):
|
||||||
from allianceauth.authentication import checks, signals # noqa: F401
|
from allianceauth.authentication import checks, signals # noqa: F401
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import logging
|
import logging
|
||||||
|
from typing import ClassVar
|
||||||
|
|
||||||
from django.contrib.auth.models import User, Permission
|
from django.contrib.auth.models import User, Permission
|
||||||
from django.db import models, transaction
|
from django.db import models, transaction
|
||||||
@@ -27,7 +28,7 @@ class State(models.Model):
|
|||||||
help_text="Factions to whose members this state is available.")
|
help_text="Factions to whose members this state is available.")
|
||||||
public = models.BooleanField(default=False, help_text="Make this state available to any character.")
|
public = models.BooleanField(default=False, help_text="Make this state available to any character.")
|
||||||
|
|
||||||
objects = StateManager()
|
objects: ClassVar[StateManager] = StateManager()
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
ordering = ['-priority']
|
ordering = ['-priority']
|
||||||
@@ -137,8 +138,10 @@ class UserProfile(models.Model):
|
|||||||
sender=self.__class__, user=self.user, state=self.state
|
sender=self.__class__, user=self.user, state=self.state
|
||||||
)
|
)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self) -> str:
|
||||||
return str(self.user)
|
return str(self.user)
|
||||||
|
|
||||||
|
|
||||||
class CharacterOwnership(models.Model):
|
class CharacterOwnership(models.Model):
|
||||||
class Meta:
|
class Meta:
|
||||||
default_permissions = ('change', 'delete')
|
default_permissions = ('change', 'delete')
|
||||||
@@ -148,7 +151,7 @@ class CharacterOwnership(models.Model):
|
|||||||
owner_hash = models.CharField(max_length=28, unique=True)
|
owner_hash = models.CharField(max_length=28, unique=True)
|
||||||
user = models.ForeignKey(User, on_delete=models.CASCADE, related_name='character_ownerships')
|
user = models.ForeignKey(User, on_delete=models.CASCADE, related_name='character_ownerships')
|
||||||
|
|
||||||
objects = CharacterOwnershipManager()
|
objects: ClassVar[CharacterOwnershipManager] = CharacterOwnershipManager()
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f"{self.user}: {self.character}"
|
return f"{self.user}: {self.character}"
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
<div>
|
<div>
|
||||||
<p class="mb-3">
|
<p class="mb-3">
|
||||||
{% translate "This page is a best attempt, but backups or database logs can still contain your tokens. Always revoke tokens on https://community.eveonline.com/support/third-party-applications/ where possible."|urlize %}
|
{% translate "This page is a best attempt, but backups or database logs can still contain your tokens. Always revoke tokens on https://developers.eveonline.com/authorized-apps where possible."|urlize %}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<table class="table w-100" id="table_tokens">
|
<table class="table w-100" id="table_tokens">
|
||||||
|
|||||||
@@ -1,24 +1,24 @@
|
|||||||
{% load theme_tags %}
|
{% load theme_tags %}
|
||||||
{% load static %}
|
{% load static %}
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en" {% theme_html_tags %}>
|
||||||
<head>
|
<head>
|
||||||
|
<!-- Required meta tags -->
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<meta name="description" content="">
|
<!-- End Required meta tags -->
|
||||||
<meta name="author" content="">
|
|
||||||
<!-- TODO Bundle all the site specific stuff up into its own template for easy override -->
|
|
||||||
<meta property="og:title" content="{{ SITE_NAME }}">
|
|
||||||
<meta property="og:image" content="{{ SITE_URL }}{% static 'allianceauth/icons/apple-touch-icon.png' %}">
|
|
||||||
<meta property="og:description" content="Alliance Auth - An auth system for EVE Online to help in-game organizations manage online service access.">
|
|
||||||
|
|
||||||
|
<!-- Meta tags -->
|
||||||
|
{% include 'allianceauth/opengraph.html' %}
|
||||||
{% include 'allianceauth/icons.html' %}
|
{% include 'allianceauth/icons.html' %}
|
||||||
|
<!-- Meta tags -->
|
||||||
|
|
||||||
<title>{% block title %}{% block page_title %}{% endblock page_title %} - {{ SITE_NAME }}{% endblock title %}</title>
|
<title>{% block title %}{% block page_title %}{% endblock page_title %} - {{ SITE_NAME }}{% endblock title %}</title>
|
||||||
|
|
||||||
{% theme_css %}
|
{% theme_css %}
|
||||||
|
|
||||||
{% include 'bundles/fontawesome.html' %}
|
{% include 'bundles/fontawesome.html' %}
|
||||||
|
{% include 'bundles/auth-framework-css.html' %}
|
||||||
|
|
||||||
{% block extra_include %}
|
{% block extra_include %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p class="text-center">
|
<p class="text-center">
|
||||||
<a class="text-reset" href="https://community.eveonline.com/support/third-party-applications/" target="_blank" rel="noopener noreferrer">
|
<a class="text-reset" href="https://developers.eveonline.com/authorized-apps" target="_blank" rel="noopener noreferrer">
|
||||||
{% translate "Manage ESI Applications" %}
|
{% translate "Manage ESI Applications" %}
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
"""
|
||||||
|
Django system checks for Alliance Auth
|
||||||
|
"""
|
||||||
|
|
||||||
from typing import List
|
from typing import List
|
||||||
from django import db
|
from django import db
|
||||||
from django.core.checks import CheckMessage, Error, register, Warning
|
from django.core.checks import CheckMessage, Error, register, Warning
|
||||||
@@ -16,142 +20,475 @@ B = Configuration
|
|||||||
|
|
||||||
@register()
|
@register()
|
||||||
def django_settings(app_configs, **kwargs) -> List[CheckMessage]:
|
def django_settings(app_configs, **kwargs) -> List[CheckMessage]:
|
||||||
errors: List[CheckMessage] = []
|
"""
|
||||||
if hasattr(settings, "SITE_URL"):
|
Check that Django settings are correctly configured
|
||||||
if settings.SITE_URL[-1] == "/":
|
|
||||||
errors.append(Warning("'SITE_URL' Has a trailing slash. This may lead to incorrect links being generated by Auth.", hint="", id="allianceauth.checks.B005"))
|
|
||||||
else:
|
|
||||||
errors.append(Error("No 'SITE_URL' found is settings. This may lead to incorrect links being generated by Auth or Errors in 3rd party modules.", hint="", id="allianceauth.checks.B006"))
|
|
||||||
|
|
||||||
if hasattr(settings, "CSRF_TRUSTED_ORIGINS") and hasattr(settings, "SITE_URL"):
|
:param app_configs:
|
||||||
if settings.SITE_URL not in settings.CSRF_TRUSTED_ORIGINS:
|
:type app_configs:
|
||||||
errors.append(Warning("'SITE_URL' not found in 'CSRF_TRUSTED_ORIGINS'. Auth may not load pages correctly until this is rectified.", hint="", id="allianceauth.checks.B007"))
|
:param kwargs:
|
||||||
|
:type kwargs:
|
||||||
|
:return:
|
||||||
|
:rtype:
|
||||||
|
"""
|
||||||
|
|
||||||
|
errors: List[CheckMessage] = []
|
||||||
|
|
||||||
|
# Check for SITE_URL
|
||||||
|
if hasattr(settings, "SITE_URL"):
|
||||||
|
# Check if SITE_URL is empty
|
||||||
|
if settings.SITE_URL == "":
|
||||||
|
errors.append(
|
||||||
|
Error(
|
||||||
|
msg="'SITE_URL' is empty.",
|
||||||
|
hint="Make sure to set 'SITE_URL' to the URL of your Auth instance. (Without trailing slash)",
|
||||||
|
id="allianceauth.checks.B011",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
# Check if SITE_URL has a trailing slash
|
||||||
|
elif settings.SITE_URL[-1] == "/":
|
||||||
|
errors.append(
|
||||||
|
Warning(
|
||||||
|
msg="'SITE_URL' has a trailing slash. This may lead to incorrect links being generated by Auth.",
|
||||||
|
hint="",
|
||||||
|
id="allianceauth.checks.B005",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
# SITE_URL not found
|
||||||
else:
|
else:
|
||||||
errors.append(Error("No 'CSRF_TRUSTED_ORIGINS' found is settings, Auth may not load pages correctly until this is rectified", hint="", id="allianceauth.checks.B008"))
|
errors.append(
|
||||||
|
Error(
|
||||||
|
msg="No 'SITE_URL' found is settings. This may lead to incorrect links being generated by Auth or Errors in 3rd party modules.",
|
||||||
|
hint="",
|
||||||
|
id="allianceauth.checks.B006",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
# Check for CSRF_TRUSTED_ORIGINS
|
||||||
|
if hasattr(settings, "CSRF_TRUSTED_ORIGINS") and hasattr(settings, "SITE_URL"):
|
||||||
|
# Check if SITE_URL is not in CSRF_TRUSTED_ORIGINS
|
||||||
|
if settings.SITE_URL not in settings.CSRF_TRUSTED_ORIGINS:
|
||||||
|
errors.append(
|
||||||
|
Warning(
|
||||||
|
msg="'SITE_URL' not found in 'CSRF_TRUSTED_ORIGINS'. Auth may not load pages correctly until this is rectified.",
|
||||||
|
hint="",
|
||||||
|
id="allianceauth.checks.B007",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
# CSRF_TRUSTED_ORIGINS not found
|
||||||
|
else:
|
||||||
|
errors.append(
|
||||||
|
Error(
|
||||||
|
msg="No 'CSRF_TRUSTED_ORIGINS' found is settings, Auth may not load pages correctly until this is rectified",
|
||||||
|
hint="",
|
||||||
|
id="allianceauth.checks.B008",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
# Check for ESI_USER_CONTACT_EMAIL
|
||||||
|
if hasattr(settings, "ESI_USER_CONTACT_EMAIL"):
|
||||||
|
# Check if ESI_USER_CONTACT_EMAIL is empty
|
||||||
|
if settings.ESI_USER_CONTACT_EMAIL == "":
|
||||||
|
errors.append(
|
||||||
|
Error(
|
||||||
|
msg="'ESI_USER_CONTACT_EMAIL' is empty. A valid email is required as maintainer contact for CCP.",
|
||||||
|
hint="",
|
||||||
|
id="allianceauth.checks.B009",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
# ESI_USER_CONTACT_EMAIL not found
|
||||||
|
else:
|
||||||
|
errors.append(
|
||||||
|
Error(
|
||||||
|
msg="No 'ESI_USER_CONTACT_EMAIL' found is settings. A valid email is required as maintainer contact for CCP.",
|
||||||
|
hint="",
|
||||||
|
id="allianceauth.checks.B010",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
return errors
|
return errors
|
||||||
|
|
||||||
|
|
||||||
@register()
|
@register()
|
||||||
def system_package_redis(app_configs, **kwargs) -> List[CheckMessage]:
|
def system_package_redis(app_configs, **kwargs) -> List[CheckMessage]:
|
||||||
|
"""
|
||||||
|
Check that Redis is a supported version
|
||||||
|
|
||||||
|
:param app_configs:
|
||||||
|
:type app_configs:
|
||||||
|
:param kwargs:
|
||||||
|
:type kwargs:
|
||||||
|
:return:
|
||||||
|
:rtype:
|
||||||
|
"""
|
||||||
|
|
||||||
|
allianceauth_redis_install_link = "https://allianceauth.readthedocs.io/en/latest/installation/allianceauth.html#redis-and-other-tools"
|
||||||
|
|
||||||
errors: List[CheckMessage] = []
|
errors: List[CheckMessage] = []
|
||||||
|
|
||||||
try:
|
try:
|
||||||
redis_version = Pep440Version(get_redis_client().info()['redis_version'])
|
redis_version = Pep440Version(get_redis_client().info()["redis_version"])
|
||||||
except InvalidVersion:
|
except InvalidVersion:
|
||||||
errors.append(Warning("Unable to confirm Redis Version"))
|
errors.append(Warning("Unable to confirm Redis Version"))
|
||||||
|
|
||||||
return errors
|
return errors
|
||||||
|
|
||||||
if redis_version.major == 7 and redis_version.minor == 2 and timezone.now() > timezone.datetime(year=2025, month=8, day=31, tzinfo=timezone.utc):
|
if (
|
||||||
errors.append(Error(f"Redis {redis_version.public} in Security Support only, Updating Suggested", hint="https://allianceauth.readthedocs.io/en/latest/installation/allianceauth.html#redis-and-other-tools", id="allianceauth.checks.A001"))
|
redis_version.major == 7
|
||||||
|
and redis_version.minor == 2
|
||||||
|
and timezone.now()
|
||||||
|
> timezone.datetime(year=2025, month=8, day=31, tzinfo=timezone.utc)
|
||||||
|
):
|
||||||
|
errors.append(
|
||||||
|
Error(
|
||||||
|
msg=f"Redis {redis_version.public} in Security Support only, Updating Suggested",
|
||||||
|
hint=allianceauth_redis_install_link,
|
||||||
|
id="allianceauth.checks.A001",
|
||||||
|
)
|
||||||
|
)
|
||||||
elif redis_version.major == 7 and redis_version.minor == 0:
|
elif redis_version.major == 7 and redis_version.minor == 0:
|
||||||
errors.append(Warning(f"Redis {redis_version.public} in Security Support only, Updating Suggested", hint="https://allianceauth.readthedocs.io/en/latest/installation/allianceauth.html#redis-and-other-tools", id="allianceauth.checks.A002"))
|
errors.append(
|
||||||
|
Warning(
|
||||||
|
msg=f"Redis {redis_version.public} in Security Support only, Updating Suggested",
|
||||||
|
hint=allianceauth_redis_install_link,
|
||||||
|
id="allianceauth.checks.A002",
|
||||||
|
)
|
||||||
|
)
|
||||||
elif redis_version.major == 6 and redis_version.minor == 2:
|
elif redis_version.major == 6 and redis_version.minor == 2:
|
||||||
errors.append(Warning(f"Redis {redis_version.public} in Security Support only, Updating Suggested", hint="https://allianceauth.readthedocs.io/en/latest/installation/allianceauth.html#redis-and-other-tools", id="allianceauth.checks.A018"))
|
errors.append(
|
||||||
|
Warning(
|
||||||
|
msg=f"Redis {redis_version.public} in Security Support only, Updating Suggested",
|
||||||
|
hint=allianceauth_redis_install_link,
|
||||||
|
id="allianceauth.checks.A018",
|
||||||
|
)
|
||||||
|
)
|
||||||
elif redis_version.major in [6, 5]:
|
elif redis_version.major in [6, 5]:
|
||||||
errors.append(Error(f"Redis {redis_version.public} EOL", hint="https://allianceauth.readthedocs.io/en/latest/installation/allianceauth.html#redis-and-other-tools", id="allianceauth.checks.A003"))
|
errors.append(
|
||||||
|
Error(
|
||||||
|
msg=f"Redis {redis_version.public} EOL",
|
||||||
|
hint=allianceauth_redis_install_link,
|
||||||
|
id="allianceauth.checks.A003",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
return errors
|
return errors
|
||||||
|
|
||||||
|
|
||||||
@register()
|
@register()
|
||||||
def system_package_mysql(app_configs, **kwargs) -> List[CheckMessage]:
|
def system_package_mysql(app_configs, **kwargs) -> List[CheckMessage]:
|
||||||
|
"""
|
||||||
|
Check that MySQL is a supported version
|
||||||
|
|
||||||
|
:param app_configs:
|
||||||
|
:type app_configs:
|
||||||
|
:param kwargs:
|
||||||
|
:type kwargs:
|
||||||
|
:return:
|
||||||
|
:rtype:
|
||||||
|
"""
|
||||||
|
|
||||||
|
mysql_quick_guide_link = "https://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/"
|
||||||
|
|
||||||
errors: List[CheckMessage] = []
|
errors: List[CheckMessage] = []
|
||||||
|
|
||||||
for connection in db.connections.all():
|
for connection in db.connections.all():
|
||||||
if connection.vendor == "mysql":
|
if connection.vendor == "mysql":
|
||||||
try:
|
try:
|
||||||
mysql_version = Pep440Version(".".join(str(i) for i in connection.mysql_version))
|
mysql_version = Pep440Version(
|
||||||
|
".".join(str(i) for i in connection.mysql_version)
|
||||||
|
)
|
||||||
except InvalidVersion:
|
except InvalidVersion:
|
||||||
errors.append(Warning("Unable to confirm MySQL Version"))
|
errors.append(Warning("Unable to confirm MySQL Version"))
|
||||||
|
|
||||||
return errors
|
return errors
|
||||||
|
|
||||||
# MySQL 8
|
# MySQL 8
|
||||||
if mysql_version.major == 8 and mysql_version.minor == 4 and timezone.now() > timezone.datetime(year=2032, month=4, day=30, tzinfo=timezone.utc):
|
if mysql_version.major == 8:
|
||||||
errors.append(Error(f"MySQL {mysql_version.public} EOL", hint="https://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/", id="allianceauth.checks.A004"))
|
if mysql_version.minor == 4 and timezone.now() > timezone.datetime(
|
||||||
elif mysql_version.major == 8 and mysql_version.minor == 3:
|
year=2032, month=4, day=30, tzinfo=timezone.utc
|
||||||
errors.append(Warning(f"MySQL {mysql_version.public} Non LTS", hint="https://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/", id="allianceauth.checks.A005"))
|
):
|
||||||
elif mysql_version.major == 8 and mysql_version.minor == 2:
|
errors.append(
|
||||||
errors.append(Warning(f"MySQL {mysql_version.public} Non LTS", hint="https://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/", id="allianceauth.checks.A006"))
|
Error(
|
||||||
elif mysql_version.major == 8 and mysql_version.minor == 1:
|
msg=f"MySQL {mysql_version.public} EOL",
|
||||||
errors.append(Error(f"MySQL {mysql_version.public} EOL", hint="https://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/", id="allianceauth.checks.A007"))
|
hint=mysql_quick_guide_link,
|
||||||
elif mysql_version.major == 8 and mysql_version.minor == 0 and timezone.now() > timezone.datetime(year=2026, month=4, day=30, tzinfo=timezone.utc):
|
id="allianceauth.checks.A004",
|
||||||
errors.append(Error(f"MySQL {mysql_version.public} EOL", hint="https://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/", id="allianceauth.checks.A008"))
|
)
|
||||||
elif mysql_version.major < 8: # This will also catch Mariadb 5.x
|
)
|
||||||
errors.append(Error(f"MySQL or MariaDB {mysql_version.public} EOL", hint="https://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/", id="allianceauth.checks.A009"))
|
elif mysql_version.minor == 3:
|
||||||
|
errors.append(
|
||||||
|
Warning(
|
||||||
|
msg=f"MySQL {mysql_version.public} Non LTS",
|
||||||
|
hint=mysql_quick_guide_link,
|
||||||
|
id="allianceauth.checks.A005",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
elif mysql_version.minor == 2:
|
||||||
|
errors.append(
|
||||||
|
Warning(
|
||||||
|
msg=f"MySQL {mysql_version.public} Non LTS",
|
||||||
|
hint=mysql_quick_guide_link,
|
||||||
|
id="allianceauth.checks.A006",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
elif mysql_version.minor == 1:
|
||||||
|
errors.append(
|
||||||
|
Error(
|
||||||
|
msg=f"MySQL {mysql_version.public} EOL",
|
||||||
|
hint=mysql_quick_guide_link,
|
||||||
|
id="allianceauth.checks.A007",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
elif mysql_version.minor == 0 and timezone.now() > timezone.datetime(
|
||||||
|
year=2026, month=4, day=30, tzinfo=timezone.utc
|
||||||
|
):
|
||||||
|
errors.append(
|
||||||
|
Error(
|
||||||
|
msg=f"MySQL {mysql_version.public} EOL",
|
||||||
|
hint=mysql_quick_guide_link,
|
||||||
|
id="allianceauth.checks.A008",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
# MySQL below 8
|
||||||
|
# This will also catch Mariadb 5.x
|
||||||
|
elif mysql_version.major < 8:
|
||||||
|
errors.append(
|
||||||
|
Error(
|
||||||
|
msg=f"MySQL or MariaDB {mysql_version.public} EOL",
|
||||||
|
hint=mysql_quick_guide_link,
|
||||||
|
id="allianceauth.checks.A009",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
return errors
|
return errors
|
||||||
|
|
||||||
|
|
||||||
@register()
|
@register()
|
||||||
def system_package_mariadb(app_configs, **kwargs) -> List[CheckMessage]:
|
def system_package_mariadb(app_configs, **kwargs) -> List[CheckMessage]:
|
||||||
|
"""
|
||||||
|
Check that MariaDB is a supported version
|
||||||
|
|
||||||
|
:param app_configs:
|
||||||
|
:type app_configs:
|
||||||
|
:param kwargs:
|
||||||
|
:type kwargs:
|
||||||
|
:return:
|
||||||
|
:rtype:
|
||||||
|
"""
|
||||||
|
|
||||||
|
mariadb_download_link = "https://mariadb.org/download/?t=repo-config"
|
||||||
|
|
||||||
errors: List[CheckMessage] = []
|
errors: List[CheckMessage] = []
|
||||||
|
|
||||||
for connection in db.connections.all():
|
for connection in db.connections.all():
|
||||||
if connection.vendor == "mysql": # Still to find a way to determine MySQL vs MariaDB
|
# TODO: Find a way to determine MySQL vs. MariaDB
|
||||||
|
if connection.vendor == "mysql":
|
||||||
try:
|
try:
|
||||||
mariadb_version = Pep440Version(".".join(str(i) for i in connection.mysql_version))
|
mariadb_version = Pep440Version(
|
||||||
|
".".join(str(i) for i in connection.mysql_version)
|
||||||
|
)
|
||||||
except InvalidVersion:
|
except InvalidVersion:
|
||||||
errors.append(Warning("Unable to confirm MariaDB Version"))
|
errors.append(Warning("Unable to confirm MariaDB Version"))
|
||||||
|
|
||||||
return errors
|
return errors
|
||||||
|
|
||||||
# MariaDB 11
|
# MariaDB 11
|
||||||
if mariadb_version.major == 11 and mariadb_version.minor == 4 and timezone.now() > timezone.datetime(year=2029, month=5, day=19, tzinfo=timezone.utc):
|
if mariadb_version.major == 11:
|
||||||
errors.append(Error(f"MariaDB {mariadb_version.public} EOL", hint="https://mariadb.org/download/?t=repo-config", id="allianceauth.checks.A010"))
|
if mariadb_version.minor == 4 and timezone.now() > timezone.datetime(
|
||||||
elif mariadb_version.major == 11 and mariadb_version.minor == 2:
|
year=2029, month=5, day=19, tzinfo=timezone.utc
|
||||||
errors.append(Warning(f"MariaDB {mariadb_version.public} Non LTS", hint="https://mariadb.org/download/?t=repo-config", id="allianceauth.checks.A018"))
|
):
|
||||||
if timezone.now() > timezone.datetime(year=2024, month=11, day=21, tzinfo=timezone.utc):
|
errors.append(
|
||||||
errors.append(Error(f"MariaDB {mariadb_version.public} EOL", hint="https://mariadb.org/download/?t=repo-config", id="allianceauth.checks.A011"))
|
Error(
|
||||||
elif mariadb_version.major == 11 and mariadb_version.minor == 1:
|
msg=f"MariaDB {mariadb_version.public} EOL",
|
||||||
errors.append(Warning(f"MariaDB {mariadb_version.public} Non LTS", hint="https://mariadb.org/download/?t=repo-config", id="allianceauth.checks.A019"))
|
hint=mariadb_download_link,
|
||||||
if timezone.now() > timezone.datetime(year=2024, month=8, day=21, tzinfo=timezone.utc):
|
id="allianceauth.checks.A010",
|
||||||
errors.append(Error(f"MariaDB {mariadb_version.public} EOL", hint="https://mariadb.org/download/?t=repo-config", id="allianceauth.checks.A012"))
|
)
|
||||||
elif mariadb_version.major == 11 and mariadb_version.minor in [0, 3]: # Demote versions down here once EOL
|
)
|
||||||
errors.append(Error(f"MariaDB {mariadb_version.public} EOL", hint="https://mariadb.org/download/?t=repo-config.", id="allianceauth.checks.A013"))
|
elif mariadb_version.minor == 2:
|
||||||
|
errors.append(
|
||||||
|
Warning(
|
||||||
|
msg=f"MariaDB {mariadb_version.public} Non LTS",
|
||||||
|
hint=mariadb_download_link,
|
||||||
|
id="allianceauth.checks.A018",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
if timezone.now() > timezone.datetime(
|
||||||
|
year=2024, month=11, day=21, tzinfo=timezone.utc
|
||||||
|
):
|
||||||
|
errors.append(
|
||||||
|
Error(
|
||||||
|
msg=f"MariaDB {mariadb_version.public} EOL",
|
||||||
|
hint=mariadb_download_link,
|
||||||
|
id="allianceauth.checks.A011",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
elif mariadb_version.minor == 1:
|
||||||
|
errors.append(
|
||||||
|
Warning(
|
||||||
|
msg=f"MariaDB {mariadb_version.public} Non LTS",
|
||||||
|
hint=mariadb_download_link,
|
||||||
|
id="allianceauth.checks.A019",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
if timezone.now() > timezone.datetime(
|
||||||
|
year=2024, month=8, day=21, tzinfo=timezone.utc
|
||||||
|
):
|
||||||
|
errors.append(
|
||||||
|
Error(
|
||||||
|
msg=f"MariaDB {mariadb_version.public} EOL",
|
||||||
|
hint=mariadb_download_link,
|
||||||
|
id="allianceauth.checks.A012",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
# Demote versions down here once EOL
|
||||||
|
elif mariadb_version.minor in [0, 3]:
|
||||||
|
errors.append(
|
||||||
|
Error(
|
||||||
|
msg=f"MariaDB {mariadb_version.public} EOL",
|
||||||
|
hint=mariadb_download_link,
|
||||||
|
id="allianceauth.checks.A013",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
# MariaDB 10
|
# MariaDB 10
|
||||||
elif mariadb_version.major == 10 and mariadb_version.minor == 11 and timezone.now() > timezone.datetime(year=2028, month=2, day=10, tzinfo=timezone.utc):
|
elif mariadb_version.major == 10:
|
||||||
errors.append(Error(f"MariaDB {mariadb_version.public} EOL", hint="https://mariadb.org/download/?t=repo-config.", id="allianceauth.checks.A014"))
|
if mariadb_version.minor == 11 and timezone.now() > timezone.datetime(
|
||||||
elif mariadb_version.major == 10 and mariadb_version.minor == 6 and timezone.now() > timezone.datetime(year=2026, month=7, day=6, tzinfo=timezone.utc):
|
year=2028, month=2, day=10, tzinfo=timezone.utc
|
||||||
errors.append(Error(f"MariaDB {mariadb_version.public} EOL", hint="https://mariadb.org/download/?t=repo-config", id="allianceauth.checks.A0015"))
|
):
|
||||||
elif mariadb_version.major == 10 and mariadb_version.minor == 5 and timezone.now() > timezone.datetime(year=2025, month=6, day=24, tzinfo=timezone.utc):
|
errors.append(
|
||||||
errors.append(Error(f"MariaDB {mariadb_version.public} EOL", hint="https://mariadb.org/download/?t=repo-config", id="allianceauth.checks.A016"))
|
Error(
|
||||||
elif mariadb_version.major == 10 and mariadb_version.minor in [0, 1, 2, 3, 4, 7, 9, 10]: # Demote versions down here once EOL
|
msg=f"MariaDB {mariadb_version.public} EOL",
|
||||||
errors.append(Error(f"MariaDB {mariadb_version.public} EOL", hint="https://mariadb.org/download/?t=repo-config", id="allianceauth.checks.A017"))
|
hint=mariadb_download_link,
|
||||||
|
id="allianceauth.checks.A014",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
elif mariadb_version.minor == 6 and timezone.now() > timezone.datetime(
|
||||||
|
year=2026, month=7, day=6, tzinfo=timezone.utc
|
||||||
|
):
|
||||||
|
errors.append(
|
||||||
|
Error(
|
||||||
|
msg=f"MariaDB {mariadb_version.public} EOL",
|
||||||
|
hint=mariadb_download_link,
|
||||||
|
id="allianceauth.checks.A0015",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
elif mariadb_version.minor == 5 and timezone.now() > timezone.datetime(
|
||||||
|
year=2025, month=6, day=24, tzinfo=timezone.utc
|
||||||
|
):
|
||||||
|
errors.append(
|
||||||
|
Error(
|
||||||
|
msg=f"MariaDB {mariadb_version.public} EOL",
|
||||||
|
hint=mariadb_download_link,
|
||||||
|
id="allianceauth.checks.A016",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
# Demote versions down here once EOL
|
||||||
|
elif mariadb_version.minor in [0, 1, 2, 3, 4, 7, 9, 10]:
|
||||||
|
errors.append(
|
||||||
|
Error(
|
||||||
|
msg=f"MariaDB {mariadb_version.public} EOL",
|
||||||
|
hint=mariadb_download_link,
|
||||||
|
id="allianceauth.checks.A017",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
return errors
|
return errors
|
||||||
|
|
||||||
|
|
||||||
@register()
|
@register()
|
||||||
def system_package_sqlite(app_configs, **kwargs) -> List[CheckMessage]:
|
def system_package_sqlite(app_configs, **kwargs) -> List[CheckMessage]:
|
||||||
|
"""
|
||||||
|
Check that SQLite is a supported version
|
||||||
|
|
||||||
|
:param app_configs:
|
||||||
|
:type app_configs:
|
||||||
|
:param kwargs:
|
||||||
|
:type kwargs:
|
||||||
|
:return:
|
||||||
|
:rtype:
|
||||||
|
"""
|
||||||
|
|
||||||
errors: List[CheckMessage] = []
|
errors: List[CheckMessage] = []
|
||||||
|
|
||||||
for connection in db.connections.all():
|
for connection in db.connections.all():
|
||||||
if connection.vendor == "sqlite":
|
if connection.vendor == "sqlite":
|
||||||
try:
|
try:
|
||||||
sqlite_version = Pep440Version(".".join(str(i) for i in sqlite_version_info))
|
sqlite_version = Pep440Version(
|
||||||
|
".".join(str(i) for i in sqlite_version_info)
|
||||||
|
)
|
||||||
except InvalidVersion:
|
except InvalidVersion:
|
||||||
errors.append(Warning("Unable to confirm SQLite Version"))
|
errors.append(Warning("Unable to confirm SQLite Version"))
|
||||||
|
|
||||||
return errors
|
return errors
|
||||||
if sqlite_version.major == 3 and sqlite_version.minor < 27:
|
if sqlite_version.major == 3 and sqlite_version.minor < 27:
|
||||||
errors.append(Error(f"SQLite {sqlite_version.public} Unsupported by Django", hint="https://pkgs.org/download/sqlite3", id="allianceauth.checks.A020"))
|
errors.append(
|
||||||
|
Error(
|
||||||
|
msg=f"SQLite {sqlite_version.public} Unsupported by Django",
|
||||||
|
hint="https://pkgs.org/download/sqlite3",
|
||||||
|
id="allianceauth.checks.A020",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
return errors
|
return errors
|
||||||
|
|
||||||
|
|
||||||
@register()
|
@register()
|
||||||
def sql_settings(app_configs, **kwargs) -> List[CheckMessage]:
|
def sql_settings(app_configs, **kwargs) -> List[CheckMessage]:
|
||||||
|
"""
|
||||||
|
Check that SQL settings are correctly configured
|
||||||
|
|
||||||
|
:param app_configs:
|
||||||
|
:type app_configs:
|
||||||
|
:param kwargs:
|
||||||
|
:type kwargs:
|
||||||
|
:return:
|
||||||
|
:rtype:
|
||||||
|
"""
|
||||||
|
|
||||||
errors: List[CheckMessage] = []
|
errors: List[CheckMessage] = []
|
||||||
|
|
||||||
for connection in db.connections.all():
|
for connection in db.connections.all():
|
||||||
if connection.vendor == "mysql":
|
if connection.vendor == "mysql":
|
||||||
try:
|
try:
|
||||||
if connection.settings_dict["OPTIONS"]["charset"] != "utf8mb4":
|
if connection.settings_dict["OPTIONS"]["charset"] != "utf8mb4":
|
||||||
errors.append(Error(f"SQL Charset is not set to utf8mb4 DB:{connection.alias}", hint="https://gitlab.com/allianceauth/allianceauth/-/commit/89be2456fb2d741b86417e889da9b6129525bec8", id="allianceauth.checks.B001"))
|
errors.append(
|
||||||
|
Error(
|
||||||
|
msg=f"SQL Charset is not set to utf8mb4 DB: {connection.alias}",
|
||||||
|
hint="https://gitlab.com/allianceauth/allianceauth/-/commit/89be2456fb2d741b86417e889da9b6129525bec8",
|
||||||
|
id="allianceauth.checks.B001",
|
||||||
|
)
|
||||||
|
)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
errors.append(Error(f"SQL Charset is not set to utf8mb4 DB:{connection.alias}", hint="https://gitlab.com/allianceauth/allianceauth/-/commit/89be2456fb2d741b86417e889da9b6129525bec8", id="allianceauth.checks.B001"))
|
errors.append(
|
||||||
|
Error(
|
||||||
|
msg=f"SQL Charset is not set to utf8mb4 DB: {connection.alias}",
|
||||||
|
hint="https://gitlab.com/allianceauth/allianceauth/-/commit/89be2456fb2d741b86417e889da9b6129525bec8",
|
||||||
|
id="allianceauth.checks.B001",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
# This hasn't actually been set on AA yet
|
# This hasn't actually been set on AA yet
|
||||||
# try:
|
# try:
|
||||||
# if connection.settings_dict["OPTIONS"]["collation"] != "utf8mb4_unicode_ci":
|
# if (
|
||||||
# errors.append(Error(f"SQL Collation is not set to utf8mb4_unicode_ci DB:{connection.alias}", hint="https://gitlab.com/allianceauth/allianceauth/-/commit/89be2456fb2d741b86417e889da9b6129525bec8", id="allianceauth.checks.B001"))
|
# connection.settings_dict["OPTIONS"]["collation"]
|
||||||
|
# != "utf8mb4_unicode_ci"
|
||||||
|
# ):
|
||||||
|
# errors.append(
|
||||||
|
# Error(
|
||||||
|
# msg=f"SQL Collation is not set to utf8mb4_unicode_ci DB:{connection.alias}",
|
||||||
|
# hint="https://gitlab.com/allianceauth/allianceauth/-/commit/89be2456fb2d741b86417e889da9b6129525bec8",
|
||||||
|
# id="allianceauth.checks.B001",
|
||||||
|
# )
|
||||||
|
# )
|
||||||
# except KeyError:
|
# except KeyError:
|
||||||
# errors.append(Error(f"SQL Collation is not set to utf8mb4_unicode_ci DB:{connection.alias}", hint="https://gitlab.com/allianceauth/allianceauth/-/commit/89be2456fb2d741b86417e889da9b6129525bec8", id="allianceauth.checks.B001"))
|
# errors.append(
|
||||||
|
# Error(
|
||||||
|
# msg=f"SQL Collation is not set to utf8mb4_unicode_ci DB:{connection.alias}",
|
||||||
|
# hint="https://gitlab.com/allianceauth/allianceauth/-/commit/89be2456fb2d741b86417e889da9b6129525bec8",
|
||||||
|
# id="allianceauth.checks.B001",
|
||||||
|
# )
|
||||||
|
# )
|
||||||
|
|
||||||
# if connection.vendor == "sqlite":
|
# if connection.vendor == "sqlite":
|
||||||
|
|
||||||
@@ -160,19 +497,57 @@ def sql_settings(app_configs, **kwargs) -> List[CheckMessage]:
|
|||||||
|
|
||||||
@register()
|
@register()
|
||||||
def celery_settings(app_configs, **kwargs) -> List[CheckMessage]:
|
def celery_settings(app_configs, **kwargs) -> List[CheckMessage]:
|
||||||
|
"""
|
||||||
|
Check that Celery settings are correctly configured
|
||||||
|
|
||||||
|
:param app_configs:
|
||||||
|
:type app_configs:
|
||||||
|
:param kwargs:
|
||||||
|
:type kwargs:
|
||||||
|
:return:
|
||||||
|
:rtype:
|
||||||
|
"""
|
||||||
|
|
||||||
errors: List[CheckMessage] = []
|
errors: List[CheckMessage] = []
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if current_app.conf.broker_transport_options != {'priority_steps': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 'queue_order_strategy': 'priority'}:
|
if current_app.conf.broker_transport_options != {
|
||||||
errors.append(Error("Celery Priorities are not set correctly", hint="https://gitlab.com/allianceauth/allianceauth/-/commit/8861ec0a61790eca0261f1adc1cc04ca5f243cbc", id="allianceauth.checks.B003"))
|
"priority_steps": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
|
||||||
|
"queue_order_strategy": "priority",
|
||||||
|
}:
|
||||||
|
errors.append(
|
||||||
|
Error(
|
||||||
|
msg="Celery Priorities are not set correctly",
|
||||||
|
hint="https://gitlab.com/allianceauth/allianceauth/-/commit/8861ec0a61790eca0261f1adc1cc04ca5f243cbc",
|
||||||
|
id="allianceauth.checks.B003",
|
||||||
|
)
|
||||||
|
)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
errors.append(Error("Celery Priorities are not set", hint="https://gitlab.com/allianceauth/allianceauth/-/commit/8861ec0a61790eca0261f1adc1cc04ca5f243cbc", id="allianceauth.checks.B003"))
|
errors.append(
|
||||||
|
Error(
|
||||||
|
msg="Celery Priorities are not set",
|
||||||
|
hint="https://gitlab.com/allianceauth/allianceauth/-/commit/8861ec0a61790eca0261f1adc1cc04ca5f243cbc",
|
||||||
|
id="allianceauth.checks.B003",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if current_app.conf.broker_connection_retry_on_startup != True:
|
if not current_app.conf.broker_connection_retry_on_startup:
|
||||||
errors.append(Error("Celery broker_connection_retry_on_startup not set correctly", hint="https://gitlab.com/allianceauth/allianceauth/-/commit/380c41400b535447839e5552df2410af35a75280", id="allianceauth.checks.B004"))
|
errors.append(
|
||||||
|
Error(
|
||||||
|
msg="Celery broker_connection_retry_on_startup not set correctly",
|
||||||
|
hint="https://gitlab.com/allianceauth/allianceauth/-/commit/380c41400b535447839e5552df2410af35a75280",
|
||||||
|
id="allianceauth.checks.B004",
|
||||||
|
)
|
||||||
|
)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
errors.append(Error("Celery broker_connection_retry_on_startup not set", hint="https://gitlab.com/allianceauth/allianceauth/-/commit/380c41400b535447839e5552df2410af35a75280", id="allianceauth.checks.B004"))
|
errors.append(
|
||||||
|
Error(
|
||||||
|
msg="Celery broker_connection_retry_on_startup not set",
|
||||||
|
hint="https://gitlab.com/allianceauth/allianceauth/-/commit/380c41400b535447839e5552df2410af35a75280",
|
||||||
|
id="allianceauth.checks.B004",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
return errors
|
return errors
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class CorpUtilsConfig(AppConfig):
|
class CorpUtilsConfig(AppConfig):
|
||||||
name = 'allianceauth.corputils'
|
name = 'allianceauth.corputils'
|
||||||
label = 'corputils'
|
label = 'corputils'
|
||||||
|
verbose_name = _('Corporation Stats')
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
from typing import ClassVar
|
||||||
|
|
||||||
from allianceauth.authentication.models import CharacterOwnership, UserProfile
|
from allianceauth.authentication.models import CharacterOwnership, UserProfile
|
||||||
from bravado.exception import HTTPForbidden
|
from bravado.exception import HTTPForbidden
|
||||||
@@ -40,9 +41,9 @@ class CorpStats(models.Model):
|
|||||||
verbose_name = "corp stats"
|
verbose_name = "corp stats"
|
||||||
verbose_name_plural = "corp stats"
|
verbose_name_plural = "corp stats"
|
||||||
|
|
||||||
objects = CorpStatsManager()
|
objects: ClassVar[CorpStatsManager] = CorpStatsManager()
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self) -> str:
|
||||||
return f"{self.__class__.__name__} for {self.corp}"
|
return f"{self.__class__.__name__} for {self.corp}"
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ Crontab App Config
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class CrontabConfig(AppConfig):
|
class CrontabConfig(AppConfig):
|
||||||
@@ -12,3 +13,4 @@ class CrontabConfig(AppConfig):
|
|||||||
|
|
||||||
name = "allianceauth.crontab"
|
name = "allianceauth.crontab"
|
||||||
label = "crontab"
|
label = "crontab"
|
||||||
|
verbose_name = _("Crontab")
|
||||||
|
|||||||
@@ -20,6 +20,10 @@ class OffsetDatabaseScheduler(DatabaseScheduler):
|
|||||||
Takes the Celery Schedule from local.py and applies our AA Framework Cron Offset, if apply_offset is true
|
Takes the Celery Schedule from local.py and applies our AA Framework Cron Offset, if apply_offset is true
|
||||||
Otherwise it passes it through as normal
|
Otherwise it passes it through as normal
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
def __init__(self, *args, **kwargs) -> None:
|
||||||
|
super().__init__(*args, **kwargs)
|
||||||
|
|
||||||
def update_from_dict(self, mapping):
|
def update_from_dict(self, mapping):
|
||||||
s = {}
|
s = {}
|
||||||
|
|
||||||
@@ -36,10 +40,11 @@ class OffsetDatabaseScheduler(DatabaseScheduler):
|
|||||||
|
|
||||||
for name, entry_fields in mapping.items():
|
for name, entry_fields in mapping.items():
|
||||||
try:
|
try:
|
||||||
apply_offset = entry_fields.pop("apply_offset", False)
|
apply_offset = entry_fields.pop("apply_offset", False) # Ensure this pops before django tries to save to ORM
|
||||||
entry = self.Entry.from_entry(name, app=self.app, **entry_fields)
|
entry = self.Entry.from_entry(name, app=self.app, **entry_fields)
|
||||||
|
|
||||||
if entry.model.enabled and apply_offset:
|
if apply_offset:
|
||||||
|
entry_fields.update({"apply_offset": apply_offset}) # Reapply this as its gets pulled from config inconsistently.
|
||||||
schedule_obj = entry.schedule
|
schedule_obj = entry.schedule
|
||||||
if isinstance(schedule_obj, schedules.crontab):
|
if isinstance(schedule_obj, schedules.crontab):
|
||||||
offset_cs = CrontabSchedule.from_schedule(offset_cron(schedule_obj))
|
offset_cs = CrontabSchedule.from_schedule(offset_cron(schedule_obj))
|
||||||
@@ -51,10 +56,12 @@ class OffsetDatabaseScheduler(DatabaseScheduler):
|
|||||||
day_of_week=offset_cs.day_of_week,
|
day_of_week=offset_cs.day_of_week,
|
||||||
timezone=offset_cs.timezone,
|
timezone=offset_cs.timezone,
|
||||||
)
|
)
|
||||||
|
entry.schedule = offset_cron(schedule_obj) # This gets passed into Celery Beats Memory, important to keep it in sync with the model/DB
|
||||||
entry.model.crontab = offset_cs
|
entry.model.crontab = offset_cs
|
||||||
entry.model.save()
|
entry.model.save()
|
||||||
logger.debug(f"Offset applied for '{name}' due to 'apply_offset' = True.")
|
logger.debug(f"Offset applied for '{name}' due to 'apply_offset' = True.")
|
||||||
|
|
||||||
|
if entry.model.enabled:
|
||||||
s[name] = entry
|
s[name] = entry
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class EveonlineConfig(AppConfig):
|
class EveonlineConfig(AppConfig):
|
||||||
name = 'allianceauth.eveonline'
|
name = 'allianceauth.eveonline'
|
||||||
label = 'eveonline'
|
label = 'eveonline'
|
||||||
|
verbose_name = _('EVE Online')
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class EveAutogroupsConfig(AppConfig):
|
class EveAutogroupsConfig(AppConfig):
|
||||||
name = 'allianceauth.eveonline.autogroups'
|
name = 'allianceauth.eveonline.autogroups'
|
||||||
label = 'eve_autogroups'
|
label = 'eve_autogroups'
|
||||||
|
verbose_name = _('EVE Online Autogroups')
|
||||||
|
|
||||||
def ready(self):
|
def ready(self):
|
||||||
import allianceauth.eveonline.autogroups.signals
|
import allianceauth.eveonline.autogroups.signals
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import logging
|
import logging
|
||||||
|
from typing import ClassVar
|
||||||
from django.db import models, transaction
|
from django.db import models, transaction
|
||||||
from django.contrib.auth.models import Group, User
|
from django.contrib.auth.models import Group, User
|
||||||
from django.core.exceptions import ObjectDoesNotExist
|
from django.core.exceptions import ObjectDoesNotExist
|
||||||
@@ -78,7 +79,7 @@ class AutogroupsConfig(models.Model):
|
|||||||
max_length=10, default='', blank=True,
|
max_length=10, default='', blank=True,
|
||||||
help_text='Any spaces in the group name will be replaced with this.')
|
help_text='Any spaces in the group name will be replaced with this.')
|
||||||
|
|
||||||
objects = AutogroupsConfigManager()
|
objects: ClassVar[AutogroupsConfigManager] = AutogroupsConfigManager()
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
|
|||||||
@@ -14,10 +14,10 @@ class EveCharacterProviderManager:
|
|||||||
class EveCharacterManager(models.Manager):
|
class EveCharacterManager(models.Manager):
|
||||||
provider = EveCharacterProviderManager()
|
provider = EveCharacterProviderManager()
|
||||||
|
|
||||||
def create_character(self, character_id):
|
def create_character(self, character_id) -> models.Model:
|
||||||
return self.create_character_obj(self.provider.get_character(character_id))
|
return self.create_character_obj(self.provider.get_character(character_id))
|
||||||
|
|
||||||
def create_character_obj(self, character: providers.Character):
|
def create_character_obj(self, character: providers.Character) -> models.Model:
|
||||||
return self.create(
|
return self.create(
|
||||||
character_id=character.id,
|
character_id=character.id,
|
||||||
character_name=character.name,
|
character_name=character.name,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import logging
|
import logging
|
||||||
from typing import Union
|
from typing import ClassVar, Union
|
||||||
|
|
||||||
from django.core.exceptions import ObjectDoesNotExist
|
from django.core.exceptions import ObjectDoesNotExist
|
||||||
from django.db import models
|
from django.db import models
|
||||||
@@ -75,8 +75,8 @@ class EveAllianceInfo(models.Model):
|
|||||||
alliance_ticker = models.CharField(max_length=254)
|
alliance_ticker = models.CharField(max_length=254)
|
||||||
executor_corp_id = models.PositiveIntegerField()
|
executor_corp_id = models.PositiveIntegerField()
|
||||||
|
|
||||||
objects = EveAllianceManager()
|
objects: ClassVar[EveAllianceManager] = EveAllianceManager()
|
||||||
provider = EveAllianceProviderManager()
|
provider: ClassVar[EveAllianceProviderManager] = EveAllianceProviderManager()
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
indexes = [models.Index(fields=['executor_corp_id',])]
|
indexes = [models.Index(fields=['executor_corp_id',])]
|
||||||
@@ -147,7 +147,7 @@ class EveCorporationInfo(models.Model):
|
|||||||
EveAllianceInfo, blank=True, null=True, on_delete=models.SET_NULL
|
EveAllianceInfo, blank=True, null=True, on_delete=models.SET_NULL
|
||||||
)
|
)
|
||||||
|
|
||||||
objects = EveCorporationManager()
|
objects: ClassVar[EveCorporationManager] = EveCorporationManager()
|
||||||
provider = EveCorporationProviderManager()
|
provider = EveCorporationProviderManager()
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
@@ -214,7 +214,7 @@ class EveCharacter(models.Model):
|
|||||||
faction_id = models.PositiveIntegerField(blank=True, null=True, default=None)
|
faction_id = models.PositiveIntegerField(blank=True, null=True, default=None)
|
||||||
faction_name = models.CharField(max_length=254, blank=True, null=True, default='')
|
faction_name = models.CharField(max_length=254, blank=True, null=True, default='')
|
||||||
|
|
||||||
objects = EveCharacterManager()
|
objects: ClassVar[EveCharacterManager] = EveCharacterManager()
|
||||||
provider = EveCharacterProviderManager()
|
provider = EveCharacterProviderManager()
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|||||||
@@ -723,5 +723,5 @@ class TestEveSwaggerProvider(TestCase):
|
|||||||
my_client = my_provider.client
|
my_client = my_provider.client
|
||||||
operation = my_client.Universe.get_universe_factions()
|
operation = my_client.Universe.get_universe_factions()
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
operation.future.request.headers['User-Agent'], 'allianceauth v1.0.0'
|
operation.future.request.headers['User-Agent'], 'allianceauth v1.0.0 dummy@example.net'
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class FatConfig(AppConfig):
|
class FatConfig(AppConfig):
|
||||||
name = 'allianceauth.fleetactivitytracking'
|
name = 'allianceauth.fleetactivitytracking'
|
||||||
label = 'fleetactivitytracking'
|
label = 'fleetactivitytracking'
|
||||||
|
verbose_name = _('Fleet Activity Tracking')
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
<th class="text-center">{% translate "Character" %}</th>
|
<th class="text-center">{% translate "Character" %}</th>
|
||||||
<th class="text-center">{% translate "System" %}</th>
|
<th class="text-center">{% translate "System" %}</th>
|
||||||
<th class="text-center">{% translate "Ship" %}</th>
|
<th class="text-center">{% translate "Ship" %}</th>
|
||||||
<th class="text-center">{% translate "Eve Time" %}</th>
|
<th class="text-center">{% translate "EVE time" %}</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th class="text-center">{% translate "Fleet" %}</th>
|
<th class="text-center">{% translate "Fleet" %}</th>
|
||||||
<th class="text-center">{% translate "Creator" %}</th>
|
<th class="text-center">{% translate "Creator" %}</th>
|
||||||
<th class="text-center">{% translate "Eve Time" %}</th>
|
<th class="text-center">{% translate "EVE time" %}</th>
|
||||||
<th class="text-center">{% translate "Duration" %}</th>
|
<th class="text-center">{% translate "Duration" %}</th>
|
||||||
<th class="text-center">{% translate "Edit" %}</th>
|
<th class="text-center">{% translate "Edit" %}</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
<th scope="col" class="text-center">{% translate "Character" %}</th>
|
<th scope="col" class="text-center">{% translate "Character" %}</th>
|
||||||
<th scope="col" class="text-center">{% translate "System" %}</th>
|
<th scope="col" class="text-center">{% translate "System" %}</th>
|
||||||
<th scope="col" class="text-center">{% translate "Ship" %}</th>
|
<th scope="col" class="text-center">{% translate "Ship" %}</th>
|
||||||
<th scope="col" class="text-center">{% translate "Eve Time" %}</th>
|
<th scope="col" class="text-center">{% translate "EVE time" %}</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
{% for fat in fats %}
|
{% for fat in fats %}
|
||||||
@@ -89,7 +89,7 @@
|
|||||||
<th scope="col" class="text-center">{% translate "Name" %}</th>
|
<th scope="col" class="text-center">{% translate "Name" %}</th>
|
||||||
<th scope="col" class="text-center">{% translate "Creator" %}</th>
|
<th scope="col" class="text-center">{% translate "Creator" %}</th>
|
||||||
<th scope="col" class="text-center">{% translate "Fleet" %}</th>
|
<th scope="col" class="text-center">{% translate "Fleet" %}</th>
|
||||||
<th scope="col" class="text-center">{% translate "Eve Time" %}</th>
|
<th scope="col" class="text-center">{% translate "EVE time" %}</th>
|
||||||
<th scope="col" class="text-center">{% translate "Duration" %}</th>
|
<th scope="col" class="text-center">{% translate "Duration" %}</th>
|
||||||
<th scope="col" class="text-center">{% translate "Edit" %}</th>
|
<th scope="col" class="text-center">{% translate "Edit" %}</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ Framework App Config
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class FrameworkConfig(AppConfig):
|
class FrameworkConfig(AppConfig):
|
||||||
@@ -12,3 +13,4 @@ class FrameworkConfig(AppConfig):
|
|||||||
|
|
||||||
name = "allianceauth.framework"
|
name = "allianceauth.framework"
|
||||||
label = "framework"
|
label = "framework"
|
||||||
|
verbose_name = _("Framework")
|
||||||
|
|||||||
@@ -5,6 +5,24 @@
|
|||||||
* to be used throughout Alliance Auth and its Community Apps
|
* to be used throughout Alliance Auth and its Community Apps
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* General
|
||||||
|
------------------------------------------------------------------------------------- */
|
||||||
|
@media all {
|
||||||
|
.navbar-toggler.collapsed {
|
||||||
|
transform: rotate(180deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
ul#nav-right:has(li) + ul#nav-right-character-control > li:first-child {
|
||||||
|
display: list-item !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media all and (max-width: 991px) {
|
||||||
|
ul#nav-left:has(li) + ul#nav-right + ul#nav-right-character-control > li:first-child {
|
||||||
|
display: list-item !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Bootstrap fixes
|
/* Bootstrap fixes
|
||||||
------------------------------------------------------------------------------------- */
|
------------------------------------------------------------------------------------- */
|
||||||
@media all {
|
@media all {
|
||||||
@@ -49,14 +67,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Chevron icons */
|
/* Chevron icons */
|
||||||
#sidebar-menu [data-bs-toggle="collapse"] > i.fa-chevron-down,
|
#sidebar-menu span[data-bs-toggle="collapse"][aria-expanded="true"] > i.fa-chevron-down,
|
||||||
#sidebar-menu [data-bs-toggle="collapse"].collapsed > i.fa-chevron-right {
|
#sidebar-menu span[data-bs-toggle="collapse"][aria-expanded="false"] > i.fa-chevron-right {
|
||||||
display: block;
|
display: block;
|
||||||
width: 16px;
|
width: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#sidebar-menu [data-bs-toggle="collapse"] > i.fa-chevron-right,
|
#sidebar-menu span[data-bs-toggle="collapse"][aria-expanded="true"] > i.fa-chevron-right,
|
||||||
#sidebar-menu [data-bs-toggle="collapse"].collapsed > i.fa-chevron-down {
|
#sidebar-menu span[data-bs-toggle="collapse"][aria-expanded="false"] > i.fa-chevron-down {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
{# {% include "framework/header/page-header.html" with title="Foobar" subtitle="Barfoo" %}#}
|
{# {% include "framework/header/page-header.html" with title="Foobar" subtitle="Barfoo" %}#}
|
||||||
|
|
||||||
{% if title %}
|
{% if title %}
|
||||||
<h1 class="page-header text-center mb-3">
|
<header class="aa-page-header mb-3">
|
||||||
|
<h1 class="page-header text-center">
|
||||||
{{ title }}
|
{{ title }}
|
||||||
|
|
||||||
{% if subtitle %}
|
{% if subtitle %}
|
||||||
@@ -10,4 +11,5 @@
|
|||||||
<small class="text-muted">{{ subtitle }}</small>
|
<small class="text-muted">{{ subtitle }}</small>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</h1>
|
</h1>
|
||||||
|
</header>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class GroupManagementConfig(AppConfig):
|
class GroupManagementConfig(AppConfig):
|
||||||
name = 'allianceauth.groupmanagement'
|
name = 'allianceauth.groupmanagement'
|
||||||
label = 'groupmanagement'
|
label = 'groupmanagement'
|
||||||
verbose_name = 'Group Management'
|
verbose_name = _('Group Management')
|
||||||
|
|
||||||
def ready(self):
|
def ready(self):
|
||||||
from . import signals # noqa: F401
|
from . import signals # noqa: F401
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class HRApplicationsConfig(AppConfig):
|
class HRApplicationsConfig(AppConfig):
|
||||||
name = 'allianceauth.hrapplications'
|
name = 'allianceauth.hrapplications'
|
||||||
label = 'hrapplications'
|
label = 'hrapplications'
|
||||||
|
verbose_name = _('HR Applications')
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
from typing import ClassVar
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from sortedm2m.fields import SortedManyToManyField
|
from sortedm2m.fields import SortedManyToManyField
|
||||||
@@ -40,7 +41,7 @@ class Application(models.Model):
|
|||||||
reviewer_character = models.ForeignKey(EveCharacter, on_delete=models.SET_NULL, blank=True, null=True)
|
reviewer_character = models.ForeignKey(EveCharacter, on_delete=models.SET_NULL, blank=True, null=True)
|
||||||
created = models.DateTimeField(auto_now_add=True)
|
created = models.DateTimeField(auto_now_add=True)
|
||||||
|
|
||||||
objects = ApplicationManager()
|
objects: ClassVar[ApplicationManager] = ApplicationManager()
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return str(self.user) + " Application To " + str(self.form)
|
return str(self.user) + " Application To " + str(self.form)
|
||||||
|
|||||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,7 @@
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -12,6 +13,7 @@ logger = logging.getLogger(__name__)
|
|||||||
class MenuConfig(AppConfig):
|
class MenuConfig(AppConfig):
|
||||||
name = "allianceauth.menu"
|
name = "allianceauth.menu"
|
||||||
label = "menu"
|
label = "menu"
|
||||||
|
verbose_name = _("Menu")
|
||||||
|
|
||||||
def ready(self):
|
def ready(self):
|
||||||
from allianceauth.menu.core import smart_sync
|
from allianceauth.menu.core import smart_sync
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
from typing import ClassVar
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
@@ -68,7 +69,7 @@ class MenuItem(models.Model):
|
|||||||
help_text=_("External URL this menu items will link to"),
|
help_text=_("External URL this menu items will link to"),
|
||||||
)
|
)
|
||||||
|
|
||||||
objects = MenuItemManager()
|
objects: ClassVar[MenuItemManager] = MenuItemManager()
|
||||||
|
|
||||||
def __str__(self) -> str:
|
def __str__(self) -> str:
|
||||||
return self.text
|
return self.text
|
||||||
|
|||||||
@@ -11,8 +11,8 @@
|
|||||||
data-bs-target="#{{ item.html_id }}"
|
data-bs-target="#{{ item.html_id }}"
|
||||||
aria-expanded="false"
|
aria-expanded="false"
|
||||||
aria-controls=""
|
aria-controls=""
|
||||||
{% endif %}>
|
{% endif %}
|
||||||
</i>
|
></i>
|
||||||
<a
|
<a
|
||||||
class="nav-link flex-fill align-self-center me-auto {% if item.navactive %}{% navactive request item.navactive|join:' ' %}{% endif %}"
|
class="nav-link flex-fill align-self-center me-auto {% if item.navactive %}{% navactive request item.navactive|join:' ' %}{% endif %}"
|
||||||
{% if item.is_folder %}
|
{% if item.is_folder %}
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
{% if item.is_folder %}
|
{% if item.is_folder %}
|
||||||
<span
|
<span
|
||||||
class="pill m-2 align-self-center collapsed"
|
class="pill m-2 align-self-center"
|
||||||
type="button"
|
type="button"
|
||||||
data-bs-toggle="collapse"
|
data-bs-toggle="collapse"
|
||||||
data-bs-target="#{{ item.html_id }}"
|
data-bs-target="#{{ item.html_id }}"
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class NotificationsConfig(AppConfig):
|
class NotificationsConfig(AppConfig):
|
||||||
name = 'allianceauth.notifications'
|
name = 'allianceauth.notifications'
|
||||||
label = 'notifications'
|
label = 'notifications'
|
||||||
|
verbose_name = _('Notifications')
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import logging
|
import logging
|
||||||
|
from typing import ClassVar
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
@@ -56,7 +57,7 @@ class Notification(models.Model):
|
|||||||
timestamp = models.DateTimeField(auto_now_add=True, db_index=True)
|
timestamp = models.DateTimeField(auto_now_add=True, db_index=True)
|
||||||
viewed = models.BooleanField(default=False, db_index=True)
|
viewed = models.BooleanField(default=False, db_index=True)
|
||||||
|
|
||||||
objects = NotificationManager()
|
objects: ClassVar[NotificationManager] = NotificationManager()
|
||||||
|
|
||||||
def __str__(self) -> str:
|
def __str__(self) -> str:
|
||||||
return f"{self.user}: {self.title}"
|
return f"{self.user}: {self.title}"
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class OptimerConfig(AppConfig):
|
class OptimerConfig(AppConfig):
|
||||||
name = 'allianceauth.optimer'
|
name = 'allianceauth.optimer'
|
||||||
label = 'optimer'
|
label = 'optimer'
|
||||||
|
verbose_name = _('Fleet Operations')
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<th class="text-center">{% translate "Operation" %}</th>
|
<th class="text-center">{% translate "Operation" %}</th>
|
||||||
<th class="text-center">{% translate "Type" %}</th>
|
<th class="text-center">{% translate "Type" %}</th>
|
||||||
<th class="text-center">{% translate "Form Up System" %}</th>
|
<th class="text-center">{% translate "Form Up System" %}</th>
|
||||||
<th class="text-center">{% translate "EVE Time" %}</th>
|
<th class="text-center">{% translate "EVE time" %}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<div class="text-center mb-3">
|
<div class="text-center mb-3">
|
||||||
<div class="badge bg-primary text-start">
|
<div class="badge bg-primary text-start">
|
||||||
<b>{% translate "Current Eve Time:" %}</b>
|
<b>{% translate "Current EVE time:" %}</b>
|
||||||
<span id="current-time"></span>
|
<span id="current-time"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -127,8 +127,8 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the current Eve time as a string
|
* Get the current EVE time as a string
|
||||||
* @returns {string} Eve time string
|
* @returns {string} EVE time string
|
||||||
*/
|
*/
|
||||||
const updateClock = () => {
|
const updateClock = () => {
|
||||||
document.getElementById("current-time").innerHTML = getCurrentEveTimeString();
|
document.getElementById("current-time").innerHTML = getCurrentEveTimeString();
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class PermissionsToolConfig(AppConfig):
|
class PermissionsToolConfig(AppConfig):
|
||||||
name = 'allianceauth.permissions_tool'
|
name = 'allianceauth.permissions_tool'
|
||||||
label = 'permissions_tool'
|
label = 'permissions_tool'
|
||||||
|
verbose_name = _('Permissions Audit')
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ CELERYBEAT_SCHEDULE = {
|
|||||||
'esi_cleanup_token': {
|
'esi_cleanup_token': {
|
||||||
'task': 'esi.tasks.cleanup_token',
|
'task': 'esi.tasks.cleanup_token',
|
||||||
'schedule': crontab(minute='0', hour='0'),
|
'schedule': crontab(minute='0', hour='0'),
|
||||||
|
'apply_offset': True,
|
||||||
},
|
},
|
||||||
'run_model_update': {
|
'run_model_update': {
|
||||||
'task': 'allianceauth.eveonline.tasks.run_model_update',
|
'task': 'allianceauth.eveonline.tasks.run_model_update',
|
||||||
@@ -119,7 +120,12 @@ LANGUAGES = ( # Sorted by Language Code alphabetical order + English at top
|
|||||||
|
|
||||||
# Django's language codes are different from some of the libraries we use,
|
# Django's language codes are different from some of the libraries we use,
|
||||||
# so we need to map them.
|
# so we need to map them.
|
||||||
|
# When adding a new language, please remember to add it to the mapping
|
||||||
|
# and add the language files to their respective directories under `allianceauth/static/allianceauth/libs/`.
|
||||||
LANGUAGE_MAPPING = {
|
LANGUAGE_MAPPING = {
|
||||||
|
# See https://github.com/DataTables/Plugins/tree/master/i18n for available languages
|
||||||
|
# (We use the JSON files)
|
||||||
|
# `allianceauth/static/allianceauth/libs/DataTables/Plugins/{version}/i18n/` for the files
|
||||||
"DataTables": {
|
"DataTables": {
|
||||||
"cs-cz": "cs",
|
"cs-cz": "cs",
|
||||||
"de": "de-DE",
|
"de": "de-DE",
|
||||||
@@ -134,6 +140,8 @@ LANGUAGE_MAPPING = {
|
|||||||
"uk": "uk",
|
"uk": "uk",
|
||||||
"zh-hans": "zh-HANT",
|
"zh-hans": "zh-HANT",
|
||||||
},
|
},
|
||||||
|
# See https://github.com/moment/moment/tree/master/locale for available languages
|
||||||
|
# `allianceauth/static/allianceauth/libs/moment.js/{version}/locale/` for the files
|
||||||
"MomentJS": {
|
"MomentJS": {
|
||||||
"cs-cz": "cs",
|
"cs-cz": "cs",
|
||||||
"de": "de",
|
"de": "de",
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
command = {{ celery }} -A {{ project_name }} beat
|
command = {{ celery }} -A {{ project_name }} beat
|
||||||
directory = {{ project_directory }}
|
directory = {{ project_directory }}
|
||||||
user = allianceserver
|
user = allianceserver
|
||||||
stdout_logfile={{ project_directory }}/log/beat.log
|
stdout_logfile = {{ project_directory }}/log/%(program_name)s.log
|
||||||
stderr_logfile={{ project_directory }}/log/beat.log
|
stderr_logfile = {{ project_directory }}/log/%(program_name)s.log
|
||||||
autostart = true
|
autostart = true
|
||||||
autorestart = true
|
autorestart = true
|
||||||
startsecs = 10
|
startsecs = 10
|
||||||
@@ -15,8 +15,8 @@ directory={{ project_directory }}
|
|||||||
user = allianceserver
|
user = allianceserver
|
||||||
numprocs = 1
|
numprocs = 1
|
||||||
process_name = %(program_name)s_%(process_num)02d
|
process_name = %(program_name)s_%(process_num)02d
|
||||||
stdout_logfile={{ project_directory }}/log/worker.log
|
stdout_logfile = {{ project_directory }}/log/%(program_name)s.log
|
||||||
stderr_logfile={{ project_directory }}/log/worker.log
|
stderr_logfile = {{ project_directory }}/log/%(program_name)s.log
|
||||||
autostart = true
|
autostart = true
|
||||||
autorestart = true
|
autorestart = true
|
||||||
startsecs = 10
|
startsecs = 10
|
||||||
@@ -29,12 +29,11 @@ priority=998
|
|||||||
user = allianceserver
|
user = allianceserver
|
||||||
directory = {{ project_directory }}
|
directory = {{ project_directory }}
|
||||||
command = {{ gunicorn }} {{ project_name }}.wsgi --workers=3 --timeout 120
|
command = {{ gunicorn }} {{ project_name }}.wsgi --workers=3 --timeout 120
|
||||||
stdout_logfile={{ project_directory }}/log/gunicorn.log
|
stdout_logfile = {{ project_directory }}/log/%(program_name)s.log
|
||||||
stderr_logfile={{ project_directory }}/log/gunicorn.log
|
stderr_logfile = {{ project_directory }}/log/%(program_name)s.log
|
||||||
autostart = true
|
autostart = true
|
||||||
autorestart = true
|
autorestart = true
|
||||||
stopsignal = INT
|
stopsignal = INT
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
[eventlistener:memmon]
|
[eventlistener:memmon]
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class ServicesConfig(AppConfig):
|
class ServicesConfig(AppConfig):
|
||||||
name = 'allianceauth.services'
|
name = 'allianceauth.services'
|
||||||
label = 'services'
|
label = 'services'
|
||||||
|
verbose_name = _('Services')
|
||||||
|
|
||||||
def ready(self):
|
def ready(self):
|
||||||
from . import signals
|
from . import signals
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class DiscordServiceConfig(AppConfig):
|
class DiscordServiceConfig(AppConfig):
|
||||||
name = 'allianceauth.services.modules.discord'
|
name = 'allianceauth.services.modules.discord'
|
||||||
label = 'discord'
|
label = 'discord'
|
||||||
|
verbose_name = _('Discord Service')
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import logging
|
import logging
|
||||||
from typing import Optional
|
from typing import ClassVar, Optional
|
||||||
|
|
||||||
from requests.exceptions import HTTPError
|
from requests.exceptions import HTTPError
|
||||||
|
|
||||||
@@ -59,7 +59,7 @@ class DiscordUser(models.Model):
|
|||||||
help_text='Date & time this service account was activated'
|
help_text='Date & time this service account was activated'
|
||||||
)
|
)
|
||||||
|
|
||||||
objects = DiscordUserManager()
|
objects: ClassVar[DiscordUserManager] = DiscordUserManager()
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
permissions = (
|
permissions = (
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class DiscourseServiceConfig(AppConfig):
|
class DiscourseServiceConfig(AppConfig):
|
||||||
name = 'allianceauth.services.modules.discourse'
|
name = 'allianceauth.services.modules.discourse'
|
||||||
label = 'discourse'
|
label = 'discourse'
|
||||||
|
verbose_name = _('Discourse Service')
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class ExampleServiceConfig(AppConfig):
|
class ExampleServiceConfig(AppConfig):
|
||||||
name = 'allianceauth.services.modules.example'
|
name = 'allianceauth.services.modules.example'
|
||||||
label = 'example_service'
|
label = 'example_service'
|
||||||
|
verbose_name = _('Example Service')
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class Ips4ServiceConfig(AppConfig):
|
class Ips4ServiceConfig(AppConfig):
|
||||||
name = 'allianceauth.services.modules.ips4'
|
name = 'allianceauth.services.modules.ips4'
|
||||||
label = 'ips4'
|
label = 'ips4'
|
||||||
|
verbose_name = _('IPS4 Service')
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class MumbleServiceConfig(AppConfig):
|
class MumbleServiceConfig(AppConfig):
|
||||||
name = 'allianceauth.services.modules.mumble'
|
name = 'allianceauth.services.modules.mumble'
|
||||||
label = 'mumble'
|
label = 'mumble'
|
||||||
|
verbose_name = _('Mumble Service')
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import random
|
import random
|
||||||
import string
|
import string
|
||||||
|
from typing import ClassVar
|
||||||
from passlib.hash import bcrypt_sha256
|
from passlib.hash import bcrypt_sha256
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
@@ -116,7 +117,7 @@ class MumbleUser(AbstractServiceModel):
|
|||||||
help_text="Timestamp of the users Last Disconnection to Mumble"
|
help_text="Timestamp of the users Last Disconnection to Mumble"
|
||||||
)
|
)
|
||||||
|
|
||||||
objects = MumbleManager()
|
objects: ClassVar[MumbleManager] = MumbleManager()
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.username
|
return self.username
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
{% endblock page_title %}
|
{% endblock page_title %}
|
||||||
|
|
||||||
{% block header_nav_brand %}
|
{% block header_nav_brand %}
|
||||||
<a class="navbar-brand">{% trans "Mumble History" %} - {{ mumble_url }}</a>
|
{% trans "Mumble History" %} - {{ mumble_url }}
|
||||||
{% endblock header_nav_brand %}
|
{% endblock header_nav_brand %}
|
||||||
|
|
||||||
{% block header_nav_collapse_left %}
|
{% block header_nav_collapse_left %}
|
||||||
@@ -87,7 +87,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
const MUMBLESTATS_DATETIME_FORMAT = 'YYYY-MM-DD, HH:mm';
|
const MUMBLESTATS_DATETIME_FORMAT = 'LLL';
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
@@ -104,15 +104,33 @@
|
|||||||
{ data: 'version' },
|
{ data: 'version' },
|
||||||
{
|
{
|
||||||
data: 'last_connect',
|
data: 'last_connect',
|
||||||
render: (data) => {
|
render: {
|
||||||
return moment(data).utc().format(MUMBLESTATS_DATETIME_FORMAT);
|
_: (data) => {
|
||||||
|
return data === null
|
||||||
|
? ''
|
||||||
|
: moment(data)
|
||||||
|
.utc()
|
||||||
|
.format(MUMBLESTATS_DATETIME_FORMAT);
|
||||||
|
},
|
||||||
|
sort: (data) => {
|
||||||
|
return data === null ? '' : data;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
className: 'text-end',
|
className: 'text-end',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
data: 'last_disconnect',
|
data: 'last_disconnect',
|
||||||
render: (data) => {
|
render: {
|
||||||
return moment(data).utc().format(MUMBLESTATS_DATETIME_FORMAT);
|
_: (data) => {
|
||||||
|
return data === null
|
||||||
|
? ''
|
||||||
|
: moment(data)
|
||||||
|
.utc()
|
||||||
|
.format(MUMBLESTATS_DATETIME_FORMAT);
|
||||||
|
},
|
||||||
|
sort: (data) => {
|
||||||
|
return data === null ? '' : data;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
className: 'text-end',
|
className: 'text-end',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -48,7 +48,7 @@
|
|||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if request.user.is_superuser %}
|
{% if perms.mumble.view_connection_history %}
|
||||||
<a class="btn btn-primary" type="button" id="btnMumbleConnectionHistory" href="{% url 'mumble:connection_history' %}" title="{% translate 'Mumble Connection History' %}">
|
<a class="btn btn-primary" type="button" id="btnMumbleConnectionHistory" href="{% url 'mumble:connection_history' %}" title="{% translate 'Mumble Connection History' %}">
|
||||||
<i class="fa-solid fa-clock-rotate-left"></i> History
|
<i class="fa-solid fa-clock-rotate-left"></i> History
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class OpenfireServiceConfig(AppConfig):
|
class OpenfireServiceConfig(AppConfig):
|
||||||
name = 'allianceauth.services.modules.openfire'
|
name = 'allianceauth.services.modules.openfire'
|
||||||
label = 'openfire'
|
label = 'openfire'
|
||||||
|
verbose_name = _('Openfire Service')
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class Phpbb3ServiceConfig(AppConfig):
|
class Phpbb3ServiceConfig(AppConfig):
|
||||||
name = 'allianceauth.services.modules.phpbb3'
|
name = 'allianceauth.services.modules.phpbb3'
|
||||||
label = 'phpbb3'
|
label = 'phpbb3'
|
||||||
|
verbose_name = _('phpBB3 Service')
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class SmfServiceConfig(AppConfig):
|
class SmfServiceConfig(AppConfig):
|
||||||
name = 'allianceauth.services.modules.smf'
|
name = 'allianceauth.services.modules.smf'
|
||||||
label = 'smf'
|
label = 'smf'
|
||||||
|
verbose_name = _('SMF Service')
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class Teamspeak3ServiceConfig(AppConfig):
|
class Teamspeak3ServiceConfig(AppConfig):
|
||||||
name = 'allianceauth.services.modules.teamspeak3'
|
name = 'allianceauth.services.modules.teamspeak3'
|
||||||
label = 'teamspeak3'
|
label = 'teamspeak3'
|
||||||
|
verbose_name = _('TeamSpeak 3 Service')
|
||||||
|
|
||||||
def ready(self):
|
def ready(self):
|
||||||
from . import signals
|
from . import signals
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class XenforoServiceConfig(AppConfig):
|
class XenforoServiceConfig(AppConfig):
|
||||||
name = 'allianceauth.services.modules.xenforo'
|
name = 'allianceauth.services.modules.xenforo'
|
||||||
label = 'xenforo'
|
label = 'xenforo'
|
||||||
|
verbose_name = _('Xenforo Service')
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
|
||||||
<div class="card text-center m-2" style="min-width: 18rem; min-height: 18rem;">
|
<div class="card text-center mx-2 mb-3" style="min-width: 18rem; min-height: 18rem;">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h5 class="card-title">{% block title %}{% endblock title %}</h5>
|
<h5 class="card-title">{% block title %}{% endblock title %}</h5>
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class SRPConfig(AppConfig):
|
class SRPConfig(AppConfig):
|
||||||
name = 'allianceauth.srp'
|
name = 'allianceauth.srp'
|
||||||
label = 'srp'
|
label = 'srp'
|
||||||
|
verbose_name = _('Ship Replacement')
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ ul.list-group.list-group-horizontal > li.list-group-item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* eve time in navbar
|
/* EVE time in navbar
|
||||||
------------------------------------------------------------------------------------- */
|
------------------------------------------------------------------------------------- */
|
||||||
@media all {
|
@media all {
|
||||||
.nav-item-eve-time .eve-time-wrapper {
|
.nav-item-eve-time .eve-time-wrapper {
|
||||||
|
|||||||
@@ -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(() => {
|
setInterval(() => {
|
||||||
renderClock($('.eve-time-wrapper .eve-time-clock'));
|
renderClock($('.eve-time-wrapper .eve-time-clock'));
|
||||||
|
|||||||
@@ -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:
|
* condition:
|
||||||
* only if moment.js is loaded before,
|
* only if moment.js is loaded before,
|
||||||
|
|||||||
@@ -12,11 +12,7 @@
|
|||||||
<ul class="list-group">
|
<ul class="list-group">
|
||||||
{% for notif in notifications %}
|
{% for notif in notifications %}
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
{% if notif.state == 'opened' %}
|
|
||||||
<span class="badge bg-success me-2">{% translate "Open" %}</span>
|
<span class="badge bg-success me-2">{% translate "Open" %}</span>
|
||||||
{% else %}
|
|
||||||
<span class="badge bg-danger me-2">{% translate "Closed" %}</span>
|
|
||||||
{% endif %}
|
|
||||||
<a href="{{ notif.web_url }}" target="_blank">#{{ notif.iid }} {{ notif.title }}</a>
|
<a href="{{ notif.web_url }}" target="_blank">#{{ notif.iid }} {{ notif.title }}</a>
|
||||||
</li>
|
</li>
|
||||||
{% empty %}
|
{% empty %}
|
||||||
|
|||||||
@@ -12,11 +12,10 @@
|
|||||||
<!-- End Required meta tags -->
|
<!-- End Required meta tags -->
|
||||||
|
|
||||||
<!-- Meta tags -->
|
<!-- Meta tags -->
|
||||||
<!-- TODO Bundle all the site specific stuff up into its own template for easy override -->
|
{% include 'allianceauth/opengraph.html' %}
|
||||||
<meta name="description" content="">
|
|
||||||
<meta name="author" content="">
|
|
||||||
{% include 'allianceauth/icons.html' %}
|
{% include 'allianceauth/icons.html' %}
|
||||||
<!-- Meta tags -->
|
<!-- Meta tags -->
|
||||||
|
|
||||||
<title>{% block title %}{% block page_title %}{% endblock page_title %} - {{ SITE_NAME }}{% endblock title %}</title>
|
<title>{% block title %}{% block page_title %}{% endblock page_title %} - {{ SITE_NAME }}{% endblock title %}</title>
|
||||||
|
|
||||||
{% theme_css %}
|
{% theme_css %}
|
||||||
@@ -25,12 +24,11 @@
|
|||||||
{% include 'bundles/auth-framework-css.html' %}
|
{% include 'bundles/auth-framework-css.html' %}
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.navbar-toggler.collapsed{
|
@media all {
|
||||||
transform: rotate(180deg);
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-padding {
|
.nav-padding {
|
||||||
padding-top: {% header_padding_size %} !important;
|
margin-top: {% header_padding_size %} !important;
|
||||||
|
max-height: calc(100vh - {% header_padding_size %}) !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
@@ -63,6 +61,11 @@
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<ul id="nav-right-character-control" class="nav navbar-nav">
|
<ul id="nav-right-character-control" class="nav navbar-nav">
|
||||||
|
<li class="nav-item ms-lg-2 py-2 py-lg-1 col-12 col-lg-auto d-none">
|
||||||
|
<div class="vr d-none d-lg-flex h-100 mx-2 text-white-50"></div>
|
||||||
|
<hr class="d-lg-none my-2 text-body text-white-50">
|
||||||
|
</li>
|
||||||
|
|
||||||
{% block header_nav_user_character_control %} <!-- Default to add char and swap main -->
|
{% block header_nav_user_character_control %} <!-- Default to add char and swap main -->
|
||||||
{% include 'allianceauth/top-menu-rh-default.html' %}
|
{% include 'allianceauth/top-menu-rh-default.html' %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
@@ -101,22 +104,30 @@
|
|||||||
const sidebar = document.getElementById('sidebar');
|
const sidebar = document.getElementById('sidebar');
|
||||||
|
|
||||||
sidebar.addEventListener('shown.bs.collapse', () => {
|
sidebar.addEventListener('shown.bs.collapse', () => {
|
||||||
localStorage.removeItem('sidebar_' + sidebar.id);
|
localStorage.removeItem(`sidebar_${sidebar.id}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
sidebar.addEventListener('hidden.bs.collapse', () => {
|
sidebar.addEventListener('hidden.bs.collapse', () => {
|
||||||
localStorage.setItem('sidebar_' + sidebar.id, 'closed');
|
localStorage.setItem(`sidebar_${sidebar.id}`, 'closed');
|
||||||
});
|
});
|
||||||
|
|
||||||
if (localStorage.getItem('sidebar_' + sidebar.id) === 'closed') {
|
if (localStorage.getItem(`sidebar_${sidebar.id}`) === 'closed') {
|
||||||
sidebar.classList.remove('show')
|
sidebar.classList.remove('show')
|
||||||
} else {
|
} else {
|
||||||
sidebar.classList.add("show")
|
sidebar.classList.add("show")
|
||||||
}
|
}
|
||||||
|
|
||||||
const activeChildMenuItem = document.querySelector('#sidebar-menu li ul li a.active');
|
const activeChildMenuItem = document.querySelector('#sidebar-menu li ul li a.active');
|
||||||
|
|
||||||
if (activeChildMenuItem) {
|
if (activeChildMenuItem) {
|
||||||
activeChildMenuItem.parentElement.parentElement.classList.add('show');
|
const activeChildMenuUl = activeChildMenuItem.parentElement.parentElement;
|
||||||
|
const elementsToToggle = document.querySelectorAll(`[data-bs-target^="#${activeChildMenuUl.id}"]`);
|
||||||
|
|
||||||
|
activeChildMenuUl.classList.add('show');
|
||||||
|
|
||||||
|
elementsToToggle.forEach((element) => {
|
||||||
|
element.setAttribute('aria-expanded', true);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
8
allianceauth/templates/allianceauth/opengraph.html
Normal file
8
allianceauth/templates/allianceauth/opengraph.html
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{% load static %}
|
||||||
|
|
||||||
|
<meta property="og:title" content="{{ SITE_NAME }}">
|
||||||
|
<meta property="og:image" content="{{ SITE_URL }}{% static 'allianceauth/icons/apple-touch-icon.png' %}">
|
||||||
|
<meta property="og:description" content="Alliance Auth - An auth system for EVE Online to help in-game organizations manage online service access.">
|
||||||
|
<meta property="og:type" content="website">
|
||||||
|
<meta property="og:site_name" content="{{ request.META.HTTP_HOST }}">
|
||||||
|
<meta property="og:url" content="{{ request.path }}">
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
<div class="collapse navbar-collapse auth-menus-collapse">
|
<div class="collapse navbar-collapse auth-menus-collapse">
|
||||||
<ul class="nav navbar-nav navbar-right navbar-pills">
|
<ul class="nav navbar-nav navbar-right navbar-pills">
|
||||||
<li class="nav-item-eve-time">
|
<li class="nav-item-eve-time">
|
||||||
<div class="eve-time-wrapper">{% translate "Eve Time" %}: <span class="eve-time-clock"></span></div>
|
<div class="eve-time-wrapper">{% translate "EVE time" %}: <span class="eve-time-clock"></span></div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
{% if user.is_authenticated %}
|
{% if user.is_authenticated %}
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
{% load static %}
|
{% load static %}
|
||||||
|
|
||||||
<img src="{% static 'allianceauth/images/auth-logo.svg' %}" width="{{ logo_width|default:"128px" }}" height="{% if logo_height %}{{ logo_ }}{% else %}{{ logo_width|default:"128px" }}{% endif %}" alt="{{ SITE_NAME }}">
|
<img src="{% static 'allianceauth/images/auth-logo.svg' %}" width="{{ logo_width|default:"128px" }}" height="{% if logo_height %}{{ logo_height }}{% else %}{{ logo_width|default:"128px" }}{% endif %}" alt="{{ SITE_NAME }}">
|
||||||
|
|||||||
@@ -67,6 +67,26 @@ def get_datatables_language_static(language: str) -> str:
|
|||||||
|
|
||||||
return static_url
|
return static_url
|
||||||
|
|
||||||
|
@register.simple_tag
|
||||||
|
def get_relative_datatables_language_path(language: str) -> str:
|
||||||
|
"""
|
||||||
|
Get the correct language code URL for DataTables (relative path to the static folder)
|
||||||
|
|
||||||
|
:param language: Django's language code
|
||||||
|
:type language: str
|
||||||
|
:return: Mapped language code
|
||||||
|
:rtype: str
|
||||||
|
"""
|
||||||
|
|
||||||
|
mapped_language = get_datatable_language_code(language)
|
||||||
|
static_url = (
|
||||||
|
f"allianceauth/libs/DataTables/Plugins/2.2.1/i18n/{mapped_language}.json"
|
||||||
|
if mapped_language
|
||||||
|
else ""
|
||||||
|
)
|
||||||
|
|
||||||
|
return static_url
|
||||||
|
|
||||||
|
|
||||||
@register.simple_tag
|
@register.simple_tag
|
||||||
def get_momentjs_language_static(language: str) -> str:
|
def get_momentjs_language_static(language: str) -> str:
|
||||||
@@ -88,3 +108,24 @@ def get_momentjs_language_static(language: str) -> str:
|
|||||||
)
|
)
|
||||||
|
|
||||||
return static_url
|
return static_url
|
||||||
|
|
||||||
|
@register.simple_tag
|
||||||
|
def get_relative_momentjs_language_path(language: str) -> str:
|
||||||
|
"""
|
||||||
|
Get the correct language code URL for Moment.JS (relative path to the static folder)
|
||||||
|
|
||||||
|
:param language: Django's language code
|
||||||
|
:type language: str
|
||||||
|
:return: Mapped language code path
|
||||||
|
:rtype: str
|
||||||
|
"""
|
||||||
|
|
||||||
|
mapped_language = get_momentjs_language_code(language)
|
||||||
|
|
||||||
|
static_url = (
|
||||||
|
f"allianceauth/libs/moment.js/2.29.4/locale/{mapped_language}.js"
|
||||||
|
if mapped_language
|
||||||
|
else ""
|
||||||
|
)
|
||||||
|
|
||||||
|
return static_url
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class TimerBoardConfig(AppConfig):
|
class TimerBoardConfig(AppConfig):
|
||||||
name = 'allianceauth.timerboard'
|
name = 'allianceauth.timerboard'
|
||||||
label = 'timerboard'
|
label = 'timerboard'
|
||||||
|
verbose_name = _('Structure Timers')
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ class TimerForm(forms.ModelForm):
|
|||||||
future_time = datetime.timedelta(days=days_left, hours=hours_left, minutes=minutes_left)
|
future_time = datetime.timedelta(days=days_left, hours=hours_left, minutes=minutes_left)
|
||||||
current_time = timezone.now()
|
current_time = timezone.now()
|
||||||
eve_time = current_time + future_time
|
eve_time = current_time + future_time
|
||||||
logger.debug(f"Determined timer eve time is {eve_time} - current time {current_time}, adding {future_time}")
|
logger.debug(f"Determined timer EVE time is {eve_time} - current time {current_time}, adding {future_time}")
|
||||||
elif absolute_time:
|
elif absolute_time:
|
||||||
# Use absolute time
|
# Use absolute time
|
||||||
eve_time = absolute_time
|
eve_time = absolute_time
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 4.2.16 on 2025-03-26 20:53
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('timerboard', '0007_alter_timer_structure'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='timer',
|
||||||
|
name='timer_type',
|
||||||
|
field=models.CharField(choices=[('UNSPECIFIED', 'Not Specified'), ('SHIELD', 'Shield'), ('ARMOR', 'Armor'), ('HULL', 'Hull'), ('FINAL', 'Final'), ('ANCHORING', 'Anchoring'), ('UNANCHORING', 'Unanchoring'), ('ABANDONED', 'Abandoned'), ('THEFT', 'Theft')], default='UNSPECIFIED', max_length=254),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -57,6 +57,7 @@ class Timer(models.Model):
|
|||||||
ANCHORING = "ANCHORING", _("Anchoring")
|
ANCHORING = "ANCHORING", _("Anchoring")
|
||||||
UNANCHORING = "UNANCHORING", _("Unanchoring")
|
UNANCHORING = "UNANCHORING", _("Unanchoring")
|
||||||
ABANDONED = "ABANDONED", _("Abandoned")
|
ABANDONED = "ABANDONED", _("Abandoned")
|
||||||
|
THEFT = "THEFT", _("Theft")
|
||||||
|
|
||||||
details = models.CharField(max_length=254, default="")
|
details = models.CharField(max_length=254, default="")
|
||||||
system = models.CharField(max_length=254, default="")
|
system = models.CharField(max_length=254, default="")
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<th class="text-center">{% translate "Timer" %}</th>
|
<th class="text-center">{% translate "Timer" %}</th>
|
||||||
<th class="text-center">{% translate "Type" %}</th>
|
<th class="text-center">{% translate "Type" %}</th>
|
||||||
<th class="text-center">{% translate "System" %}</th>
|
<th class="text-center">{% translate "System" %}</th>
|
||||||
<th class="text-center">{% translate "EVE Time" %}</th>
|
<th class="text-center">{% translate "EVE time" %}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<th class="text-center">{% translate "Objective" %}</th>
|
<th class="text-center">{% translate "Objective" %}</th>
|
||||||
<th class="text-center">{% translate "System" %}</th>
|
<th class="text-center">{% translate "System" %}</th>
|
||||||
<th class="text-center">{% translate "Structure" %}</th>
|
<th class="text-center">{% translate "Structure" %}</th>
|
||||||
<th class="text-center">{% translate "Eve Time" %}</th>
|
<th class="text-center">{% translate "EVE time" %}</th>
|
||||||
<th class="text-center">{% translate "Local Time" %}</th>
|
<th class="text-center">{% translate "Local Time" %}</th>
|
||||||
<th class="text-center">{% translate "Creator" %}</th>
|
<th class="text-center">{% translate "Creator" %}</th>
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
<div class="allianceauth-timerboard">
|
<div class="allianceauth-timerboard">
|
||||||
<div class="col-lg-12 text-center mb-3">
|
<div class="col-lg-12 text-center mb-3">
|
||||||
<div class="badge bg-primary text-start">
|
<div class="badge bg-primary text-start">
|
||||||
<span>{% translate "Current Eve Time:" %}</span>
|
<span>{% translate "Current EVE time:" %}</span>
|
||||||
<span id="current-time"></span>
|
<span id="current-time"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -180,6 +180,9 @@
|
|||||||
$(document).ready(() => {
|
$(document).ready(() => {
|
||||||
const dtOptions = {
|
const dtOptions = {
|
||||||
language: {url: '{{ DT_LANG_PATH }}'},
|
language: {url: '{{ DT_LANG_PATH }}'},
|
||||||
|
order: [
|
||||||
|
[4, 'asc']
|
||||||
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
{% if perms.auth.timer_management %}
|
{% if perms.auth.timer_management %}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
PROTOCOL=https://
|
PROTOCOL=https://
|
||||||
AUTH_SUBDOMAIN=%AUTH_SUBDOMAIN%
|
AUTH_SUBDOMAIN=%AUTH_SUBDOMAIN%
|
||||||
DOMAIN=%DOMAIN%
|
DOMAIN=%DOMAIN%
|
||||||
AA_DOCKER_TAG=registry.gitlab.com/allianceauth/allianceauth/auth:v4.6.1
|
AA_DOCKER_TAG=registry.gitlab.com/allianceauth/allianceauth/auth:v4.6.4
|
||||||
|
|
||||||
# Nginx Proxy Manager
|
# Nginx Proxy Manager
|
||||||
PROXY_HTTP_PORT=80
|
PROXY_HTTP_PORT=80
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
FROM python:3.11-slim
|
FROM python:3.11-slim
|
||||||
ARG AUTH_VERSION=v4.6.1
|
ARG AUTH_VERSION=v4.6.4
|
||||||
ARG AUTH_PACKAGE=allianceauth==${AUTH_VERSION}
|
ARG AUTH_PACKAGE=allianceauth==${AUTH_VERSION}
|
||||||
ENV AUTH_USER=allianceauth
|
ENV AUTH_USER=allianceauth
|
||||||
ENV AUTH_GROUP=allianceauth
|
ENV AUTH_GROUP=allianceauth
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ Example implementation for a celery chain:
|
|||||||
|
|
||||||
```python
|
```python
|
||||||
from allianceauth.services.hooks import get_extension_logger
|
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__)
|
logger = get_extension_logger(__name__)
|
||||||
|
|
||||||
@@ -98,18 +98,23 @@ def long_runner():
|
|||||||
task_signature = example.si()
|
task_signature = example.si()
|
||||||
my_tasks.append(task_signature)
|
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.
|
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.
|
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}
|
:::{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.
|
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.
|
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.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
[build-system]
|
[build-system]
|
||||||
build-backend = "flit_core.buildapi"
|
build-backend = "flit_core.buildapi"
|
||||||
requires = [
|
requires = [
|
||||||
"flit-core<4,>=3.2",
|
"flit-core>=3.2,<4",
|
||||||
]
|
]
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
@@ -31,6 +31,7 @@ classifiers = [
|
|||||||
"Programming Language :: Python :: 3.10",
|
"Programming Language :: Python :: 3.10",
|
||||||
"Programming Language :: Python :: 3.11",
|
"Programming Language :: Python :: 3.11",
|
||||||
"Programming Language :: Python :: 3.12",
|
"Programming Language :: Python :: 3.12",
|
||||||
|
"Programming Language :: Python :: 3.13",
|
||||||
"Topic :: Internet :: WWW/HTTP",
|
"Topic :: Internet :: WWW/HTTP",
|
||||||
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
|
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
|
||||||
]
|
]
|
||||||
@@ -41,15 +42,15 @@ dynamic = [
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"bcrypt",
|
"bcrypt",
|
||||||
"beautifulsoup4",
|
"beautifulsoup4",
|
||||||
"celery<6,>=5.2",
|
"celery>=5.2,<6",
|
||||||
"celery-once>=3.0.1",
|
"celery-once>=3.0.1",
|
||||||
"django<5,>=4.2",
|
"django>=4.2,<5",
|
||||||
"django-bootstrap-form",
|
"django-bootstrap-form",
|
||||||
"django-bootstrap5>=23.3",
|
"django-bootstrap5>=23.3",
|
||||||
"django-celery-beat>=2.3",
|
"django-celery-beat>=2.3",
|
||||||
"django-esi>=5",
|
"django-esi>=5",
|
||||||
"django-redis>=5.2",
|
"django-redis>=5.2",
|
||||||
"django-registration<3.4,>=3.3",
|
"django-registration>=3.3,<3.4",
|
||||||
"django-solo",
|
"django-solo",
|
||||||
"django-sortedm2m",
|
"django-sortedm2m",
|
||||||
"django-sri",
|
"django-sri",
|
||||||
@@ -64,13 +65,13 @@ dependencies = [
|
|||||||
"requests>=2.9.1",
|
"requests>=2.9.1",
|
||||||
"requests-oauthlib",
|
"requests-oauthlib",
|
||||||
"semantic-version",
|
"semantic-version",
|
||||||
"slixmpp",
|
"slixmpp<1.9",
|
||||||
]
|
]
|
||||||
optional-dependencies.docs = [
|
optional-dependencies.docs = [
|
||||||
"myst-parser",
|
"myst-parser",
|
||||||
"sphinx",
|
"sphinx",
|
||||||
"sphinx-copybutton",
|
"sphinx-copybutton",
|
||||||
"sphinx-rtd-theme<3,>=2",
|
"sphinx-rtd-theme>=2,<3",
|
||||||
"sphinx-tabs",
|
"sphinx-tabs",
|
||||||
"sphinxcontrib-django",
|
"sphinxcontrib-django",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ CACHES = {
|
|||||||
ESI_SSO_CLIENT_ID = "dummy"
|
ESI_SSO_CLIENT_ID = "dummy"
|
||||||
ESI_SSO_CLIENT_SECRET = "dummy"
|
ESI_SSO_CLIENT_SECRET = "dummy"
|
||||||
ESI_SSO_CALLBACK_URL = f"{SITE_URL}/sso/callback"
|
ESI_SSO_CALLBACK_URL = f"{SITE_URL}/sso/callback"
|
||||||
|
ESI_USER_CONTACT_EMAIL = "dummy@example.net"
|
||||||
|
|
||||||
########################
|
########################
|
||||||
# XenForo Configuration
|
# XenForo Configuration
|
||||||
|
|||||||
@@ -37,3 +37,4 @@ ALLIANCEAUTH_DASHBOARD_TASK_STATISTICS_DISABLED = True # disable for tests
|
|||||||
ESI_SSO_CLIENT_ID = "dummy"
|
ESI_SSO_CLIENT_ID = "dummy"
|
||||||
ESI_SSO_CLIENT_SECRET = "dummy"
|
ESI_SSO_CLIENT_SECRET = "dummy"
|
||||||
ESI_SSO_CALLBACK_URL = f"{SITE_URL}/sso/callback"
|
ESI_SSO_CALLBACK_URL = f"{SITE_URL}/sso/callback"
|
||||||
|
ESI_USER_CONTACT_EMAIL = "dummy@example.net"
|
||||||
|
|||||||
Reference in New Issue
Block a user