From 2ce9ba997f85f541b51d3d5fc3eafbb92a7eeae1 Mon Sep 17 00:00:00 2001 From: Peter Pfeufer Date: Sun, 16 Mar 2025 10:11:27 +0100 Subject: [PATCH 01/53] [CHANGE] Update supervisor.conf template Use `%(program_name)s` variable for logfile names, which makes it easier to avoid possible copy/paste issues and mistakes. --- allianceauth/project_template/supervisor.conf | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/allianceauth/project_template/supervisor.conf b/allianceauth/project_template/supervisor.conf index 5dcc54d6..ed9bb2a1 100644 --- a/allianceauth/project_template/supervisor.conf +++ b/allianceauth/project_template/supervisor.conf @@ -2,8 +2,8 @@ command={{ celery }} -A {{ project_name }} beat directory={{ project_directory }} user=allianceserver -stdout_logfile={{ project_directory }}/log/beat.log -stderr_logfile={{ project_directory }}/log/beat.log +stdout_logfile={{ project_directory }}/log/%(program_name)s.log +stderr_logfile={{ project_directory }}/log/%(program_name)s.log autostart=true autorestart=true startsecs=10 @@ -15,12 +15,12 @@ directory={{ project_directory }} user=allianceserver numprocs=1 process_name=%(program_name)s_%(process_num)02d -stdout_logfile={{ project_directory }}/log/worker.log -stderr_logfile={{ project_directory }}/log/worker.log +stdout_logfile={{ project_directory }}/log/%(program_name)s.log +stderr_logfile={{ project_directory }}/log/%(program_name)s.log autostart=true autorestart=true startsecs=10 -stopwaitsecs = 600 +stopwaitsecs=600 killasgroup=true priority=998 @@ -29,12 +29,11 @@ priority=998 user = allianceserver directory={{ project_directory }} command={{ gunicorn }} {{ project_name }}.wsgi --workers=3 --timeout 120 -stdout_logfile={{ project_directory }}/log/gunicorn.log -stderr_logfile={{ project_directory }}/log/gunicorn.log +stdout_logfile={{ project_directory }}/log/%(program_name)s.log +stderr_logfile={{ project_directory }}/log/%(program_name)s.log autostart=true autorestart=true stopsignal=INT - {% endif %} [eventlistener:memmon] From 4edb7cb678054ffaca8a13199cc0d821c13c7f02 Mon Sep 17 00:00:00 2001 From: Peter Pfeufer Date: Sun, 16 Mar 2025 10:15:36 +0100 Subject: [PATCH 02/53] [CHANGE] Assignment format to INI style The supervisor.conf file uses INI style, so the format should reflect this. --- allianceauth/project_template/supervisor.conf | 72 +++++++++---------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/allianceauth/project_template/supervisor.conf b/allianceauth/project_template/supervisor.conf index ed9bb2a1..3c74a372 100644 --- a/allianceauth/project_template/supervisor.conf +++ b/allianceauth/project_template/supervisor.conf @@ -1,48 +1,48 @@ [program:beat] -command={{ celery }} -A {{ project_name }} beat -directory={{ project_directory }} -user=allianceserver -stdout_logfile={{ project_directory }}/log/%(program_name)s.log -stderr_logfile={{ project_directory }}/log/%(program_name)s.log -autostart=true -autorestart=true -startsecs=10 -priority=998 +command = {{ celery }} -A {{ project_name }} beat +directory = {{ project_directory }} +user = allianceserver +stdout_logfile = {{ project_directory }}/log/%(program_name)s.log +stderr_logfile = {{ project_directory }}/log/%(program_name)s.log +autostart = true +autorestart = true +startsecs = 10 +priority = 998 [program:worker] -command={{ celery }} -A {{ project_name }} worker --pool=threads --concurrency=5 -n %(program_name)s_%(process_num)02d -directory={{ project_directory }} -user=allianceserver -numprocs=1 -process_name=%(program_name)s_%(process_num)02d -stdout_logfile={{ project_directory }}/log/%(program_name)s.log -stderr_logfile={{ project_directory }}/log/%(program_name)s.log -autostart=true -autorestart=true -startsecs=10 -stopwaitsecs=600 -killasgroup=true -priority=998 +command = {{ celery }} -A {{ project_name }} worker --pool=threads --concurrency=5 -n %(program_name)s_%(process_num)02d +directory = {{ project_directory }} +user = allianceserver +numprocs = 1 +process_name = %(program_name)s_%(process_num)02d +stdout_logfile = {{ project_directory }}/log/%(program_name)s.log +stderr_logfile = {{ project_directory }}/log/%(program_name)s.log +autostart = true +autorestart = true +startsecs = 10 +stopwaitsecs = 600 +killasgroup = true +priority = 998 {% if gunicorn %} [program:gunicorn] user = allianceserver -directory={{ project_directory }} -command={{ gunicorn }} {{ project_name }}.wsgi --workers=3 --timeout 120 -stdout_logfile={{ project_directory }}/log/%(program_name)s.log -stderr_logfile={{ project_directory }}/log/%(program_name)s.log -autostart=true -autorestart=true -stopsignal=INT +directory = {{ project_directory }} +command = {{ gunicorn }} {{ project_name }}.wsgi --workers=3 --timeout 120 +stdout_logfile = {{ project_directory }}/log/%(program_name)s.log +stderr_logfile = {{ project_directory }}/log/%(program_name)s.log +autostart = true +autorestart = true +stopsignal = INT {% endif %} [eventlistener:memmon] -command={{ memmon }} -p worker_00=256MB -p gunicorn=256MB -directory={{ project_directory }} -events=TICK_60 -stdout_logfile={{ project_directory }}/log/memmon.log -stderr_logfile={{ project_directory }}/log/memmon.log +command = {{ memmon }} -p worker_00=256MB -p gunicorn=256MB +directory = {{ project_directory }} +events = TICK_60 +stdout_logfile = {{ project_directory }}/log/memmon.log +stderr_logfile = {{ project_directory }}/log/memmon.log [group:{{ project_name }}] -programs=beat,worker{% if gunicorn %},gunicorn{% endif %} -priority=999 +programs = beat,worker{% if gunicorn %},gunicorn{% endif %} +priority = 999 From f26835fae0af5c27452ad364cda00fb56324d889 Mon Sep 17 00:00:00 2001 From: Peter Pfeufer Date: Tue, 18 Mar 2025 18:25:58 +0100 Subject: [PATCH 03/53] [ADD] Opengraph Template for easier override --- allianceauth/authentication/templates/public/base.html | 7 +------ allianceauth/templates/allianceauth/base-bs5.html | 5 ++--- allianceauth/templates/allianceauth/opengraph.html | 5 +++++ 3 files changed, 8 insertions(+), 9 deletions(-) create mode 100644 allianceauth/templates/allianceauth/opengraph.html diff --git a/allianceauth/authentication/templates/public/base.html b/allianceauth/authentication/templates/public/base.html index b73cfd4d..ada256e0 100644 --- a/allianceauth/authentication/templates/public/base.html +++ b/allianceauth/authentication/templates/public/base.html @@ -6,13 +6,8 @@ - - - - - - + {% include 'allianceauth/opengraph.html' %} {% include 'allianceauth/icons.html' %} {% block title %}{% block page_title %}{% endblock page_title %} - {{ SITE_NAME }}{% endblock title %} diff --git a/allianceauth/templates/allianceauth/base-bs5.html b/allianceauth/templates/allianceauth/base-bs5.html index a26531e7..1eba9aea 100644 --- a/allianceauth/templates/allianceauth/base-bs5.html +++ b/allianceauth/templates/allianceauth/base-bs5.html @@ -12,11 +12,10 @@ - - - + {% include 'allianceauth/opengraph.html' %} {% include 'allianceauth/icons.html' %} + {% block title %}{% block page_title %}{% endblock page_title %} - {{ SITE_NAME }}{% endblock title %} {% theme_css %} diff --git a/allianceauth/templates/allianceauth/opengraph.html b/allianceauth/templates/allianceauth/opengraph.html new file mode 100644 index 00000000..b7b0d682 --- /dev/null +++ b/allianceauth/templates/allianceauth/opengraph.html @@ -0,0 +1,5 @@ +{% load static %} + + + + From b7bacd11af02ed25a78dcf2bac3220fb433bcf83 Mon Sep 17 00:00:00 2001 From: Peter Pfeufer Date: Tue, 18 Mar 2025 18:30:00 +0100 Subject: [PATCH 04/53] [CHANGE] Bring public base templkate in line with the non-public version --- allianceauth/authentication/templates/public/base.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/allianceauth/authentication/templates/public/base.html b/allianceauth/authentication/templates/public/base.html index ada256e0..39d9f520 100644 --- a/allianceauth/authentication/templates/public/base.html +++ b/allianceauth/authentication/templates/public/base.html @@ -1,19 +1,24 @@ {% load theme_tags %} {% load static %} - + + - + + {% include 'allianceauth/opengraph.html' %} {% include 'allianceauth/icons.html' %} + {% block title %}{% block page_title %}{% endblock page_title %} - {{ SITE_NAME }}{% endblock title %} {% theme_css %} + {% include 'bundles/fontawesome.html' %} + {% include 'bundles/auth-framework-css.html' %} {% block extra_include %} {% endblock %} From c93afd2d68c2e86f0b892823ff6a31d2226774af Mon Sep 17 00:00:00 2001 From: Peter Pfeufer Date: Tue, 18 Mar 2025 21:40:47 +0100 Subject: [PATCH 05/53] [ADD] Site name and URL --- allianceauth/templates/allianceauth/opengraph.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/allianceauth/templates/allianceauth/opengraph.html b/allianceauth/templates/allianceauth/opengraph.html index b7b0d682..bc960918 100644 --- a/allianceauth/templates/allianceauth/opengraph.html +++ b/allianceauth/templates/allianceauth/opengraph.html @@ -3,3 +3,6 @@ + + + From 83d2dfc7d92cedf61ba2139526fbafa901b5a6af Mon Sep 17 00:00:00 2001 From: Aaron Kable Date: Thu, 20 Mar 2025 19:11:08 +0800 Subject: [PATCH 06/53] use the view_connection_history perm not superuser --- .../templates/services/mumble/mumble_service_ctrl.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/allianceauth/services/modules/mumble/templates/services/mumble/mumble_service_ctrl.html b/allianceauth/services/modules/mumble/templates/services/mumble/mumble_service_ctrl.html index cf122157..962571e4 100644 --- a/allianceauth/services/modules/mumble/templates/services/mumble/mumble_service_ctrl.html +++ b/allianceauth/services/modules/mumble/templates/services/mumble/mumble_service_ctrl.html @@ -48,9 +48,9 @@ {% endif %} {% endif %} - {% if request.user.is_superuser %} - - History - -{% endif %} + {% if perms.mumble.view_connection_history %} + + History + + {% endif %} {% endblock %} From 4de0774f15f9e5c4b98d1b3c0609ebb2fa0a0518 Mon Sep 17 00:00:00 2001 From: r0kym Date: Thu, 20 Mar 2025 18:47:19 +0100 Subject: [PATCH 07/53] Switch the doc example to use group instead of chain for long running tasks --- docs/development/tech_docu/celery.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/development/tech_docu/celery.md b/docs/development/tech_docu/celery.md index b9571170..a9b6c566 100644 --- a/docs/development/tech_docu/celery.md +++ b/docs/development/tech_docu/celery.md @@ -81,7 +81,7 @@ Example implementation for a celery chain: ```python from allianceauth.services.hooks import get_extension_logger -from celery import shared_task, chain +from celery import shared_task, group logger = get_extension_logger(__name__) @@ -98,18 +98,23 @@ def long_runner(): task_signature = example.si() my_tasks.append(task_signature) - chain(my_tasks).delay() + group(my_tasks).delay() ``` In this example, we first add 10 example tasks that need to run one after the other to a list. This can be done by creating a so-called signature for a task. Those signatures are a kind of wrapper for tasks and can be used in various ways to compose work flow for tasks. The list of task signatures is then converted to a chain and started asynchronously. +:::{note} +In this example we import group to execute all tasks independently. +If you wish to run them in order (and stop if a tasks fail) you can use `celery.chain` instead of `celery.group` + +For more information on signature and work flows see the official documentation on [Canvas](https://docs.celeryproject.org/en/latest/userguide/canvas.html). +::: + :::{hint} In our example we use ``si()``, which is a shortcut for "immutable signatures" and prevents us from having to deal with result sharing between tasks. -For more information on signature and work flows see the official documentation on `Canvas `_. - In this context, please note that Alliance Auth currently only supports chaining because all other variants require a so-called results back, which Alliance Auth does not have. ::: From a34baf4154f0f75ab15ceaefdeda12bde34edfe5 Mon Sep 17 00:00:00 2001 From: Peter Pfeufer Date: Sat, 22 Mar 2025 17:37:10 +0100 Subject: [PATCH 08/53] [FIX] `logo_height` variable name --- allianceauth/templates/bundles/image-auth-logo.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/allianceauth/templates/bundles/image-auth-logo.html b/allianceauth/templates/bundles/image-auth-logo.html index b797e12d..47281028 100644 --- a/allianceauth/templates/bundles/image-auth-logo.html +++ b/allianceauth/templates/bundles/image-auth-logo.html @@ -1,3 +1,3 @@ {% load static %} -{{ SITE_NAME }} +{{ SITE_NAME }} From 702def2a4da63a186e1cd80730008bacf58a2f8d Mon Sep 17 00:00:00 2001 From: Peter Pfeufer Date: Mon, 24 Mar 2025 13:32:53 +0100 Subject: [PATCH 09/53] [CHANGE] Wrap page header in `header` element --- .../templates/framework/header/page-header.html | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/allianceauth/framework/templates/framework/header/page-header.html b/allianceauth/framework/templates/framework/header/page-header.html index d84868c2..a88c8924 100644 --- a/allianceauth/framework/templates/framework/header/page-header.html +++ b/allianceauth/framework/templates/framework/header/page-header.html @@ -2,12 +2,14 @@ {# {% include "framework/header/page-header.html" with title="Foobar" subtitle="Barfoo" %}#} {% if title %} -

- {{ title }} +
+

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

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

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

+
+

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