Compare commits

...

4 Commits

Author SHA1 Message Date
Peter Pfeufer
dec1069901 Merge branch 'supervisor-env-variables' into 'master'
[ADD] Environment variables to supervisor config

See merge request allianceauth/allianceauth!1739
2025-08-10 02:31:22 +00:00
Ariel Rin
1e822729c3 Merge branch 'cursor-style' into 'master'
[FIX] Force AA framework cursor style

See merge request allianceauth/allianceauth!1749
2025-08-10 02:31:11 +00:00
Peter Pfeufer
80ac8f7feb
[FIX] Force AA framework cursor style
Might be overwritten by Bootstrap otherwise.
2025-08-09 22:30:29 +02:00
Peter Pfeufer
ad41fc052f
[ADD] Environment variables to supervisor config 2025-07-16 11:28:00 +02:00
3 changed files with 52 additions and 31 deletions

View File

@ -13,6 +13,7 @@ class StartProject(BaseStartProject):
parser.add_argument('--celery', help='The path to the celery executable.') parser.add_argument('--celery', help='The path to the celery executable.')
parser.add_argument('--gunicorn', help='The path to the gunicorn executable.') parser.add_argument('--gunicorn', help='The path to the gunicorn executable.')
parser.add_argument('--memmon', help='The path to the memmon executable.') parser.add_argument('--memmon', help='The path to the memmon executable.')
parser.add_argument('--venv_directory', help='The path to the virtual environment directory.')
def create_project(parser, options, args): def create_project(parser, options, args):
@ -27,7 +28,7 @@ def create_project(parser, options, args):
allianceauth_path = os.path.dirname(allianceauth.__file__) allianceauth_path = os.path.dirname(allianceauth.__file__)
template_path = os.path.join(allianceauth_path, 'project_template') template_path = os.path.join(allianceauth_path, 'project_template')
# Determine locations of commands to render supervisor cond # Determine locations of commands to render supervisor configuration
command_options = { command_options = {
'template': template_path, 'template': template_path,
'python': shutil.which('python'), 'python': shutil.which('python'),
@ -35,6 +36,7 @@ def create_project(parser, options, args):
'celery': shutil.which('celery'), 'celery': shutil.which('celery'),
'memmon': shutil.which('memmon'), 'memmon': shutil.which('memmon'),
'extensions': ['py', 'conf', 'json'], 'extensions': ['py', 'conf', 'json'],
'venv_directory': os.getenv('VIRTUAL_ENV'),
} }
# Strip 'start' out of the arguments, leaving project name (and optionally destination dir) # Strip 'start' out of the arguments, leaving project name (and optionally destination dir)

View File

@ -80,47 +80,47 @@
------------------------------------------------------------------------------------- */ ------------------------------------------------------------------------------------- */
@media all { @media all {
.cursor-auto { .cursor-auto {
cursor: auto; cursor: auto !important;
} }
.cursor-default { .cursor-default {
cursor: default; cursor: default !important;
} }
.cursor-pointer { .cursor-pointer {
cursor: pointer; cursor: pointer !important;
} }
.cursor-wait { .cursor-wait {
cursor: wait; cursor: wait !important;
} }
.cursor-text { .cursor-text {
cursor: text; cursor: text !important;
} }
.cursor-move { .cursor-move {
cursor: move; cursor: move !important;
} }
.cursor-help { .cursor-help {
cursor: help; cursor: help !important;
} }
.cursor-not-allowed { .cursor-not-allowed {
cursor: not-allowed; cursor: not-allowed !important;
} }
.cursor-inherit { .cursor-inherit {
cursor: inherit; cursor: inherit !important;
} }
.cursor-zoom-in { .cursor-zoom-in {
cursor: zoom-in; cursor: zoom-in !important;
} }
.cursor-zoom-out { .cursor-zoom-out {
cursor: zoom-out; cursor: zoom-out !important;
} }
} }

View File

