mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-09 04:20:17 +02:00
Compare commits
10 Commits
93d3e22204
...
1f04818b95
Author | SHA1 | Date | |
---|---|---|---|
|
1f04818b95 | ||
|
403b067d86 | ||
|
c9142fe8f4 | ||
|
f849b75029 | ||
|
25c27793fe | ||
|
6e413772ad | ||
|
44ffe6001e | ||
|
fc51f6bea2 | ||
|
6477c22308 | ||
|
329b3fecfb |
105
allianceauth/framework/staticfiles/storage.py
Normal file
105
allianceauth/framework/staticfiles/storage.py
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
"""
|
||||||
|
Custom static files storage for Alliance Auth.
|
||||||
|
|
||||||
|
This module defines a custom static files storage class for
|
||||||
|
Alliance Auth, named `AaManifestStaticFilesStorage`.
|
||||||
|
|
||||||
|
Using `ManifestStaticFilesStorage` will give us a hashed name for
|
||||||
|
our static files, which is useful for cache busting.
|
||||||
|
|
||||||
|
This storage class extends Django's `ManifestStaticFilesStorage` to ignore missing files,
|
||||||
|
which the original class does not handle, and log them in debug mode.
|
||||||
|
It is useful for handling cases where static files may not exist, such as when a
|
||||||
|
CSS file references a background image that is not present in the static files directory.
|
||||||
|
|
||||||
|
With debug mode enabled, it will print a message for each missing file when running `collectstatic`,
|
||||||
|
which can help identify issues with static file references during development.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from django.conf import settings
|
||||||
|
from django.contrib.staticfiles.storage import ManifestStaticFilesStorage
|
||||||
|
|
||||||
|
|
||||||
|
class AaManifestStaticFilesStorage(ManifestStaticFilesStorage):
|
||||||
|
"""
|
||||||
|
Custom static files storage that ignores missing files.
|
||||||
|
"""
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def _cleanup_name(cls, name: str) -> str:
|
||||||
|
"""
|
||||||
|
Clean up the name by removing quotes.
|
||||||
|
This method is used to ensure that the name does not contain any quotes,
|
||||||
|
which can cause issues with file paths.
|
||||||
|
|
||||||
|
:param name: The name of the static file.
|
||||||
|
:type name: str
|
||||||
|
:return: The cleaned-up name without quotes.
|
||||||
|
:rtype: str
|
||||||
|
"""
|
||||||
|
|
||||||
|
# Remove quotes from the name
|
||||||
|
return name.replace('"', "").replace("'", "")
|
||||||
|
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
"""
|
||||||
|
Initialize the static files storage, ignoring missing files.
|
||||||
|
|
||||||
|
:param args:
|
||||||
|
:type args:
|
||||||
|
:param kwargs:
|
||||||
|
:type kwargs:
|
||||||
|
"""
|
||||||
|
|
||||||
|
self.missing_files = []
|
||||||
|
|
||||||
|
super().__init__(*args, **kwargs)
|
||||||
|
|
||||||
|
def hashed_name(self, name, content=None, filename=None):
|
||||||
|
"""
|
||||||
|
Generate a hashed name for the given static file, ignoring missing files.
|
||||||
|
|
||||||
|
Ignore missing files, e.g. non-existent background image referenced from css.
|
||||||
|
Returns the original filename if the referenced file doesn't exist.
|
||||||
|
|
||||||
|
:param name: The name of the static file to hash.
|
||||||
|
:type name: str
|
||||||
|
:param content: The content of the static file, if available.
|
||||||
|
:type content: bytes | None
|
||||||
|
:param filename: The original filename of the static file, if available.
|
||||||
|
:type filename: str | None
|
||||||
|
:return: The hashed name of the static file, or the original name if the file is missing.
|
||||||
|
:rtype: str
|
||||||
|
"""
|
||||||
|
|
||||||
|
try:
|
||||||
|
clean_name = self._cleanup_name(name)
|
||||||
|
|
||||||
|
return super().hashed_name(clean_name, content, filename)
|
||||||
|
except ValueError as e:
|
||||||
|
if settings.DEBUG:
|
||||||
|
# In debug mode, we log the missing file message
|
||||||
|
message = e.args[0].split(" with ")[0]
|
||||||
|
self.missing_files.append(message)
|
||||||
|
# print(f'\x1b[0;30;41m{message}\x1b[0m')
|
||||||
|
|
||||||
|
return name
|
||||||
|
|
||||||
|
def post_process(self, *args, **kwargs):
|
||||||
|
"""
|
||||||
|
Post-process the static files, printing any missing files in debug mode.
|
||||||
|
|
||||||
|
:param args:
|
||||||
|
:type args:
|
||||||
|
:param kwargs:
|
||||||
|
:type kwargs:
|
||||||
|
:return:
|
||||||
|
:rtype:
|
||||||
|
"""
|
||||||
|
|
||||||
|
yield from super().post_process(*args, **kwargs)
|
||||||
|
|
||||||
|
if settings.DEBUG:
|
||||||
|
# In debug mode, print the missing files
|
||||||
|
for message in sorted(set(self.missing_files)):
|
||||||
|
print(f"\x1b[0;30;41m{message}\x1b[0m")
|
File diff suppressed because it is too large
Load Diff
@ -25,7 +25,7 @@ msgstr ""
|
|||||||
|
|
||||||
#: allianceauth/analytics/apps.py:8
|
#: allianceauth/analytics/apps.py:8
|
||||||
msgid "Analytics"
|
msgid "Analytics"
|
||||||
msgstr ""
|
msgstr "Analyse"
|
||||||
|
|
||||||
#: allianceauth/analytics/models.py:22
|
#: allianceauth/analytics/models.py:22
|
||||||
msgid "Google Analytics Universal"
|
msgid "Google Analytics Universal"
|
||||||
@ -37,7 +37,7 @@ msgstr "Google Analytics V4"
|
|||||||
|
|
||||||
#: allianceauth/authentication/apps.py:9
|
#: allianceauth/authentication/apps.py:9
|
||||||
msgid "Authentication"
|
msgid "Authentication"
|
||||||
msgstr ""
|
msgstr "Authentifizierung"
|
||||||
|
|
||||||
#: allianceauth/authentication/constants.py:6
|
#: allianceauth/authentication/constants.py:6
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -458,7 +458,7 @@ msgstr "Fehler beim Sammeln von Corpstatistiken mit ausgewählten Token."
|
|||||||
|
|
||||||
#: allianceauth/crontab/apps.py:16
|
#: allianceauth/crontab/apps.py:16
|
||||||
msgid "Crontab"
|
msgid "Crontab"
|
||||||
msgstr ""
|
msgstr "Crontab"
|
||||||
|
|
||||||
#: allianceauth/crontab/models.py:13
|
#: allianceauth/crontab/models.py:13
|
||||||
msgid "Minute Offset"
|
msgid "Minute Offset"
|
||||||
@ -495,11 +495,11 @@ msgstr "Dieses CSS wird der Site nach dem Standard-CSS hinzugefügt."
|
|||||||
|
|
||||||
#: allianceauth/eveonline/apps.py:8
|
#: allianceauth/eveonline/apps.py:8
|
||||||
msgid "EVE Online"
|
msgid "EVE Online"
|
||||||
msgstr ""
|
msgstr "EVE Online"
|
||||||
|
|
||||||
#: allianceauth/eveonline/autogroups/apps.py:8
|
#: allianceauth/eveonline/autogroups/apps.py:8
|
||||||
msgid "EVE Online Autogroups"
|
msgid "EVE Online Autogroups"
|
||||||
msgstr ""
|
msgstr "EVE Online Autogrouppen"
|
||||||
|
|
||||||
#: allianceauth/fleetactivitytracking/apps.py:8
|
#: allianceauth/fleetactivitytracking/apps.py:8
|
||||||
#: allianceauth/fleetactivitytracking/auth_hooks.py:10
|
#: allianceauth/fleetactivitytracking/auth_hooks.py:10
|
||||||
@ -616,7 +616,7 @@ msgstr "Schiff"
|
|||||||
#: allianceauth/timerboard/templates/timerboard/dashboard.timers.html:18
|
#: allianceauth/timerboard/templates/timerboard/dashboard.timers.html:18
|
||||||
#: allianceauth/timerboard/templates/timerboard/timertable.html:12
|
#: allianceauth/timerboard/templates/timerboard/timertable.html:12
|
||||||
msgid "EVE time"
|
msgid "EVE time"
|
||||||
msgstr ""
|
msgstr "EVE Zeit"
|
||||||
|
|
||||||
#: allianceauth/fleetactivitytracking/templates/fleetactivitytracking/fatlinkmodify.html:49
|
#: allianceauth/fleetactivitytracking/templates/fleetactivitytracking/fatlinkmodify.html:49
|
||||||
#: allianceauth/fleetactivitytracking/templates/fleetactivitytracking/fatlinkview.html:52
|
#: allianceauth/fleetactivitytracking/templates/fleetactivitytracking/fatlinkview.html:52
|
||||||
@ -784,7 +784,7 @@ msgstr ""
|
|||||||
|
|
||||||
#: allianceauth/framework/apps.py:16
|
#: allianceauth/framework/apps.py:16
|
||||||
msgid "Framework"
|
msgid "Framework"
|
||||||
msgstr ""
|
msgstr "Framework"
|
||||||
|
|
||||||
#: allianceauth/groupmanagement/apps.py:8
|
#: allianceauth/groupmanagement/apps.py:8
|
||||||
#: allianceauth/groupmanagement/auth_hooks.py:18
|
#: allianceauth/groupmanagement/auth_hooks.py:18
|
||||||
@ -1242,7 +1242,7 @@ msgstr "Austrittsanfrage für Gruppe %(group)s gesendet."
|
|||||||
|
|
||||||
#: allianceauth/hrapplications/apps.py:8
|
#: allianceauth/hrapplications/apps.py:8
|
||||||
msgid "HR Applications"
|
msgid "HR Applications"
|
||||||
msgstr ""
|
msgstr "Bewerbungen"
|
||||||
|
|
||||||
#: allianceauth/hrapplications/auth_hooks.py:15
|
#: allianceauth/hrapplications/auth_hooks.py:15
|
||||||
msgid "Applications"
|
msgid "Applications"
|
||||||
@ -1452,7 +1452,7 @@ msgstr "sichtbar"
|
|||||||
|
|
||||||
#: allianceauth/menu/apps.py:16
|
#: allianceauth/menu/apps.py:16
|
||||||
msgid "Menu"
|
msgid "Menu"
|
||||||
msgstr ""
|
msgstr "Menü"
|
||||||
|
|
||||||
#: allianceauth/menu/constants.py:16
|
#: allianceauth/menu/constants.py:16
|
||||||
msgid "app"
|
msgid "app"
|
||||||
@ -1537,17 +1537,17 @@ msgstr "Super User"
|
|||||||
#: allianceauth/menu/templates/menu/menu-user.html:83
|
#: allianceauth/menu/templates/menu/menu-user.html:83
|
||||||
#: allianceauth/menu/templates/menu/menu-user.html:86
|
#: allianceauth/menu/templates/menu/menu-user.html:86
|
||||||
msgid "Alliance Auth Documentation"
|
msgid "Alliance Auth Documentation"
|
||||||
msgstr ""
|
msgstr "Alliance Auth Dokumentation"
|
||||||
|
|
||||||
#: allianceauth/menu/templates/menu/menu-user.html:94
|
#: allianceauth/menu/templates/menu/menu-user.html:94
|
||||||
#: allianceauth/menu/templates/menu/menu-user.html:97
|
#: allianceauth/menu/templates/menu/menu-user.html:97
|
||||||
msgid "Alliance Auth Discord"
|
msgid "Alliance Auth Discord"
|
||||||
msgstr ""
|
msgstr "Alliance Auth Discord"
|
||||||
|
|
||||||
#: allianceauth/menu/templates/menu/menu-user.html:105
|
#: allianceauth/menu/templates/menu/menu-user.html:105
|
||||||
#: allianceauth/menu/templates/menu/menu-user.html:108
|
#: allianceauth/menu/templates/menu/menu-user.html:108
|
||||||
msgid "Alliance Auth Git"
|
msgid "Alliance Auth Git"
|
||||||
msgstr ""
|
msgstr "Alliance Auth Git"
|
||||||
|
|
||||||
#: allianceauth/menu/templates/menu/menu-user.html:118
|
#: allianceauth/menu/templates/menu/menu-user.html:118
|
||||||
#: allianceauth/menu/templates/menu/menu-user.html:121
|
#: allianceauth/menu/templates/menu/menu-user.html:121
|
||||||
@ -1726,7 +1726,7 @@ msgstr "Flottenoperationen Verwaltung"
|
|||||||
#: allianceauth/optimer/templates/optimer/management.html:28
|
#: allianceauth/optimer/templates/optimer/management.html:28
|
||||||
#: allianceauth/timerboard/templates/timerboard/view.html:32
|
#: allianceauth/timerboard/templates/timerboard/view.html:32
|
||||||
msgid "Current EVE time:"
|
msgid "Current EVE time:"
|
||||||
msgstr ""
|
msgstr "Aktuelle EVE Zeit"
|
||||||
|
|
||||||
#: allianceauth/optimer/templates/optimer/management.html:36
|
#: allianceauth/optimer/templates/optimer/management.html:36
|
||||||
msgid "Next Fleet Operations"
|
msgid "Next Fleet Operations"
|
||||||
@ -1893,7 +1893,7 @@ msgstr "Das Passwort muss mindestens 8 Zeichen lang sein"
|
|||||||
|
|
||||||
#: allianceauth/services/modules/discord/apps.py:8
|
#: allianceauth/services/modules/discord/apps.py:8
|
||||||
msgid "Discord Service"
|
msgid "Discord Service"
|
||||||
msgstr ""
|
msgstr "Discord Service"
|
||||||
|
|
||||||
#: allianceauth/services/modules/discord/models.py:187
|
#: allianceauth/services/modules/discord/models.py:187
|
||||||
msgid "Discord Account Disabled"
|
msgid "Discord Account Disabled"
|
||||||
@ -1949,7 +1949,7 @@ msgstr ""
|
|||||||
|
|
||||||
#: allianceauth/services/modules/discourse/apps.py:8
|
#: allianceauth/services/modules/discourse/apps.py:8
|
||||||
msgid "Discourse Service"
|
msgid "Discourse Service"
|
||||||
msgstr ""
|
msgstr "Discourse Service"
|
||||||
|
|
||||||
#: allianceauth/services/modules/discourse/templates/services/discourse/discourse_service_ctrl.html:5
|
#: allianceauth/services/modules/discourse/templates/services/discourse/discourse_service_ctrl.html:5
|
||||||
msgid "Discourse"
|
msgid "Discourse"
|
||||||
@ -1989,11 +1989,11 @@ msgstr ""
|
|||||||
|
|
||||||
#: allianceauth/services/modules/example/apps.py:8
|
#: allianceauth/services/modules/example/apps.py:8
|
||||||
msgid "Example Service"
|
msgid "Example Service"
|
||||||
msgstr ""
|
msgstr "Beispiel Service"
|
||||||
|
|
||||||
#: allianceauth/services/modules/ips4/apps.py:8
|
#: allianceauth/services/modules/ips4/apps.py:8
|
||||||
msgid "IPS4 Service"
|
msgid "IPS4 Service"
|
||||||
msgstr ""
|
msgstr "IPS4 Service"
|
||||||
|
|
||||||
#: allianceauth/services/modules/ips4/views.py:31
|
#: allianceauth/services/modules/ips4/views.py:31
|
||||||
msgid "Activated IPSuite4 account."
|
msgid "Activated IPSuite4 account."
|
||||||
@ -2020,7 +2020,7 @@ msgstr "IP4Suite Konto deaktiviert."
|
|||||||
|
|
||||||
#: allianceauth/services/modules/mumble/apps.py:8
|
#: allianceauth/services/modules/mumble/apps.py:8
|
||||||
msgid "Mumble Service"
|
msgid "Mumble Service"
|
||||||
msgstr ""
|
msgstr "Mumble Service"
|
||||||
|
|
||||||
#: allianceauth/services/modules/mumble/templates/services/mumble/mumble_connection_history.html:7
|
#: allianceauth/services/modules/mumble/templates/services/mumble/mumble_connection_history.html:7
|
||||||
msgid "Mumble"
|
msgid "Mumble"
|
||||||
@ -2079,7 +2079,7 @@ msgstr "Verlauf der Mumbleverbindungen"
|
|||||||
|
|
||||||
#: allianceauth/services/modules/openfire/apps.py:8
|
#: allianceauth/services/modules/openfire/apps.py:8
|
||||||
msgid "Openfire Service"
|
msgid "Openfire Service"
|
||||||
msgstr ""
|
msgstr "Openfire Service"
|
||||||
|
|
||||||
#: allianceauth/services/modules/openfire/auth_hooks.py:27
|
#: allianceauth/services/modules/openfire/auth_hooks.py:27
|
||||||
msgid "Jabber"
|
msgid "Jabber"
|
||||||
@ -2134,7 +2134,7 @@ msgstr "Setze Jabber Passwort."
|
|||||||
|
|
||||||
#: allianceauth/services/modules/phpbb3/apps.py:8
|
#: allianceauth/services/modules/phpbb3/apps.py:8
|
||||||
msgid "phpBB3 Service"
|
msgid "phpBB3 Service"
|
||||||
msgstr ""
|
msgstr "phpBB3 Service"
|
||||||
|
|
||||||
#: allianceauth/services/modules/phpbb3/views.py:34
|
#: allianceauth/services/modules/phpbb3/views.py:34
|
||||||
msgid "Activated forum account."
|
msgid "Activated forum account."
|
||||||
@ -2161,7 +2161,7 @@ msgstr "Setze Forum Passwort."
|
|||||||
|
|
||||||
#: allianceauth/services/modules/smf/apps.py:8
|
#: allianceauth/services/modules/smf/apps.py:8
|
||||||
msgid "SMF Service"
|
msgid "SMF Service"
|
||||||
msgstr ""
|
msgstr "SMF Service"
|
||||||
|
|
||||||
#: allianceauth/services/modules/smf/views.py:52
|
#: allianceauth/services/modules/smf/views.py:52
|
||||||
msgid "Activated SMF account."
|
msgid "Activated SMF account."
|
||||||
@ -2188,7 +2188,7 @@ msgstr "Setze SMF Passwort."
|
|||||||
|
|
||||||
#: allianceauth/services/modules/teamspeak3/apps.py:8
|
#: allianceauth/services/modules/teamspeak3/apps.py:8
|
||||||
msgid "TeamSpeak 3 Service"
|
msgid "TeamSpeak 3 Service"
|
||||||
msgstr ""
|
msgstr "TeamSpeak 3 Service"
|
||||||
|
|
||||||
#: allianceauth/services/modules/teamspeak3/forms.py:14
|
#: allianceauth/services/modules/teamspeak3/forms.py:14
|
||||||
#, python-format
|
#, python-format
|
||||||
@ -2242,7 +2242,7 @@ msgstr "TeamSpeak3 Berechtigungsschlüssel zurücksetzen."
|
|||||||
|
|
||||||
#: allianceauth/services/modules/xenforo/apps.py:8
|
#: allianceauth/services/modules/xenforo/apps.py:8
|
||||||
msgid "Xenforo Service"
|
msgid "Xenforo Service"
|
||||||
msgstr ""
|
msgstr "Xenforo Service"
|
||||||
|
|
||||||
#: allianceauth/services/modules/xenforo/views.py:30
|
#: allianceauth/services/modules/xenforo/views.py:30
|
||||||
msgid "Activated XenForo account."
|
msgid "Activated XenForo account."
|
||||||
@ -2951,7 +2951,7 @@ msgstr "Aufgegeben"
|
|||||||
|
|
||||||
#: allianceauth/timerboard/models.py:60
|
#: allianceauth/timerboard/models.py:60
|
||||||
msgid "Theft"
|
msgid "Theft"
|
||||||
msgstr ""
|
msgstr "Diebstahl"
|
||||||
|
|
||||||
#: allianceauth/timerboard/templates/timerboard/dashboard.timers.html:7
|
#: allianceauth/timerboard/templates/timerboard/dashboard.timers.html:7
|
||||||
#: allianceauth/timerboard/templates/timerboard/view.html:54
|
#: allianceauth/timerboard/templates/timerboard/view.html:54
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -15,68 +15,68 @@ from django.contrib import messages
|
|||||||
from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
INSTALLED_APPS = [
|
INSTALLED_APPS = [
|
||||||
'allianceauth', # needs to be on top of this list to support favicons in Django admin (see https://gitlab.com/allianceauth/allianceauth/-/issues/1301)
|
"allianceauth", # needs to be on top of this list to support favicons in Django admin (see https://gitlab.com/allianceauth/allianceauth/-/issues/1301)
|
||||||
'django.contrib.admin',
|
"django.contrib.admin",
|
||||||
'django.contrib.auth',
|
"django.contrib.auth",
|
||||||
'django.contrib.contenttypes',
|
"django.contrib.contenttypes",
|
||||||
'django.contrib.sessions',
|
"django.contrib.sessions",
|
||||||
'django.contrib.messages',
|
"django.contrib.messages",
|
||||||
'django.contrib.staticfiles',
|
"django.contrib.staticfiles",
|
||||||
'django.contrib.humanize',
|
"django.contrib.humanize",
|
||||||
'django_celery_beat',
|
"django_celery_beat",
|
||||||
'solo',
|
"solo",
|
||||||
'bootstrapform',
|
"bootstrapform",
|
||||||
'django_bootstrap5', # https://github.com/zostera/django-bootstrap5
|
"django_bootstrap5", # https://github.com/zostera/django-bootstrap5
|
||||||
'sortedm2m',
|
"sortedm2m",
|
||||||
'esi',
|
"esi",
|
||||||
'allianceauth.framework',
|
"allianceauth.framework",
|
||||||
'allianceauth.authentication',
|
"allianceauth.authentication",
|
||||||
'allianceauth.services',
|
"allianceauth.services",
|
||||||
'allianceauth.eveonline',
|
"allianceauth.eveonline",
|
||||||
'allianceauth.groupmanagement',
|
"allianceauth.groupmanagement",
|
||||||
'allianceauth.notifications',
|
"allianceauth.notifications",
|
||||||
'allianceauth.thirdparty.navhelper',
|
"allianceauth.thirdparty.navhelper",
|
||||||
'allianceauth.analytics',
|
"allianceauth.analytics",
|
||||||
'allianceauth.menu',
|
"allianceauth.menu",
|
||||||
'allianceauth.theme',
|
"allianceauth.theme",
|
||||||
'allianceauth.theme.darkly',
|
"allianceauth.theme.darkly",
|
||||||
'allianceauth.theme.flatly',
|
"allianceauth.theme.flatly",
|
||||||
'allianceauth.theme.materia',
|
"allianceauth.theme.materia",
|
||||||
"allianceauth.custom_css",
|
"allianceauth.custom_css",
|
||||||
'allianceauth.crontab',
|
"allianceauth.crontab",
|
||||||
'sri',
|
"sri",
|
||||||
]
|
]
|
||||||
|
|
||||||
SRI_ALGORITHM = "sha512"
|
SRI_ALGORITHM = "sha512"
|
||||||
SECRET_KEY = "wow I'm a really bad default secret key"
|
SECRET_KEY = "wow I'm a really bad default secret key"
|
||||||
|
|
||||||
# Celery configuration
|
# Celery configuration
|
||||||
BROKER_URL = 'redis://localhost:6379/0'
|
BROKER_URL = "redis://localhost:6379/0"
|
||||||
CELERYBEAT_SCHEDULER = "allianceauth.crontab.schedulers.OffsetDatabaseScheduler"
|
CELERYBEAT_SCHEDULER = "allianceauth.crontab.schedulers.OffsetDatabaseScheduler"
|
||||||
CELERYBEAT_SCHEDULE = {
|
CELERYBEAT_SCHEDULE = {
|
||||||
'esi_cleanup_callbackredirect': {
|
"esi_cleanup_callbackredirect": {
|
||||||
'task': 'esi.tasks.cleanup_callbackredirect',
|
"task": "esi.tasks.cleanup_callbackredirect",
|
||||||
'schedule': crontab(minute='0', hour='*/4'),
|
"schedule": crontab(minute="0", hour="*/4"),
|
||||||
},
|
},
|
||||||
'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,
|
"apply_offset": True,
|
||||||
},
|
},
|
||||||
'run_model_update': {
|
"run_model_update": {
|
||||||
'task': 'allianceauth.eveonline.tasks.run_model_update',
|
"task": "allianceauth.eveonline.tasks.run_model_update",
|
||||||
'schedule': crontab(minute='0', hour="*/6"),
|
"schedule": crontab(minute="0", hour="*/6"),
|
||||||
'apply_offset': True
|
"apply_offset": True,
|
||||||
},
|
},
|
||||||
'check_all_character_ownership': {
|
"check_all_character_ownership": {
|
||||||
'task': 'allianceauth.authentication.tasks.check_all_character_ownership',
|
"task": "allianceauth.authentication.tasks.check_all_character_ownership",
|
||||||
'schedule': crontab(minute='0', hour='*/4'),
|
"schedule": crontab(minute="0", hour="*/4"),
|
||||||
'apply_offset': True
|
"apply_offset": True,
|
||||||
|
},
|
||||||
|
"analytics_daily_stats": {
|
||||||
|
"task": "allianceauth.analytics.tasks.analytics_daily_stats",
|
||||||
|
"schedule": crontab(minute="0", hour="2"),
|
||||||
},
|
},
|
||||||
'analytics_daily_stats': {
|
|
||||||
'task': 'allianceauth.analytics.tasks.analytics_daily_stats',
|
|
||||||
'schedule': crontab(minute='0', hour='2'),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -85,22 +85,20 @@ PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|||||||
BASE_DIR = os.path.dirname(PROJECT_DIR)
|
BASE_DIR = os.path.dirname(PROJECT_DIR)
|
||||||
|
|
||||||
MIDDLEWARE = [
|
MIDDLEWARE = [
|
||||||
'django.middleware.security.SecurityMiddleware',
|
"django.middleware.security.SecurityMiddleware",
|
||||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
"django.contrib.sessions.middleware.SessionMiddleware",
|
||||||
'allianceauth.authentication.middleware.UserSettingsMiddleware',
|
"allianceauth.authentication.middleware.UserSettingsMiddleware",
|
||||||
'django.middleware.locale.LocaleMiddleware',
|
"django.middleware.locale.LocaleMiddleware",
|
||||||
'django.middleware.common.CommonMiddleware',
|
"django.middleware.common.CommonMiddleware",
|
||||||
'django.middleware.csrf.CsrfViewMiddleware',
|
"django.middleware.csrf.CsrfViewMiddleware",
|
||||||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
"django.contrib.auth.middleware.AuthenticationMiddleware",
|
||||||
'django.contrib.messages.middleware.MessageMiddleware',
|
"django.contrib.messages.middleware.MessageMiddleware",
|
||||||
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
"django.middleware.clickjacking.XFrameOptionsMiddleware",
|
||||||
]
|
]
|
||||||
|
|
||||||
ROOT_URLCONF = 'allianceauth.urls'
|
ROOT_URLCONF = "allianceauth.urls"
|
||||||
|
|
||||||
LOCALE_PATHS = (
|
LOCALE_PATHS = (os.path.join(BASE_DIR, "locale/"),)
|
||||||
os.path.join(BASE_DIR, 'locale/'),
|
|
||||||
)
|
|
||||||
|
|
||||||
LANGUAGES = ( # Sorted by Language Code alphabetical order + English at top
|
LANGUAGES = ( # Sorted by Language Code alphabetical order + English at top
|
||||||
("en", _("English")),
|
("en", _("English")),
|
||||||
@ -160,58 +158,58 @@ LANGUAGE_MAPPING = {
|
|||||||
|
|
||||||
TEMPLATES = [
|
TEMPLATES = [
|
||||||
{
|
{
|
||||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
||||||
'DIRS': [os.path.join(PROJECT_DIR, 'templates')],
|
"DIRS": [os.path.join(PROJECT_DIR, "templates")],
|
||||||
'APP_DIRS': True,
|
"APP_DIRS": True,
|
||||||
'OPTIONS': {
|
"OPTIONS": {
|
||||||
'context_processors': [
|
"context_processors": [
|
||||||
'django.template.context_processors.debug',
|
"django.template.context_processors.debug",
|
||||||
'django.template.context_processors.request',
|
"django.template.context_processors.request",
|
||||||
'django.contrib.auth.context_processors.auth',
|
"django.contrib.auth.context_processors.auth",
|
||||||
'django.contrib.messages.context_processors.messages',
|
"django.contrib.messages.context_processors.messages",
|
||||||
'django.template.context_processors.i18n',
|
"django.template.context_processors.i18n",
|
||||||
'django.template.context_processors.media',
|
"django.template.context_processors.media",
|
||||||
'django.template.context_processors.static',
|
"django.template.context_processors.static",
|
||||||
'django.template.context_processors.tz',
|
"django.template.context_processors.tz",
|
||||||
'allianceauth.context_processors.auth_settings',
|
"allianceauth.context_processors.auth_settings",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
WSGI_APPLICATION = 'allianceauth.wsgi.application'
|
WSGI_APPLICATION = "allianceauth.wsgi.application"
|
||||||
|
|
||||||
# Password validation
|
# Password validation
|
||||||
# https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators
|
# https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators
|
||||||
|
|
||||||
AUTH_PASSWORD_VALIDATORS = [
|
AUTH_PASSWORD_VALIDATORS = [
|
||||||
{
|
{
|
||||||
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
|
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
|
"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
|
"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
|
"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
AUTHENTICATION_BACKENDS = [
|
AUTHENTICATION_BACKENDS = [
|
||||||
'allianceauth.authentication.backends.StateBackend',
|
"allianceauth.authentication.backends.StateBackend",
|
||||||
'django.contrib.auth.backends.ModelBackend'
|
"django.contrib.auth.backends.ModelBackend",
|
||||||
]
|
]
|
||||||
|
|
||||||
# Internationalization
|
# Internationalization
|
||||||
# https://docs.djangoproject.com/en/1.10/topics/i18n/
|
# https://docs.djangoproject.com/en/1.10/topics/i18n/
|
||||||
|
|
||||||
LANGUAGE_CODE = 'en-us'
|
LANGUAGE_CODE = "en-us"
|
||||||
|
|
||||||
LANGUAGE_COOKIE_AGE = 1209600
|
LANGUAGE_COOKIE_AGE = 1209600
|
||||||
|
|
||||||
TIME_ZONE = 'UTC'
|
TIME_ZONE = "UTC"
|
||||||
|
|
||||||
USE_I18N = True
|
USE_I18N = True
|
||||||
|
|
||||||
@ -219,44 +217,51 @@ USE_TZ = True
|
|||||||
|
|
||||||
# Static files (CSS, JavaScript, Images)
|
# Static files (CSS, JavaScript, Images)
|
||||||
# https://docs.djangoproject.com/en/1.10/howto/static-files/
|
# https://docs.djangoproject.com/en/1.10/howto/static-files/
|
||||||
STATIC_URL = '/static/'
|
STORAGES = {
|
||||||
|
"default": {
|
||||||
|
"BACKEND": "django.core.files.storage.FileSystemStorage",
|
||||||
|
},
|
||||||
|
"staticfiles": {
|
||||||
|
"BACKEND": "allianceauth.framework.staticfiles.storage.AaManifestStaticFilesStorage",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
STATIC_URL = "/static/"
|
||||||
STATICFILES_DIRS = [
|
STATICFILES_DIRS = [
|
||||||
os.path.join(PROJECT_DIR, 'static'),
|
os.path.join(PROJECT_DIR, "static"),
|
||||||
]
|
]
|
||||||
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
|
STATIC_ROOT = os.path.join(BASE_DIR, "static")
|
||||||
|
|
||||||
# Bootstrap messaging css workaround
|
# Bootstrap messaging css workaround
|
||||||
MESSAGE_TAGS = {
|
MESSAGE_TAGS = {messages.ERROR: "danger error"}
|
||||||
messages.ERROR: 'danger error'
|
|
||||||
}
|
|
||||||
|
|
||||||
CACHES = {
|
CACHES = {
|
||||||
"default": {
|
"default": {
|
||||||
"BACKEND": "django_redis.cache.RedisCache",
|
"BACKEND": "django_redis.cache.RedisCache",
|
||||||
"LOCATION": "redis://127.0.0.1:6379/1" # change the 1 here for the DB used
|
"LOCATION": "redis://127.0.0.1:6379/1", # change the 1 here for the DB used
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SESSION_ENGINE = "django.contrib.sessions.backends.cached_db"
|
SESSION_ENGINE = "django.contrib.sessions.backends.cached_db"
|
||||||
|
|
||||||
DEBUG = True
|
DEBUG = True
|
||||||
ALLOWED_HOSTS = ['*']
|
ALLOWED_HOSTS = ["*"]
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
'default': {
|
"default": {
|
||||||
'ENGINE': 'django.db.backends.sqlite3',
|
"ENGINE": "django.db.backends.sqlite3",
|
||||||
'NAME': str(os.path.join(BASE_DIR, 'alliance_auth.sqlite3')),
|
"NAME": str(os.path.join(BASE_DIR, "alliance_auth.sqlite3")),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
SITE_NAME = 'Alliance Auth'
|
SITE_NAME = "Alliance Auth"
|
||||||
|
|
||||||
DEFAULT_THEME = "allianceauth.theme.flatly.auth_hooks.FlatlyThemeHook"
|
DEFAULT_THEME = "allianceauth.theme.flatly.auth_hooks.FlatlyThemeHook"
|
||||||
DEFAULT_THEME_DARK = "allianceauth.theme.darkly.auth_hooks.DarklyThemeHook" # Legacy AAv3 user.profile.night_mode=1
|
DEFAULT_THEME_DARK = "allianceauth.theme.darkly.auth_hooks.DarklyThemeHook" # Legacy AAv3 user.profile.night_mode=1
|
||||||
|
|
||||||
LOGIN_URL = 'auth_login_user' # view that handles login logic
|
LOGIN_URL = "auth_login_user" # view that handles login logic
|
||||||
|
|
||||||
LOGIN_REDIRECT_URL = 'authentication:dashboard' # default destination when logging in if no redirect specified
|
LOGIN_REDIRECT_URL = "authentication:dashboard" # default destination when logging in if no redirect specified
|
||||||
LOGOUT_REDIRECT_URL = 'authentication:dashboard' # destination after logging out
|
LOGOUT_REDIRECT_URL = "authentication:dashboard" # destination after logging out
|
||||||
# Both of these redirects accept values as per the django redirect shortcut
|
# Both of these redirects accept values as per the django redirect shortcut
|
||||||
# https://docs.djangoproject.com/en/1.11/topics/http/shortcuts/#redirect
|
# https://docs.djangoproject.com/en/1.11/topics/http/shortcuts/#redirect
|
||||||
# - url names eg 'authentication:dashboard'
|
# - url names eg 'authentication:dashboard'
|
||||||
@ -264,73 +269,71 @@ LOGOUT_REDIRECT_URL = 'authentication:dashboard' # destination after logging ou
|
|||||||
# - absolute urls eg 'http://example.com/dashboard'
|
# - absolute urls eg 'http://example.com/dashboard'
|
||||||
|
|
||||||
# scopes required on new tokens when logging in. Cannot be blank.
|
# scopes required on new tokens when logging in. Cannot be blank.
|
||||||
LOGIN_TOKEN_SCOPES = ['publicData']
|
LOGIN_TOKEN_SCOPES = ["publicData"]
|
||||||
|
|
||||||
EMAIL_TIMEOUT = 15
|
EMAIL_TIMEOUT = 15
|
||||||
|
|
||||||
# number of days email verification links are valid for
|
# number of days email verification links are valid for
|
||||||
ACCOUNT_ACTIVATION_DAYS = 1
|
ACCOUNT_ACTIVATION_DAYS = 1
|
||||||
|
|
||||||
ESI_API_URL = 'https://esi.evetech.net/'
|
ESI_API_URL = "https://esi.evetech.net/"
|
||||||
|
|
||||||
LOGGING = {
|
LOGGING = {
|
||||||
'version': 1,
|
"version": 1,
|
||||||
'disable_existing_loggers': False,
|
"disable_existing_loggers": False,
|
||||||
'formatters': {
|
"formatters": {
|
||||||
'verbose': {
|
"verbose": {
|
||||||
'format': "[%(asctime)s] %(levelname)s [%(name)s:%(lineno)s] %(message)s",
|
"format": "[%(asctime)s] %(levelname)s [%(name)s:%(lineno)s] %(message)s",
|
||||||
'datefmt': "%d/%b/%Y %H:%M:%S"
|
"datefmt": "%d/%b/%Y %H:%M:%S",
|
||||||
},
|
},
|
||||||
'simple': {
|
"simple": {"format": "%(levelname)s %(message)s"},
|
||||||
'format': '%(levelname)s %(message)s'
|
},
|
||||||
|
"handlers": {
|
||||||
|
"log_file": {
|
||||||
|
"level": "INFO", # edit this line to change logging level to file
|
||||||
|
"class": "logging.handlers.RotatingFileHandler",
|
||||||
|
"filename": os.path.join(BASE_DIR, "log/allianceauth.log"),
|
||||||
|
"formatter": "verbose",
|
||||||
|
"maxBytes": 1024 * 1024 * 5, # edit this line to change max log file size
|
||||||
|
"backupCount": 5, # edit this line to change number of log backups
|
||||||
|
},
|
||||||
|
"extension_file": {
|
||||||
|
"level": "INFO",
|
||||||
|
"class": "logging.handlers.RotatingFileHandler",
|
||||||
|
"filename": os.path.join(BASE_DIR, "log/extensions.log"),
|
||||||
|
"formatter": "verbose",
|
||||||
|
"maxBytes": 1024 * 1024 * 5, # edit this line to change max log file size
|
||||||
|
"backupCount": 5, # edit this line to change number of log backups
|
||||||
|
},
|
||||||
|
"console": {
|
||||||
|
"level": "DEBUG", # edit this line to change logging level to console
|
||||||
|
"class": "logging.StreamHandler",
|
||||||
|
"formatter": "verbose",
|
||||||
|
},
|
||||||
|
"notifications": { # creates notifications for users with logging_notifications permission
|
||||||
|
"level": "ERROR", # edit this line to change logging level to notifications
|
||||||
|
"class": "allianceauth.notifications.handlers.NotificationHandler",
|
||||||
|
"formatter": "verbose",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'handlers': {
|
"loggers": {
|
||||||
'log_file': {
|
"allianceauth": {
|
||||||
'level': 'INFO', # edit this line to change logging level to file
|
"handlers": ["log_file", "console", "notifications"],
|
||||||
'class': 'logging.handlers.RotatingFileHandler',
|
"level": "DEBUG",
|
||||||
'filename': os.path.join(BASE_DIR, 'log/allianceauth.log'),
|
|
||||||
'formatter': 'verbose',
|
|
||||||
'maxBytes': 1024 * 1024 * 5, # edit this line to change max log file size
|
|
||||||
'backupCount': 5, # edit this line to change number of log backups
|
|
||||||
},
|
},
|
||||||
'extension_file': {
|
"extensions": {
|
||||||
'level': 'INFO',
|
"handlers": ["extension_file", "console"],
|
||||||
'class': 'logging.handlers.RotatingFileHandler',
|
"level": "DEBUG",
|
||||||
'filename': os.path.join(BASE_DIR, 'log/extensions.log'),
|
|
||||||
'formatter': 'verbose',
|
|
||||||
'maxBytes': 1024 * 1024 * 5, # edit this line to change max log file size
|
|
||||||
'backupCount': 5, # edit this line to change number of log backups
|
|
||||||
},
|
},
|
||||||
'console': {
|
"django": {
|
||||||
'level': 'DEBUG', # edit this line to change logging level to console
|
"handlers": ["log_file", "console"],
|
||||||
'class': 'logging.StreamHandler',
|
"level": "ERROR",
|
||||||
'formatter': 'verbose',
|
|
||||||
},
|
},
|
||||||
'notifications': { # creates notifications for users with logging_notifications permission
|
"esi": {
|
||||||
'level': 'ERROR', # edit this line to change logging level to notifications
|
"handlers": ["log_file", "console"],
|
||||||
'class': 'allianceauth.notifications.handlers.NotificationHandler',
|
"level": "DEBUG",
|
||||||
'formatter': 'verbose',
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'loggers': {
|
|
||||||
'allianceauth': {
|
|
||||||
'handlers': ['log_file', 'console', 'notifications'],
|
|
||||||
'level': 'DEBUG',
|
|
||||||
},
|
|
||||||
'extensions': {
|
|
||||||
'handlers': ['extension_file', 'console'],
|
|
||||||
'level': 'DEBUG',
|
|
||||||
},
|
|
||||||
'django': {
|
|
||||||
'handlers': ['log_file', 'console'],
|
|
||||||
'level': 'ERROR',
|
|
||||||
},
|
|
||||||
'esi': {
|
|
||||||
'handlers': ['log_file', 'console'],
|
|
||||||
'level': 'DEBUG',
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
|
DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
|
||||||
|
@ -102,19 +102,24 @@
|
|||||||
(() => {
|
(() => {
|
||||||
// TODO Move to own JS file
|
// TODO Move to own JS file
|
||||||
const sidebar = document.getElementById('sidebar');
|
const sidebar = document.getElementById('sidebar');
|
||||||
|
const sidebarKey = `sidebar_${sidebar.id}`;
|
||||||
|
|
||||||
sidebar.addEventListener('shown.bs.collapse', () => {
|
sidebar.addEventListener('shown.bs.collapse', (event) => {
|
||||||
localStorage.removeItem(`sidebar_${sidebar.id}`);
|
if (event.target.id === sidebar.id) {
|
||||||
|
localStorage.removeItem(sidebarKey);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
sidebar.addEventListener('hidden.bs.collapse', () => {
|
sidebar.addEventListener('hidden.bs.collapse', (event) => {
|
||||||
localStorage.setItem(`sidebar_${sidebar.id}`, 'closed');
|
if (event.target.id === sidebar.id) {
|
||||||
|
localStorage.setItem(sidebarKey, 'closed');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (localStorage.getItem(`sidebar_${sidebar.id}`) === 'closed') {
|
if (localStorage.getItem(sidebarKey) === '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');
|
||||||
@ -133,6 +138,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
{% include 'bundles/jquery-js.html' %}
|
{% include 'bundles/jquery-js.html' %}
|
||||||
|
|
||||||
{% theme_js %}
|
{% theme_js %}
|
||||||
|
|
||||||
{% if user.is_authenticated %}
|
{% if user.is_authenticated %}
|
||||||
@ -148,6 +154,7 @@
|
|||||||
|
|
||||||
{% block extra_javascript %}
|
{% block extra_javascript %}
|
||||||
{% endblock extra_javascript %}
|
{% endblock extra_javascript %}
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
{% block extra_script %}
|
{% block extra_script %}
|
||||||
{% endblock extra_script %}
|
{% endblock extra_script %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user