Skip to content

Commit 0fcd689

Browse files
mattiagiupponigiohappy
authored andcommitted
[Fixes #12828] New remote datasets are not registered inside proxy allowed hosts when GeoNode runs asynchoronously
1 parent 54fd8be commit 0fcd689

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.env_dev

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ GEODATABASE_URL=postgis://geonode:geonode@localhost:5432/geonode_data
3737
GEONODE_DB_CONN_MAX_AGE=0
3838
GEONODE_DB_CONN_TOUT=5
3939
DEFAULT_BACKEND_DATASTORE=datastore
40-
BROKER_URL=amqp://admin:admin@localhost:5672//
40+
BROKER_URL=amqp://guest:guest@localhost:5672//
4141
CELERY_BEAT_SCHEDULER=celery.beat:PersistentScheduler
42-
ASYNC_SIGNALS=False
42+
ASYNC_SIGNALS=True
4343

4444
SITEURL=http://localhost:8000/
4545

geonode/upload/api/views.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#
1818
#########################################################################
1919
import logging
20-
from urllib.parse import urljoin
20+
from urllib.parse import urljoin, urlsplit
2121
from django.conf import settings
2222
from django.http import Http404, HttpResponse
2323
from django.urls import reverse
@@ -53,6 +53,7 @@
5353
from rest_framework.response import Response
5454
from geonode.assets.handlers import asset_handler_registry
5555
from geonode.assets.local import LocalAssetHandler
56+
from geonode.proxy.utils import proxy_urls_registry
5657

5758
from geonode.upload.api.serializer import (
5859
UploadParallelismLimitSerializer,
@@ -190,6 +191,10 @@ def create(self, request, *args, **kwargs):
190191

191192
self.validate_upload(request, storage_manager)
192193

194+
if "url" in extracted_params:
195+
# we should register the hosts for the proxy
196+
proxy_urls_registry.register_host(urlsplit(extracted_params["url"]).hostname)
197+
193198
input_params = {
194199
**{"files": files, "handler_module_path": str(handler)},
195200
**extracted_params,

0 commit comments

Comments
 (0)