@ -1,22 +1,37 @@
[supervisord]
environment =
AA_USER = allianceserver, ; The user under which the processes will run
AA_PROJECT_NAME = {{ project_name }}, ; The name of the project
AA_PROJECT_DIRECTORY = {{ project_directory }}, ; The directory of the project
AA_VENV_DIRECTORY = {{ venv_directory }}, ; The directory of the virtual environment
AA_COMMAND_CELERY = {{ celery }}, ; The command to run Celery
AA_COMMAND_GUNICORN = {{ gunicorn }}, ; The command to run Gunicorn
AA_COMMAND_MEMMON = {{ memmon }} ; The command to run Memmon
[program:beat] [program:beat]
command = {{ celery }} -A {{ project_name }} beat command = %(ENV_AA_COMMAND_CELERY)s
directory = {{ project_directory }} -A %(ENV_AA_PROJECT_NAME)s beat
user = allianceserver directory = %(ENV_AA_VENV_DIRECTORY)s
stdout_logfile = {{ project_directory }}/log/%(program_name)s.log user = %(ENV_AA_USER)s
stderr_logfile = {{ project_directory }}/log/%(program_name)s.log stdout_logfile = %(ENV_AA_VENV_DIRECTORY)s/log/%(program_name)s.log
stderr_logfile = %(ENV_AA_VENV_DIRECTORY)s/log/%(program_name)s.log
autostart = true autostart = true
autorestart = true autorestart = true
startsecs = 10 startsecs = 10
priority = 998 priority = 998
[program:worker] [program:worker]
command = {{ celery }} -A {{ project_name }} worker --pool=threads --concurrency=5 -n %(program_name)s_%(process_num)02d command = %(ENV_AA_COMMAND_CELERY)s
directory = {{ project_directory }} -A %(ENV_AA_PROJECT_NAME)s worker
user = allianceserver --pool=threads
--concurrency=5
-n %(program_name)s_%(process_num)02d
directory = %(ENV_AA_VENV_DIRECTORY)s
user = %(ENV_AA_USER)s
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/%(program_name)s.log stdout_logfile = %(ENV_AA_VENV_DIRECTORY)s/log/%(program_name)s.log
stderr_logfile = {{ project_directory }}/log/%(program_name)s.log stderr_logfile = %(ENV_AA_VENV_DIRECTORY)s/log/%(program_name)s.log
autostart = true autostart = true
autorestart = true autorestart = true
startsecs = 10 startsecs = 10
@ -26,22 +41,26 @@ priority = 998
{% if gunicorn %} {% if gunicorn %}
[program:gunicorn] [program:gunicorn]
user = allianceserver user = %(ENV_AA_USER)s
directory = {{ project_directory }} directory = %(ENV_AA_VENV_DIRECTORY)s
command = {{ gunicorn }} {{ project_name }}.wsgi --workers=3 --timeout 120 command = %(ENV_AA_COMMAND_GUNICORN)s %(ENV_AA_PROJECT_NAME)s.wsgi
stdout_logfile = {{ project_directory }}/log/%(program_name)s.log --workers=3
stderr_logfile = {{ project_directory }}/log/%(program_name)s.log --timeout 120
stdout_logfile = %(ENV_AA_VENV_DIRECTORY)s/log/%(program_name)s.log
stderr_logfile = %(ENV_AA_VENV_DIRECTORY)s/log/%(program_name)s.log
autostart = true autostart = true
autorestart = true autorestart = true
stopsignal = INT stopsignal = INT
{% endif %} {% endif %}
[eventlistener:memmon] [eventlistener:memmon]
command = {{ memmon }} -p worker_00=256MB -p gunicorn=256MB command = %(ENV_AA_COMMAND_MEMMON)s
directory = {{ project_directory }} -p worker_00=256MB
-p gunicorn=256MB
directory = %(ENV_AA_VENV_DIRECTORY)s
events = TICK_60 events = TICK_60
stdout_logfile = {{ project_directory }}/log/memmon.log stdout_logfile = %(ENV_AA_VENV_DIRECTORY)s/log/memmon.log
stderr_logfile = {{ project_directory }}/log/memmon.log stderr_logfile = %(ENV_AA_VENV_DIRECTORY)s/log/memmon.log
[group:{{ project_name }}] [group:{{ project_name }}]
programs = beat,worker{% if gunicorn %},gunicorn{% endif %} programs = beat,worker{% if gunicorn %},gunicorn{% endif %}