aa-doctrinehub 1.0.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- aa_doctrinehub-1.0.3/.gitignore +71 -0
- aa_doctrinehub-1.0.3/LICENSE +21 -0
- aa_doctrinehub-1.0.3/PKG-INFO +156 -0
- aa_doctrinehub-1.0.3/README.md +109 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/__init__.py +3 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/app_settings.py +5 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/apps.py +13 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/auth_hooks.py +36 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/discord_i18n.py +40 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/locale/nl/LC_MESSAGES/django.mo +0 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/locale/nl/LC_MESSAGES/django.po +145 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/management/__init__.py +0 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/management/commands/__init__.py +0 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/management/commands/doctrinehub_refresh_requirements.py +31 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/migrations/0001_initial.py +429 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/migrations/0002_remove_category_doctrinehub_category_unique_external_and_more.py +43 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/migrations/0003_alter_category_source_alter_doctrine_source_and_more.py +42 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/migrations/0004_notificationconfig_characterskillsnapshot_and_more.py +389 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/migrations/0005_category_is_available.py +19 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/migrations/0006_fitting_is_available.py +19 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/migrations/__init__.py +0 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/models.py +539 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/services/__init__.py +0 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/services/eft.py +197 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/services/esi_sync.py +246 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/services/fittings.py +162 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/services/fittings_sync.py +385 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/services/integrations.py +321 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/services/remote_scrape.py +565 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/services/rules.py +609 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/services/skills.py +347 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/services/types.py +312 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/services/visibility.py +47 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/static/aa_doctrinehub/spa/assets/index.css +1 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/static/aa_doctrinehub/spa/assets/index.js +214 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/tasks.py +59 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/templates/aa_doctrinehub/spa.html +31 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/tests/__init__.py +0 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/tests/conftest.py +11 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/tests/test_discord_language.py +39 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/tests/test_eft.py +70 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/tests/test_fittings_service.py +34 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/tests/test_fittings_sync.py +240 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/tests/test_integrations.py +92 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/tests/test_models.py +46 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/tests/test_no_external_plugins.py +21 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/tests/test_remote_scrape.py +337 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/tests/test_rules_and_groups.py +182 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/tests/test_skills_and_eligibility.py +190 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/tests/test_type_resolution.py +65 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/tests/test_types_and_requirements.py +174 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/tests/test_views.py +396 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/urls.py +99 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/views.py +32 -0
- aa_doctrinehub-1.0.3/aa_doctrinehub/views_spa_api.py +1153 -0
- aa_doctrinehub-1.0.3/pyproject.toml +84 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
|
|
7
|
+
# Build & Distribution
|
|
8
|
+
/build/
|
|
9
|
+
/dist/
|
|
10
|
+
*.egg-info/
|
|
11
|
+
*.egg
|
|
12
|
+
|
|
13
|
+
# Virtual environments
|
|
14
|
+
.venv/
|
|
15
|
+
venv/
|
|
16
|
+
tmp_env/
|
|
17
|
+
build_venv/
|
|
18
|
+
/build_venv
|
|
19
|
+
.venv-precommit/
|
|
20
|
+
.temp_venv/
|
|
21
|
+
precommit-env/
|
|
22
|
+
.tmp-env/
|
|
23
|
+
env/
|
|
24
|
+
|
|
25
|
+
# IDEs and OS
|
|
26
|
+
.idea/
|
|
27
|
+
.vscode/
|
|
28
|
+
*.swp
|
|
29
|
+
.DS_Store
|
|
30
|
+
|
|
31
|
+
# Tests, Tox & Coverage
|
|
32
|
+
.tox/
|
|
33
|
+
htmlcov/
|
|
34
|
+
.coverage
|
|
35
|
+
/coverage.xml
|
|
36
|
+
.pytest_cache/
|
|
37
|
+
.mypy_cache/
|
|
38
|
+
.ruff_cache/
|
|
39
|
+
|
|
40
|
+
# Databases
|
|
41
|
+
*.sqlite3
|
|
42
|
+
db.sqlite3
|
|
43
|
+
alliance_auth.sqlite3
|
|
44
|
+
|
|
45
|
+
# Node / JS
|
|
46
|
+
node_modules/
|
|
47
|
+
|
|
48
|
+
# Logs and temps
|
|
49
|
+
*.log
|
|
50
|
+
*.tmp
|
|
51
|
+
*.bak
|
|
52
|
+
*.old
|
|
53
|
+
.env
|
|
54
|
+
|
|
55
|
+
# Tijdelijke (scratch) scripts in de root
|
|
56
|
+
/*test*.py
|
|
57
|
+
/append_task.py
|
|
58
|
+
/make_migrations.py
|
|
59
|
+
|
|
60
|
+
# Testing & Build files
|
|
61
|
+
.pytest_cache/
|
|
62
|
+
htmlcov/
|
|
63
|
+
.coverage
|
|
64
|
+
.tox/
|
|
65
|
+
build/
|
|
66
|
+
dist/
|
|
67
|
+
*.egg-info/
|
|
68
|
+
.mypy_cache/
|
|
69
|
+
.ruff_cache/
|
|
70
|
+
frontend/package-lock.json
|
|
71
|
+
*.tsbuildinfo
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Machiel Broekman
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: aa-doctrinehub
|
|
3
|
+
Version: 1.0.3
|
|
4
|
+
Summary: Doctrines, fittings and member compliance for Alliance Auth
|
|
5
|
+
Author: Maddog Broekman
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2026 Machiel Broekman
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
License-File: LICENSE
|
|
28
|
+
Keywords: aa_doctrinehub,allianceauth,doctrines,eveonline,fittings
|
|
29
|
+
Classifier: Environment :: Web Environment
|
|
30
|
+
Classifier: Framework :: Django
|
|
31
|
+
Classifier: Framework :: Django :: 5.2
|
|
32
|
+
Classifier: Intended Audience :: Developers
|
|
33
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
34
|
+
Classifier: Operating System :: OS Independent
|
|
35
|
+
Classifier: Programming Language :: Python
|
|
36
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
37
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
38
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
39
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
40
|
+
Classifier: Topic :: Internet :: WWW/HTTP
|
|
41
|
+
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
|
|
42
|
+
Requires-Python: <3.14,>=3.11
|
|
43
|
+
Requires-Dist: allianceauth>=5
|
|
44
|
+
Requires-Dist: beautifulsoup4>=4.12
|
|
45
|
+
Requires-Dist: requests>=2.31
|
|
46
|
+
Description-Content-Type: text/markdown
|
|
47
|
+
|
|
48
|
+
# AA Doctrine Hub
|
|
49
|
+
|
|
50
|
+
Doctrines, fittings and member compliance for [Alliance Auth](https://gitlab.com/allianceauth/allianceauth).
|
|
51
|
+
A modern successor to the community Fittings app.
|
|
52
|
+
|
|
53
|
+
> **Status:** early development (phase 1, catalogue). See `backlog/docs/doc-1` for the design.
|
|
54
|
+
|
|
55
|
+
## Features
|
|
56
|
+
|
|
57
|
+
Phase 1 (in progress):
|
|
58
|
+
|
|
59
|
+
- Doctrines with fittings, roles (DPS, logistics, tackle, ...), required or optional, and a target count.
|
|
60
|
+
- Fittings with versions: every change is a new version with author, time and note.
|
|
61
|
+
- EFT import and export, multibuy text for one or more fits.
|
|
62
|
+
- Categories that limit visibility to Auth groups.
|
|
63
|
+
- Periodic sync from the Fittings app on the same Auth (optional). Synced doctrines and fittings
|
|
64
|
+
carry the source label "Fittings" and are read-only here.
|
|
65
|
+
- React + Tailwind + shadcn/ui single-page app that follows the Alliance Auth light/dark theme.
|
|
66
|
+
|
|
67
|
+
Planned: per-character eligibility from ESI skills, skill plans, coverage reports for leadership,
|
|
68
|
+
and compliance rules that assign and revoke Auth groups automatically.
|
|
69
|
+
|
|
70
|
+
## Installation
|
|
71
|
+
|
|
72
|
+
1. Install the package in your Auth virtual environment:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
pip install aa-doctrinehub
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
2. Add `"aa_doctrinehub"` to `INSTALLED_APPS` in `local.py`. Also add `"eveuniverse"` if it isn't already
|
|
79
|
+
installed for another app — Doctrine Hub uses it when present to resolve ship/item names to type ids,
|
|
80
|
+
icons and skill/slot data, and falls back to public ESI calls when it is not.
|
|
81
|
+
|
|
82
|
+
3. Add the periodic task to `local.py`:
|
|
83
|
+
|
|
84
|
+
```python
|
|
85
|
+
CELERYBEAT_SCHEDULE["aa_doctrinehub_sync_from_fittings"] = {
|
|
86
|
+
"task": "aa_doctrinehub.tasks.sync_from_fittings",
|
|
87
|
+
"schedule": crontab(minute="30", hour="4"),
|
|
88
|
+
}
|
|
89
|
+
CELERYBEAT_SCHEDULE["aa_doctrinehub_sync_character_snapshots"] = {
|
|
90
|
+
"task": "aa_doctrinehub.tasks.sync_character_snapshots",
|
|
91
|
+
"schedule": crontab(minute="0", hour="*/4"),
|
|
92
|
+
}
|
|
93
|
+
CELERYBEAT_SCHEDULE["aa_doctrinehub_evaluate_compliance_rules"] = {
|
|
94
|
+
"task": "aa_doctrinehub.tasks.evaluate_compliance_rules",
|
|
95
|
+
"schedule": crontab(minute="15", hour="*/4"),
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
4. Run migrations and collect static files, then restart Auth and the Celery workers:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
python manage.py migrate
|
|
103
|
+
python manage.py collectstatic --noinput
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Periodic tasks (CELERYBEAT_SCHEDULE)
|
|
107
|
+
|
|
108
|
+
| Name | Task | Schedule | What it does |
|
|
109
|
+
| --- | --- | --- | --- |
|
|
110
|
+
| `aa_doctrinehub_sync_from_fittings` | `aa_doctrinehub.tasks.sync_from_fittings` | daily, 04:30 | Copies doctrines, fittings and categories from the Fittings app when the sync is enabled and its interval (set in the app, default 7 days) has passed. Does nothing when Fittings is not installed. |
|
|
111
|
+
| `aa_doctrinehub_sync_character_snapshots` | `aa_doctrinehub.tasks.sync_character_snapshots` | every 4 hours | Syncs skills, implants, and assets from ESI for all linked characters (no external plugins). |
|
|
112
|
+
| `aa_doctrinehub_evaluate_compliance_rules` | `aa_doctrinehub.tasks.evaluate_compliance_rules` | every 4 hours | Evaluates active compliance rules across all account characters and applies automatic Auth group grants/revocations. |
|
|
113
|
+
|
|
114
|
+
## Permissions
|
|
115
|
+
|
|
116
|
+
| Permission | For |
|
|
117
|
+
| --- | --- |
|
|
118
|
+
| `aa_doctrinehub.basic_access` | Members: see doctrines and fittings |
|
|
119
|
+
| `aa_doctrinehub.manage_doctrines` | Doctrine managers: import and edit fittings, sync settings |
|
|
120
|
+
| `aa_doctrinehub.view_compliance` | FCs and leadership: coverage and member status (planned) |
|
|
121
|
+
| `aa_doctrinehub.manage_rules` | Compliance rules and group assignments (planned) |
|
|
122
|
+
|
|
123
|
+
## Settings
|
|
124
|
+
|
|
125
|
+
| Setting | Default | Description |
|
|
126
|
+
| --- | --- | --- |
|
|
127
|
+
| `DOCTRINEHUB_APP_NAME` | `"Doctrines"` | Name in the menu and page title |
|
|
128
|
+
|
|
129
|
+
Functional settings (Fittings sync on/off and interval) live in the app itself, not in Django admin.
|
|
130
|
+
|
|
131
|
+
## Fittings sync
|
|
132
|
+
|
|
133
|
+
Doctrine Hub never imports the Fittings package. It looks up Fittings' models through Django's app
|
|
134
|
+
registry, so it works with or without Fittings installed. Sync behaviour:
|
|
135
|
+
|
|
136
|
+
- Fittings and doctrines are matched on their Fittings ID; a changed fitting gets a new version.
|
|
137
|
+
- Doctrines removed from Fittings are archived here; fittings removed from Fittings are deleted,
|
|
138
|
+
unless one of our own doctrines still uses them.
|
|
139
|
+
- Category group restrictions are copied.
|
|
140
|
+
|
|
141
|
+
## Development
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
uv sync
|
|
145
|
+
uv run pytest
|
|
146
|
+
uv run ruff check . && uv run ruff format --check .
|
|
147
|
+
uv run mypy aa_doctrinehub
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Frontend (React 19 + Vite + Tailwind v4 + shadcn/ui), output goes to `aa_doctrinehub/static/aa_doctrinehub/spa/`:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
cd frontend && npm install && npm run build
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
On Windows with the workspace on Google Drive, use `frontend/build.ps1` (builds on a local disk).
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# AA Doctrine Hub
|
|
2
|
+
|
|
3
|
+
Doctrines, fittings and member compliance for [Alliance Auth](https://gitlab.com/allianceauth/allianceauth).
|
|
4
|
+
A modern successor to the community Fittings app.
|
|
5
|
+
|
|
6
|
+
> **Status:** early development (phase 1, catalogue). See `backlog/docs/doc-1` for the design.
|
|
7
|
+
|
|
8
|
+
## Features
|
|
9
|
+
|
|
10
|
+
Phase 1 (in progress):
|
|
11
|
+
|
|
12
|
+
- Doctrines with fittings, roles (DPS, logistics, tackle, ...), required or optional, and a target count.
|
|
13
|
+
- Fittings with versions: every change is a new version with author, time and note.
|
|
14
|
+
- EFT import and export, multibuy text for one or more fits.
|
|
15
|
+
- Categories that limit visibility to Auth groups.
|
|
16
|
+
- Periodic sync from the Fittings app on the same Auth (optional). Synced doctrines and fittings
|
|
17
|
+
carry the source label "Fittings" and are read-only here.
|
|
18
|
+
- React + Tailwind + shadcn/ui single-page app that follows the Alliance Auth light/dark theme.
|
|
19
|
+
|
|
20
|
+
Planned: per-character eligibility from ESI skills, skill plans, coverage reports for leadership,
|
|
21
|
+
and compliance rules that assign and revoke Auth groups automatically.
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
1. Install the package in your Auth virtual environment:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pip install aa-doctrinehub
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
2. Add `"aa_doctrinehub"` to `INSTALLED_APPS` in `local.py`. Also add `"eveuniverse"` if it isn't already
|
|
32
|
+
installed for another app — Doctrine Hub uses it when present to resolve ship/item names to type ids,
|
|
33
|
+
icons and skill/slot data, and falls back to public ESI calls when it is not.
|
|
34
|
+
|
|
35
|
+
3. Add the periodic task to `local.py`:
|
|
36
|
+
|
|
37
|
+
```python
|
|
38
|
+
CELERYBEAT_SCHEDULE["aa_doctrinehub_sync_from_fittings"] = {
|
|
39
|
+
"task": "aa_doctrinehub.tasks.sync_from_fittings",
|
|
40
|
+
"schedule": crontab(minute="30", hour="4"),
|
|
41
|
+
}
|
|
42
|
+
CELERYBEAT_SCHEDULE["aa_doctrinehub_sync_character_snapshots"] = {
|
|
43
|
+
"task": "aa_doctrinehub.tasks.sync_character_snapshots",
|
|
44
|
+
"schedule": crontab(minute="0", hour="*/4"),
|
|
45
|
+
}
|
|
46
|
+
CELERYBEAT_SCHEDULE["aa_doctrinehub_evaluate_compliance_rules"] = {
|
|
47
|
+
"task": "aa_doctrinehub.tasks.evaluate_compliance_rules",
|
|
48
|
+
"schedule": crontab(minute="15", hour="*/4"),
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
4. Run migrations and collect static files, then restart Auth and the Celery workers:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
python manage.py migrate
|
|
56
|
+
python manage.py collectstatic --noinput
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Periodic tasks (CELERYBEAT_SCHEDULE)
|
|
60
|
+
|
|
61
|
+
| Name | Task | Schedule | What it does |
|
|
62
|
+
| --- | --- | --- | --- |
|
|
63
|
+
| `aa_doctrinehub_sync_from_fittings` | `aa_doctrinehub.tasks.sync_from_fittings` | daily, 04:30 | Copies doctrines, fittings and categories from the Fittings app when the sync is enabled and its interval (set in the app, default 7 days) has passed. Does nothing when Fittings is not installed. |
|
|
64
|
+
| `aa_doctrinehub_sync_character_snapshots` | `aa_doctrinehub.tasks.sync_character_snapshots` | every 4 hours | Syncs skills, implants, and assets from ESI for all linked characters (no external plugins). |
|
|
65
|
+
| `aa_doctrinehub_evaluate_compliance_rules` | `aa_doctrinehub.tasks.evaluate_compliance_rules` | every 4 hours | Evaluates active compliance rules across all account characters and applies automatic Auth group grants/revocations. |
|
|
66
|
+
|
|
67
|
+
## Permissions
|
|
68
|
+
|
|
69
|
+
| Permission | For |
|
|
70
|
+
| --- | --- |
|
|
71
|
+
| `aa_doctrinehub.basic_access` | Members: see doctrines and fittings |
|
|
72
|
+
| `aa_doctrinehub.manage_doctrines` | Doctrine managers: import and edit fittings, sync settings |
|
|
73
|
+
| `aa_doctrinehub.view_compliance` | FCs and leadership: coverage and member status (planned) |
|
|
74
|
+
| `aa_doctrinehub.manage_rules` | Compliance rules and group assignments (planned) |
|
|
75
|
+
|
|
76
|
+
## Settings
|
|
77
|
+
|
|
78
|
+
| Setting | Default | Description |
|
|
79
|
+
| --- | --- | --- |
|
|
80
|
+
| `DOCTRINEHUB_APP_NAME` | `"Doctrines"` | Name in the menu and page title |
|
|
81
|
+
|
|
82
|
+
Functional settings (Fittings sync on/off and interval) live in the app itself, not in Django admin.
|
|
83
|
+
|
|
84
|
+
## Fittings sync
|
|
85
|
+
|
|
86
|
+
Doctrine Hub never imports the Fittings package. It looks up Fittings' models through Django's app
|
|
87
|
+
registry, so it works with or without Fittings installed. Sync behaviour:
|
|
88
|
+
|
|
89
|
+
- Fittings and doctrines are matched on their Fittings ID; a changed fitting gets a new version.
|
|
90
|
+
- Doctrines removed from Fittings are archived here; fittings removed from Fittings are deleted,
|
|
91
|
+
unless one of our own doctrines still uses them.
|
|
92
|
+
- Category group restrictions are copied.
|
|
93
|
+
|
|
94
|
+
## Development
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
uv sync
|
|
98
|
+
uv run pytest
|
|
99
|
+
uv run ruff check . && uv run ruff format --check .
|
|
100
|
+
uv run mypy aa_doctrinehub
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Frontend (React 19 + Vite + Tailwind v4 + shadcn/ui), output goes to `aa_doctrinehub/static/aa_doctrinehub/spa/`:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
cd frontend && npm install && npm run build
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
On Windows with the workspace on Google Drive, use `frontend/build.ps1` (builds on a local disk).
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"""App configuration for aa_doctrinehub."""
|
|
2
|
+
|
|
3
|
+
from django.apps import AppConfig
|
|
4
|
+
from django.utils.translation import gettext_lazy as _
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class AaDoctrineHubConfig(AppConfig):
|
|
8
|
+
"""Django app config."""
|
|
9
|
+
|
|
10
|
+
default_auto_field = "django.db.models.BigAutoField"
|
|
11
|
+
name = "aa_doctrinehub"
|
|
12
|
+
label = "aa_doctrinehub"
|
|
13
|
+
verbose_name = _("Doctrine Hub")
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"""Alliance Auth hooks for aa_doctrinehub."""
|
|
2
|
+
|
|
3
|
+
from allianceauth import hooks
|
|
4
|
+
from allianceauth.services.hooks import MenuItemHook, UrlHook
|
|
5
|
+
|
|
6
|
+
from . import urls
|
|
7
|
+
from .app_settings import DOCTRINEHUB_APP_NAME
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class DoctrineHubMenuItem(MenuItemHook):
|
|
11
|
+
"""Menu item for Doctrine Hub."""
|
|
12
|
+
|
|
13
|
+
def __init__(self):
|
|
14
|
+
super().__init__(
|
|
15
|
+
DOCTRINEHUB_APP_NAME,
|
|
16
|
+
"fas fa-shield-alt fa-fw",
|
|
17
|
+
"aa_doctrinehub:index",
|
|
18
|
+
navactive=["aa_doctrinehub:"],
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
def render(self, request):
|
|
22
|
+
if request.user.has_perm("aa_doctrinehub.basic_access"):
|
|
23
|
+
return super().render(request)
|
|
24
|
+
return ""
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@hooks.register("menu_item_hook")
|
|
28
|
+
def register_menu():
|
|
29
|
+
"""Register the menu item."""
|
|
30
|
+
return DoctrineHubMenuItem()
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
@hooks.register("url_hook")
|
|
34
|
+
def register_urls():
|
|
35
|
+
"""Register the URLs."""
|
|
36
|
+
return UrlHook(urls, "aa_doctrinehub", r"^doctrines/")
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"""Fixed-language helper for Discord messages sent by aa-doctrinehub (AGENTS §14)."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from collections.abc import Iterator
|
|
6
|
+
from contextlib import contextmanager
|
|
7
|
+
from typing import Any
|
|
8
|
+
|
|
9
|
+
from django.conf import settings
|
|
10
|
+
from django.utils import translation
|
|
11
|
+
from django.utils.translation import gettext_lazy as _
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def default_language() -> str:
|
|
15
|
+
"""Return the configured default Discord message language."""
|
|
16
|
+
return getattr(settings, "DISCORD_MESSAGE_LANGUAGE", "") or settings.LANGUAGE_CODE
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def channel_language(code: str | None) -> str:
|
|
20
|
+
"""Return the channel's configured language, falling back to default_language()."""
|
|
21
|
+
return code or default_language()
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def user_language(user: Any) -> str:
|
|
25
|
+
"""Return the recipient's Alliance Auth language, falling back to default_language()."""
|
|
26
|
+
profile = getattr(user, "profile", None)
|
|
27
|
+
lang = getattr(profile, "language", "") if profile is not None else ""
|
|
28
|
+
return lang or default_language()
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
@contextmanager
|
|
32
|
+
def discord_language(code: str | None) -> Iterator[None]:
|
|
33
|
+
"""Context manager that activates the target Discord language for gettext calls."""
|
|
34
|
+
with translation.override(code or default_language()):
|
|
35
|
+
yield
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def language_choices() -> list[tuple[str, str]]:
|
|
39
|
+
"""Choices for configuring a webhook language in the frontend."""
|
|
40
|
+
return [("", str(_("Default")))] + [(code, str(label)) for code, label in settings.LANGUAGES]
|
|
Binary file
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# SOME DESCRIPTIVE TITLE.
|
|
2
|
+
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
|
3
|
+
# This file is distributed under the same license as the PACKAGE package.
|
|
4
|
+
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
|
5
|
+
#
|
|
6
|
+
#, fuzzy
|
|
7
|
+
msgid ""
|
|
8
|
+
msgstr ""
|
|
9
|
+
"Project-Id-Version: PACKAGE VERSION\n"
|
|
10
|
+
"Report-Msgid-Bugs-To: \n"
|
|
11
|
+
"POT-Creation-Date: 2026-11-24 21:15+0000\n"
|
|
12
|
+
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
|
13
|
+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
|
14
|
+
"Language-Team: LANGUAGE <LL@li.org>\n"
|
|
15
|
+
"Language: nl\n"
|
|
16
|
+
"MIME-Version: 1.0\n"
|
|
17
|
+
"Content-Type: text/plain; charset=UTF-8\n"
|
|
18
|
+
"Content-Transfer-Encoding: 8bit\n"
|
|
19
|
+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
|
20
|
+
|
|
21
|
+
#: apps.py:13 models.py:31
|
|
22
|
+
msgid "Doctrine Hub"
|
|
23
|
+
msgstr "Doctrine Hub"
|
|
24
|
+
|
|
25
|
+
#: models.py:32 models.py:110
|
|
26
|
+
msgid "Fittings"
|
|
27
|
+
msgstr "Fittings"
|
|
28
|
+
|
|
29
|
+
#: models.py:54
|
|
30
|
+
msgid "Primary key of this record in its source, if synced."
|
|
31
|
+
msgstr ""
|
|
32
|
+
"Primaire sleutel van dit record in de bron, als het gesynchroniseerd is."
|
|
33
|
+
|
|
34
|
+
#: models.py:78
|
|
35
|
+
msgid "Leave empty to show this category to everyone with basic access."
|
|
36
|
+
msgstr "Laat leeg om deze categorie te tonen aan iedereen met basistoegang."
|
|
37
|
+
|
|
38
|
+
#: models.py:82
|
|
39
|
+
msgid "Category"
|
|
40
|
+
msgstr "Categorie"
|
|
41
|
+
|
|
42
|
+
#: models.py:83
|
|
43
|
+
msgid "Categories"
|
|
44
|
+
msgstr "Categorieën"
|
|
45
|
+
|
|
46
|
+
#: models.py:109
|
|
47
|
+
msgid "Fitting"
|
|
48
|
+
msgstr "Fit"
|
|
49
|
+
|
|
50
|
+
#: models.py:134
|
|
51
|
+
msgid "The fitting in EFT format."
|
|
52
|
+
msgstr "De fit in EFT-formaat."
|
|
53
|
+
|
|
54
|
+
#: models.py:140
|
|
55
|
+
msgid "Fitting version"
|
|
56
|
+
msgstr "Fitversie"
|
|
57
|
+
|
|
58
|
+
#: models.py:141
|
|
59
|
+
msgid "Fitting versions"
|
|
60
|
+
msgstr "Fitversies"
|
|
61
|
+
|
|
62
|
+
#: models.py:155
|
|
63
|
+
msgid "EVE inventory flag, e.g. HiSlot0, DroneBay, Cargo."
|
|
64
|
+
msgstr "EVE-inventory flag, bijv. HiSlot0, DroneBay, Cargo."
|
|
65
|
+
|
|
66
|
+
#: models.py:163
|
|
67
|
+
msgid "Fitting item"
|
|
68
|
+
msgstr "Fit-onderdeel"
|
|
69
|
+
|
|
70
|
+
#: models.py:164
|
|
71
|
+
msgid "Fitting items"
|
|
72
|
+
msgstr "Fit-onderdelen"
|
|
73
|
+
|
|
74
|
+
#: models.py:175
|
|
75
|
+
msgid "Draft"
|
|
76
|
+
msgstr "Concept"
|
|
77
|
+
|
|
78
|
+
#: models.py:176
|
|
79
|
+
msgid "Active"
|
|
80
|
+
msgstr "Actief"
|
|
81
|
+
|
|
82
|
+
#: models.py:177
|
|
83
|
+
msgid "Phasing out"
|
|
84
|
+
msgstr "Uitfaseren"
|
|
85
|
+
|
|
86
|
+
#: models.py:178
|
|
87
|
+
msgid "Archived"
|
|
88
|
+
msgstr "Gearchiveerd"
|
|
89
|
+
|
|
90
|
+
#: models.py:190
|
|
91
|
+
msgid "Doctrine"
|
|
92
|
+
msgstr "Doctrine"
|
|
93
|
+
|
|
94
|
+
#: models.py:191
|
|
95
|
+
msgid "Doctrines"
|
|
96
|
+
msgstr "Doctrines"
|
|
97
|
+
|
|
98
|
+
#: models.py:209
|
|
99
|
+
msgid "Unspecified"
|
|
100
|
+
msgstr "Niet opgegeven"
|
|
101
|
+
|
|
102
|
+
#: models.py:210
|
|
103
|
+
msgid "DPS"
|
|
104
|
+
msgstr "DPS"
|
|
105
|
+
|
|
106
|
+
#: models.py:211
|
|
107
|
+
msgid "Logistics"
|
|
108
|
+
msgstr "Logistiek"
|
|
109
|
+
|
|
110
|
+
#: models.py:212
|
|
111
|
+
msgid "Tackle"
|
|
112
|
+
msgstr "Tackle"
|
|
113
|
+
|
|
114
|
+
#: models.py:213
|
|
115
|
+
msgid "EWAR"
|
|
116
|
+
msgstr "EWAR"
|
|
117
|
+
|
|
118
|
+
#: models.py:214
|
|
119
|
+
msgid "Command"
|
|
120
|
+
msgstr "Command"
|
|
121
|
+
|
|
122
|
+
#: models.py:215
|
|
123
|
+
msgid "Support"
|
|
124
|
+
msgstr "Ondersteuning"
|
|
125
|
+
|
|
126
|
+
#: models.py:216
|
|
127
|
+
msgid "Scout"
|
|
128
|
+
msgstr "Scout"
|
|
129
|
+
|
|
130
|
+
#: models.py:226
|
|
131
|
+
msgid "Doctrine fitting"
|
|
132
|
+
msgstr "Doctrinefit"
|
|
133
|
+
|
|
134
|
+
#: models.py:227
|
|
135
|
+
msgid "Doctrine fittings"
|
|
136
|
+
msgstr "Doctrinefits"
|
|
137
|
+
|
|
138
|
+
#: models.py:242
|
|
139
|
+
msgid ""
|
|
140
|
+
"Periodically copy doctrines and fittings from the Fittings app on this Auth."
|
|
141
|
+
msgstr "Kopieer periodiek doctrines en fits uit de Fittings-app op deze Auth."
|
|
142
|
+
|
|
143
|
+
#: models.py:249 models.py:250
|
|
144
|
+
msgid "Sync settings"
|
|
145
|
+
msgstr "Sync-instellingen"
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"""Fill in hull types and skill requirements of fittings that miss them."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Any
|
|
6
|
+
|
|
7
|
+
from django.core.management.base import BaseCommand, CommandParser
|
|
8
|
+
|
|
9
|
+
from aa_doctrinehub.models import Fitting
|
|
10
|
+
from aa_doctrinehub.services.fittings import refresh_incomplete_fittings, refresh_requirements
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class Command(BaseCommand):
|
|
14
|
+
help = "Resolve ship and item type IDs and recompute dogma skill requirements of fittings."
|
|
15
|
+
|
|
16
|
+
def add_arguments(self, parser: CommandParser) -> None:
|
|
17
|
+
parser.add_argument("--all", action="store_true", help="Refresh every fitting, not only incomplete ones.")
|
|
18
|
+
|
|
19
|
+
def handle(self, *args: Any, **options: Any) -> None:
|
|
20
|
+
if options["all"]:
|
|
21
|
+
count = 0
|
|
22
|
+
for fitting in Fitting.objects.all():
|
|
23
|
+
refresh_requirements(fitting)
|
|
24
|
+
count += 1
|
|
25
|
+
else:
|
|
26
|
+
count = refresh_incomplete_fittings()
|
|
27
|
+
for fitting in Fitting.objects.all():
|
|
28
|
+
version = fitting.current_version
|
|
29
|
+
if not fitting.ship_type_id or version is None or not version.skill_requirements.exists():
|
|
30
|
+
self.stdout.write(self.style.WARNING(f"Still incomplete: {fitting} (id {fitting.pk})"))
|
|
31
|
+
self.stdout.write(self.style.SUCCESS(f"Refreshed {count} fitting(s)."))
|