Skip to content

Commit

Permalink
Merge branch 'dev' into layer_field_comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Raruto authored Apr 15, 2024
2 parents 7835cfe + a3b5636 commit a0f4e63
Show file tree
Hide file tree
Showing 197 changed files with 37,919 additions and 3,162 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/backport.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: 🔙 Backport
on:
pull_request_target:
types:
- closed
- labeled

jobs:
backport:
name: Backport
runs-on: ubuntu-latest
# Only react to merged PRs for security reasons.
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target.
if: >
github.event.pull_request.merged
&& (
github.event.action == 'closed'
|| (
github.event.action == 'labeled'
&& contains(github.event.label.name, 'backport')
)
)
steps:
- uses: tibdex/backport@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
body_template: "Backport <%= mergeCommitSha %> from #<%= number %> to <%= base %>.\n\n<%= body %>"
label_pattern: "^backport to (?<base>([^ ]+))$"
# Include the original labels from the merged PR (minus any matching label_pattern)
labels_template: "<% print(JSON.stringify(labels)) %>"
title_template: "🔙 from #<%= number %> - <%= title %>"
46 changes: 23 additions & 23 deletions .github/workflows/test_runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:

ci_tests:

runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

strategy:
matrix:
Expand All @@ -22,91 +22,91 @@ jobs:
id: extract_branch

- name: Starting Docker compose
run: docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml up -d
run: docker compose -f docker-compose.${{ matrix.qgis_version }}.yml up -d

- name: Copying code into the container
run: |
docker cp ./ "$(docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml ps -q g3w-suite)":/code
docker cp ./ "$(docker compose -f docker-compose.${{ matrix.qgis_version }}.yml ps -q g3w-suite)":/code
- name: Installing Python requirements
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/ && pip3 install -r requirements_docker.txt && pip3 install -r requirements_huey.txt"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/ && pip3 install -r requirements_docker.txt && pip3 install -r requirements_huey.txt"
- name: Installing Caching Python requirements
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/ && pip3 install -r g3w-admin/caching/requirements.txt"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/ && pip3 install -r g3w-admin/caching/requirements.txt"
- name: Installing Filemanager Python requirements
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/ && pip3 install -r g3w-admin/filemanager/requirements.txt"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/ && pip3 install -r g3w-admin/filemanager/requirements.txt"
- name: Installing Qplotly Python requirements
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/ && pip3 install -r g3w-admin/qplotly/requirements.txt"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/ && pip3 install -r g3w-admin/qplotly/requirements.txt"
- name: Installing Openrouteservice Python requirements
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/ && pip3 install -r g3w-admin/openrouteservice/requirements.txt && pip3 install -r g3w-admin/openrouteservice/requirements_testing.txt"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/ && pip3 install -r g3w-admin/openrouteservice/requirements.txt && pip3 install -r g3w-admin/openrouteservice/requirements_testing.txt"
- name: Building g3w-suite
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "/code/ci_scripts/build_suite.sh"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "/code/ci_scripts/build_suite.sh"
- name: Setting up g3w-suite
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "/code/ci_scripts/setup_suite.sh"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "/code/ci_scripts/setup_suite.sh"
- name: Starting Django
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py runserver 0.0.0.0:8000" &
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py runserver 0.0.0.0:8000" &
- name: Waiting for Django
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "wait-for-it -h localhost -p 8000 -t 240"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "wait-for-it -h localhost -p 8000 -t 240"
- name: Running g3w-admin core tests
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test core"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test core"
- name: Running g3w-admin qdjango tests
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test qdjango"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test qdjango"
- name: Running g3w-admin usersmanage tests
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test usersmanage"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test usersmanage"
- name: Running g3w-admin client tests
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test client"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test client"
- name: Running g3w-admin editing tests
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test editing.tests"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test editing.tests"
- name: Running g3w-admin caching tests
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test caching"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test caching"
- name: Running g3w-admin filemanager tests
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test filemanager"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test filemanager"
- name: Running g3w-admin qplotly tests
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test qplotly"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test qplotly"
- name: Running g3w-admin openrouteservice tests
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test openrouteservice"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test openrouteservice"
- name: Running g3w-admin qtimeseries tests
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test qtimeseries"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test qtimeseries"
- name: Running g3w-admin about tests
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test about"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test about"
- name: Setup tmate session
if: ${{ failure() }}
Expand Down
26 changes: 14 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,22 @@ Admin server for G3W-SUITE written in Python, based on **Django** LTS (v3.2) and

Software releases follow theese main branches as described in the compatibility table:

| Branch | Python | Django | QGIS | [client] | First release | Status |
|------------|----------------|----------------|---------------|----------|---------------|----------------|
| [dev] | 3.10 | 3.2 | 3.28 | dev | Unreleased | ⚠️️ Unstable |
| [v.3.6.x] | 3.10 | 3.2 | 3.28 | 3.8.10 | May 2023 | 🪲️ Bug fixing |
| [v.3.5.x] | 3.10 | 2.2 | 3.22 | 3.7 | Nov 2022 | 🪲️ Bug fixing |
| [v.3.4.x] | 3.8 | 2.2 | 3.22 | 3.4 | Mar 2022 | 🚨 End of Life |
| [v.3.3.x] | 3.6 | 2.2 | 3.16 | 3.3 | Sep 2021 | 🚨 End of Life |
| [v.3.2.x] | 3.6 | 2.2 | 3.16 | 3.2 | Apr 2021 | 🚨 End of Life |
| [v.3.1.x] | 3.6 | 2.2 | 3.10 | 3.1 | Nov 2020 | 🚨 End of Life |
| [v.3.0.x] | 3.6 | 2.2 | 3.10 | 3.0 | Nov 2020 | 🚨 End of Life |
| [dj22-py3] | 3.6 | 2.2 | [🔗] | | | 🚨 End of Life |
| [py2] | 2.7 | 1.11 | [🔗] | | | 🚨 End of Life |
| Branch | Python | Django | QGIS | [client] | First release | Status |
|------------|----------------|----------------|---------------|--------------|---------------|----------------|
| [dev] | 3.10 | 3.2 | 3.28 | dev | Unreleased | ⚠️️ Unstable |
| [v.3.7.x] | 3.10 | 3.2 | 3.28 | 3.9.0 | Dec 2023 | 🪲️ Bug fixing |
| [v.3.6.x] | 3.10 | 3.2 | 3.28 | 3.8.15 | May 2023 | 🪲️ Bug fixing |
| [v.3.5.x] | 3.10 | 2.2 | 3.22 | 3.7 | Nov 2022 | 🚨 End of Life |
| [v.3.4.x] | 3.8 | 2.2 | 3.22 | 3.4 | Mar 2022 | 🚨 End of Life |
| [v.3.3.x] | 3.6 | 2.2 | 3.16 | 3.3 | Sep 2021 | 🚨 End of Life |
| [v.3.2.x] | 3.6 | 2.2 | 3.16 | 3.2 | Apr 2021 | 🚨 End of Life |
| [v.3.1.x] | 3.6 | 2.2 | 3.10 | 3.1 | Nov 2020 | 🚨 End of Life |
| [v.3.0.x] | 3.6 | 2.2 | 3.10 | 3.0 | Nov 2020 | 🚨 End of Life |
| [dj22-py3] | 3.6 | 2.2 | [🔗] | | | 🚨 End of Life |
| [py2] | 2.7 | 1.11 | [🔗] | | | 🚨 End of Life |

[dev]: https://github.com/g3w-suite/g3w-admin/tree/dev
[v.3.7.x]: https://github.com/g3w-suite/g3w-admin/tree/v.3.7.x
[v.3.6.x]: https://github.com/g3w-suite/g3w-admin/tree/v.3.6.x
[v.3.5.x]: https://github.com/g3w-suite/g3w-admin/tree/v.3.5.x
[v.3.4.x]: https://github.com/g3w-suite/g3w-admin/tree/v.3.4.x
Expand Down
6 changes: 6 additions & 0 deletions g3w-admin/OWS/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,10 @@
name='ows'
),

re_path(
r'^ows/(?P<group_slug>[-_\w\d]+)/(?P<project_type>[-_\w\d]+)/(?P<project_id>[-_\w\d]+)/wfs3&?',
OWSView.as_view(),
name='ows-wfs3'
),

]
2 changes: 1 addition & 1 deletion g3w-admin/OWS/utils/data.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from defusedxml import ElementTree as etree
from django.utils.translation import ugettext, ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from django.contrib.gis.geos import GEOSGeometry
from core.utils.data import XmlData
import json
Expand Down
14 changes: 9 additions & 5 deletions g3w-admin/about/api/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def filter_queryset(self, request, queryset, view):


class UserProjectFilter(BaseFilterBackend):
"""A filter backend for portal module for qdjango project"""
"""A filter backend for about module for qdjango project"""

def filter_queryset(self, request, queryset, view):
"""
Expand All @@ -47,20 +47,24 @@ def filter_queryset(self, request, queryset, view):


class GroupProjectFilter(BaseFilterBackend):
"""A filter backend for portal module for qdjango project , filter by group"""
"""A filter backend for about module for qdjango project , filter by group"""

def filter_queryset(self, request, queryset, view):
"""
Return a filtered queryset by group_id
"""

if 'group_id' in view.kwargs:
queryset = queryset.filter(group_id=view.kwargs['group_id']).order_by('order')

if resolve(request.path_info).url_name == 'about-group-without-macrogroup-api-list':
queryset = queryset.filter(macrogroups__pk=None)

return queryset


class MacroGroupGroupFilter(BaseFilterBackend):
"""A filter backend for portal module for group, filter by macrogroup"""
"""A filter backend for about module for group, filter by macrogroup"""

def filter_queryset(self, request, queryset, view):
"""
Expand All @@ -70,14 +74,14 @@ def filter_queryset(self, request, queryset, view):
queryset = queryset.filter(macrogroups__pk=view.kwargs['macrogroup_id'])

