Compare commits

...

16 Commits

Author SHA1 Message Date
Ariel Rin
0036e8b280 Version Bump v2.8.3 2021-04-07 15:18:08 +00:00
Ariel Rin
ea2b5bfecf Merge branch 'srp-killmail-link-fix-issue-1282' into 'master'
Proper error message on non kill mail zkb links

See merge request allianceauth/allianceauth!1297
2021-04-07 15:12:56 +00:00
Peter Pfeufer
aa7495fa60 Proper error message on non kill mail zkb links 2021-04-07 15:12:56 +00:00
Ariel Rin
162ec1bd86 Merge branch 'docs-permissioncleanup' into 'master'
Permissions Cleanup Docs

See merge request allianceauth/allianceauth!1293
2021-04-07 13:23:28 +00:00
Ariel Rin
2668884008 Merge branch 'srp-copypaste' into 'master'
SRP Character Name Copy-Paste

See merge request allianceauth/allianceauth!1295
2021-04-07 13:22:24 +00:00
Ariel Rin
abdc3f3485 SRP Character Name Copy-Paste 2021-04-07 13:22:23 +00:00
Ariel Rin
911f21ee7c Merge branch 'add-support-discord-link' into 'master'
support discord link added to admin notifications on dashboard

See merge request allianceauth/allianceauth!1298
2021-04-07 13:21:26 +00:00
Ariel Rin
2387c40254 Limit Django to 3.1.x 2021-04-07 13:12:15 +00:00
Peter Pfeufer
76e18a79b3 support discord link added to admin notifications on dashboard 2021-04-06 10:44:12 +02:00
Ariel Rin
9725c9c947 Update .gitlab-ci.yml file 2021-03-27 08:38:40 +00:00
Ariel Rin
247ed7cc64 Merge branch 'nootification_log_spam' into 'master'
Use default by default in Notification system

See merge request allianceauth/allianceauth!1294
2021-02-25 11:04:18 +00:00
Aaron Kable
2fd2af793e Use default by defaut in notification system 2021-02-21 18:14:42 +08:00
Ariel Rin
3fc36b9ce1 Permissions Cleanup Tool 2021-02-18 13:33:23 +10:00
Ariel Rin
c12fd2d7bc Merge branch 'improve_developer_docs' into 'master'
Improve developer docs

See merge request allianceauth/allianceauth!1292
2021-02-18 01:52:15 +00:00
ErikKalkoken
7fe1ba2fb2 Improve docs for WSL setup 2021-02-17 09:50:01 +01:00
ErikKalkoken
ab7eb3e5df Fix sphinx issues in docs 2021-02-17 09:35:18 +01:00
13 changed files with 183 additions and 37 deletions

View File

@@ -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

View File

@@ -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__)

View File

@@ -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

View File

@@ -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

View File

@@ -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 }}&nbsp;<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() {

View File

@@ -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>

View File

@@ -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 -->

View File

@@ -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

View File

@@ -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

View File

@@ -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`

View File

@@ -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

View File

@@ -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.

View File

@@ -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',