mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2026-02-04 14:16:21 +01:00
Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0036e8b280 | ||
|
|
ea2b5bfecf | ||
|
|
aa7495fa60 | ||
|
|
162ec1bd86 | ||
|
|
2668884008 | ||
|
|
abdc3f3485 | ||
|
|
911f21ee7c | ||
|
|
2387c40254 | ||
|
|
76e18a79b3 | ||
|
|
9725c9c947 | ||
|
|
247ed7cc64 | ||
|
|
2fd2af793e | ||
|
|
3fc36b9ce1 | ||
|
|
c12fd2d7bc | ||
|
|
7fe1ba2fb2 | ||
|
|
ab7eb3e5df |
@@ -1,43 +1,113 @@
|
||||
stages:
|
||||
- gitlab
|
||||
- test
|
||||
- deploy
|
||||
|
||||
before_script:
|
||||
- apt-get update && apt-get install redis-server -y
|
||||
- redis-server --daemonize yes
|
||||
- redis-cli ping
|
||||
- python -V
|
||||
- pip install wheel tox
|
||||
include:
|
||||
- template: Dependency-Scanning.gitlab-ci.yml
|
||||
- template: Security/SAST.gitlab-ci.yml
|
||||
|
||||
sast:
|
||||
stage: gitlab
|
||||
|
||||
dependency_scanning:
|
||||
stage: gitlab
|
||||
before_script:
|
||||
- apt-get update && apt-get install redis-server libmariadbclient-dev -y
|
||||
- redis-server --daemonize yes
|
||||
- redis-cli ping
|
||||
- python -V
|
||||
- pip install wheel tox
|
||||
|
||||
test-3.6-core:
|
||||
image: python:3.6-buster
|
||||
script:
|
||||
- tox -e py36-core
|
||||
before_script:
|
||||
- apt-get update && apt-get install redis-server -y
|
||||
- redis-server --daemonize yes
|
||||
- redis-cli ping
|
||||
- python -V
|
||||
- pip install wheel tox
|
||||
artifacts:
|
||||
when: always
|
||||
reports:
|
||||
cobertura: coverage.xml
|
||||
|
||||
test-3.7-core:
|
||||
image: python:3.7-buster
|
||||
script:
|
||||
- tox -e py37-core
|
||||
before_script:
|
||||
- apt-get update && apt-get install redis-server -y
|
||||
- redis-server --daemonize yes
|
||||
- redis-cli ping
|
||||
- python -V
|
||||
- pip install wheel tox
|
||||
artifacts:
|
||||
when: always
|
||||
reports:
|
||||
cobertura: coverage.xml
|
||||
|
||||
test-3.8-core:
|
||||
image: python:3.8-buster
|
||||
script:
|
||||
- tox -e py38-core
|
||||
before_script:
|
||||
- apt-get update && apt-get install redis-server -y
|
||||
- redis-server --daemonize yes
|
||||
- redis-cli ping
|
||||
- python -V
|
||||
- pip install wheel tox
|
||||
artifacts:
|
||||
when: always
|
||||
reports:
|
||||
cobertura: coverage.xml
|
||||
|
||||
test-3.6-all:
|
||||
image: python:3.6-buster
|
||||
script:
|
||||
- tox -e py36-all
|
||||
before_script:
|
||||
- apt-get update && apt-get install redis-server -y
|
||||
- redis-server --daemonize yes
|
||||
- redis-cli ping
|
||||
- python -V
|
||||
- pip install wheel tox
|
||||
artifacts:
|
||||
when: always
|
||||
reports:
|
||||
cobertura: coverage.xml
|
||||
|
||||
test-3.7-all:
|
||||
image: python:3.7-buster
|
||||
script:
|
||||
- tox -e py37-all
|
||||
before_script:
|
||||
- apt-get update && apt-get install redis-server -y
|
||||
- redis-server --daemonize yes
|
||||
- redis-cli ping
|
||||
- python -V
|
||||
- pip install wheel tox
|
||||
artifacts:
|
||||
when: always
|
||||
reports:
|
||||
cobertura: coverage.xml
|
||||
|
||||
test-3.8-all:
|
||||
image: python:3.8-buster
|
||||
script:
|
||||
- tox -e py38-all
|
||||
before_script:
|
||||
- apt-get update && apt-get install redis-server -y
|
||||
- redis-server --daemonize yes
|
||||
- redis-cli ping
|
||||
- python -V
|
||||
- pip install wheel tox
|
||||
artifacts:
|
||||
when: always
|
||||
reports:
|
||||
cobertura: coverage.xml
|
||||
|
||||
deploy_production:
|
||||
stage: deploy
|
||||
@@ -51,4 +121,4 @@ deploy_production:
|
||||
- twine upload dist/*
|
||||
|
||||
rules:
|
||||
- if: $CI_COMMIT_TAG
|
||||
- if: $CI_COMMIT_TAG
|
||||
@@ -1,7 +1,7 @@
|
||||
# This will make sure the app is always imported when
|
||||
# Django starts so that shared_task will use this app.
|
||||
|
||||
__version__ = '2.8.2'
|
||||
__version__ = '2.8.3'
|
||||
__title__ = 'Alliance Auth'
|
||||
__url__ = 'https://gitlab.com/allianceauth/allianceauth'
|
||||
NAME = '%s v%s' % (__title__, __version__)
|
||||
|
||||
@@ -33,10 +33,8 @@ def user_unread_notification_count(user: object) -> int:
|
||||
|
||||
@register.simple_tag
|
||||
def notifications_refresh_time() -> int:
|
||||
refresh_time = getattr(settings, 'NOTIFICATIONS_REFRESH_TIME', None)
|
||||
if (
|
||||
refresh_time is None or not isinstance(refresh_time, int) or refresh_time < 0
|
||||
):
|
||||
refresh_time = getattr(settings, 'NOTIFICATIONS_REFRESH_TIME', Notification.NOTIFICATIONS_REFRESH_TIME_DEFAULT)
|
||||
if (not isinstance(refresh_time, int) or refresh_time < 0):
|
||||
logger.warning('NOTIFICATIONS_REFRESH_TIME setting is invalid. Using default.')
|
||||
refresh_time = Notification.NOTIFICATIONS_REFRESH_TIME_DEFAULT
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import re
|
||||
|
||||
from django import forms
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
@@ -21,6 +23,11 @@ class SrpFleetUserRequestForm(forms.Form):
|
||||
data = self.cleaned_data['killboard_link']
|
||||
if "zkillboard.com" not in data:
|
||||
raise forms.ValidationError(_("Invalid Link. Please use zKillboard.com"))
|
||||
|
||||
if not re.match(r"http[s]?://zkillboard\.com/kill/\d+\/", data):
|
||||
raise forms.ValidationError(
|
||||
_("Invalid Link. Please post a direct link to a killmail.")
|
||||
)
|
||||
return data
|
||||
|
||||
|
||||
|
||||
@@ -10,6 +10,9 @@
|
||||
{% include 'bundles/x-editable.css.html' %}
|
||||
<link href="{% static 'css/checkbox.css' %}" rel="stylesheet" type="text/css">
|
||||
<style>
|
||||
.copy-text-fa-icon:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
.radio label, .checkbox label {
|
||||
padding-left: 10px;
|
||||
}
|
||||
@@ -109,7 +112,8 @@ ESC to cancel{% endblocktrans %}"id="blah"></i></th>
|
||||
{{ srpfleetrequest.character.alliance.alliance_ticker }}
|
||||
{% endif %}
|
||||
[{{ srpfleetrequest.character.corporation.corporation_ticker }}]
|
||||
{{ srpfleetrequest.character.character_name }}
|
||||
{{ srpfleetrequest.character.character_name }} <i class="copy-text-fa-icon far fa-copy" data-clipboard-text="{{ srpfleetrequest.character.character_name }}"></i>
|
||||
</span>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<a href="{{ srpfleetrequest.killboard_link }}"
|
||||
@@ -182,7 +186,24 @@ ESC to cancel{% endblocktrans %}"id="blah"></i></th>
|
||||
{% include 'bundles/datatables-js.html' %}
|
||||
{% include 'bundles/x-editable-js.html' %}
|
||||
{% include 'bundles/moment-js.html' %}
|
||||
{% endblock %}
|
||||
{% include 'bundles/clipboard-js.html' %}
|
||||
|
||||
<script>
|
||||
var clipboard = new ClipboardJS('.copy-text-fa-icon');
|
||||
clipboard.on('success', function (e) {
|
||||
console.info('Action:', e.action);
|
||||
console.info('Text:', e.text);
|
||||
console.info('Trigger:', e.trigger);
|
||||
|
||||
e.clearSelection();
|
||||
});
|
||||
|
||||
clipboard.on('error', function (e) {
|
||||
console.error('Action:', e.action);
|
||||
console.error('Trigger:', e.trigger);
|
||||
});
|
||||
</script>
|
||||
{% endblock extra_javascript %}
|
||||
|
||||
{% block extra_script %}
|
||||
$(document).ready(function() {
|
||||
|
||||
@@ -18,9 +18,20 @@
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="text-right" style="position:absolute;bottom:5px;right:5px;">
|
||||
<a href="https://gitlab.com/allianceauth/allianceauth/issues"><span class="label" style="background-color:#e65328;">
|
||||
<i class="fab fa-gitlab" aria-hidden="true"></i> Powered by GitLab</span>
|
||||
|
||||
<div class="text-right" style="position: absolute; bottom: 5px; right: 5px;">
|
||||
<a href="https://gitlab.com/allianceauth/allianceauth/issues" target="_blank" style="margin-right: 0.5rem;">
|
||||
<span class="label" style="background-color: #e65328;">
|
||||
<i class="fab fa-gitlab" aria-hidden="true"></i>
|
||||
{% translate 'Powered by GitLab' %}
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<a href="https://discord.com/invite/fjnHAmk" target="_blank">
|
||||
<span class="label" style="background-color: rgb(110,133,211);">
|
||||
<i class="fab fa-discord" aria-hidden="true"></i>
|
||||
{% translate 'Support Discord' %}
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
<!-- Start Clipboard.js js from cdnjs -->
|
||||
<script type="application/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js"></script>
|
||||
<script type="application/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.8/clipboard.min.js" integrity="sha512-sIqUEnRn31BgngPmHt2JenzleDDsXwYO+iyvQ46Mw6RL+udAUZj2n/u/PGY80NxRxynO7R9xIGx5LEzw4INWJQ==" crossorigin="anonymous"></script>
|
||||
<!-- End Clipboard.js js from cdnjs -->
|
||||
@@ -25,6 +25,11 @@ The development environment consists of the following components:
|
||||
|
||||
We will use the build-in Django development webserver, so we don't need to setup a WSGI server or a web server.
|
||||
|
||||
```eval_rst
|
||||
.. note::
|
||||
This setup works with both WSL 1 and WSL 2. However, due to the significantly better performance we recommend WSL 2.
|
||||
```
|
||||
|
||||
## Requirement
|
||||
|
||||
The only requirement is a PC with Windows 10 and Internet connection in order to download the additional software components.
|
||||
@@ -361,8 +366,7 @@ Here is an example debug config for Celery:
|
||||
"module": "celery",
|
||||
"cwd": "${workspaceFolder}/myauth",
|
||||
"console": "integratedTerminal",
|
||||
"args": [
|
||||
"-E",
|
||||
"args": [
|
||||
"-A",
|
||||
"myauth",
|
||||
"worker",
|
||||
@@ -371,7 +375,8 @@ Here is an example debug config for Celery:
|
||||
"-P",
|
||||
"solo",
|
||||
],
|
||||
"django": true
|
||||
"django": true,
|
||||
"justMyCode": true,
|
||||
},
|
||||
```
|
||||
|
||||
@@ -386,15 +391,14 @@ Finally it makes sense to have a dedicated debug config for running unit tests.
|
||||
"request": "launch",
|
||||
"program": "${workspaceFolder}/myauth/manage.py",
|
||||
"args": [
|
||||
"test",
|
||||
"-v 2",
|
||||
"test",
|
||||
"--keepdb",
|
||||
"--debug-mode",
|
||||
"--failfast",
|
||||
"example",
|
||||
],
|
||||
|
||||
"django": true
|
||||
"django": true,
|
||||
"justMyCode": true
|
||||
},
|
||||
```
|
||||
|
||||
@@ -416,13 +420,31 @@ Finally you may also want to have a debug config to debug a non-Django Python sc
|
||||
|
||||
## Additional tools
|
||||
|
||||
The following additional tools are very helpful when developing for AA.
|
||||
The following additional tools are very helpful when developing for AA with VS Code:
|
||||
|
||||
### Pylance
|
||||
|
||||
Pylance is an extension that works alongside Python in Visual Studio Code to provide performant language support: [Pylance](https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance)
|
||||
|
||||
### Code Spell Checker
|
||||
|
||||
Typos in your user facing comments can be quite embarrassing. This spell checker helps you avoid them.
|
||||
Typos in your user facing comments can be quite embarrassing. This spell checker helps you avoid them: [Code Spell Checker](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker)
|
||||
|
||||
Install from here: [Code Spell Checker](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker)
|
||||
### markdownlint
|
||||
|
||||
Extension for Visual Studio Code - Markdown linting and style checking for Visual Studio Code: [markdownlint](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint)
|
||||
|
||||
### GitLens
|
||||
|
||||
Extension for Visual Studio Code - Supercharge the Git capabilities built into Visual Studio Code: [GitLens](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens)
|
||||
|
||||
### RST preview
|
||||
|
||||
A VS Code extension to preview restructured text and provide syntax highlighting: [RST Preview](https://marketplace.visualstudio.com/items?itemName=tht13.rst-vscode)
|
||||
|
||||
### Django Template
|
||||
|
||||
This extension adds language colorization support and user snippets for the Django template language to VS Code: [Django Template](https://marketplace.visualstudio.com/items?itemName=bibhasdn.django-html)
|
||||
|
||||
### DBeaver
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ models
|
||||
===========
|
||||
|
||||
.. autoclass:: allianceauth.notifications.models.Notification
|
||||
:members: view, set_level, LEVEL_CHOICES
|
||||
:members: LEVEL_CHOICES, mark_viewed, set_level
|
||||
:undoc-members:
|
||||
|
||||
managers
|
||||
|
||||
@@ -42,11 +42,12 @@ Auto Groups are configured via models in the Admin Interface, a user will requir
|
||||
+-------------------------------------------+------------------+----------------+
|
||||
| Permission | Admin Site | Auth Site |
|
||||
+===========================================+==================+================+
|
||||
| eve_autogroups.add_autogroupsconfig | Can create model | None. |
|
||||
| eve_autogroups.add_autogroupsconfig | Can create model | None. |
|
||||
+-------------------------------------------+------------------+----------------+
|
||||
| eve_autogroups.change_autogroupsconfig | Can edit model | None. |
|
||||
| eve_autogroups.change_autogroupsconfig | Can edit model | None. |
|
||||
+-------------------------------------------+------------------+----------------+
|
||||
| eve_autogroups.delete_autogroupsconfig | Can delete model | None. |
|
||||
| eve_autogroups.delete_autogroupsconfig | Can delete model | None. |
|
||||
+-------------------------------------------+------------------+----------------+
|
||||
```
|
||||
|
||||
There exists more models that will be automatically created and maintained by this module, they do not require end-user/admin interaction. `managedalliancegroup` `managedcorpgroups`
|
||||
|
||||
@@ -38,14 +38,14 @@ To install we need a copy of the server. You can find the latest version from [t
|
||||
|
||||
Download the server, replacing the link with the link you got earlier.
|
||||
|
||||
```url
|
||||
```text
|
||||
http://dl.4players.de/ts/releases/3.13.2/teamspeak3-server_linux_amd64-3.13.2.tar.bz2
|
||||
```
|
||||
|
||||
Now we need to extract the file.
|
||||
|
||||
```bash
|
||||
tar -xf teamspeak3-server_linux_amd64-3.1.0.tar.bz2
|
||||
tar -xf teamspeak3-server_linux_amd64-3.1.0.tar.bz2
|
||||
```
|
||||
|
||||
### Create User
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
# Adding and Removing Apps
|
||||
# App Maintenance
|
||||
|
||||
## Adding and Removing Apps
|
||||
|
||||
Your auth project is just a regular Django project - you can add in [other Django apps](https://djangopackages.org/) as desired. Most come with dedicated setup guides, but here is the general procedure:
|
||||
|
||||
@@ -8,3 +10,17 @@ Your auth project is just a regular Django project - you can add in [other Djang
|
||||
4. restart AA with `supervisorctl restart myauth:`
|
||||
|
||||
If you ever want to remove an app, you should first clear it from the database to avoid dangling foreign keys: `python manage.py migrate appname zero`. Then you can remove it from your auth project's `INSTALLED_APPS` list.
|
||||
|
||||
## Permission Cleanup
|
||||
|
||||
Mature Alliance Auth installations, or those with actively developed extensions may find themselves with stale or duplicated Permission models.
|
||||
|
||||
This can make it confusing for admins to apply the right permissions, contribute to larger queries in backend management or simply look unsightly.
|
||||
|
||||
```python
|
||||
python manage.py remove_stale_contenttypes --include-stale-apps
|
||||
```
|
||||
|
||||
This inbuilt Django command will step through each contenttype and offer to delete it, displaying what exactly this will cascade to delete. Pay attention and ensure you understand exactly what is being removed before answering `yes`.
|
||||
|
||||
This should only cleanup uninstalled apps, deprecated permissions within apps should be cleaned up using Data Migrations by each responsible application.
|
||||
|
||||
4
setup.py
4
setup.py
@@ -22,7 +22,7 @@ install_requires = [
|
||||
'celery>=4.3.0,<5.0.0,!=4.4.4', # 4.4.4 is missing a dependency
|
||||
'celery_once>=2.0.1',
|
||||
|
||||
'django>=3.1.1,<4.0.0',
|
||||
'django>=3.1.1,<3.2.0',
|
||||
'django-bootstrap-form',
|
||||
'django-registration>=3.1',
|
||||
'django-sortedm2m',
|
||||
@@ -71,7 +71,7 @@ setup(
|
||||
classifiers=[
|
||||
'Environment :: Web Environment',
|
||||
'Framework :: Django',
|
||||
'Framework :: Django :: 2.2',
|
||||
'Framework :: Django :: 3.1',
|
||||
'Intended Audience :: Developers',
|
||||
'License :: OSI Approved :: GNU General Public License v2 (GPLv2)',
|
||||
'Operating System :: POSIX :: Linux',
|
||||
|
||||
Reference in New Issue
Block a user