# check for group without macrogroup
if resolve(request.path_info).url_name == 'portal-group-without-macrogroup-api-list':
if resolve(request.path_info).url_name == 'about-group-without-macrogroup-api-list':
queryset = queryset.filter(macrogroups__pk=None)

return queryset


class PanoramicProjectFilter(BaseFilterBackend):
"""A filter backend for portal module for qdjango project , filter by not panoramic"""
"""A filter backend for about module for qdjango project , filter by not panoramic"""

def filter_queryset(self, request, queryset, view):

Expand Down
13 changes: 9 additions & 4 deletions g3w-admin/about/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ def setUpTestData(cls):

cls.project_group2.save()

cls.project_group3 = CoreGroup(name='Group3', title='Group3', header_logo_img='',
srid=G3WSpatialRefSys.objects.get(auth_srid=3857))

cls.project_group3.save()

# create macrogroups
cls.macrogroup = MacroGroup(title='Macrogroup1', logo_img='macrogroup.png')
cls.macrogroup.save()
Expand Down Expand Up @@ -173,7 +178,7 @@ def test_group(self):
response = client.get(url)
self.assertEqual(response.status_code, 200)
jcontent = json.loads(response.content)
self.assertEqual(len(jcontent), 2)
self.assertEqual(len(jcontent), 3)
feature = jcontent[0]
self.assertIn('edit_url', feature)
group = CoreGroup.objects.filter(pk=feature['id'])[0]
Expand Down Expand Up @@ -318,7 +323,7 @@ def test_macrogroup(self):
response = client.get(url)
self.assertEqual(response.status_code, 200)
jcontent = json.loads(response.content)
self.assertEqual(len(jcontent), 2)
self.assertEqual(len(jcontent), 1)

# ad new group without macrogroup
new_group = CoreGroup(name='Group33', title='Group33', header_logo_img='',
Expand All @@ -328,8 +333,8 @@ def test_macrogroup(self):
response = client.get(url)
self.assertEqual(response.status_code, 200)
jcontent = json.loads(response.content)
self.assertEqual(len(jcontent), 3)
self.assertEqual(jcontent[2]['name'], 'Group33')
self.assertEqual(len(jcontent), 2)
self.assertEqual(jcontent[1]['name'], 'Group33')

client.logout()

Expand Down
2 changes: 1 addition & 1 deletion g3w-admin/base/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
logger.warning('Celery could not be imported, this might be ok if there are no custom suite modules that require Celery')


__version__ = (3, 6, 0, 'unstable', 0)
__version__ = (3, 8, 0, 'unstable', 0)
42 changes: 40 additions & 2 deletions g3w-admin/base/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@
'huey_monitor',
'about',
'django_bleach',
'django_registration',
'captcha'
]

G3WADMIN_APPS = [
Expand Down Expand Up @@ -247,7 +249,8 @@

# for qdjango module, this is the base URL for WMS/WFS visible by the client
QDJANGO_SERVER_URL = 'http://localhost'
QDJANGO_PRJ_CACHE_KEY = 'qdjango_prj_{}'
QDJANGO_PRJ_CACHE = True
QDJANGO_PRJ_CACHE_KEY = 'qdjango_prj_'

# data for proxy server
PROXY_SERVER = False
Expand Down Expand Up @@ -315,6 +318,25 @@
# Setting to activate/deactivate user password reset by email.
RESET_USER_PASSWORD = False

# REGISTRATION ACCOUNTS
# ---------------------
ACCOUNT_ACTIVATION_DAYS = 2
REGISTRATION_OPEN = False

REGISTRATION_EMAIL_SUBJECT_PREFIX = '[G3W-SUITE]'
REGISTRATION_EMAIL_BODY_SIGN = '''
g3wsuite.it
'''

# Set to true if the activation of a registered user
# must be done by the administrator
REGISTRATION_ACTIVE_BY_ADMIN = False

# CHANGE PASSWORD AT FIRST LOGIN
# ------------------------------
PASSWORD_CHANGE_FIRST_LOGIN = False


# QPLOTLY DEFAULT SETTINGS
# ------------------------

Expand Down Expand Up @@ -344,4 +366,20 @@
BLEACH_STRIP_COMMENTS = True

# For reverse proxy
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')

# GOOGLE RECAPTCHA
# ----------------

# Activate/deactivate Google ReCaptcha system. Default False
RECAPTCHA = False
# Set Google ReCaptch version. Default 3
RECAPTCHA_VERSION = '3'

# Settings for ReCaptcha v3
RECAPTCHA_REQUIRED_SCORE = 0.85

# Settings for ReCaptcha v2. Default checkbox
RECAPTCHA_VERSION2_TYPE = 'checkbox' # or 'invisible'

SILENCED_SYSTEM_CHECKS = ['captcha.recaptcha_test_key_error']
8 changes: 8 additions & 0 deletions g3w-admin/base/settings/base_geo_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,11 @@
}
}

# Geocoding providers
GEOCODING_PROVIDERS = {
"nominatim": {
"label": "Nominatim (OSM)",
"url": "https://nominatim.openstreetmap.org/search"
},
}

Loading

0 comments on commit a0f4e63

Please sign in to comment.